fertig-classic-games/assets/images/tetrisattack
Brian Fertig 4fcae92e59 feat(civ): AI-initiated diplomacy with frustration escalation
Introduce active diplomacy where rival leaders approach the player with
requests, demands, trades, and gifts rather than passively waiting.

New CivilizationDiplomacy.js module handles:
- 9 request kinds (joinWar, breakTreaty, borderUltimatum, demandGold,
  demandTech, techTrade, ceasefire, peace, alliance) with initiative
  tiers so urgent calls to arms aren't drowned out by filler offers
- Cooldowns per (leader, target, kind) plus a per-leader gap so a
  leader can't spam different requests to bypass rate limits
- Frustration grudge (0-100) raised by refusals, decaying each turn
  and dragging attitude toward hostility through the ordinary war path
- Escalation: frustrated leaders demand compensation, then renounce
  treaties at breaking point, with ordinary hostility finishing the job
- Border ultimatum promises checked when pledges expire (double penalty
  for broken word)
- Unprompted gold/tech gifts from leaders with high attitude
- Staleness validation so requests the world invalidated are dropped
- AI-to-AI requests resolve immediately through the same pipeline

UI changes:
- AI requests queued on state.pendingRequests, presented via audience
  popup at the start of the human turn (one per turn, configurable)
- Diplomacy screen shows ACCEPT/REFUSE with consequence hints until
  answered; unanswered requests lapse with half-weight penalties
- New event types: treatyRenounced, pledgeBroken/pledgeKept, aiGift
- Leader dialogue for demands, refusals, gifts, and renouncements
- Tetris Attack menu gets a title art backdrop

Data/infra:
- diplomacyRequests tuning in civilization-rules.json (thresholds,
  cooldowns, attitude weights, per-request config)
- Frustration, requestCooldown, lastRequestTurn, pledges fields on
  civ state — all backward-compatible with old saves
- Full verification suite covering eligibility, resolution, cooldowns,
  frustration arc, serialization, and fuzz testing
2026-07-23 16:26:15 -06:00
..
background-beth-r1.png
background-beth-r2.png
background-beth-r3.png
background-beth-r4.png
background-beth-r5.png
background-jerry-r1.png
background-jerry-r2.png
background-jerry-r3.png
background-jerry-r4.png
background-jerry-r5.png
background-klaxon-r1.png
background-klaxon-r2.png
background-klaxon-r3.png
background-klaxon-r4.png
background-klaxon-r5.png
background-michael-r1.png
background-michael-r2.png
background-michael-r3.png
background-michael-r4.png
background-michael-r5.png
background-steve-r1.png
background-steve-r2.png
background-steve-r3.png
background-steve-r4.png
background-steve-r5.png
background-victor-r1.png
background-victor-r2.png
background-victor-r3.png
background-victor-r4.png
background-victor-r5.png
main-menu.png feat(civ): AI-initiated diplomacy with frustration escalation 2026-07-23 16:26:15 -06:00
ta-stage.png
tetrisattack-characters.png feat(tetrisattack): add optional character voice reactions and adjust BGM volume 2026-07-22 21:06:03 -06:00
tetrisattack-characters.psd feat(tetrisattack): add optional character voice reactions and adjust BGM volume 2026-07-22 21:06:03 -06:00
tetrisattack-panels.png
tetrisattack-panels.psd