diff --git a/src/shattered_sword/AI/EnemyAI.ts b/src/shattered_sword/AI/EnemyAI.ts index 24c143c..1214910 100644 --- a/src/shattered_sword/AI/EnemyAI.ts +++ b/src/shattered_sword/AI/EnemyAI.ts @@ -282,21 +282,6 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI { } - //TODO - GOAP NOT WORKING, ATTACK WORKAROUND - if(this.getPlayerPosition() == null){ - return; - } - let distance = this.owner.position.distanceTo(this.getPlayerPosition()); - if( distance <= 20){ - if( this.direction == Math.sign(this.getPlayerPosition().x -this.owner.position.x) ){ - let dir = this.getPlayerPosition().clone().sub(this.owner.position).normalize(); - if(this.attackTimer.isStopped()){ - this.weapon.use(this.owner, "enemy", dir.scale(1,0)) - this.attackTimer.start(); - } - } - - } diff --git a/src/shattered_sword/Scenes/GameLevel.ts b/src/shattered_sword/Scenes/GameLevel.ts index 2ab2926..fa527f7 100644 --- a/src/shattered_sword/Scenes/GameLevel.ts +++ b/src/shattered_sword/Scenes/GameLevel.ts @@ -287,27 +287,25 @@ export default class GameLevel extends Scene { case Player_Events.GIVE_BUFF: this.buffs = (this.player._ai).generateBuffs(); - if(this.buffs[0].string !== undefined){ - //this.buffButton1.text = this.buffs[0].string; - this.buffLabel1.text = this.buffs[0].string; - } - else{ - //this.buffButton1.text = "Increase "+this.buffs[0].type + " by "+this.buffs[0].value; + if(this.buffs[0].string === undefined){ this.buffLabel1.text = "Increase "+this.buffs[0].type + "\n by \n"+this.buffs[0].value; } - - if(this.buffs[1].string !== undefined){ - this.buffLabel2.text = this.buffs[1].string; - } else{ + this.buffLabel1.text = this.buffs[0].string; + } + + if(this.buffs[1].string === undefined){ this.buffLabel2.text = "Increase "+this.buffs[1].type + "\n by \n"+this.buffs[1].value; } + else{ + this.buffLabel2.text = this.buffs[1].string; + } - if(this.buffs[2].string !== undefined){ - this.buffLabel3.text = this.buffs[2].string; + if(this.buffs[2].string === undefined){ + this.buffLabel3.text = "Increase "+this.buffs[2].type + "\n by \n"+this.buffs[2].value; } else{ - this.buffLabel3.text = "Increase "+this.buffs[2].type + "\n by \n"+this.buffs[2].value; + this.buffLabel3.text = this.buffs[2].string; } //pause game here