Skip to content

Commit

Permalink
fix(combat): only some stats have to stay at 1. rest can go back to 0…
Browse files Browse the repository at this point in the history
… when an effect unapplies. closes #111
  • Loading branch information
seiyria committed Feb 25, 2023
1 parent 500c0f7 commit 2123918
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions content/data/effects/hots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ Regen2:
turnsLeft: 4
statusEffectType: DamageOverTime
damageOverTime: -5

RegenStats:
name: Regenerate (Stats)
description: Regenerates health over time.
icon: healing
color: "#00ff00"
turnsLeft: 2
statusEffectType: StatModification
statModifications:
healingPerRound: 3
6 changes: 5 additions & 1 deletion src/app/helpers/combat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ export function applyDelta(character: IGameEncounterCharacter, appliedDelta: ICo
}

default: {
character.stats[key as Stat] = Math.max(character.stats[key as Stat] - bonusValue, 1);
const statsThatStayAt1 = [Stat.Speed];
character.stats[key as Stat] = Math.max(
character.stats[key as Stat] - bonusValue,
statsThatStayAt1.includes(key as Stat) ? 1 : 0
);
break;
}
}
Expand Down

0 comments on commit 2123918

Please sign in to comment.