Skip to main content

Belial

Sovereign of the Skies

Unit #101

HPPWRCPSpeedRangeTier
12 (+6)4 (+2)3 (+2)SlowDistantC

Abilities

Passive

q: When Belial card comes into play, play the Floating Castle Familiar in Any Lane.
Engine Implementation
def _belial_deploy_castle_trigger(
state: GameState, event: GameEvent, demon: DemonInstance, depth: int
) -> GameState | None:
"""#101 Belial — Deploy trigger: When Belial enters play, deploy Floating Castle.

Fires on DEMON_DEPLOYED when the deployed demon IS this Belial instance.
Deploys Floating Castle (familiar_id="101_1") in Belial's lane.

If Floating Castle is not in Belial's owner's familiar_deck (already in play),
the trigger does nothing.
"""
from engine.operations import deploy_familiar

# Only fire if Belial itself was just deployed
if event.source is None:
return None
if event.source.instance_id != demon.instance_id:
return None

FLOATING_CASTLE_ID = "101_1"
owner = demon.owner

# Check availability in familiar_deck
if FLOATING_CASTLE_ID not in state.players[owner].familiar_deck:
return None # Already in play or unavailable

return deploy_familiar(state, owner, FLOATING_CASTLE_ID, demon.lane)

register_trigger("101", 0, _belial_deploy_castle_trigger)

Banish — 3 AP

Banish: 3 AP - a: Deal k Fixed Damage to All Enemy Demons in Floating Castle's Lane. Independently move each of those Demons 1 or 2 Lanes.
Engine Implementation
def _belial_banish(
state: GameState, demon: DemonInstance, targets, choices, rng
) -> GameState:
"""#101 Belial — Banish
Action, 3 AP, (exhaust): Deal this demon's PWR Fixed Damage to All Enemy Demons
in Floating Castle's Lane. Independently move each of those Demons 1 or 2 Lanes.

Floating Castle familiar ID: "101_1".
If Floating Castle is not on field, ability fizzles.
choices["lane_map"] = {instance_id: new_lane} for movement.
Fixed Damage bypasses DEF.
"""
from engine.operations import get_effective_pwr, deal_fixed_damage

# Find Floating Castle
floating_castle = next(
(d for d in state.demons if d.unit_id == "101_1"), None
)
if floating_castle is None:
return state # Floating Castle not in play — ability fizzles

target_lane = floating_castle.lane
opponent = Side.PLAYER_2 if demon.owner == Side.PLAYER_1 else Side.PLAYER_1

enemies_in_lane = [
d for d in state.demons
if d.lane == target_lane and d.owner == opponent and not d.fatally_wounded
]

pwr = get_effective_pwr(state, demon)

# Deal Fixed Damage to each
for enemy in enemies_in_lane:
e_current = next(
(d for d in state.demons if d.instance_id == enemy.instance_id), None
)
if e_current is None or e_current.fatally_wounded:
continue
state = deal_fixed_damage(state, e_current, pwr)

# Move each enemy independently
lane_map = choices.get("lane_map", {}) if choices else {}
if lane_map:
new_state = copy.deepcopy(state)
for d in new_state.demons:
if d.instance_id in lane_map:
new_lane = lane_map[d.instance_id]
if 0 <= new_lane < 3:
d.lane = new_lane
state = new_state

return state

register_ability("101", 1, _belial_banish)
Belial