Add fights
This commit is contained in:
parent
28ab0873ab
commit
7ad0d493dc
1 changed files with 3 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ const fightEntity = async (
|
|||
client.sendTextMessage(roomId, `Round ${round}`);
|
||||
client.sendTextMessage(
|
||||
roomId,
|
||||
`${attacker.name}: ${attacker.health}/${getMaxHealth(attacker)}HP\n${defender.name}: ${defender.health}/${getMaxHealth(defender)}HP`,
|
||||
`${attacker.name}: ${attacker.health.toFixed(0)}/${getMaxHealth(attacker)}HP\n${defender.name}: ${defender.health.toFixed(0)}/${getMaxHealth(defender)}HP`,
|
||||
);
|
||||
|
||||
await sleep(3000);
|
||||
|
|
@ -119,6 +119,8 @@ const fightRound = (
|
|||
): boolean => {
|
||||
const attackerAttack =
|
||||
attackerAttacks[Math.floor(Math.random() * attackerAttacks.length)];
|
||||
console.log(attackerAttacks);
|
||||
console.log(attackerAttack);
|
||||
|
||||
if (!attackerAttack) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue