Valefar
Sovereign of Thieves
Unit #007
| HP | PWR | CP | Speed | Range | Tier |
|---|---|---|---|---|---|
| 9 (+3) | 4 (+2) | 3 (+2) | Fast | Distant | B |
Abilities
Stolen Time — 0 AP
Stolen Time: 0 AP - a, 1x: Steal 1 AP and/or the Time Token from your opponent.
Engine Implementation
def _valefar_stolen_time(
state: GameState, demon: DemonInstance, targets, choices, rng
) -> GameState:
"""#007 Valefar — Stolen Time
Action, 0 AP, (exhaust), 1x: Steal 1 AP and/or the Time Token from your opponent.
choices["steal_ap"] = True → subtract 1 AP from opponent, add 1 AP to Valefar's owner.
choices["steal_token"] = True → transfer Time Token to Valefar's owner if opponent holds it.
Both effects are optional (the card says "and/or"). Default: steal both if not specified.
"""
import copy as _copy
opponent = Side.PLAYER_2 if demon.owner == Side.PLAYER_1 else Side.PLAYER_1
steal_ap = choices.get("steal_ap", True) if choices else True
steal_token = choices.get("steal_token", True) if choices else True
new_state = _copy.deepcopy(state)
if steal_ap:
if new_state.players[opponent].ap >= 1:
new_state.players[opponent].ap -= 1
new_state.players[demon.owner].ap += 1
if steal_token:
if new_state.players[opponent].has_time_token:
new_state.players[opponent].has_time_token = False
new_state.players[demon.owner].has_time_token = True
# Valefar's own passive: gain 1 AP when gaining the time token
new_state = apply_valefar_time_token_bonus(new_state, demon.owner)
return new_state
register_ability("007", 0, _valefar_stolen_time)
Passive
When you gain the Time Token, also gain 1 AP.
Engine Implementation
def _valefar_time_token_passive(state: GameState, demon: DemonInstance) -> dict:
"""#007 Valefar [1] — When controller gains the Time Token, gain 1 AP.
Implemented via apply_valefar_time_token_bonus() called from
turn_sequence._grant_time_token() and _valefar_stolen_time().
Registered as passive so the ability index is tracked in coverage.
"""
return {}
register_passive("007", 1, _valefar_time_token_passive)