Skip to main content

Mammon

Demon of Greed

Unit #053

HPPWRCPSpeedRangeTier
9 (+3)7 (+5)3 (+2)SlowLocalC

Abilities

Passive

d: At the start of each Evoker's Main Phases, give control of Mammon (and Mammon's potential Familiars) to the Evoker with the current Main Phase.
Engine Implementation
def _mammon_phase_start_transfer(
state: GameState, event: GameEvent, demon: DemonInstance, depth: int
) -> GameState | None:
"""#053 Mammon — Time: Transfer Mammon ownership to the current main phase player.

Fires on MAIN_PHASE_START. Gives control of Mammon (and its familiars)
to event.side (the player whose main phase is starting).

event.side = the player whose main phase is starting
"""
mammon_in_state = next(
(d for d in state.demons if d.instance_id == demon.instance_id), None
)
if mammon_in_state is None or mammon_in_state.fatally_wounded:
return None

new_owner = event.side

# Already owned by the right player — no change needed
if mammon_in_state.owner == new_owner:
return None

new_state = _copy_mammon.deepcopy(state)

# Transfer Mammon
mammon_in_new = next(
(d for d in new_state.demons if d.instance_id == demon.instance_id), None
)
if mammon_in_new is None:
return None
mammon_in_new.owner = new_owner

# Transfer Mammon's associated familiars (familiar_of == Mammon's instance_id)
for d in new_state.demons:
if d.familiar_of == demon.instance_id:
d.owner = new_owner

return new_state

register_trigger("053", 0, _mammon_phase_start_transfer)

Pay — 1 AP

Pay: 1 AP - 1x: Ready Mammon and Mammon's (potential) Familiars.
Engine Implementation
def _mammon_pay(
state: GameState, demon: DemonInstance, targets, choices, rng
) -> GameState:
"""#053 Mammon — Pay
1 AP, 1x: Ready Mammon and Mammon's (potential) Familiars.

Readies Mammon itself and any familiars on the field that belong to Mammon
(unit_ids in the Mammon familiar set, e.g., "053_1" etc.). Currently Mammon
has no familiars in the dataset, so this readies only Mammon itself.

Targets: None
"""
new_state = copy.deepcopy(state)
# Ready Mammon itself
mammon_in_new = next(
(d for d in new_state.demons if d.instance_id == demon.instance_id), None
)
if mammon_in_new is not None:
mammon_in_new.state = DemonState.READIED

# Ready any of Mammon's familiars currently on the field
# Mammon's familiar IDs follow the pattern "053_*"
for d in new_state.demons:
if d.unit_id.startswith("053_") and d.owner == demon.owner:
d.state = DemonState.READIED

return new_state

register_ability("053", 1, _mammon_pay)
Mammon