Core Modules (game-agnostic, reusable for WarFactory): - ResourceModule: Inventory, crafting system (465 lines) - StorageModule: Save/load with pub/sub state collection (424 lines) - CombatModule: Combat resolver, damage/armor/morale (580 lines) - EventModule: JSON event scripting with choices/outcomes (651 lines) MC-Specific Modules: - GameModule v2: State machine + event subscriptions (updated) - TrainBuilderModule: 3 wagons, 2-axis balance, performance malus (530 lines) - ExpeditionModule: A→B expeditions, team management, events integration (641 lines) Features: - All modules hot-reload compatible (state preservation) - Pure pub/sub architecture (zero direct coupling) - 7 config files (resources, storage, combat, events, train, expeditions) - 7 test suites (GameModuleTest: 12/12 PASSED) - CMakeLists.txt updated for all modules + tests Total: ~3,500 lines of production code + comprehensive tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
274 lines
7.1 KiB
JSON
274 lines
7.1 KiB
JSON
{
|
|
"events": {
|
|
"encounter_hostile": {
|
|
"title": "Hostile Forces Detected",
|
|
"description": "Sensors detect a group of hostile forces approaching. They appear to be armed and searching for something. You have moments to decide.",
|
|
"cooldown": 300,
|
|
"conditions": {
|
|
"game_time_min": 60
|
|
},
|
|
"choices": {
|
|
"attack": {
|
|
"text": "Engage immediately - use force to neutralize the threat",
|
|
"requirements": {
|
|
"ammunition": 50
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"ammunition": -50,
|
|
"supplies": 20
|
|
},
|
|
"flags": {
|
|
"reputation_hostile": "1"
|
|
}
|
|
}
|
|
},
|
|
"negotiate": {
|
|
"text": "Attempt to negotiate or trade",
|
|
"requirements": {
|
|
"reputation": 10
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"ammunition": -10,
|
|
"supplies": 15
|
|
},
|
|
"flags": {
|
|
"reputation_neutral": "1"
|
|
}
|
|
}
|
|
},
|
|
"avoid": {
|
|
"text": "Evade quietly and continue on",
|
|
"requirements": {},
|
|
"outcomes": {
|
|
"resources": {
|
|
"fuel": -5
|
|
},
|
|
"flags": {
|
|
"stealth_success": "1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"resource_cache_found": {
|
|
"title": "Supply Cache Discovered",
|
|
"description": "Your team has located an abandoned supply cache. It's not trapped, but it's large - taking everything would require significant time and carrying capacity.",
|
|
"cooldown": 240,
|
|
"conditions": {
|
|
"game_time_min": 120
|
|
},
|
|
"choices": {
|
|
"take_all": {
|
|
"text": "Take everything - maximum supplies but slower movement",
|
|
"requirements": {
|
|
"fuel": 10
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"supplies": 80,
|
|
"fuel": -10,
|
|
"ammunition": 40
|
|
},
|
|
"flags": {
|
|
"overloaded": "1"
|
|
}
|
|
}
|
|
},
|
|
"take_some": {
|
|
"text": "Take essentials only - balanced approach",
|
|
"requirements": {},
|
|
"outcomes": {
|
|
"resources": {
|
|
"supplies": 50,
|
|
"ammunition": 20,
|
|
"fuel": -5
|
|
}
|
|
}
|
|
},
|
|
"leave": {
|
|
"text": "Mark location and leave - can return later",
|
|
"requirements": {},
|
|
"outcomes": {
|
|
"flags": {
|
|
"cache_location_known": "1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"individual_in_need": {
|
|
"title": "Individual Requesting Assistance",
|
|
"description": "A lone individual has approached your position. They claim to have valuable information but need medical supplies urgently.",
|
|
"cooldown": 360,
|
|
"conditions": {
|
|
"game_time_min": 180,
|
|
"resource_min": {
|
|
"supplies": 10
|
|
}
|
|
},
|
|
"choices": {
|
|
"help_full": {
|
|
"text": "Provide full medical assistance and supplies",
|
|
"requirements": {
|
|
"supplies": 20
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"supplies": -20,
|
|
"intel": 30
|
|
},
|
|
"flags": {
|
|
"morale_boost": "1",
|
|
"reputation": "1"
|
|
}
|
|
}
|
|
},
|
|
"help_minimal": {
|
|
"text": "Provide basic aid only",
|
|
"requirements": {
|
|
"supplies": 5
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"supplies": -5,
|
|
"intel": 10
|
|
}
|
|
}
|
|
},
|
|
"recruit": {
|
|
"text": "Recruit them to join your team",
|
|
"requirements": {
|
|
"reputation": 15,
|
|
"supplies": 10
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"supplies": -10
|
|
},
|
|
"flags": {
|
|
"crew_expanded": "1",
|
|
"specialist_available": "1"
|
|
}
|
|
}
|
|
},
|
|
"ignore": {
|
|
"text": "Decline and move on",
|
|
"requirements": {},
|
|
"outcomes": {
|
|
"flags": {
|
|
"morale_penalty": "1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"equipment_malfunction": {
|
|
"title": "Critical Equipment Failure",
|
|
"description": "Essential equipment has malfunctioned. You can attempt a quick field repair, invest time in a thorough fix, or continue operating with reduced efficiency.",
|
|
"cooldown": 180,
|
|
"conditions": {
|
|
"game_time_min": 240
|
|
},
|
|
"choices": {
|
|
"repair_quick": {
|
|
"text": "Quick field repair - fast but temporary",
|
|
"requirements": {
|
|
"supplies": 15
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"supplies": -15
|
|
},
|
|
"flags": {
|
|
"equipment_fragile": "1"
|
|
},
|
|
"trigger_event": ""
|
|
}
|
|
},
|
|
"repair_thorough": {
|
|
"text": "Thorough repair - time-consuming but permanent",
|
|
"requirements": {
|
|
"supplies": 30,
|
|
"fuel": 20
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"supplies": -30,
|
|
"fuel": -20
|
|
},
|
|
"flags": {
|
|
"equipment_upgraded": "1",
|
|
"maintenance_complete": "1"
|
|
}
|
|
}
|
|
},
|
|
"continue": {
|
|
"text": "Continue with reduced efficiency - save resources",
|
|
"requirements": {},
|
|
"outcomes": {
|
|
"flags": {
|
|
"efficiency_reduced": "1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"warning_detected": {
|
|
"title": "Danger Warning",
|
|
"description": "Your sensors have detected signs of significant danger ahead. The threat appears substantial, but the exact nature is unclear.",
|
|
"cooldown": 420,
|
|
"conditions": {
|
|
"game_time_min": 300
|
|
},
|
|
"choices": {
|
|
"prepare": {
|
|
"text": "Prepare defenses and proceed cautiously",
|
|
"requirements": {
|
|
"ammunition": 30,
|
|
"supplies": 20
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"ammunition": -30,
|
|
"supplies": -20
|
|
},
|
|
"flags": {
|
|
"defensive_posture": "1",
|
|
"prepared": "1"
|
|
}
|
|
}
|
|
},
|
|
"rush": {
|
|
"text": "Rush through quickly before threat materializes",
|
|
"requirements": {
|
|
"fuel": 30
|
|
},
|
|
"outcomes": {
|
|
"resources": {
|
|
"fuel": -30
|
|
},
|
|
"flags": {
|
|
"risk_taken": "1"
|
|
}
|
|
}
|
|
},
|
|
"retreat": {
|
|
"text": "Fall back and find alternate route",
|
|
"requirements": {},
|
|
"outcomes": {
|
|
"resources": {
|
|
"fuel": -15
|
|
},
|
|
"flags": {
|
|
"alternate_route": "1",
|
|
"time_lost": "1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|