fix(spells): backfill casting times for all imported spells
This commit is contained in:
@@ -789,7 +789,7 @@ class Action:
|
||||
# drops from the policy sequence (second standard, second move when no
|
||||
# standard is left to convert, second swift, full-round conflicting with
|
||||
# standard+move). The cast-time package adds downgraded:cast_time for
|
||||
# cast_spell actions whose spell has a long casting time (1+ minutes): the
|
||||
# cast_spell actions whose spell has a long casting time (more than 1 round): the
|
||||
# engine cannot schedule them within a turn, so they are dropped before the
|
||||
# budget filter runs.
|
||||
ACTION_RESULT_REASONS: frozenset[str] = frozenset({
|
||||
@@ -1468,7 +1468,7 @@ class CombatEngine:
|
||||
"""Downgrade the policy's action sequence to the legal action economy.
|
||||
|
||||
Composition order: a cast-time pre-pass first drops every cast_spell
|
||||
whose spell has a long casting time (1+ minutes — the engine cannot
|
||||
whose spell has a long casting time (more than 1 round — the engine cannot
|
||||
schedule it within a turn; reported as downgraded:cast_time). Then
|
||||
the general per-turn budget (CRB, "Actions in Combat": one standard
|
||||
+ one move, or one full-round, plus one swift; a move action may be
|
||||
@@ -5795,7 +5795,7 @@ def _has_slot(engine: CombatEngine, caster: CombatantState, spell_name: str) ->
|
||||
|
||||
|
||||
def _is_castable_this_turn(engine: CombatEngine, spell_name: str) -> bool:
|
||||
"""False only for long casting times (1+ minutes): the budget filter
|
||||
"""False only for long casting times (more than 1 round): the budget filter
|
||||
would drop the cast, so the policy must never propose it."""
|
||||
spell = engine.spell_registry.get(spell_name)
|
||||
return spell is None or spell.cast_time != "long"
|
||||
@@ -5874,7 +5874,8 @@ def _cast_time_slot(cast_time: CastTime) -> _ActionEconomySlot:
|
||||
free-action cast is free. one_round is CLAMPED to the full-round slot:
|
||||
the engine resolves it within the current turn instead of tracking a
|
||||
pending cast across turns (documented approximation). A long casting
|
||||
time (1+ minutes) cannot be scheduled by the turn budget at all — the
|
||||
time (more than 1 round: 3 rounds, 10 minutes, 1 hour, ...) cannot be
|
||||
scheduled by the turn budget at all — the
|
||||
engine drops such casts before the filter runs, so reaching this
|
||||
function with "long" is a programming error.
|
||||
"""
|
||||
|
||||
@@ -198,6 +198,7 @@ _CAST_TIME_ALIASES: dict[str, CastTime] = {
|
||||
"full-round action": "full_round",
|
||||
"full-round": "full_round",
|
||||
"1 minute": "long",
|
||||
"3 rounds": "long",
|
||||
"10 minutes": "long",
|
||||
"1 hour": "long",
|
||||
"standard action": "standard",
|
||||
|
||||
Reference in New Issue
Block a user