fertig-classic-games/tools
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
..
buildCommonWords.js
…
fetchStarControlAssets.js
…
genDotLink.js
…
genJumble.js
…
genKatamino.js
…
genMiniCrossword.js
…
genPeggleLevels.js
…
genPuddingMonsters.js
…
genRushHour.js
…
genSpireClimbCreatures.js
…
genSuperKartTracks.js feat: add Super Kart — SNES-style Mode 7 kart racing game 2026-07-17 14:25:18 -06:00
genTetrisAttackPuzzles.js feat: add Tetris Attack (Panel de Pon) with endless, stage clear, and puzzle modes 2026-07-20 00:04:26 -06:00
genZuma.js
…
verifyAdvanceWars.js feat(advance-wars): add unit progression system with mission-based unlocks 2026-07-19 10:55:18 -06:00
verifyBalatro.js
…
verifyBejeweled.js
…
verifyBlockFighter.js
…
verifyBookwork.js
…
verifyCanasta.js
…
verifyCivilization.js feat(civ): AI-initiated diplomacy with frustration escalation 2026-07-23 16:26:15 -06:00
verifyColoradoDefense.js
…
verifyCribbage.js
…
verifyDotLink.js
…
verifyDungeonBoss.js
…
verifyGinRummy.js
…
verifyJewelQuest.js
…
verifyJumble.js
…
verifyMahjong.js
…
verifyMahjongMatch.js
…
verifyMiniMotorways.js
…
verifyPaiGowPoker.js
…
verifyPeggle.js
…
verifyRisk.js
…
verifyRummikub.js
…
verifySWDBG.js
…
verifySlots.js
…
verifySpireClimb.js
…
verifyStarControl.js
…
verifySuperKart.js feat(superkart): add missed-checkpoint correction for shortcut detection 2026-07-22 13:00:12 -06:00
verifyTempest.js retune tempest difficulty and fix death persistence 2026-07-21 22:52:07 -06:00
verifyTetrisAttack.js Re-theme stage clear to helping friends with multi-line intros 2026-07-22 20:52:05 -06:00
verifyZuma.js
…