From: xangelo Date: Mon, 5 Jun 2023 14:49:24 +0000 (-0400) Subject: fix: display when your armour gets destroyed and actual HP damage X-Git-Tag: v0.0.1~66 X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=067db3bd5a771feb4f42ef7c08c4a1ec31fe4fcb;p=risinglegends.git fix: display when your armour gets destroyed and actual HP damage --- 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);