Skip to content

Commit

Permalink
Make healing units cheaper when using the Sneaky Dragon and Last Reso…
Browse files Browse the repository at this point in the history
…rt skills.

GitOrigin-RevId: dc26e779a769bfc2e93a6de6a444f0311dc2d09f
  • Loading branch information
cpojer committed Dec 3, 2024
1 parent ffee558 commit af4305e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions athena/lib/getUnitValue.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
import { Skill } from '../info/Skill.tsx';
import Player from '../map/Player.tsx';
import Unit from '../map/Unit.tsx';

export default function getUnitValue(unit: Unit, player: Player) {
if (player.skills.has(Skill.DragonSaboteur)) {
player = player.copy({
skills: new Set([...player.skills, Skill.BuyUnitDragon]),
});
}
if (player.skills.has(Skill.UnlockZombie)) {
player = player.copy({
skills: new Set([
...player.skills,
Skill.BuyUnitZombieDefenseDecreaseMajor,
]),
});
}

const cost = unit.info.getCostFor(player);
return cost < Number.POSITIVE_INFINITY
? cost
Expand Down

0 comments on commit af4305e

Please sign in to comment.