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;
36 var fvx = this.fireVelocity.x;
37 if(ownerObj.direction == 0){
40 this.origin.x = ownerObj.origin.x - 32;
42 this.movingSpeed.x = fvx;
43 this.movingSpeed.y = -this.fireVelocity.y
44 ownerObj.ownerStage.addStageObject(this);
50 if(this.livingTick > this.maxLivingTick){
51 this.ownerStage.removeStageObject(this);
53 FireObjectClass.base.prototype.tick.apply(this);
55 objectAttacked : function(obj, obj_x, obj_y, direction)
57 if(obj === this.ownerStage.userControlledCharacter)
61 if(direction & CollideTop){
65 this.hurtPerTickCount = this.hurtPerTickBase;
68 if(direction & (CollideLeft | CollideRight)){
72 this.damagePerTickCount = this.damagePerTickBase;
77 if(obj instanceof EnemyCharacterClass)
80 obj.damage(this.touchDamage);
81 this.ownerStage.removeStageObject(this);
83 if((obj instanceof BlockClass || obj instanceof SlopeBlockClass) && this.lastCollidedTick + 10 < this.ownerStage.manager.tickCount && !obj.isPhantom){
84 this.movingSpeed.y -= this.boundPower;
86 if(this.maxBoundCount <= this.boundCount){
87 this.ownerStage.removeStageObject(this);
91 this.lastCollidedTick = this.ownerStage.manager.tickCount;