Floating Castle
Familiar of Belial — Card 1 of 1
| HP | PWR | CP | Speed | Range |
|---|---|---|---|---|
| — | — | — | F (Fast) | - |
Abilities
Passive
Floating Castle cannot perform actions. Floating Castle cannot take damage or be Fatally Wounded. When Belial leaves play, remove Floating Castle from play. (Fused Demons have both names.)
Engine Implementation
def _floating_castle_invulnerable_trigger(state: GameState, event: GameEvent, demon: DemonInstance, depth: int) -> GameState | None:
"""101_1 Floating Castle — cannot take damage or be Fatally Wounded.
Cancel any damage received by Floating Castle.
"""
if event.target is None or event.target.instance_id != demon.instance_id:
return None
damage_dealt = event.value or 0
if damage_dealt <= 0:
return None
import copy
new_state = copy.deepcopy(state)
castle_in_state = _find_demon(new_state, demon.instance_id)
if castle_in_state is None:
return None
castle_in_state.damage = max(0, castle_in_state.damage - damage_dealt)
return new_state
def _floating_castle_belial_dies_trigger(state: GameState, event: GameEvent, demon: DemonInstance, depth: int) -> GameState | None:
"""101_1 Floating Castle — when Belial leaves play, remove Floating Castle.
Fires on FATALLY_WOUNDED when Belial (unit_id "101") is the target.
"""
if event.target is None:
return None
# Belial's unit_id is "101"
if event.target.unit_id != "101":
return None
# Must be the same owner's Belial
if event.target.owner != demon.owner:
return None
# Remove Floating Castle from play (back to familiar_deck)
import copy
new_state = copy.deepcopy(state)
castle_in_state = _find_demon(new_state, demon.instance_id)
if castle_in_state is None:
return None
# Remove from field and return to familiar_deck
new_state.demons = [d for d in new_state.demons if d.instance_id != castle_in_state.instance_id]
new_state.players[castle_in_state.owner].familiar_deck.append(castle_in_state.unit_id)
return new_state
register_trigger("101_1", 0, _floating_castle_invulnerable_trigger)
Passive
c: All Local Allied demons have +2n when taking damage from Distant Demons.
Engine Implementation
def _floating_castle_distant_defense_passive(state: GameState, demon: DemonInstance) -> dict:
"""101_1 Floating Castle field aura: +2 DEF vs Distant Demons for local allies.
This passive grants +2 DEF to all Local Allied Demons when taking damage from
Distant Demons. The DEF bonus is conditional on the damage source being Distant.
We implement this as a flat +2 DEF bonus while Floating Castle is in the lane.
"""
# Grant +2 DEF to the demon being evaluated if a Floating Castle (101_1)
# owned by the same player is in the same lane.
for d in state.demons:
if d.unit_id == "101_1" and d.owner == demon.owner and d.lane == demon.lane:
return {"def": 2}
return {}
register_passive("101_1", 1, _floating_castle_distant_defense_passive)