From 5d9d43e4a4317c9fbf962e7fc733e90bff17bee4 Mon Sep 17 00:00:00 2001 From: OfficialCHenry Date: Thu, 21 Apr 2022 14:01:44 -0400 Subject: [PATCH] increased dot icon size, moved snake falling to just tutorial --- src/main.ts | 2 +- src/shattered_sword/AI/EnemyAI.ts | 9 +++++---- src/shattered_sword/Player/PlayerController.ts | 6 +++--- src/shattered_sword/Scenes/GameLevel.ts | 18 ++++++++++-------- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/main.ts b/src/main.ts index 3e49d08..a5fed18 100644 --- a/src/main.ts +++ b/src/main.ts @@ -30,7 +30,7 @@ import WeaponTypeRegistry from "./shattered_sword/Registry/WeaponTypeRegistry"; {name: "spawn", keys: ["q"]} //debug feature to test enemy spawning, press q to spawn enemy at current location ], useWebGL: false, // Tell the game we want to use webgl - showDebug: true // Whether to show debug messages. You can change this to true if you want + showDebug: false // Whether to show debug messages. You can change this to true if you want } diff --git a/src/shattered_sword/AI/EnemyAI.ts b/src/shattered_sword/AI/EnemyAI.ts index e2347fa..6401d78 100644 --- a/src/shattered_sword/AI/EnemyAI.ts +++ b/src/shattered_sword/AI/EnemyAI.ts @@ -229,6 +229,7 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI { super.update(deltaT); // This is the plan that is executed in the Active state, so whenever we don't have a plan, acquire a new one given the current statuses the enemy has + /* if (this.plan.isEmpty()) { //get a new plan if(this.possibleActions === undefined){ @@ -240,7 +241,7 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI { } this.plan = this.planner.plan(Statuses.REACHED_GOAL, this.possibleActions, this.currentStatus, null); } - + */ //TODO if(this.burnTimer.isStopped() && this.burnCounter >0){ @@ -288,9 +289,9 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI { else { this.healthBar.color = Color.RED; } - this.poisonStat.position = this.owner.collisionShape.center.clone().add(new Vec2(-((this.owner.collisionShape).hw)*1.5+5, -((this.owner.collisionShape).hh+15))); - this.burnStat.position = this.poisonStat.position.clone().add(new Vec2(10, 0)); - this.bleedStat.position = this.poisonStat.position.clone().add(new Vec2(20, 0)); + this.poisonStat.position = this.owner.collisionShape.center.clone().add(new Vec2(-((this.owner.collisionShape).hw)*1.5+10, -((this.owner.collisionShape).hh+15))); + this.burnStat.position = this.poisonStat.position.clone().add(new Vec2(15, 0)); + this.bleedStat.position = this.poisonStat.position.clone().add(new Vec2(30, 0)); this.poisonStat.visible = this.poisonCounter > 0; this.burnStat.visible = this.burnCounter > 0; this.bleedStat.visible = this.bleedCounter > 0; diff --git a/src/shattered_sword/Player/PlayerController.ts b/src/shattered_sword/Player/PlayerController.ts index c6e4877..7a8e64d 100644 --- a/src/shattered_sword/Player/PlayerController.ts +++ b/src/shattered_sword/Player/PlayerController.ts @@ -173,9 +173,9 @@ export default class PlayerController extends StateMachineAI implements BattlerA //to test the buffs //this.addBuff( {type:BuffType.HEALTH, value:1} ); - this.addBuff({type:BuffType.BURN, value:1, category:BuffCategory.DOT}); - this.addBuff({type:BuffType.BLEED, value:1, category:BuffCategory.DOT}); - this.addBuff({type:BuffType.POISON, value:1, category:BuffCategory.DOT}); + //this.addBuff({type:BuffType.BURN, value:1, category:BuffCategory.DOT}); + //this.addBuff({type:BuffType.BLEED, value:1, category:BuffCategory.DOT}); + //this.addBuff({type:BuffType.POISON, value:1, category:BuffCategory.DOT}); } diff --git a/src/shattered_sword/Scenes/GameLevel.ts b/src/shattered_sword/Scenes/GameLevel.ts index 0514bbb..58ce366 100644 --- a/src/shattered_sword/Scenes/GameLevel.ts +++ b/src/shattered_sword/Scenes/GameLevel.ts @@ -276,21 +276,21 @@ export default class GameLevel extends Scene { } else{ //this.buffButton1.text = "Increase "+this.buffs[0].type + " by "+this.buffs[0].value; - this.buffLabel1.text = "Increase "+this.buffs[0].type + " by "+this.buffs[0].value; + 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.buffLabel2.text = "Increase "+this.buffs[1].type + " by "+this.buffs[1].value; + this.buffLabel2.text = "Increase "+this.buffs[1].type + "\n by \n"+this.buffs[1].value; } if(this.buffs[2].string !== undefined){ this.buffLabel3.text = this.buffs[2].string; } else{ - this.buffLabel3.text = "Increase "+this.buffs[2].type + " by "+this.buffs[2].value; + this.buffLabel3.text = "Increase "+this.buffs[2].type + "\n by \n"+this.buffs[2].value; } //pause game here @@ -404,7 +404,10 @@ export default class GameLevel extends Scene { tilemap: "Main", //actions:actions, goal: Statuses.REACHED_GOAL, - + actions: [new AttackAction(3, [Statuses.IN_RANGE], [Statuses.REACHED_GOAL]), + new Move(2, [], [Statuses.IN_RANGE], {inRange: 60})], + status : [Statuses.CAN_RETREAT, Statuses.CAN_BERSERK], + weapon : this.createWeapon("knife") }); } @@ -598,7 +601,6 @@ export default class GameLevel extends Scene { //TODO - //determine button location this.buffButton1 =