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 Major Port 2026-06-28 19:27:29 -06:00
fetchStarControlAssets.js refactor: improve Star Control ship rendering and ship picker UX 2026-07-15 11:45:08 -06:00
genDotLink.js Major Port 2026-06-28 19:27:29 -06:00
genJumble.js feat: add Jumble word puzzle game with 58 curated levels 2026-06-30 19:42:57 -06:00
genKatamino.js Major Port 2026-06-28 19:27:29 -06:00
genMiniCrossword.js Major Port 2026-06-28 19:27:29 -06:00
genPeggleLevels.js Peggle Adjustments 2026-07-12 09:14:06 -06:00
genPuddingMonsters.js Major Port 2026-06-28 19:27:29 -06:00
genRushHour.js Major Port 2026-06-28 19:27:29 -06:00
genSpireClimbCreatures.js Major Port 2026-06-28 19:27:29 -06:00
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 Major Port 2026-06-28 19:27:29 -06:00
verifyAdvanceWars.js feat(advance-wars): add unit progression system with mission-based unlocks 2026-07-19 10:55:18 -06:00
verifyBalatro.js feat: add Balatro — poker roguelike game 2026-07-09 22:43:36 -06:00
verifyBejeweled.js Major Port 2026-06-28 19:27:29 -06:00
verifyBlockFighter.js Major Port 2026-06-28 19:27:29 -06:00
verifyBookwork.js Major Port 2026-06-28 19:27:29 -06:00
verifyCanasta.js Major Port 2026-06-28 19:27:29 -06:00
verifyCivilization.js feat(civ): AI-initiated diplomacy with frustration escalation 2026-07-23 16:26:15 -06:00
verifyColoradoDefense.js Further Tweaks to Colorado Defense 2026-07-14 13:19:07 -06:00
verifyCribbage.js Major Port 2026-06-28 19:27:29 -06:00
verifyDotLink.js Major Port 2026-06-28 19:27:29 -06:00
verifyDungeonBoss.js feat(dungeonboss): mid-walk spell casting in adventure windows 2026-07-06 21:55:04 -06:00
verifyGinRummy.js Major Port 2026-06-28 19:27:29 -06:00
verifyJewelQuest.js Major Port 2026-06-28 19:27:29 -06:00
verifyJumble.js feat: add Jumble word puzzle game with 58 curated levels 2026-06-30 19:42:57 -06:00
verifyMahjong.js Major Port 2026-06-28 19:27:29 -06:00
verifyMahjongMatch.js Major Port 2026-06-28 19:27:29 -06:00
verifyMiniMotorways.js Major Port 2026-06-28 19:27:29 -06:00
verifyPaiGowPoker.js Major Port 2026-06-28 19:27:29 -06:00
verifyPeggle.js feat(peggle): overhaul 7 powers with enhanced mechanics, visuals, and audio 2026-07-12 15:29:55 -06:00
verifyRisk.js Major Port 2026-06-28 19:27:29 -06:00
verifyRummikub.js Major Port 2026-06-28 19:27:29 -06:00
verifySWDBG.js feat(swdbg): overhaul card data from physical set transcription 2026-07-08 22:07:48 -06:00
verifySlots.js Major Port 2026-06-28 19:27:29 -06:00
verifySpireClimb.js Major Port 2026-06-28 19:27:29 -06:00
verifyStarControl.js feat: add Star Control space combat game 2026-07-14 22:45:56 -06:00
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 Major Port 2026-06-28 19:27:29 -06:00