Skip to main content

Shax

Harvester of Souls

Unit #021

HPPWRCPSpeedRangeTier
9 (+3)4 (+2)3 (+2)SlowLocalB

Abilities

Passive

When Shax Fatally Wounds Demons, you may Ready Shax and gain 2 AP for each Demon that was Fatally Wounded.
Engine Implementation
def _shax_kill_reward_trigger(
state: GameState, event: GameEvent, demon: DemonInstance, depth: int
) -> GameState | None:
"""#021 Shax — Passive trigger: When Shax Fatally Wounds a Demon, Ready + 2 AP.

Fires on FATALLY_WOUNDED. Activates if:
- event.source is this Shax instance (Shax dealt the killing blow)
- Shax is NOT fatally_wounded (dead demons cannot resolve)

Effect: Shax's owner gains 2 AP and Shax is readied.
"each Demon that was Fatally Wounded" — fires per death, so 2 AP per kill.

CRITICAL (confusion #2): familiars ARE demons — triggers when Shax kills familiars too.
CRITICAL: re-fetch Shax from current state to check latest fatally_wounded flag.
"""
from engine.operations import ready_demon

# Only fire if Shax is the source (killer)
if event.source is None:
return None
if event.source.instance_id != demon.instance_id:
return None # A different demon killed — not Shax's trigger

# Re-fetch Shax from current state to check fatally_wounded
shax_current = next(
(d for d in state.demons if d.instance_id == demon.instance_id), None
)
if shax_current is None or shax_current.fatally_wounded:
return None # Shax is dead or dying — cannot resolve

# Ready Shax
state = ready_demon(state, shax_current)

# Owner gains 2 AP (re-fetch in new state after ready)
new_state = copy.deepcopy(state)
new_state.players[shax_current.owner].ap += 2
return new_state

register_trigger("021", 0, _shax_kill_reward_trigger)
Shax