Players/authors can now directly correct the live values of stats the
schema already defines (health, trust, flags, milestones, etc.) without
waiting for the AI to emit a delta. New apply_override() sets values
absolutely rather than adding deltas, and — unlike the AI-facing
apply_delta() — bypasses cooldown/max_delta_per_turn and lets
milestones be un-set, since this is a deliberate correction rather
than a turn to police. Exposed via PUT /adventures/{id}/world-state
and an edit toggle in the World State drawer. Also fixes the
schema-editor stat-kind dropdown and free-text initial-value input
to size consistently with the numeric fields next to them.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
31 lines
609 B
Python
31 lines
609 B
Python
"""Phase 12 — RPG world state: the AI proposes stat/milestone deltas, this
|
|
module validates and clamps them against a scenario's stat_schema."""
|
|
|
|
from .engine import (
|
|
EMIT_RULE,
|
|
apply_delta,
|
|
apply_override,
|
|
band_label,
|
|
extract_delta,
|
|
has_schema,
|
|
instantiate,
|
|
npc_name,
|
|
npc_triggers,
|
|
render_reference,
|
|
render_state_section,
|
|
)
|
|
|
|
__all__ = [
|
|
"EMIT_RULE",
|
|
"apply_delta",
|
|
"apply_override",
|
|
"band_label",
|
|
"extract_delta",
|
|
"has_schema",
|
|
"instantiate",
|
|
"npc_name",
|
|
"npc_triggers",
|
|
"render_reference",
|
|
"render_state_section",
|
|
]
|