import {expToLevel, maxHp, Player, professionList} from '../shared/player';
import {clearFight, createFight, getMonsterList, loadMonster, loadMonsterFromFight, saveFightState} from './monster';
import {FightRound} from '../shared/fight';
-import {addInventoryItem, getEquippedItems, getInventory, getInventoryItem, updateAp} from './inventory';
+import {addInventoryItem, deleteInventoryItem, getEquippedItems, getInventory, getInventoryItem, updateAp} from './inventory';
import {Monster, MonsterForList} from '../shared/monsters';
import {getShopItem, listShopItems} from './shopItem';
import {equip, unequip} from './equipment';
roundData.roundDetails.push(`Your ${item.name} was destroyed so they hit your directly for ${monster.strength} damage!`);
player.hp += item.currentAp;
item.currentAp = 0;
+ await deleteInventoryItem(player.id, item.item_id);
}
else {
roundData.roundDetails.push(`Your ${target} took ${monster.strength} damage!`);
+ await updateAp(player.id, item.item_id, item.currentAp, item.maxAp);
}
- await updateAp(player.id, item.item_id, item.currentAp, item.maxAp);
}
else {
roundData.roundDetails.push(`The ${monster.name} hit you for ${monster.strength} damage`);