Skip to content

Commit

Permalink
fix(combat): using items on self should also not cost energy
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Mar 24, 2023
1 parent 7a58746 commit 08b749e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stores/combat/combat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,11 @@ export class CombatState {
allowBonusStats: !fromItem,
statusEffect: this.contentService.getEffectByName(effectRef.effectName || '')
});
deltas.push({ target: 'source', attribute: 'currentEnergy', delta: -ability.energyCost });

// items do not cost energy
if(ability.energyCost > 0 && !fromItem) {
deltas.push({ target: 'source', attribute: 'currentEnergy', delta: -ability.energyCost });
}

const hp = currentPlayer.currentHealth;
applyDeltas(ctx, currentPlayer, currentPlayer, deltas);
Expand Down

0 comments on commit 08b749e

Please sign in to comment.