levelIncrease: false
}
};
- if(data.action === 'flee') {
- roundData.roundDetails.push(`You managed to escape from the ${monster.name}!`)
- roundData.winner = 'monster';
- await clearFight(player.id);
-
- socket.emit('fight-over', {roundData, monsters: []});
- return;
- }
const equippedItems = await getEquippedItems(player.id);
// we only use this if the player successfully defeated the monster
boost.damage += item.boost_damage;
});
+ // if you flee'd, then we want to check your dex vs. the monsters
+ // but we want to give you the item/weapon boosts you need
+ // if not then you're going to get hit.
+ if(data.action === 'flee') {
+ roundData.roundDetails.push(`You managed to escape from the ${monster.name}!`)
+ roundData.winner = 'monster';
+ await clearFight(player.id);
+
+ socket.emit('fight-over', {roundData, monsters: []});
+ return;
+ }
+
const primaryStat = data.action === 'attack' ? player.strength : player.constitution;
const boostStat = data.action === 'attack' ? boost.strength : boost.constitution;
const attackType = data.action === 'attack' ? 'physical' : 'magical';