Skip to main content

Allocer

The Infernal Spear

Unit #074

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

Abilities

Passive

After Allocer successfully pays for an action with a a cost (even if the a cost is ignored), Allocer may move 1 Lane.
Engine Implementation
def _allocer_self_march_after_exhaust(
state: GameState, event: GameEvent, demon: DemonInstance, depth: int
):
"""#074 Allocer idx=0 — Field Passive: Self-March After Exhaust.

After Allocer exhausts from an action cost, Allocer may move 1 Lane.

Fires on DEMON_EXHAUSTED. Only activates if THIS Allocer is the exhausted
demon (event.source.instance_id == demon.instance_id).

Auto-moves Allocer 1 lane (toward lane 2; wraps to lane 1 at boundary).
A full implementation would present a lane choice to the player.
"""
from engine.constants import LANE_COUNT

# Only fire if this Allocer exhausted itself
if event.source is None or event.source.instance_id != demon.instance_id:
return None

# Re-fetch Allocer
allocer_current = next(
(d for d in state.demons if d.instance_id == demon.instance_id), None
)
if allocer_current is None or allocer_current.fatally_wounded:
return None

# Auto-move 1 lane (prefer toward center lane 1; if at 1, go to 0)
current_lane = allocer_current.lane
if current_lane < LANE_COUNT - 1:
new_lane = current_lane + 1
else:
new_lane = current_lane - 1

import copy as _copy
new_state = _copy.deepcopy(state)
a = next(d for d in new_state.demons if d.instance_id == allocer_current.instance_id)
a.lane = new_lane
return new_state

register_trigger("074", 0, _allocer_self_march_after_exhaust)

Passive

After Allocer resolves an action targeting Any Demon(s), you may move the targeted Demon(s) 1 Lane.
Engine Implementation
def _allocer_push_target_after_action(
state: GameState, event: GameEvent, demon: DemonInstance, depth: int
):
"""#074 Allocer idx=1 — Field Passive: Push Target After Action.

After Allocer resolves an action targeting Any Demon(s), move the targeted
Demon(s) 1 Lane.

Fires on ABILITY_USED. Only activates if this Allocer is the source.
Moves the event.target 1 lane (auto: toward lane 0 if possible, else lane 1).
A full implementation would let the player choose direction.

Skips fatally_wounded targets.
"""
from engine.constants import LANE_COUNT

if event.source is None or event.source.instance_id != demon.instance_id:
return None

allocer_current = next(
(d for d in state.demons if d.instance_id == demon.instance_id), None
)
if allocer_current is None or allocer_current.fatally_wounded:
return None

if event.target is None:
return None

target_current = next(
(d for d in state.demons if d.instance_id == event.target.instance_id), None
)
if target_current is None or target_current.fatally_wounded:
return None

# Auto-move target 1 lane (toward lane 0 if possible, else toward lane 2)
current_lane = target_current.lane
if current_lane > 0:
new_lane = current_lane - 1
else:
new_lane = current_lane + 1

if new_lane == current_lane or not (0 <= new_lane < LANE_COUNT):
return None

import copy as _copy
new_state = _copy.deepcopy(state)
t = next(d for d in new_state.demons if d.instance_id == target_current.instance_id)
t.lane = new_lane
return new_state

register_trigger("074", 1, _allocer_push_target_after_action)
Allocer