diff --git a/dist/shattered_sword_assets/images/bleeding.png b/dist/shattered_sword_assets/images/bleeding.png new file mode 100644 index 0000000..3a2af22 Binary files /dev/null and b/dist/shattered_sword_assets/images/bleeding.png differ diff --git a/dist/shattered_sword_assets/images/burning.png b/dist/shattered_sword_assets/images/burning.png new file mode 100644 index 0000000..6da0978 Binary files /dev/null and b/dist/shattered_sword_assets/images/burning.png differ diff --git a/dist/shattered_sword_assets/images/poisoning.png b/dist/shattered_sword_assets/images/poisoning.png new file mode 100644 index 0000000..41d1494 Binary files /dev/null and b/dist/shattered_sword_assets/images/poisoning.png differ diff --git a/src/shattered_sword/AI/EnemyAI.ts b/src/shattered_sword/AI/EnemyAI.ts index e5017f9..e2347fa 100644 --- a/src/shattered_sword/AI/EnemyAI.ts +++ b/src/shattered_sword/AI/EnemyAI.ts @@ -79,6 +79,9 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI { bleedCounter :number = 0; healthBar: Rect; + poisonStat: Sprite; + burnStat: Sprite; + bleedStat: Sprite; initializeAI(owner: AnimatedSprite, options: Record): void { @@ -285,6 +288,12 @@ 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.visible = this.poisonCounter > 0; + this.burnStat.visible = this.burnCounter > 0; + this.bleedStat.visible = this.bleedCounter > 0; } } diff --git a/src/shattered_sword/Scenes/GameLevel.ts b/src/shattered_sword/Scenes/GameLevel.ts index c6b9e8a..996f11d 100644 --- a/src/shattered_sword/Scenes/GameLevel.ts +++ b/src/shattered_sword/Scenes/GameLevel.ts @@ -80,6 +80,10 @@ export default class GameLevel extends Scene { protected shieldLabel : Label; protected shieldBar: Rect; + protected poisonStat: Sprite; + protected burnStat: Sprite; + protected bleedStat: Sprite; + //seed UI protected seedLabel: Label; @@ -139,6 +143,9 @@ export default class GameLevel extends Scene { this.load.spritesheet("slice", "shattered_sword_assets/spritesheets/slice.json"); this.load.image("inventorySlot", "shattered_sword_assets/sprites/inventory.png"); this.load.image("black", "shattered_sword_assets/images/black.png"); + this.load.image("poisoning", "shattered_sword_assets/images/poisoning.png"); + this.load.image("burning", "shattered_sword_assets/images/burning.png"); + this.load.image("bleeding", "shattered_sword_assets/images/bleeding.png"); this.load.spritesheet("test_dummy","shattered_sword_assets/spritesheets/test_dummy.json") this.enemies = new Array(); @@ -343,7 +350,7 @@ export default class GameLevel extends Scene { let playerAI = (this.player.ai); this.healthLabel.text = "Health: "+ playerAI.CURRENT_HP +'/' + (playerAI.MAX_HP +playerAI.CURRENT_BUFFS.hp ); this.healthBar.size.set(playerAI.MAX_HP*2, 10); - this.healthBar.position.set(playerAI.MAX_HP+50, 20); + this.healthBar.position.set(playerAI.MAX_HP+50, 40); this.healthBar.fillWidth = playerAI.CURRENT_HP*2; if (playerAI.CURRENT_HP/playerAI.MAX_HP >= 2/3) { this.healthBar.color = Color.GREEN; @@ -362,7 +369,7 @@ export default class GameLevel extends Scene { //update shield ui this.shieldLabel.text = "Shield: "+ playerAI.CURRENT_SHIELD +'/' + (playerAI.MAX_SHIELD); this.shieldBar.size.set(playerAI.CURRENT_SHIELD*2, 10); - this.shieldBar.position.set(playerAI.CURRENT_SHIELD+50, 60); + this.shieldBar.position.set(playerAI.CURRENT_SHIELD+50, 70); // this.shieldLabel.sizeToText(); //update exp ui @@ -489,27 +496,37 @@ export default class GameLevel extends Scene { */ protected addUI(){ // In-game labels - this.healthLabel =