Nyx
The Eternal Night
Unit #045
| HP | PWR | CP | Speed | Range | Tier |
|---|---|---|---|---|---|
| 12 (+6) | 4 (+2) | 3 (+2) | Normal | Any | A |
Abilities
Poisoned Night — 1 AP
i: Poisoned Night: 1 AP - a: Deal 2 damage to Target Exhausted, In Range Demon. e: Afterwards, the targeted Demon has -2n.
Engine Implementation
def _nyx_poisoned_night(state: GameState, demon: DemonInstance, targets, choices, rng) -> GameState:
"""#045 Nyx — Poisoned Night
Allied, 1 AP, (exhaust): Deal 2 damage to Target Exhausted, In Range Demon.
Status: Afterwards, the targeted Demon has -2 DEF.
Status expires end of current main phase.
Note: Target must be Exhausted — this is checked by targeting logic, not handler.
The 2 damage is NOT fixed damage — it goes through DEF reduction (deal_damage).
Any allied demon can perform this (confusion #5).
Targets: [target_exhausted_in_range_demon]
"""
target = targets[0]
# Deal 2 damage (through DEF — not fixed)
state = deal_damage(state, demon, target, 2)
# Status: -2 DEF
state = apply_status(state, demon, target, "def", -2)
return state
register_ability("045", 0, _nyx_poisoned_night)
Fear of the Dark — 1 AP
h: Fear of the Dark: 1 AP - a: e: The targeted Demon can not be readied (including fusion). Exhaust the targeted demon.
Engine Implementation
def _nyx_fear_of_the_dark(
state: GameState, demon: DemonInstance, targets, choices, rng
) -> GameState:
"""#045 Nyx — Fear of the Dark
Start of Turn, 1 AP, (exhaust): Status: Target Demon cannot be readied
(including fusion). Exhaust the targeted demon.
Applies status "cannot_ready" (value=1) and exhausts the target.
Status expires end of current main phase (confusion #9 — NOT permanent).
This means the lock only lasts for the phase it was applied in.
"""
from engine.operations import exhaust_demon
from engine.status_effects import apply_status
if not targets:
return state
target = targets[0]
# Apply "cannot_ready" status (value=1 = lock active; 0/absent = no lock)
state = apply_status(state, demon, target, "cannot_ready", 1)
# Re-fetch target after deepcopy from apply_status
target_refreshed = next(
(d for d in state.demons if d.instance_id == target.instance_id), None
)
if target_refreshed is None:
return state
# Exhaust the target
state = exhaust_demon(state, target_refreshed)
return state
register_ability("045", 1, _nyx_fear_of_the_dark)