OSDN Git Service

DamageDefenseModeのバグ修正
authorttwilb <ttwilb@users.sourceforge.jp>
Thu, 5 Sep 2013 06:46:49 +0000 (15:46 +0900)
committerttwilb <ttwilb@users.sourceforge.jp>
Thu, 5 Sep 2013 06:46:49 +0000 (15:46 +0900)
www/corelib/classes/MainCharacterClass.js

index b3a969e..f9963d9 100644 (file)
@@ -30,19 +30,20 @@ var MainCharacterClass = function(stage, args, isFromNetwork){
        },
        tick : function()
        {
-               MainCharacterClass.base.prototype.tick.apply(this);
-               if((!mainManager.runningStageName || this.ownerStage.manager.userID == this.ownerUID) && this.origin.y > 1000){
-                       this.kill();
-               }
-       },
-       damage: function(p){
                if(this.isDamageDefenseMode)
                {
                        if((+new Date()) > this.damageDefenseModeTimeStamp + this.damageDefenseModeLong)
                        {
                                this.isDamageDefenseMode = false;
                        }
-               }else
+               }
+               MainCharacterClass.base.prototype.tick.apply(this);
+               if((!mainManager.runningStageName || this.ownerStage.manager.userID == this.ownerUID) && this.origin.y > 1000){
+                       this.kill();
+               }
+       },
+       damage: function(p){
+               if(!this.isDamageDefenseMode)
                {
                        if(this.HP <= p){
                                
@@ -67,9 +68,11 @@ var MainCharacterClass = function(stage, args, isFromNetwork){
        },
        draw: function(x, y){
                
-               if(this.isDamageDefenseMode && (+new Date()) % 200 < 100) return;
-               
-               MainCharacterClass.base.prototype.draw.apply(this, [x, y]);
+               if(!this.isDamageDefenseMode || (+new Date()) % 200 < 100)
+               {
+                       //自分を描画
+                       MainCharacterClass.base.prototype.draw.apply(this, [x, y]);
+               }
                
                if(this != this.ownerStage.userControlledCharacter)
                {