feat(engine): add story arc system for narrative-driven world

- Add StoryArc and StoryEventResult models
- Create story_arcs.py with progress tracking logic
- Implement two story arcs: civil_unrest and golden_age
- Progress updates based on faction power balance
- Trigger story events when progress reaches threshold
- Add 3 tests for story arc system

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2025-12-30 12:06:14 +08:00
parent 1fd318c9e3
commit cec3e95a4b
5 changed files with 178 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import json
from pathlib import Path
from .models import WorldState, AgentState, GlobalMeter, Stance, Factions, FactionData
from .story_arcs import get_default_story_arcs
STATE_FILE = Path(__file__).parent.parent / "state.json"
@@ -33,6 +34,7 @@ def get_default_state() -> WorldState:
optimists=FactionData(power=0, members=[]),
fearful=FactionData(power=0, members=[])
),
story_arcs=get_default_story_arcs(),
)