Skip to main content

Libra

Unit #078

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

Abilities

Zero Sum — 0 AP

Zero Sum: 0 AP - a, 1x: You and your opponent each Target Any Demon during target declaration, with your opponent declaring their target first. Fatally Wound the targeted Demons. e: Ignore their CP for the purposes of scoring.
Engine Implementation
def _libra_zero_sum(
state: GameState, demon: DemonInstance, targets, choices, rng
) -> GameState:
"""#078 Libra — Zero Sum
0 AP, (exhaust), 1x: You and your opponent each Target Any Demon during target
declaration, with your opponent declaring their target first. Fatally Wound the
targeted Demons. Status: Ignore their CP for the purposes of scoring.

CRITICAL: "Ignore their CP" means the fatally wounded demons do NOT contribute
CP when they die. We implement this by fatally wounding both targets and
applying "cp_override_zero" status on both (overrides get_effective_cp to 0).

Complex targeting: targets[0] = Libra owner's target, targets[1] = opponent's
target (both passed by the caller based on each player's declaration).

Targets: [owner_target, opponent_target]
"""
# Fatally wound both targets and mark their CP as ignored
for target in targets:
if not target.fatally_wounded:
new_state_tmp = copy.deepcopy(state)
t_in_new = next(
(d for d in new_state_tmp.demons if d.instance_id == target.instance_id),
None,
)
if t_in_new is not None:
t_in_new.fatally_wounded = True
# Apply cp_override_zero so the deaths don't score CP (confusion #11)
new_state_tmp = apply_status(
new_state_tmp, demon, t_in_new, "cp_override_zero", 1
)
state = new_state_tmp
else:
# Already fatally wounded — still apply cp_override_zero
t_in_existing = next(
(d for d in state.demons if d.instance_id == target.instance_id), None
)
if t_in_existing is not None:
state = apply_status(
state, demon, t_in_existing, "cp_override_zero", 1
)
return state

register_ability("078", 0, _libra_zero_sum)
Libra