From 067db3bd5a771feb4f42ef7c08c4a1ec31fe4fcb Mon Sep 17 00:00:00 2001 From: xangelo Date: Mon, 5 Jun 2023 10:49:24 -0400 Subject: [PATCH] fix: display when your armour gets destroyed and actual HP damage --- src/server/api.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/api.ts b/src/server/api.ts index 3df5fac..25a0556 100644 --- a/src/server/api.ts +++ b/src/server/api.ts @@ -471,7 +471,8 @@ io.on('connection', async socket => { const item = equipment.get(target); item.currentAp -= monster.strength; if(item.currentAp < 0) { - roundData.roundDetails.push(`Your ${item.name} was destroyed so they hit your directly for ${monster.strength} damage!`); + roundData.roundDetails.push(`Your ${item.name} amour was destroyed`); + roundData.roundDetails.push(`The ${monster.name} hit your HP for ${item.currentAp * -1} damage!`); player.hp += item.currentAp; item.currentAp = 0; await deleteInventoryItem(player.id, item.item_id); @@ -493,6 +494,8 @@ io.on('connection', async socket => { player.hp = 0; roundData.winner = 'monster'; + roundData.roundDetails.push(`You were killed by the ${monster.name}`); + await clearFight(player.id); await updatePlayer(player); -- 2.25.1