Skip to main content

Malphas

Demon of Torturers

Unit #041

HPPWRCPSpeedRangeTier
15 (+9)24 (+3)NormalLocalB

Abilities

Passive

c: When Any Local Enemy Demon moves or is moved, Exhaust them.
Engine Implementation
def _malphas_exhaust_entering_enemy(
state: GameState, event: GameEvent, demon: DemonInstance, depth: int
) -> GameState | None:
"""#041 Malphas — Field: When Any Local Enemy Demon moves or is moved, Exhaust them.

Fires on DEMON_MARCHED. If the moved demon lands in Malphas's lane
AND is an enemy of Malphas, exhaust it.

event.target = the demon that moved
event.lane = the destination lane (where the demon ended up)
"""
# Malphas must be alive
malphas = next((d for d in state.demons if d.instance_id == demon.instance_id), None)
if malphas is None or malphas.fatally_wounded:
return None

moved = event.target
if moved is None:
return None

# PRE-MOVE lane must be Malphas's lane (enemy was LOCAL before moving)
# event.value = pre-move lane, event.lane = destination lane
pre_move_lane = event.value
if pre_move_lane is None:
return None
if pre_move_lane != malphas.lane:
return None # Enemy was NOT local to Malphas before moving

# The moved demon must be an enemy of Malphas
if moved.owner == malphas.owner:
return None

# Re-fetch the moved demon in current state
moved_in_state = next(
(d for d in state.demons if d.instance_id == moved.instance_id), None
)
if moved_in_state is None or moved_in_state.fatally_wounded:
return None

# Exhaust the moved enemy demon
new_state = _copy_malphas.deepcopy(state)
target_in_new = next(
(d for d in new_state.demons if d.instance_id == moved.instance_id), None
)
if target_in_new is None:
return None
target_in_new.state = DemonState.EXHAUSTED
return new_state

register_trigger("041", 0, _malphas_exhaust_entering_enemy)

Warden's Command — 2 AP

Warden's Command: 2 AP - b, 1x: Move Target Distant Demon to Malphas's Lane. e: The targeted Demon has -2n.
Engine Implementation
def _malphas_wardens_command(
state: GameState, demon: DemonInstance, targets, choices, rng
) -> GameState:
"""#041 Malphas — Warden's Command
2 AP, (ready), 1x: Move Target Distant Demon to Malphas's Lane.
Status: The targeted Demon has -2 DEF.
Status expires end of current main phase.

(ready) — does NOT exhaust on use.
Target must be Distant (different lane) — enforced by targeting logic.
Moves the target to Malphas's current lane, then applies -2 DEF status.

Targets: [target_distant_demon]
"""
target = targets[0]
state = _move_to_lane(state, target, demon.lane)
# Re-locate target in new state for apply_status
target_in_new = next(d for d in state.demons if d.instance_id == target.instance_id)
state = apply_status(state, demon, target_in_new, "def", -2)
return state

register_ability("041", 1, _malphas_wardens_command)
Malphas