1 var FireObjectClass = function(stage, args){
2 FireObjectClass.base.apply(this, arguments);
4 this.fireVelocity = new Point2D(600, 100);
8 this.movingSpeed.y = -this.fireVelocity.y;
10 this.isItemCollector = true;
11 this.boundPower = 400;
13 this.maxBoundCount = 3;
14 this.maxLivingTick = 120;
16 }.extend(EnemyCharacterClass, {
17 className: "FireObjectClass",
18 fire: function(ownerObj, x, y){
23 if(ownerObj.direction == 0){
25 this.origin.x = ownerObj.origin.x - x;
28 this.origin.x = ownerObj.origin.x + x;
31 this.origin.y = ownerObj.origin.y;
33 this.origin.y = ownerObj.origin.y + y;
37 var fvx = this.fireVelocity.x;
38 if(ownerObj.direction == 0){
41 this.origin.x = ownerObj.origin.x - 32;
43 this.movingSpeed.x = fvx;
44 this.movingSpeed.y = -this.fireVelocity.y
46 // 初期位置で壁などに引っかかっていないか確認
47 if(this.canMoveTo(this.origin.x, this.origin.y)){
48 ownerObj.ownerStage.addStageObject(this);
55 if(this.livingTick > this.maxLivingTick){
56 this.ownerStage.removeStageObject(this);
58 FireObjectClass.base.prototype.tick.apply(this);
60 objectAttacked : function(obj, obj_x, obj_y, direction)
62 if(obj === this.ownerStage.userControlledCharacter)
66 if(direction & CollideTop){
70 this.hurtPerTickCount = this.hurtPerTickBase;
73 if(direction & (CollideLeft | CollideRight)){
77 this.damagePerTickCount = this.damagePerTickBase;
82 if(obj instanceof EnemyCharacterClass)
85 obj.damage(this.touchDamage);
86 this.ownerStage.removeStageObject(this);
88 if((obj instanceof BlockClass || obj instanceof SlopeBlockClass) && this.lastCollidedTick + 10 < this.ownerStage.manager.tickCount && !obj.isPhantom){
89 this.movingSpeed.y -= this.boundPower;
91 if(this.maxBoundCount <= this.boundCount){
92 this.ownerStage.removeStageObject(this);
96 this.lastCollidedTick = this.ownerStage.manager.tickCount;