This commit is contained in:
Hexugory 2023-03-29 21:33:37 -05:00
parent 1f01a94368
commit aa54131626
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ interface StatusEffects {
regeneration: number regeneration: number
burn: number burn: number
confusion: number confusion: number
stun: number
} }
interface PotencyEffects { interface PotencyEffects {
@ -34,7 +35,8 @@ class BattleUnit {
poison: 0, poison: 0,
regeneration: 0, regeneration: 0,
burn: 0, burn: 0,
confusion: 0 confusion: 0,
stun: 0
} }
potencyEffects: PotencyEffects = { potencyEffects: PotencyEffects = {
resistanceChange: [], resistanceChange: [],
@ -82,12 +84,14 @@ export class Battle {
unit.health -= 5; unit.health -= 5;
this.appendLog(`${unit.character.nameShort} took 5 burn damage!`); this.appendLog(`${unit.character.nameShort} took 5 burn damage!`);
} }
this.log += '\n';
} }
} }
checkAlive (units: BattleUnit[]) { checkAlive (units: BattleUnit[]) {
for (const unit of units) { for (const unit of units) {
if (unit.health <= 0) unit.active = false; if (unit.health <= 0) unit.active = false;
this.appendLog(`${unit.character.nameShort} has been defeated!`);
} }
} }

View File

@ -23,6 +23,7 @@ interface Effect {
regeneration?: number regeneration?: number
burn?: number burn?: number
confusion?: number confusion?: number
stun?: number
resistanceChange?: PotencyStatus resistanceChange?: PotencyStatus
accuracyChange?: PotencyStatus accuracyChange?: PotencyStatus
speedChange?: PotencyStatus speedChange?: PotencyStatus