fix: display when your armour gets destroyed and actual HP damage
authorxangelo <git@xangelo.ca>
Mon, 5 Jun 2023 14:49:24 +0000 (10:49 -0400)
committerxangelo <git@xangelo.ca>
Mon, 5 Jun 2023 14:49:24 +0000 (10:49 -0400)
src/server/api.ts

index 3df5fac7d02ca56c71ff6663a858c913ac85518c..25a0556ce1e16323b17d8fcf2005177c0c4409db 100644 (file)
@@ -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);