Enki
Unit #118
| HP | PWR | CP | Speed | Range | Tier |
|---|---|---|---|---|---|
| 12 (+6) | 3 (+1) | 3 (+2) | Normal | Any | C |
Abilities
Purity — 0 AP
Purity: 0 AP - b, 1x: Unfuse all demon cards from Target Fused and Exhausted Demon. e: The next March or Special Action performed by one of the newly unfused Demons ignores a and b costs.
Engine Implementation
def _enki_purity(
state: GameState, demon: DemonInstance, targets, choices, rng
) -> GameState:
"""#118 Enki — Purity
Action, 0 AP, (ready), 1x: Unfuse all demon cards from Target Fused and Exhausted Demon.
Status: The next March or Special Action by one of the newly unfused Demons ignores
(exhaust) and (ready) costs.
Target must be Fused and Exhausted.
Result: the top card remains (still exhausted); the bottom card is returned to the
controller's graveyard. The fused bonus stats are removed.
The unfused top demon gets "ignore_exhaust" + "ignore_ready" status for 1 action.
"""
from engine.status_effects import apply_status
from engine.data_loader import UNITS
if not targets:
return state
target = targets[0]
t_current = next(
(d for d in state.demons if d.instance_id == target.instance_id), None
)
if t_current is None:
return state
if not t_current.is_fused or t_current.state != DemonState.EXHAUSTED:
return state # Must be fused AND exhausted
# Unfuse: remove the bottom card
new_state = copy.deepcopy(state)
t_in_new = next(
(d for d in new_state.demons if d.instance_id == target.instance_id), None
)
if t_in_new is None:
return state
bottom_id = t_in_new.fused_bottom
target_owner = t_in_new.owner
# Return bottom card to graveyard
if bottom_id is not None:
new_state.players[target_owner].graveyard.append(bottom_id)
# Reset top card to un-fused state
t_in_new.fused_bottom = None
t_in_new.is_fused = False
# Restore HP to base
if t_in_new.unit_id in UNITS:
t_in_new.current_hp = UNITS[t_in_new.unit_id].hp
state = new_state
# Apply ignore_exhaust and ignore_ready to the unfused demon
t_refreshed = next(
(d for d in state.demons if d.instance_id == target.instance_id), None
)
if t_refreshed is not None:
state = apply_status(state, demon, t_refreshed, "ignore_exhaust", 1)
state = apply_status(state, demon, t_refreshed, "ignore_ready", 1)
return state
register_ability("118", 0, _enki_purity)
Reminder
(Unfuse: Evenly Divide damage (rounded up) from the original Demon to the new Demons. e effects applied to the original are now applied to the new Demons. The new Demons' control, position, and exhaustion are identical to the original.)