@chrischall/warapp-mcp 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/README.md +199 -8
  4. package/dist/analysis/award.js +159 -0
  5. package/dist/analysis/bonuses.js +98 -0
  6. package/dist/analysis/breach.js +62 -0
  7. package/dist/analysis/card-support.js +329 -0
  8. package/dist/analysis/card-threats.js +234 -0
  9. package/dist/analysis/cards-in-effect.js +130 -0
  10. package/dist/analysis/chains.js +59 -0
  11. package/dist/analysis/chokepoints.js +140 -0
  12. package/dist/analysis/combat.js +231 -0
  13. package/dist/analysis/commander-safety.js +149 -0
  14. package/dist/analysis/commitments.js +338 -0
  15. package/dist/analysis/exchange.js +155 -0
  16. package/dist/analysis/graph.js +82 -0
  17. package/dist/analysis/guard-off.js +54 -0
  18. package/dist/analysis/guess.js +351 -0
  19. package/dist/analysis/headroom.js +241 -0
  20. package/dist/analysis/hold-diff.js +64 -0
  21. package/dist/analysis/how-lost.js +130 -0
  22. package/dist/analysis/index.js +14 -0
  23. package/dist/analysis/local-deploy.js +159 -0
  24. package/dist/analysis/lookahead.js +108 -0
  25. package/dist/analysis/opponent-profile.js +551 -0
  26. package/dist/analysis/opponents.js +1245 -0
  27. package/dist/analysis/outlook.js +633 -0
  28. package/dist/analysis/overrides.js +60 -0
  29. package/dist/analysis/picks.js +1879 -0
  30. package/dist/analysis/plan/after-leftover.js +140 -0
  31. package/dist/analysis/plan/cap-spend.js +242 -0
  32. package/dist/analysis/plan/captures.js +1195 -0
  33. package/dist/analysis/plan/commander.js +236 -0
  34. package/dist/analysis/plan/completed.js +29 -0
  35. package/dist/analysis/plan/conceded-out.js +131 -0
  36. package/dist/analysis/plan/estimates.js +715 -0
  37. package/dist/analysis/plan/guard-off.js +232 -0
  38. package/dist/analysis/plan/holds.js +1631 -0
  39. package/dist/analysis/plan/leftover.js +760 -0
  40. package/dist/analysis/plan/move-order.js +319 -0
  41. package/dist/analysis/plan/orders.js +317 -0
  42. package/dist/analysis/plan/relations.js +702 -0
  43. package/dist/analysis/plan/report.js +672 -0
  44. package/dist/analysis/plan/shared.js +1218 -0
  45. package/dist/analysis/plan/stand-still.js +823 -0
  46. package/dist/analysis/plan/state.js +44 -0
  47. package/dist/analysis/plan/strike.js +1416 -0
  48. package/dist/analysis/plan/targets.js +651 -0
  49. package/dist/analysis/plan/team.js +299 -0
  50. package/dist/analysis/plan/threats.js +927 -0
  51. package/dist/analysis/plan/transfers.js +328 -0
  52. package/dist/analysis/plan/util.js +5 -0
  53. package/dist/analysis/plan/vacated.js +285 -0
  54. package/dist/analysis/planner.js +2922 -0
  55. package/dist/analysis/player-record.js +144 -0
  56. package/dist/analysis/player.js +268 -0
  57. package/dist/analysis/profile.js +347 -0
  58. package/dist/analysis/relations.js +1030 -0
  59. package/dist/analysis/schedule.js +88 -0
  60. package/dist/analysis/since-last.js +50 -0
  61. package/dist/analysis/static-seats.js +71 -0
  62. package/dist/analysis/stress.js +577 -0
  63. package/dist/analysis/team-brief.js +151 -0
  64. package/dist/analysis/tripwire.js +644 -0
  65. package/dist/analysis/turn-sim.js +259 -0
  66. package/dist/analysis/whereabouts.js +1109 -0
  67. package/dist/board.js +105 -0
  68. package/dist/bundle.js +117959 -36172
  69. package/dist/cards.js +435 -0
  70. package/dist/chat-cursor.js +135 -0
  71. package/dist/chat.js +192 -0
  72. package/dist/client.js +361 -0
  73. package/dist/config.js +62 -0
  74. package/dist/direct/link.js +102 -0
  75. package/dist/direct/session.js +267 -0
  76. package/dist/direct/transport.js +424 -0
  77. package/dist/guess-salt.js +65 -0
  78. package/dist/hosted.js +24 -0
  79. package/dist/index.js +33 -0
  80. package/dist/join-color.js +140 -0
  81. package/dist/live.js +278 -0
  82. package/dist/map-stats.js +152 -0
  83. package/dist/map-store.js +204 -0
  84. package/dist/move-order.js +141 -0
  85. package/dist/my-games.js +180 -0
  86. package/dist/normalize.js +411 -0
  87. package/dist/open-games.js +537 -0
  88. package/dist/outlook-log.js +138 -0
  89. package/dist/path-lock.js +22 -0
  90. package/dist/pick-list.js +193 -0
  91. package/dist/player-record-store.js +229 -0
  92. package/dist/player-states.js +31 -0
  93. package/dist/profile-store.js +677 -0
  94. package/dist/protocol/bundle.js +375 -0
  95. package/dist/protocol/codec.js +556 -0
  96. package/dist/protocol/decoded.js +12 -0
  97. package/dist/protocol/interp.js +1904 -0
  98. package/dist/protocol/methods.js +531 -0
  99. package/dist/protocol/rpc.js +202 -0
  100. package/dist/push/listener.js +393 -0
  101. package/dist/push/packets.js +66 -0
  102. package/dist/push/socketio.js +333 -0
  103. package/dist/push/websocket.js +179 -0
  104. package/dist/redact.js +62 -0
  105. package/dist/relations-store.js +242 -0
  106. package/dist/replay.js +215 -0
  107. package/dist/scalars.js +28 -0
  108. package/dist/scout.js +346 -0
  109. package/dist/stats.js +269 -0
  110. package/dist/strategy/card-clock.js +185 -0
  111. package/dist/strategy/map-notes.js +128 -0
  112. package/dist/strategy/notes.js +2168 -0
  113. package/dist/team-cards.js +84 -0
  114. package/dist/team-orders.js +150 -0
  115. package/dist/teams.js +19 -0
  116. package/dist/tools/award.js +206 -0
  117. package/dist/tools/begin-turn.js +162 -0
  118. package/dist/tools/board.js +77 -0
  119. package/dist/tools/card-advice.js +256 -0
  120. package/dist/tools/card-effects.js +49 -0
  121. package/dist/tools/card-plays.js +434 -0
  122. package/dist/tools/card-support-advice.js +140 -0
  123. package/dist/tools/chat-inbox.js +146 -0
  124. package/dist/tools/chat.js +483 -0
  125. package/dist/tools/check-plan.js +688 -0
  126. package/dist/tools/commander-check.js +102 -0
  127. package/dist/tools/commitments.js +216 -0
  128. package/dist/tools/common.js +143 -0
  129. package/dist/tools/diplomacy.js +342 -0
  130. package/dist/tools/game.js +126 -0
  131. package/dist/tools/guess-view.js +56 -0
  132. package/dist/tools/healthcheck.js +90 -0
  133. package/dist/tools/hints.js +34 -0
  134. package/dist/tools/how-lost.js +154 -0
  135. package/dist/tools/index.js +142 -0
  136. package/dist/tools/join-game.js +327 -0
  137. package/dist/tools/leave-game.js +181 -0
  138. package/dist/tools/live-context.js +339 -0
  139. package/dist/tools/live.js +404 -0
  140. package/dist/tools/map-stats.js +117 -0
  141. package/dist/tools/map.js +133 -0
  142. package/dist/tools/my-games.js +123 -0
  143. package/dist/tools/open-games.js +104 -0
  144. package/dist/tools/opponents.js +151 -0
  145. package/dist/tools/order-options.js +135 -0
  146. package/dist/tools/picks.js +292 -0
  147. package/dist/tools/profile-hook.js +156 -0
  148. package/dist/tools/profile-opponents.js +121 -0
  149. package/dist/tools/profile-reads.js +99 -0
  150. package/dist/tools/push.js +385 -0
  151. package/dist/tools/relations.js +611 -0
  152. package/dist/tools/resolve.js +45 -0
  153. package/dist/tools/route.js +36 -0
  154. package/dist/tools/scout.js +87 -0
  155. package/dist/tools/session.js +163 -0
  156. package/dist/tools/strategy.js +200 -0
  157. package/dist/tools/stress-opponents.js +83 -0
  158. package/dist/tools/surrender.js +240 -0
  159. package/dist/tools/survival.js +189 -0
  160. package/dist/tools/team-brief.js +266 -0
  161. package/dist/tools/team-source.js +222 -0
  162. package/dist/tools/team.js +182 -0
  163. package/dist/tools/turn.js +2761 -0
  164. package/dist/tools/uncommit.js +160 -0
  165. package/dist/tools/where.js +275 -0
  166. package/dist/tools/write-kit.js +158 -0
  167. package/dist/transport-bridge.js +33 -0
  168. package/dist/trend.js +452 -0
  169. package/dist/version.js +4 -0
  170. package/manifest.json +174 -4
  171. package/mint.yaml +101 -14
  172. package/package.json +11 -6
  173. package/server.json +40 -3
  174. package/skills/warapp-api/SKILL.md +95 -4
  175. package/skills/warapp-api/references/scout.mjs +348 -0
  176. package/skills/warapp-api/scripts/warapp.sh +69 -8
  177. package/skills/warapp-mcp/SKILL.md +969 -21
@@ -0,0 +1,2168 @@
1
+ // Strategy notes: the community's heuristics as data, in our own words, each with the
2
+ // link it came from (docs/STRATEGY.md lists them and says which are encoded where).
3
+ // Pure and deterministic; no I/O. `warapp_strategy` and the `warapp://strategy`
4
+ // resource serve them.
5
+ import { gameProfile } from '../analysis/profile.js';
6
+ import { bonusTerritories } from '../analysis/bonuses.js';
7
+ import { armiesToTake, DEFAULT_DEFENSIVE_KILL_RATE, DEFAULT_OFFENSIVE_KILL_RATE } from '../analysis/combat.js';
8
+ import { cardRules } from '../cards.js';
9
+ export const NOTE_TOPICS = ['format', 'settings', 'cards', 'reading', 'opening', 'timing', 'fighting', 'diplomacy', 'map'];
10
+ /** The pages the notes were researched from (read 2026-11; paraphrased, never copied): the war.app wiki and forum, and community guides they link to. */
11
+ export const STRATEGY_SOURCES = {
12
+ general: 'https://war.app/Forum/811395-general-strategy-guidelines',
13
+ oneVsOne: 'https://war.app/Forum/99097-good-1v1-strategies',
14
+ ffa: 'https://war.app/Forum/621189-ffa-strategy',
15
+ combat: 'https://war.app/wiki/Combat_Basics',
16
+ luck: 'https://war.app/wiki/Luck_Modifier',
17
+ cards: 'https://war.app/wiki/Cards',
18
+ moveOrder: 'https://war.app/wiki/Move_order',
19
+ manualDistribution: 'https://war.app/wiki/Manual_distribution',
20
+ turnPhases: 'https://war.app/wiki/Turn_phases',
21
+ orderPriority: 'https://war.app/wiki/Order_priority_card',
22
+ orderDelay: 'https://war.app/wiki/Order_delay_card',
23
+ blockade: 'https://war.app/wiki/Blockade_and_Emergency_Blockade_Cards',
24
+ armyCap: 'https://war.app/wiki/Army_cap',
25
+ noSplit: 'https://war.app/wiki/No-split_mode',
26
+ multiAttack: 'https://war.app/wiki/Multi-attack',
27
+ // The second research pass (read 2026-11-13): more wiki pages, forum threads, and three community
28
+ // guides the wiki links to (the clan guide and two documents).
29
+ localDeployments: 'https://war.app/wiki/Local_deployments',
30
+ forumTeamLadder: 'https://war.app/Forum/394357-2-v-2-ladder-tutorial-final-earth',
31
+ advancedStrategy: 'https://war.app/wiki/Advanced_Strategy',
32
+ ai: 'https://war.app/wiki/AI',
33
+ airlift: 'https://war.app/wiki/Airlift_Card',
34
+ attackTransferOnly: 'https://war.app/wiki/Attack_Only_and_Transfer_Only',
35
+ beginnerGuide: 'https://docs.google.com/document/d/e/2PACX-1vS5eO54w3LgnkcwbLqM3DhynuQGoChrPn313QXIMm0QZ3ApILPuvcunEdmG_nZflHKcfRwCpZfvHA8L/pub',
36
+ bomb: 'https://war.app/wiki/Bomb_Card',
37
+ cardMinimums: 'https://war.app/wiki/Card_minimums',
38
+ cities: 'https://war.app/wiki/Cities_(commerce)',
39
+ clanGuide: 'https://warlight.nghood.com/',
40
+ commanders: 'https://war.app/wiki/Commanders',
41
+ commerce: 'https://war.app/wiki/Commerce',
42
+ diplomacy: 'https://war.app/wiki/Diplomacy_Card',
43
+ fog: 'https://war.app/wiki/Fog',
44
+ forumAiCards: 'https://war.app/Forum/141245-ais-use-blockadegiftdiplomacybomb',
45
+ forumAttackTransferOrders: 'https://war.app/Forum/4440-usefulness-attacktransfer-orders',
46
+ forumAutoDistAnalysis: 'https://war.app/Forum/621318-favorite-cw-template-sead-analysis',
47
+ forumBattleTactics: 'https://war.app/Forum/2557-need-battle-tactics',
48
+ forumBlockadeProposal: 'https://war.app/Forum/1125-proposal-blockade-card',
49
+ forumBombCommander: 'https://war.app/Forum/152187-bombing-territory-commander',
50
+ forumBombStrategy: 'https://war.app/Forum/148237-strategy-bomb-cards',
51
+ forumCommanderTemplate: 'https://war.app/Forum/223845-commander-template-challenge',
52
+ forumDelayCard: 'https://war.app/Forum/412763-delay-card',
53
+ forumFfaGames: 'https://war.app/Forum/4723-best-way-quality-ffa-games',
54
+ forumImprovingGameplay: 'https://war.app/Forum/140529-help-improving-gameplay',
55
+ forumIntelBeforeTurn1: 'https://war.app/Forum/427054-maximize-intel-before-t1',
56
+ forumKeepDelayCard: 'https://war.app/Forum/804335-keep-play-order-delay-card',
57
+ forumKeepingPlayers: 'https://war.app/Forum/169693-keeping-players-game-longer',
58
+ forumKingmaking: 'https://war.app/Forum/699119-kingmaking-reportableagainst-rules',
59
+ forumPickClues: 'https://war.app/Forum/719814-alexclusives-clues',
60
+ forumPickingGuide: 'https://war.app/Forum/434535-1v1-ladder-strategic-picking-guide',
61
+ forumPickOrder: 'https://war.app/Forum/429801-pick-order-issue-1vs1',
62
+ forumSafePicking: 'https://war.app/Forum/42216-safe-picking-play',
63
+ forumSkillChecklist: 'https://war.app/Forum/664334-skill-evaluation-phakh-gokhn',
64
+ forumSmallEarthSeries: 'https://war.app/Forum/551071-small-earth-series-nauzhror-vs-sanmu-shamu',
65
+ forumStrategicTemplates: 'https://war.app/Forum/721296-makes-template-strategic?Offset=120',
66
+ forumTeamStrategy: 'https://war.app/Forum/139981-team-strategy-question',
67
+ guard: 'https://war.app/wiki/One_Army_Must_Stand_Guard',
68
+ mediumEarth: 'https://war.app/wiki/Medium_Earth_Traditional',
69
+ negativeBonuses: 'https://war.app/wiki/Negative_bonuses',
70
+ percentageAttacks: 'https://war.app/wiki/Percentage_attacks',
71
+ sanctions: 'https://war.app/wiki/Sanctions_Card',
72
+ smallEarthGuide: 'https://docs.google.com/document/d/18vq7hPEy3WORXujZJiQVgRPCdaQ-iys9RmFNv7_yq7U',
73
+ specialUnit: 'https://war.app/wiki/Special_unit',
74
+ spyCards: 'https://war.app/wiki/Spy,_Reconnaissance,_and_Surveillance_Cards',
75
+ strategic1v1: 'https://war.app/wiki/Strategic_1_v_1',
76
+ strategyGuideDoc: 'https://docs.google.com/document/d/1YAoH8zzh7uk9-jQwuYzwGll0hsPukq1u8P2lHrTMoqo',
77
+ surrender: 'https://war.app/wiki/Surrender',
78
+ teamGames: 'https://war.app/wiki/Team_Games',
79
+ territoryIncome: 'https://war.app/wiki/Extra_armies_for_territories',
80
+ // The end-game pass (read 2026-11-13): finishing, being behind, stand-offs, leavers and AI seats.
81
+ aiSurrenders: 'https://war.app/wiki/AI_surrenders_when_one_human_remains',
82
+ booting: 'https://war.app/wiki/Booting',
83
+ playersIntoAis: 'https://war.app/wiki/Players_turning_into_AIs',
84
+ voteToEnd: 'https://war.app/wiki/Vote_to_End',
85
+ forumBadSurrender: 'https://war.app/Forum/642777-bad-surrender',
86
+ forumCommanderDeath: 'https://war.app/Forum/156933-commanders-eliminated-ends-turn-player',
87
+ forumFfaLeague: 'https://war.app/Forum/546500-ffa-competition-league',
88
+ forumFfaTruce: 'https://war.app/Forum/5231-ffa-ffa',
89
+ forumGuessMultiBorder: 'https://war.app/Forum/145784-guess-attack-multibordering',
90
+ forumLargeFront: 'https://war.app/Forum/101261-fight-over-large-front',
91
+ forumNeverSurrender: 'https://war.app/Forum/376144-people-never-surrender',
92
+ forumStalemate: 'https://war.app/Forum/41750-strategic-1v1-draw-perfect-play',
93
+ forumTeamCommanders: 'https://war.app/Forum/737712-kabix-2v2-template',
94
+ forumTellingSurrender: 'https://war.app/Forum/118844-telling-opponent-surrender',
95
+ forumTougherOpponents: 'https://war.app/Forum/297674-strategy-facing-tougher-opponents',
96
+ forumTurningAi: 'https://war.app/Forum/3768-turningai-issue',
97
+ // The diplomacy pass (read 2026-11-14, PLAN-TEAMS part E): the site rules on players working
98
+ // together, the wiki's page on diplomacy games, and forum threads on truces in free-for-alls.
99
+ rules: 'https://war.app/wiki/Rules',
100
+ diplomacyGames: 'https://war.app/wiki/PE',
101
+ forumFfaChatEtiquette: 'https://war.app/Forum/759391-ffa-private-chat-etiquette',
102
+ forumTreatyBreaking: 'https://war.app/Forum/4401-everybodys-position-breaking-treaties-unannounced',
103
+ forumTreatyBreakingLater: 'https://war.app/Forum/4401-everybodys-position-breaking-treaties-unannounced?Offset=20',
104
+ forumTruceTwoLeft: 'https://war.app/Forum/4467-fair-blacklist-here',
105
+ forumTrucePsychology: 'https://war.app/Forum/2981-psychology',
106
+ forumHiddenTeaming: 'https://war.app/Forum/669761-playing-team-ffa',
107
+ };
108
+ /** Whether a game with this profile and these settings meets a note's condition. */
109
+ export function noteMatches(c, p, x = {}) {
110
+ const off = x.offensiveKillRate ?? DEFAULT_OFFENSIVE_KILL_RATE;
111
+ const def = x.defensiveKillRate ?? DEFAULT_DEFENSIVE_KILL_RATE;
112
+ if (c.format && !c.format.includes(p.format))
113
+ return false;
114
+ if (c.phase && !c.phase.includes(p.phase))
115
+ return false;
116
+ if (c.standing && p.standing !== 'unknown' && !c.standing.includes(p.standing))
117
+ return false;
118
+ if (c.cardsInPlay && !(x.cardsInPlay ? x.cardsInPlay.some((n) => c.cardsInPlay.includes(n)) : p.settings.cards))
119
+ return false;
120
+ if (c.anyCards && !p.settings.cards)
121
+ return false;
122
+ if (c.fog && (p.settings.fog === null || !c.fog.includes(p.settings.fog)))
123
+ return false;
124
+ if (c.commanders !== undefined && p.settings.commanders !== c.commanders)
125
+ return false;
126
+ if (c.guard !== undefined && (x.oneArmyStandsGuard ?? true) !== c.guard)
127
+ return false;
128
+ if (c.multiAttack !== undefined && (x.multiAttack ?? false) !== c.multiAttack)
129
+ return false;
130
+ if (c.localDeployments !== undefined && p.settings.localDeployments !== c.localDeployments)
131
+ return false;
132
+ if (c.noSplit !== undefined && p.settings.noSplit !== c.noSplit)
133
+ return false;
134
+ if (c.moveOrder && (x.moveOrder === undefined || !c.moveOrder.includes(x.moveOrder)))
135
+ return false;
136
+ if (c.distribution && x.distribution !== c.distribution)
137
+ return false;
138
+ if (c.exact && !(p.settings.luck === 0 && p.settings.rounding !== 'WeightedRandom'))
139
+ return false;
140
+ if (c.defaultKillRates && !(off === DEFAULT_OFFENSIVE_KILL_RATE && def === DEFAULT_DEFENSIVE_KILL_RATE))
141
+ return false;
142
+ if (c.defenceBeatsOffence && !(def > off))
143
+ return false;
144
+ if (c.territoryIncome && !((x.bonusArmyPer ?? 0) > 0))
145
+ return false;
146
+ if (c.attackOnlyAllowed && x.attackOnlyAllowed !== true)
147
+ return false;
148
+ if (c.transferOnlyAllowed && x.transferOnlyAllowed !== true)
149
+ return false;
150
+ if (c.percentageAllowed && x.percentageAllowed !== true)
151
+ return false;
152
+ if (c.commerce && x.commerce !== true)
153
+ return false;
154
+ if (c.wastelands && x.wastelands !== true)
155
+ return false;
156
+ if (c.negativeBonus && x.negativeBonus !== true)
157
+ return false;
158
+ if (c.privateMessaging !== undefined && x.privateMessaging !== c.privateMessaging)
159
+ return false;
160
+ return true;
161
+ }
162
+ /**
163
+ * Whether completing some bonus would cut income: its value plus the value of every bonus that
164
+ * lies inside it comes to less than zero. A negative value alone is not enough — maps built from
165
+ * overlapping "progressive" bonuses use negative entries as offsets, and the full set still pays.
166
+ */
167
+ export function hasCostlyBonus(g) {
168
+ if (![...g.bonusById.values()].some((b) => b.value < 0))
169
+ return false;
170
+ const all = [...g.bonusById.values()].map((b) => ({ value: b.value, territories: bonusTerritories(g, b.id) })).filter((b) => b.territories.length > 0);
171
+ return all.some((b) => {
172
+ if (b.value >= 0)
173
+ return false;
174
+ const mine = new Set(b.territories);
175
+ return all.filter((o) => o.territories.every((t) => mine.has(t))).reduce((n, o) => n + o.value, 0) < 0;
176
+ });
177
+ }
178
+ const flag = (v) => v === true || v === 'true' || v === 'True' ? true : v === false || v === 'false' || v === 'False' ? false : undefined;
179
+ /** The settings a note's condition may need, from a game's GameFeed settings. */
180
+ export function noteContext(settings) {
181
+ if (!settings)
182
+ return {};
183
+ const raw = settings.raw;
184
+ const out = {};
185
+ if (settings.offensiveKillRate !== undefined)
186
+ out.offensiveKillRate = settings.offensiveKillRate;
187
+ if (settings.defensiveKillRate !== undefined)
188
+ out.defensiveKillRate = settings.defensiveKillRate;
189
+ if (settings.armyCap !== undefined)
190
+ out.armyCap = settings.armyCap;
191
+ if (settings.multiAttack !== undefined)
192
+ out.multiAttack = settings.multiAttack;
193
+ out.cardsInPlay = cardRules(settings).inPlay;
194
+ if (settings.oneArmyStandsGuard !== undefined)
195
+ out.oneArmyStandsGuard = settings.oneArmyStandsGuard;
196
+ if (settings.moveOrder !== undefined)
197
+ out.moveOrder = settings.moveOrder;
198
+ // "Automatic" is what the lobby fixture sends; "Manual" is the client's name for ranked picks and
199
+ // is not verified from a live feed: any other spelling leaves the distribution unknown, which
200
+ // hides the pick notes rather than showing them wrongly.
201
+ const dealt = raw.AutomaticTerritoryDistribution;
202
+ if (dealt === 'Manual' || dealt === 'Automatic')
203
+ out.distribution = dealt === 'Manual' ? 'manual' : 'automatic';
204
+ if (settings.bonusArmyPer !== undefined)
205
+ out.bonusArmyPer = settings.bonusArmyPer;
206
+ const attackOnly = flag(raw.AllowAttackOnly);
207
+ if (attackOnly !== undefined)
208
+ out.attackOnlyAllowed = attackOnly;
209
+ const transferOnly = flag(raw.AllowTransferOnly);
210
+ if (transferOnly !== undefined)
211
+ out.transferOnlyAllowed = transferOnly;
212
+ const percentage = flag(raw.AllowPercentageAttacks);
213
+ if (percentage !== undefined)
214
+ out.percentageAllowed = percentage;
215
+ if (settings.privateMessaging !== undefined)
216
+ out.privateMessaging = settings.privateMessaging;
217
+ // An empty `Commerce` object is a game without it (the lobby fixture); what a commerce game
218
+ // sends there is not verified, so any content counts as on.
219
+ const commerce = raw.Commerce;
220
+ if (typeof commerce === 'object' && commerce !== null)
221
+ out.commerce = Object.keys(commerce).length > 0;
222
+ // Wastelands that are walls, not just neutrals: some templates scatter many small ones.
223
+ const wastelands = raw.Wastelands;
224
+ if (typeof wastelands === 'object' && wastelands !== null) {
225
+ const w = wastelands;
226
+ const size = Number(w.WastelandSize ?? 0);
227
+ out.wastelands = Number(w.NumberOfWastelands ?? 0) > 0 && size >= Math.max(5, 2 * (settings.initialNonDistributionArmies ?? 2));
228
+ }
229
+ return out;
230
+ }
231
+ const S = STRATEGY_SOURCES;
232
+ const always = () => true;
233
+ const cards = (p) => p.settings.cards;
234
+ /** A note's condition as data (see {@link NoteCondition}). */
235
+ const on = (c) => (p, x) => noteMatches(c, p, x);
236
+ /** Fog levels that show every territory's owner: nothing about who holds what is hidden. */
237
+ const OWNERS_SHOWN = new Set(['NoFog', 'LightFog', 'ModerateFog']);
238
+ /** Every battle ends exactly as the kill rates say: no luck, and fractions round straight. */
239
+ const exact = (p) => p.settings.luck === 0 && p.settings.rounding !== 'WeightedRandom';
240
+ /** The 60/70 breakpoints: two defenders fall to three attackers and three need five. */
241
+ const defaultBreakpoints = (rates) => armiesToTake(2, rates) === 3 && armiesToTake(3, rates) === 5;
242
+ export const STRATEGY_NOTES = [
243
+ // ---- format ----
244
+ {
245
+ id: '1v1-break-bonuses',
246
+ topic: 'format',
247
+ when: (p) => p.format === '1v1',
248
+ text: 'Once you touch your one opponent, income decides the game, not kills: take one territory in each of their ' +
249
+ 'bonuses to switch it off, rather than trading armies against their stacks.',
250
+ source: S.oneVsOne,
251
+ basis: 'source',
252
+ },
253
+ {
254
+ id: '1v1-contact-ground',
255
+ topic: 'format',
256
+ when: (p) => p.format === '1v1',
257
+ text: 'Work out early where you will meet the opponent and shape that ground: bonuses you can hold through a narrow ' +
258
+ 'front or a bottleneck are worth some income, and an exposed bonus is worth less than its value says.',
259
+ source: S.oneVsOne,
260
+ basis: 'source',
261
+ },
262
+ {
263
+ id: 'ffa-strike-last',
264
+ topic: 'format',
265
+ when: (p) => p.format === 'ffa',
266
+ text: 'In a free-for-all, let rivals spend their armies on each other and move in afterwards; a war you are not in ' +
267
+ 'makes both sides weaker against you.',
268
+ source: S.ffa,
269
+ basis: 'source',
270
+ },
271
+ {
272
+ id: 'ffa-pick-fights',
273
+ topic: 'format',
274
+ when: (p) => p.format === 'ffa',
275
+ text: 'Choose your fights: know who borders you, keep expanding while you can, and avoid fighting two neighbours at ' +
276
+ 'once — a second front splits your deploys while the players behind you grow.',
277
+ source: S.ffa,
278
+ basis: 'derived',
279
+ },
280
+ {
281
+ id: 'ffa-diplomacy',
282
+ topic: 'format',
283
+ when: (p) => p.format === 'ffa',
284
+ text: 'A truce on one border frees armies for another. Without chat, stop attacking and deploying on a border and ' +
285
+ 'many players answer in kind. With chat, fix the terms (turns of notice, a cap on border armies): a truce ' +
286
+ 'with no terms ends when it stops paying one side, so keep a guard where a betrayal would hurt most.',
287
+ source: S.ffa,
288
+ basis: 'derived',
289
+ },
290
+ {
291
+ id: 'ffa-big-stack',
292
+ topic: 'format',
293
+ when: (p) => p.format === 'ffa',
294
+ text: "A giant enemy stack cannot be everywhere: fill the territories it leaves behind, wall its path with a blockade, " +
295
+ 'or wait in the fog and hit where it is heading once you are strong enough.',
296
+ source: S.ffa,
297
+ basis: 'source',
298
+ },
299
+ {
300
+ id: 'teams-focus',
301
+ topic: 'format',
302
+ when: (p) => p.format === 'teams',
303
+ text: 'With teammates, attack the same opponent together: its one income must cover two fronts. Start with the ' +
304
+ 'weaker opponent; once its income is capped and it can no longer hurt you, turn together on the stronger ' +
305
+ 'one before it outgrows you.',
306
+ source: S.forumTeamLadder,
307
+ basis: 'source',
308
+ },
309
+ // ---- settings ----
310
+ {
311
+ id: 'settings-efficient-sizes',
312
+ topic: 'settings',
313
+ when: always,
314
+ text: 'Attack with the smallest army that wins: with exact results every few extra armies kill one more ' +
315
+ 'defender and armies between those breakpoints are wasted (with luck or weighted rounding they buy a ' +
316
+ 'better chance). At the defaults (60% attack, 70% defence) three attackers take two defenders and ' +
317
+ 'five take three.',
318
+ source: S.combat,
319
+ basis: 'source',
320
+ encoded: 'the planner sizes every attack at its breakpoint (src/analysis/combat.ts, warapp_plan_turn)',
321
+ },
322
+ {
323
+ id: 'settings-defend-with-three',
324
+ topic: 'settings',
325
+ // Its numbers are the 60/70 breakpoints: offered only where two defenders fall to
326
+ // three attackers and three need five, and only where results are exact (at 75% luck
327
+ // three against two wins about two times in three).
328
+ when: (p, rates) => exact(p) && defaultBreakpoints(rates),
329
+ text: 'Leave three, not two, on a border you want to keep cheap to hold: at the default kill rates two defenders fall ' +
330
+ 'to three attackers but three need five, so the extra army costs the attacker two.',
331
+ source: S.general,
332
+ basis: 'source',
333
+ },
334
+ {
335
+ id: 'settings-poke',
336
+ topic: 'settings',
337
+ // One attacker must kill one defender for sure: a kill rate of at least 50% and exact results.
338
+ when: (p, rates) => exact(p) && (rates.offensiveKillRate ?? 60) >= 50,
339
+ text: 'A one-army attack can spoil an opponent\'s breakpoint: it kills one of the armies they counted on, so their ' +
340
+ 'attack of exactly the right size falls short. Expect the same against you and keep a margin. Where one ' +
341
+ 'army must stand guard it is wasted on a territory holding a single army: that defender survives.',
342
+ source: S.general,
343
+ basis: 'source',
344
+ },
345
+ {
346
+ id: 'settings-move-order',
347
+ topic: 'settings',
348
+ when: always,
349
+ text: 'Know the move order and sort your orders into three groups: certain strikes and reinforcements first; ' +
350
+ 'attacks the opponent could answer last; everything else in between, where it serves as the delay. A heavy ' +
351
+ 'attack in the middle of the list is exposed to both a reinforcement and a reply.',
352
+ source: S.general,
353
+ basis: 'source',
354
+ },
355
+ {
356
+ id: 'settings-move-order-zigzag',
357
+ topic: 'settings',
358
+ when: always,
359
+ text: 'Orders do not simply alternate. Each round every player runs one order, and the order of players ' +
360
+ 'reverses from round to round: with two players, first mover, second, second, first, first, and so ' +
361
+ 'on, separately in each phase, deployments included. Cyclic and no-luck cycle reverse the players ' +
362
+ 'each turn; random redraws them.',
363
+ source: S.moveOrder,
364
+ basis: 'source',
365
+ },
366
+ {
367
+ id: 'settings-attack-second',
368
+ topic: 'settings',
369
+ // Only where a defender kills more per army than an attacker.
370
+ when: (_p, rates) => (rates.defensiveKillRate ?? 70) > (rates.offensiveKillRate ?? 60),
371
+ text: 'Against a stack about your size, do not attack first: a defender kills more per army, so whoever ' +
372
+ 'attacks second fights the survivors. If you attack, list it last; if the stack has not attacked by ' +
373
+ 'then, you lose the exchange. Attack as your first order only on a turn you move first and if you win ' +
374
+ "against its owner's whole income.",
375
+ source: S.combat,
376
+ basis: 'derived',
377
+ encoded: 'the planner lists its moves in this order (rule 7, warapp_plan_turn)',
378
+ },
379
+ {
380
+ id: 'settings-contested-neutral',
381
+ topic: 'settings',
382
+ // Its numbers are the 60/70 breakpoints with exact results.
383
+ when: (p, rates) => exact(p) && defaultBreakpoints(rates),
384
+ text: 'A two-army neutral the opponent can also reach: three attackers leave two survivors, which three armies ' +
385
+ 'take straight back. Make that capture your last order, so yours is the one that stands, or send four ' +
386
+ 'early: the three survivors then need five.',
387
+ source: S.combat,
388
+ basis: 'derived',
389
+ encoded: 'the planner orders such a capture last, or early when its survivors hold (rule 7)',
390
+ },
391
+ {
392
+ id: 'settings-army-cap',
393
+ topic: 'settings',
394
+ when: (_p, context) => (context.armyCap ?? 0) > 0,
395
+ text: 'With an army cap you may hold at most your income times the cap, and at the cap no new armies arrive ' +
396
+ '(a Reinforcement card still pays). Near it, spend armies instead of banking them: what dies in a useful ' +
397
+ 'attack makes room for the next income.',
398
+ source: S.armyCap,
399
+ basis: 'derived',
400
+ },
401
+ {
402
+ id: 'settings-multi-attack',
403
+ topic: 'settings',
404
+ when: (_p, context) => context.multiAttack === true,
405
+ text: 'With Multi-Attack an army that captures can attack again in the same turn (a transfer ends its turn), so ' +
406
+ 'the threat to a territory is every stack that can chain its way there, not only the one next door. A held ' +
407
+ 'line breaks easily: keep small garrisons inside your bonuses and plan to break back.',
408
+ source: S.multiAttack,
409
+ basis: 'derived',
410
+ },
411
+ {
412
+ id: 'settings-no-luck-exact',
413
+ topic: 'settings',
414
+ // Weighted-random rounding makes a breakpoint attack a chance even with no luck.
415
+ when: exact,
416
+ text: 'With no luck every battle ends exactly as the kill rates say, so an attack at its breakpoint never fails: plan to the army.',
417
+ source: S.luck,
418
+ basis: 'source',
419
+ encoded: 'capture costs assume the exact result (src/analysis/combat.ts armiesToTake)',
420
+ },
421
+ {
422
+ id: 'settings-luck-guaranteed',
423
+ topic: 'settings',
424
+ when: (p) => p.settings.luck > 0,
425
+ text: "With luck on, part of each side's kills is the average and the rest is a roll. Count only the kills the roll " +
426
+ 'cannot take away, and add a margin (or accept a stated chance) on attacks you cannot afford to lose.',
427
+ source: S.luck,
428
+ basis: 'derived',
429
+ encoded: 'exact win chances and min_win_chance (src/analysis/combat.ts winChance, guaranteedKills; warapp_plan_turn)',
430
+ },
431
+ {
432
+ id: 'settings-weighted-rounding',
433
+ topic: 'settings',
434
+ when: (p) => p.settings.rounding === 'WeightedRandom',
435
+ text: 'Weighted-random rounding turns a fractional kill into a chance of one more, so the straight-rounding ' +
436
+ 'breakpoints are no longer certain: one extra army often buys the safety.',
437
+ source: S.luck,
438
+ basis: 'derived',
439
+ encoded: 'win chances model weighted-random rounding (src/analysis/combat.ts winChance)',
440
+ },
441
+ {
442
+ id: 'settings-local-deployments',
443
+ topic: 'settings',
444
+ when: (p) => p.settings.localDeployments,
445
+ text: 'With Local Deployment the armies a bonus earns can be deployed only inside it; base income, territory ' +
446
+ 'income and Reinforcement cards go anywhere. So each bonus must defend itself and a quiet bonus cannot feed ' +
447
+ 'the front. A cut in income (negative bonus, army cap, Sanctions) is shared evenly by every pool.',
448
+ source: S.localDeployments,
449
+ basis: 'source',
450
+ encoded: 'deploys are limited to each pool (src/analysis/local-deploy.ts, warapp_plan_turn)',
451
+ },
452
+ {
453
+ id: 'settings-no-split',
454
+ topic: 'settings',
455
+ when: (p) => p.settings.noSplit,
456
+ text: 'With No-Split a territory that moves sends everything it has, in one attack or transfer a turn: a stack ' +
457
+ 'cannot fan out or leave a garrison behind, so a territory that must hold should not move. Stage armies on ' +
458
+ 'several territories ahead of the turn you need several attacks.',
459
+ source: S.noSplit,
460
+ basis: 'source',
461
+ encoded: 'one move per source, each sending the whole stack, and none from a territory that must hold (src/analysis/planner.ts, warapp_plan_turn; #124)',
462
+ },
463
+ // ---- cards ----
464
+ {
465
+ id: 'cards-piece-each-turn',
466
+ topic: 'cards',
467
+ when: cards,
468
+ text: "A turn with at least one capture of an enemy or neutral territory earns that turn's card pieces (the " +
469
+ "settings say how many), even if you lose it again; more captures earn nothing extra and a teammate's " +
470
+ 'territory does not count. Take the capture when the pieces are worth more than the armies it costs.',
471
+ source: S.cards,
472
+ basis: 'source',
473
+ encoded: 'with no capture planned, warapp_plan_turn takes the cheapest one that loses no more than the Reinforcement pieces a capturing turn brings are worth (fixed armies, or the card in hand when progressive; other cards unvalued; rule 4g, #127)',
474
+ },
475
+ {
476
+ id: 'cards-order-delay',
477
+ topic: 'cards',
478
+ when: on({ cardsInPlay: ['Order Delay'] }),
479
+ text: 'Order Delay holds back only the orders listed after it; at the end of your list it does nothing. Put ' +
480
+ 'it above every order that is not urgent and keep the decisive attack last. warapp_submit_turn writes ' +
481
+ 'the card after all your moves, where it has no effect, so play it in the game client.',
482
+ source: S.orderDelay,
483
+ basis: 'source',
484
+ },
485
+ {
486
+ id: 'cards-order-priority',
487
+ topic: 'cards',
488
+ when: on({ cardsInPlay: ['Order Priority'] }),
489
+ text: "Order Priority moves only your first order ahead of the opponent's first: put the one order that must " +
490
+ 'beat them at the top (a withdrawal, or a strike on a stack or a commander before it moves). If you would ' +
491
+ 'move first anyway it adds nothing, unless they may play one too: two cancel, so yours is what keeps ' +
492
+ 'your first move.',
493
+ source: S.orderPriority,
494
+ basis: 'source',
495
+ encoded: 'the planner puts the protected order first and advises the card (cardAdvice, warapp_plan_turn) for a commander ' +
496
+ 'strike or a withdrawal worth a card, only when you hold one and are not known to move first',
497
+ },
498
+ {
499
+ id: 'cards-blockade-own-bonus',
500
+ topic: 'cards',
501
+ when: on({ cardsInPlay: ['Blockade', 'Emergency Blockade'], standing: ['behind'] }),
502
+ text: 'When you are the weaker side, a Blockade on a territory in front of your bonus (not a member: you give up ' +
503
+ 'the territory and its armies) makes a big neutral wall. It resolves after the attacks, is wasted if the ' +
504
+ 'territory fell first, and multiplies armies moved in that turn; an Emergency Blockade runs before the attacks.',
505
+ source: S.blockade,
506
+ basis: 'derived',
507
+ },
508
+ {
509
+ id: 'cards-turn-order',
510
+ topic: 'cards',
511
+ when: on({ cardsInPlay: ['Order Priority', 'Order Delay', 'Bomb', 'Emergency Blockade', 'Airlift', 'Gift', 'Blockade', 'Sanctions', 'Spy', 'Reconnaissance', 'Surveillance'] }),
512
+ text: 'Cards run in a fixed order: Order Priority, Spy-type cards, then Reinforcement, before the deployments; ' +
513
+ 'then Bomb, Emergency Blockade, Airlift and Gift, in that order, before any attack; Order Delay among the ' +
514
+ 'attacks; Blockade, then Sanctions, after them. So a bomb halves a stack before it is blockaded or flown out.',
515
+ source: S.turnPhases,
516
+ basis: 'source',
517
+ encoded: 'card plays are sent in turn-phase order (src/protocol/methods.ts writeSendOrdersParams)',
518
+ },
519
+ // ---- reading the game ----
520
+ {
521
+ id: 'reading-count-armies',
522
+ topic: 'reading',
523
+ when: always,
524
+ text: "Count the armies an opponent shows each turn: what appears beyond their losses is their income, and income " +
525
+ 'tells you how far ahead or behind you are.',
526
+ source: S.oneVsOne,
527
+ basis: 'source',
528
+ encoded: 'per-opponent deploy estimates from the board and its trend (warapp_plan_turn enemyDeploy, profile standing)',
529
+ },
530
+ {
531
+ id: 'reading-infer-bonuses',
532
+ topic: 'reading',
533
+ when: (p) => p.settings.fog === null || p.settings.fog === 'Foggy',
534
+ text: "An opponent's deploys minus the base income are their bonuses: match that number against the bonuses they " +
535
+ 'could hold to find which ones are complete, then aim to break those.',
536
+ source: S.oneVsOne,
537
+ basis: 'derived',
538
+ },
539
+ {
540
+ id: 'reading-unseen-opponent',
541
+ topic: 'reading',
542
+ // Under Light and Dense fog every owner is shown, so its income is read off the board, not assumed.
543
+ when: (p) => !OWNERS_SHOWN.has(p.settings.fog ?? ''),
544
+ text: 'An opponent you cannot see is growing too. Until its deploys show otherwise, assume it earns about what ' +
545
+ 'you earn, and read the first big stack it shows as income saved over the turns you did not see it — not ' +
546
+ 'as a one-off.',
547
+ source: S.oneVsOne,
548
+ basis: 'derived',
549
+ },
550
+ {
551
+ id: 'reading-who-moves-first',
552
+ topic: 'reading',
553
+ when: always,
554
+ text: 'The first deployment or order to run shows the first mover; under a cyclic (not random) order it ' +
555
+ 'alternates, and after picks whoever was awarded first moves second on turn 1. Under fog, count your ' +
556
+ 'deployments (or your moves) before its first visible one of the same kind: even means it moved ' +
557
+ 'first, if one of yours ran later.',
558
+ source: S.moveOrder,
559
+ basis: 'source',
560
+ },
561
+ {
562
+ id: 'reading-pick-zigzag',
563
+ topic: 'reading',
564
+ when: (p, x) => (p.phase === 'opening' || p.phase === 'expansion') && x.distribution !== 'automatic',
565
+ text: 'Picks are handed out in a zigzag in move order, each player getting their highest-ranked territory still ' +
566
+ 'free, so rank enough. Any territory you ranked above your last granted pick and did not get is another ' +
567
+ "player's start; in a two-player game, being granted list number 2 × your starts shows every enemy start.",
568
+ source: S.manualDistribution,
569
+ basis: 'derived',
570
+ },
571
+ {
572
+ id: 'reading-border-neutrals',
573
+ topic: 'reading',
574
+ when: (p) => p.phase !== 'late',
575
+ text: 'Wait before taking a neutral that borders an enemy: captured armies are thin there, and the opponent can take ' +
576
+ 'it back cheaply on the same turn you spent armies on it.',
577
+ source: S.general,
578
+ basis: 'source',
579
+ },
580
+ {
581
+ id: 'reading-idle-armies',
582
+ topic: 'reading',
583
+ when: (p) => p.phase !== 'opening',
584
+ text: 'Armies far from any front do nothing: walk them towards where they will be needed, a little every turn.',
585
+ source: S.ffa,
586
+ basis: 'source',
587
+ },
588
+ {
589
+ id: 'reading-ahead',
590
+ topic: 'reading',
591
+ when: (p) => p.standing === 'ahead' || p.standing === 'unknown',
592
+ text: 'Ahead on income, use every turn: break a bonus or take ground the opponent cannot retake. Trade armies ' +
593
+ 'only where you kill more than you lose, which needs clearly more than the defenders after their ' +
594
+ 'deployment (fighting-trade-zones); at the usual kill rates an attack at even numbers costs the attacker ' +
595
+ 'more, lead or not.',
596
+ source: S.oneVsOne,
597
+ basis: 'derived',
598
+ encoded: 'ahead in a 1v1, the planner allows more pressure (profile rule 0p, warapp_plan_turn)',
599
+ },
600
+ {
601
+ id: 'reading-behind',
602
+ topic: 'reading',
603
+ when: (p) => p.standing === 'behind' || p.standing === 'unknown',
604
+ text: 'Behind on income, every turn costs you: any edge you have in armies shrinks every turn, so spend it ' +
605
+ 'now on an attack that breaks a bonus, and refuse trades that only swap armies. Defend the bonuses that ' +
606
+ 'pay (defence kills more than attack). Stacking and waiting helps only the richer side.',
607
+ source: S.oneVsOne,
608
+ basis: 'derived',
609
+ encoded: 'behind, the profile picks the defend goal and minimal attack sizes (profile rule 0p, warapp_plan_turn)',
610
+ },
611
+ // ---- map ----
612
+ {
613
+ id: 'map-defensible-bonuses',
614
+ topic: 'map',
615
+ when: always,
616
+ text: 'Value a bonus by what it costs to take and to keep: few territories, few ways in and a narrow front make a ' +
617
+ 'small bonus better than a big one you cannot hold.',
618
+ source: S.oneVsOne,
619
+ basis: 'source',
620
+ encoded: 'map notes rank bonuses by value per army and list their entry points (warapp_strategy); picks weigh entry points',
621
+ },
622
+ {
623
+ id: 'map-chokepoints',
624
+ topic: 'map',
625
+ when: always,
626
+ text: 'Territories that are the only link between regions (bottlenecks) are where small armies stop big ones: hold ' +
627
+ 'them in front of your bonuses, and do not leave your back open past them.',
628
+ source: S.oneVsOne,
629
+ basis: 'source',
630
+ encoded: 'map notes and warapp_get_map list the chokepoints',
631
+ },
632
+ // ---- cards: each card, and the card economy (second research pass) ----
633
+ {
634
+ id: 'cards-count-arrival',
635
+ topic: 'cards',
636
+ when: on({ anyCards: true }),
637
+ text: 'Count when each card arrives: it needs its pieces minus the starting pieces, earned at the per-turn ' +
638
+ 'rate only on turns with a capture, and is playable the next turn. With minimums equal to the pieces ' +
639
+ 'per turn this is exact per player; a team shares one hand and each capturing teammate is said to add ' +
640
+ 'pieces, so it fills faster.',
641
+ source: S.cardMinimums,
642
+ basis: 'derived',
643
+ encoded: "warapp_strategy lists each card's clock for a game (`cardClock`, src/strategy/card-clock.ts)",
644
+ },
645
+ {
646
+ id: 'cards-opponent-reinforcement-due',
647
+ topic: 'cards',
648
+ when: on({ cardsInPlay: ['Reinforcement'] }),
649
+ text: 'From the first turn an opponent can hold a Reinforcement card, add its armies to what they can ' +
650
+ 'deploy against you, every turn until you have seen the extra armies land. A card they have not ' +
651
+ 'played is still in their hand.',
652
+ source: S.clanGuide,
653
+ basis: 'derived',
654
+ },
655
+ {
656
+ id: 'cards-reinforcement-play-or-hold',
657
+ topic: 'cards',
658
+ when: on({ cardsInPlay: ['Reinforcement'] }),
659
+ text: 'In contact, play a Reinforcement card the turn you get it unless holding it has a reason: nothing worth ' +
660
+ 'spending it on, making the opponent undercount your next deployment, or a border neither side can ' +
661
+ 'break, where cards kept up to the hand limit and played in one turn can tip it when a single card ' +
662
+ 'cannot.',
663
+ source: S.smallEarthGuide,
664
+ basis: 'source',
665
+ encoded: 'the planner plays every Reinforcement card it holds and says the play is a default (in a team game it holds them for the ' +
666
+ 'team unless cards must be shed)',
667
+ },
668
+ {
669
+ id: 'cards-delay-keep-threat',
670
+ topic: 'cards',
671
+ when: on({ cardsInPlay: ['Order Delay'] }),
672
+ text: 'An unplayed Order Delay is a threat in itself: once the opponent has spent theirs and you still hold ' +
673
+ 'one, no number of filler moves makes their late attack safe, so they must hold armies back. Play it ' +
674
+ 'on the turn it decides a fight, not on the first turn you can.',
675
+ source: S.forumKeepDelayCard,
676
+ basis: 'source',
677
+ encoded: 'forced discards keep Order Delay longest; warapp_plan_turn advises it (cards.advice.orderDelay, with the card order and its `before` for warapp_submit_turn — a placement unverified live) only when an attack the opponent can answer first is planned',
678
+ },
679
+ {
680
+ id: 'cards-delay-opponent-holds',
681
+ topic: 'cards',
682
+ when: on({ cardsInPlay: ['Order Delay'] }),
683
+ text: 'When an opponent may hold an Order Delay and you do not, do not attack lightly on every border: ' +
684
+ 'their delayed counter-attacks then hit your weakened stacks. Make one heavy attack, or defend and ' +
685
+ 'let their late stacks break on your defence.',
686
+ source: S.forumDelayCard,
687
+ basis: 'source',
688
+ },
689
+ {
690
+ id: 'cards-bomb-hold',
691
+ topic: 'cards',
692
+ when: on({ cardsInPlay: ['Bomb'] }),
693
+ text: 'Do not bomb just because you can. The card kills half of whatever stands there, so it is worth more ' +
694
+ 'the more the enemy stacks, and while you still hold it they cannot safely build one big stack. Spend ' +
695
+ 'it on the turn it wins a fight or saves a border.',
696
+ source: S.forumBombStrategy,
697
+ basis: 'source',
698
+ encoded: 'warapp_plan_turn (cards.advice.bomb) names a target only where halving a stack changes a hold, a capture or a commander kill, else says to hold it',
699
+ },
700
+ {
701
+ id: 'cards-bomb-target',
702
+ topic: 'cards',
703
+ when: on({ cardsInPlay: ['Bomb'] }),
704
+ text: 'A bomb can only hit a territory next to one of yours. It lands after deployment and before every ' +
705
+ 'attack, so it also halves what the enemy deploys there that turn. Aim it at the stack you are about ' +
706
+ 'to attack or that is about to attack you, where halving it changes who wins.',
707
+ source: S.bomb,
708
+ basis: 'derived',
709
+ },
710
+ {
711
+ id: 'cards-bomb-split-stacks',
712
+ topic: 'cards',
713
+ when: on({ cardsInPlay: ['Bomb'] }),
714
+ text: 'While an opponent may hold a Bomb, do not keep everything in one stack beside them: spread it over ' +
715
+ 'two or three territories. Deploying one step back and moving up also dodges the bomb (it strikes ' +
716
+ 'after deployment, before any move), but only when your move lands before their attack: you move ' +
717
+ 'first, or you play Order Priority.',
718
+ source: S.bomb,
719
+ basis: 'source',
720
+ encoded: 'once the card clock lets an opponent hold a Bomb, warapp_plan_turn sizes each border\'s hold against the attack next turn as if a bomb halved the stack (not two-step holds or the floor tier), splits the leftover over two stacks (not a stack concentrating for an attack), and warns of borders that still hold only while unbombed',
721
+ },
722
+ {
723
+ id: 'cards-bomb-commander',
724
+ topic: 'cards',
725
+ when: on({ cardsInPlay: ['Bomb'], commanders: true }),
726
+ text: 'A bomb is reported to halve only the ordinary armies and leave a commander unharmed (players and the ' +
727
+ "developer say so; the wiki does not cover it). So a bomb on a commander's guard, then one attack big " +
728
+ 'enough for what is left plus the commander, is a cheap kill - against yours as well.',
729
+ source: S.forumBombCommander,
730
+ basis: 'derived',
731
+ },
732
+ {
733
+ id: 'cards-emergency-blockade-trap',
734
+ topic: 'cards',
735
+ when: on({ cardsInPlay: ['Emergency Blockade'] }),
736
+ text: 'An Emergency Blockade can destroy an attack you could not survive: deploy on the territory the big ' +
737
+ 'stack must hit and play the card there, and the attackers meet your armies times the multiplier. If ' +
738
+ 'they do not attack, you have given away the armies and the territory for nothing.',
739
+ source: S.blockade,
740
+ basis: 'source',
741
+ encoded: 'warapp_plan_turn (cards.advice.emergencyBlockade) offers it on a conceded border where the wall kills more than it gives up, never on the commander or a held bonus',
742
+ },
743
+ {
744
+ id: 'cards-emergency-blockade-opponent',
745
+ topic: 'cards',
746
+ when: on({ cardsInPlay: ['Emergency Blockade'] }),
747
+ text: 'When an opponent may hold an Emergency Blockade, size the wall before a big attack: their armies on ' +
748
+ 'the target plus all they can deploy, times the multiplier. Send a large stack only where even that ' +
749
+ 'cannot stop it.',
750
+ source: S.forumStrategicTemplates,
751
+ basis: 'derived',
752
+ encoded: 'warapp_plan_turn warns of a planned attack that wall would stop, once the card clock lets the opponent hold one',
753
+ },
754
+ {
755
+ id: 'cards-blockade-spoil-bonus',
756
+ topic: 'cards',
757
+ when: on({ cardsInPlay: ['Blockade', 'Emergency Blockade'], standing: ['behind'] }),
758
+ text: 'A bonus you cannot hold is worth ruining. Blockade one of your territories inside it that the enemy ' +
759
+ 'cannot take this turn: the big neutral left there denies them the bonus until they pay to clear it.',
760
+ source: S.forumAiCards,
761
+ basis: 'source',
762
+ },
763
+ {
764
+ id: 'cards-blockade-size',
765
+ topic: 'cards',
766
+ when: on({ cardsInPlay: ['Blockade', 'Emergency Blockade'] }),
767
+ text: 'Size a blockade against what the enemy can bring. The wall is your armies there times the ' +
768
+ 'multiplier; unless breaking it costs more than their stack beside it plus a turn of their income, ' +
769
+ 'you have only given the territory away. A low multiplier rarely passes that test.',
770
+ source: S.forumBlockadeProposal,
771
+ basis: 'derived',
772
+ },
773
+ {
774
+ id: 'cards-blockade-commander',
775
+ topic: 'cards',
776
+ when: on({ cardsInPlay: ['Blockade', 'Emergency Blockade'], commanders: true }),
777
+ text: 'Never play a Blockade or Emergency Blockade on the territory your commander stands on: special units ' +
778
+ 'count for nothing on a blockaded territory, so treat it as losing the commander, and with it the ' +
779
+ 'game.',
780
+ source: S.specialUnit,
781
+ basis: 'derived',
782
+ },
783
+ {
784
+ id: 'cards-airlift-defend',
785
+ topic: 'cards',
786
+ when: on({ cardsInPlay: ['Airlift'] }),
787
+ text: 'An airlift lands before any attack, so its strongest use is defence: fly a stack onto the territory ' +
788
+ 'the enemy is about to hit and their attack runs into it. The flown armies cannot move or attack ' +
789
+ 'again that turn, so it does not set up an attack this turn.',
790
+ source: S.airlift,
791
+ basis: 'source',
792
+ },
793
+ {
794
+ id: 'cards-airlift-opponent',
795
+ topic: 'cards',
796
+ when: on({ cardsInPlay: ['Airlift'] }),
797
+ text: 'While an opponent may hold an Airlift, any territory you attack can be reinforced from anywhere ' +
798
+ 'before your attack lands. Count their largest stack you have seen as a possible defender, and attack ' +
799
+ 'where you would still win, or not at all.',
800
+ source: S.forumStrategicTemplates,
801
+ basis: 'derived',
802
+ },
803
+ {
804
+ id: 'cards-diplomacy-starts-next-turn',
805
+ topic: 'cards',
806
+ when: on({ cardsInPlay: ['Diplomacy'] }),
807
+ text: 'A Diplomacy card starts the turn after it is played. If you play one, your attacks on that player in ' +
808
+ 'the same turn still happen. Once you see one played on you it is already in force: attacks on that ' +
809
+ 'player do nothing, so take them out of your orders and plan for the turn it ends.',
810
+ source: S.diplomacy,
811
+ basis: 'derived',
812
+ },
813
+ {
814
+ id: 'cards-diplomacy-target',
815
+ topic: 'cards',
816
+ when: on({ cardsInPlay: ['Diplomacy'], format: ['ffa', 'teams'] }),
817
+ text: 'Diplomacy pays only with two or more enemies. Play it on the one attacking you hardest, not on a ' +
818
+ 'strong neighbour who is leaving you alone, and not when you are the one winning the fights; use the ' +
819
+ 'quiet turns for something that border would not have allowed.',
820
+ source: S.forumAiCards,
821
+ basis: 'source',
822
+ },
823
+ {
824
+ id: 'cards-sanctions-sign-and-timing',
825
+ topic: 'cards',
826
+ when: on({ cardsInPlay: ['Sanctions'] }),
827
+ text: "Read the Sanctions percentage first: a negative one raises the target's income, so that card goes on " +
828
+ "yourself or a teammate. A normal one resolves at the end of the turn and cuts the target's income " +
829
+ 'from their next turn; Reinforcement cards are added after it and still pay in full.',
830
+ source: S.sanctions,
831
+ basis: 'derived',
832
+ },
833
+ {
834
+ id: 'cards-gift-enemy-teammate',
835
+ topic: 'cards',
836
+ when: on({ cardsInPlay: ['Gift'], format: ['teams'] }),
837
+ text: "In a team game a territory about to fall can be gifted to the attacker's teammate: by default the " +
838
+ 'attack becomes a transfer and the bonus stays incomplete that turn. If the other team may hold a ' +
839
+ 'Gift card, a bonus-completing capture must treat teammates as enemies ' +
840
+ '(`attack_teammates` in warapp_submit_turn, not yet verified live).',
841
+ source: S.clanGuide,
842
+ basis: 'source',
843
+ },
844
+ {
845
+ id: 'cards-spy-turn-ahead',
846
+ topic: 'cards',
847
+ when: on({ cardsInPlay: ['Spy', 'Reconnaissance', 'Surveillance'], fog: ['LightFog', 'Foggy', 'ModerateFog', 'VeryFoggy', 'ExtremeFog'] }),
848
+ text: 'A Spy, Reconnaissance or Surveillance card shows its view next turn, so play it the turn before the ' +
849
+ "decision it should inform: Surveillance to learn whether a bonus is held, Spy for one opponent's " +
850
+ 'whole position, Reconnaissance for what stands behind a border you mean to attack or defend.',
851
+ source: S.spyCards,
852
+ basis: 'derived',
853
+ },
854
+ // ---- settings: commanders, the guard, income, commerce (second research pass) ----
855
+ {
856
+ id: 'settings-commander-protect',
857
+ topic: 'settings',
858
+ when: on({ commanders: true }),
859
+ text: 'Losing your Commander eliminates you and turns everything you hold neutral. Each turn, first check ' +
860
+ 'that no stack beside it could kill every army with it and deal 7 more in one attack; if one could, ' +
861
+ 'deploy on its territory. It moves only when an order sets `commander`, so do not strip its guard. ' +
862
+ 'Never Blockade its territory.',
863
+ source: S.commanders,
864
+ basis: 'source',
865
+ encoded: "the planner holds its commander's territory before anything else and never carries the commander (warapp_submit_turn does when a move sets `commander`)",
866
+ },
867
+ {
868
+ id: 'settings-commander-strike',
869
+ topic: 'settings',
870
+ when: on({ commanders: true }),
871
+ text: 'An enemy Commander dies only to one attack that kills every army with it and then deals 7 more; ' +
872
+ 'less leaves it unharmed. That removes its owner, and all it held turns neutral where it stands. Against ' +
873
+ "one opponent, strike first when a stack covers its armies, its 7 and its owner's deploy; with more " +
874
+ 'sides, first see who collects the land.',
875
+ source: S.commanders,
876
+ basis: 'derived',
877
+ encoded: "the planner strikes an adjacent enemy commander first, sized for its armies, its 7 and its owner's deploy",
878
+ },
879
+ {
880
+ id: 'settings-commander-free-captures',
881
+ topic: 'settings',
882
+ when: on({ commanders: true, phase: ['opening', 'expansion'] }),
883
+ text: 'A Commander attacking alone fights as 7 armies and is unharmed by less than 7 damage, so it can take ' +
884
+ 'small neutrals at no cost. To send it, set `commander` on the move in warapp_submit_turn (with ' +
885
+ '`armies` 0 it goes alone; not yet verified live); without it, an order from its territory sends only armies and thins its guard.',
886
+ source: S.forumCommanderTemplate,
887
+ basis: 'source',
888
+ },
889
+ {
890
+ id: 'settings-guard-off-taps',
891
+ topic: 'settings',
892
+ when: on({ guard: false }),
893
+ text: 'With no army required to stay behind, a territory can be left empty, and any single army then ' +
894
+ 'captures it; against one defender a single attacker only trades. Send one army at empty enemy border ' +
895
+ 'territories to break bonuses, and keep armies on every border territory of a bonus you hold.',
896
+ source: S.guard,
897
+ basis: 'derived',
898
+ },
899
+ // #276: the guard-off risks beyond the taps (our own analysis of lost guard-off games).
900
+ {
901
+ id: 'settings-guard-off-hollow-interior',
902
+ topic: 'settings',
903
+ when: on({ guard: false }),
904
+ text: 'With no guard the territories behind a border can stand empty, so one breach puts the whole interior a ' +
905
+ 'move away, and a big stack can split into single armies that each take an empty territory. When a large ' +
906
+ 'enemy stack is within two moves of a bonus you hold, keep a few armies on its inner territories as a second line.',
907
+ source: S.guard,
908
+ basis: 'derived',
909
+ },
910
+ {
911
+ id: 'settings-guard-off-raids',
912
+ topic: 'settings',
913
+ when: on({ guard: false }),
914
+ text: 'With no guard a stack that moves on can leave the territory behind it at 0. An empty enemy territory in ' +
915
+ "view whose capture breaks its owner's bonus is a cheap income swing, but its owner may deploy there " +
916
+ 'first: send what takes it through that deploy. One of yours its stack left empty is retaken the same way.',
917
+ source: S.guard,
918
+ basis: 'derived',
919
+ },
920
+ {
921
+ id: 'settings-guard-off-whole-stacks',
922
+ topic: 'settings',
923
+ when: on({ guard: false }),
924
+ text: 'With no guard an advancing stack leaves nobody behind, so two territories on, it still has every army it ' +
925
+ 'set out with, plus its deploys, less only what the fighting killed. Size the garrison of a territory a ' +
926
+ 'stack two moves away could reach for that whole stack, not for what a guard would have thinned it to.',
927
+ source: S.guard,
928
+ basis: 'derived',
929
+ },
930
+ {
931
+ id: 'settings-territory-income-threshold',
932
+ topic: 'settings',
933
+ when: on({ territoryIncome: true }),
934
+ text: 'Income from territories replaces the base income only when it is the larger of the two, so more ' +
935
+ 'territories pay nothing until your count divided by the setting exceeds the base. Past that point ' +
936
+ 'each further group of territories is one army a turn, and cheap neutrals are worth taking for ' +
937
+ 'themselves.',
938
+ source: S.territoryIncome,
939
+ basis: 'source',
940
+ encoded: 'the income model (`boardIncome`) takes the larger of the base and the territory income',
941
+ },
942
+ {
943
+ id: 'settings-negative-bonus',
944
+ topic: 'settings',
945
+ when: on({ negativeBonus: true }),
946
+ text: 'A bonus worth less than zero cuts your income while you hold all of it, unless other bonuses on the ' +
947
+ 'same territories pay more than it costs, and you cannot give a territory up at will. Stop one ' +
948
+ 'territory short of completing it; if you hold it, a Blockade or Gift on one of its territories is ' +
949
+ 'the way out.',
950
+ source: S.negativeBonuses,
951
+ basis: 'source',
952
+ },
953
+ {
954
+ id: 'settings-commerce-army-price',
955
+ topic: 'settings',
956
+ when: on({ commerce: true }),
957
+ text: 'Unless the game sets a flat price, armies bought in one turn get dearer in steps, so the same gold ' +
958
+ 'buys more armies spread over several turns than saved and spent at once. Buy steadily, and save only ' +
959
+ "for a turn that needs a bigger stack than one turn's gold can raise.",
960
+ source: S.commerce,
961
+ basis: 'derived',
962
+ },
963
+ {
964
+ id: 'settings-commerce-cities',
965
+ topic: 'settings',
966
+ when: on({ commerce: true }),
967
+ text: 'Where the game sells cities: a city pays gold every turn to whoever holds its territory and is never ' +
968
+ 'destroyed, so a captured city pays the captor. Build far from any enemy, spread them (by default ' +
969
+ 'each further city on one territory costs more), and buy armies instead when an attack is near.',
970
+ source: S.cities,
971
+ basis: 'derived',
972
+ },
973
+ // ---- opening: picks and the first turns (second research pass) ----
974
+ {
975
+ id: 'opening-pick-guarantees',
976
+ topic: 'opening',
977
+ when: on({ format: ['1v1'], distribution: 'manual', phase: ['opening'] }),
978
+ text: 'With two or more starts each in a two-player game you cannot lose both your first and second listed ' +
979
+ 'picks, nor both your first and third; losing the first gives you the second and third. So an area ' +
980
+ 'you must be in is secured by ranking two of its territories 1 and 2, or 1 and 3.',
981
+ source: S.forumPickOrder,
982
+ basis: 'source',
983
+ },
984
+ {
985
+ id: 'opening-safe-with-neighbour',
986
+ topic: 'opening',
987
+ when: on({ distribution: 'manual', phase: ['opening'] }),
988
+ text: 'A bonus is only as safe as the pickable territories that can reach it before it pays. If one ' +
989
+ 'neighbouring pick threatens the bonus you mean to take first, rank that pick among your top picks ' +
990
+ 'too: granted both, expand there freely; refused it, another player starts there. Ranked below your ' +
991
+ 'last granted pick, it tells you nothing.',
992
+ source: S.forumSafePicking,
993
+ basis: 'source',
994
+ },
995
+ {
996
+ id: 'opening-pair-order',
997
+ topic: 'opening',
998
+ when: on({ format: ['1v1'], distribution: 'manual', phase: ['opening'], commanders: false }),
999
+ text: 'When two picks only pay off together and the opponent may want the same two, expect one each. Rank ' +
1000
+ 'first the one that does better alone against the other: the one whose bonus is harder to break, or ' +
1001
+ "that reaches the other's bonus first. That is not always the bonus you are after.",
1002
+ source: S.forumPickingGuide,
1003
+ basis: 'source',
1004
+ },
1005
+ {
1006
+ id: 'opening-counter-stands-alone',
1007
+ topic: 'opening',
1008
+ when: on({ distribution: 'manual', phase: ['opening'] }),
1009
+ text: 'Pick a territory to break a bonus you expect the opponent to take only if its own bonus is worth ' +
1010
+ 'finishing. If they are not there you must be able to carry on and take it yourself; a pick that is ' +
1011
+ 'useless unless the guess is right leaves you one start short.',
1012
+ source: S.forumPickClues,
1013
+ basis: 'source',
1014
+ },
1015
+ {
1016
+ id: 'opening-commit-speed',
1017
+ topic: 'opening',
1018
+ when: on({ format: ['1v1'], distribution: 'manual', moveOrder: ['NoLuckCycle'], phase: ['opening'] }),
1019
+ text: "Under no-luck cycle the pick order goes to the faster player: by one guide's account the clock runs " +
1020
+ 'from pressing Begin to committing, so committing early in the day is not what counts. The faster ' +
1021
+ 'gets the first award and the first move on turn 2; the slower the award or two after it and the ' +
1022
+ 'first move on turn 1.',
1023
+ source: S.forumSkillChecklist,
1024
+ basis: 'source',
1025
+ },
1026
+ {
1027
+ id: 'opening-wastelands',
1028
+ topic: 'opening',
1029
+ when: on({ phase: ['opening', 'expansion'], wastelands: true }),
1030
+ text: 'A wasteland much larger than the ordinary neutrals makes its bonus slow: do not start in it or ' +
1031
+ "expand into it first, as its cost comes back only after several turns of that bonus's income. It is " +
1032
+ 'also a wall: between an enemy start and your bonus it protects; on your own way out it strands ' +
1033
+ 'armies. A small one is just a neutral.',
1034
+ source: S.mediumEarth,
1035
+ basis: 'source',
1036
+ },
1037
+ {
1038
+ id: 'opening-automatic-no-intel',
1039
+ topic: 'opening',
1040
+ when: on({ distribution: 'automatic', phase: ['opening'] }),
1041
+ text: 'With automatic distribution no pick list shows where the others are or who moves first, but the deal ' +
1042
+ 'narrows it: where each bonus holds one start, theirs are in bonuses you did not get. Plan against ' +
1043
+ 'the most dangerous of those until scouting rules it out, read the move order from first orders, and ' +
1044
+ 'do not resign over the deal.',
1045
+ source: S.forumAutoDistAnalysis,
1046
+ basis: 'source',
1047
+ },
1048
+ {
1049
+ id: 'opening-first-turn-bonus-second-mover',
1050
+ topic: 'opening',
1051
+ when: on({ phase: ['opening'] }),
1052
+ text: 'Finishing a bonus on turn 1 can cost it on turn 2: an enemy start one move from its border can ' +
1053
+ 'arrive with its stack and a full deploy, and if they move first on turn 2 you cannot answer in time. ' +
1054
+ 'Unless you know you move first on turn 2, with such a start possible finish a turn later or hold the ' +
1055
+ 'approach first.',
1056
+ source: S.forumSmallEarthSeries,
1057
+ basis: 'source',
1058
+ },
1059
+ {
1060
+ id: 'opening-one-bonus-at-a-time',
1061
+ topic: 'opening',
1062
+ when: on({ phase: ['opening', 'expansion'], localDeployments: false }),
1063
+ text: "Do not split a turn's income between two unfinished bonuses: both then finish later. Put it all into " +
1064
+ 'the bonus that completes soonest, and split only when each share finishes something this turn or one ' +
1065
+ 'share is needed to hold a border.',
1066
+ source: S.beginnerGuide,
1067
+ basis: 'source',
1068
+ encoded: 'the planner commits to the bonus closest to completion until one is held (rule 4f)',
1069
+ },
1070
+ {
1071
+ id: 'opening-capture-survivors',
1072
+ topic: 'opening',
1073
+ when: on({ exact: true, defaultKillRates: true, phase: ['opening', 'expansion'] }),
1074
+ text: 'Smallest sure captures and what moves in: 3 armies take a 2 and 2 move in; 5 take a 3 (3 move in); 6 ' +
1075
+ 'take a 4 (3); 8 take a 5 (4); 16 take a 10 (9). One army more adds a survivor, not a kill, so send ' +
1076
+ 'it only when that survivor has a job next turn.',
1077
+ source: S.combat,
1078
+ basis: 'derived',
1079
+ },
1080
+ {
1081
+ id: 'opening-chain-captures',
1082
+ topic: 'opening',
1083
+ when: on({ phase: ['opening', 'expansion'] }),
1084
+ text: 'Plan a route, not single captures: the survivors of one capture launch the next. Size the last ' +
1085
+ 'capture at its minimum and each earlier one to deliver what the next needs, plus the army that must ' +
1086
+ 'stay behind where one must, so a single deployment carries down the whole chain.',
1087
+ source: S.forumSkillChecklist,
1088
+ basis: 'source',
1089
+ },
1090
+ {
1091
+ id: 'opening-tap-then-capture',
1092
+ topic: 'opening',
1093
+ when: on({ exact: true, defaultKillRates: true, phase: ['opening', 'expansion'], noSplit: false }),
1094
+ text: 'Two orders can take what one cannot afford: a 1-army attack first kills one defender, so the capture ' +
1095
+ 'behind it needs fewer armies (a 3 falls to 1 then 3 instead of 5; a 5 to 1 then 6 instead of 8). ' +
1096
+ 'Losses are the same; it costs an extra order and one survivor fewer.',
1097
+ source: S.forumSkillChecklist,
1098
+ basis: 'source',
1099
+ },
1100
+ {
1101
+ id: 'opening-hide-expansion',
1102
+ topic: 'opening',
1103
+ when: on({ fog: ['Foggy'], phase: ['opening', 'expansion'] }),
1104
+ text: 'Where the opponent sees only territory next to their own, they learn your income from what you ' +
1105
+ 'deploy and capture in their sight. Finish bonuses out of view, take the territory that touches them ' +
1106
+ 'as late as the plan allows, and deploy out of sight when the armies can walk up in time.',
1107
+ source: S.smallEarthGuide,
1108
+ basis: 'source',
1109
+ },
1110
+ // ---- timing: the order of orders within a turn (second research pass) ----
1111
+ {
1112
+ id: 'timing-first-order-certain',
1113
+ topic: 'timing',
1114
+ when: on({ moveOrder: ['Cycle', 'NoLuckCycle'], phase: ['contact', 'late'] }),
1115
+ text: "On a turn you move first, your first attack or transfer runs before any of the opponent's, unless it " +
1116
+ 'plays Order Priority. Give it to the order that must not be answered: a strike that beats the ' +
1117
+ "defenders plus their owner's whole income and any card armies, a stack leaving a lost territory, or " +
1118
+ 'a reinforcement that must arrive.',
1119
+ source: S.beginnerGuide,
1120
+ basis: 'source',
1121
+ },
1122
+ {
1123
+ id: 'timing-reinforce-first',
1124
+ topic: 'timing',
1125
+ when: on({ phase: ['contact', 'late'] }),
1126
+ text: 'List reinforcing transfers at the top of the turn, the largest or the one to the weakest territory ' +
1127
+ 'first, and as one order rather than several small ones: every enemy order that runs before they ' +
1128
+ 'arrive is a chance to hit that territory without them.',
1129
+ source: S.advancedStrategy,
1130
+ basis: 'source',
1131
+ },
1132
+ {
1133
+ id: 'timing-dummy-must-move',
1134
+ topic: 'timing',
1135
+ when: always,
1136
+ text: 'A dummy order pushes your later orders back only if armies actually move. A Transfer Only that ' +
1137
+ 'cannot transfer, or an order from a territory with nothing left to send, delays nothing: pad a late ' +
1138
+ 'attack with real transfers of spare armies or cheap captures.',
1139
+ source: S.moveOrder,
1140
+ basis: 'source',
1141
+ },
1142
+ {
1143
+ id: 'timing-delay-pairs',
1144
+ topic: 'timing',
1145
+ when: on({ format: ['1v1'], phase: ['contact', 'late'] }),
1146
+ text: 'Orders run in pairs: moving first, your 2nd and 3rd run back to back (then 4th and 5th); moving ' +
1147
+ 'second, your 1st and 2nd. So one more dummy order helps only every other time. Count the orders the ' +
1148
+ 'opponent can make, pad a late attack just past that (one extra if unsure who is first), and keep the ' +
1149
+ 'other armies at the front.',
1150
+ source: S.moveOrder,
1151
+ basis: 'derived',
1152
+ },
1153
+ {
1154
+ id: 'timing-deploy-border-first',
1155
+ topic: 'timing',
1156
+ when: on({ fog: ['LightFog', 'Foggy', 'ModerateFog', 'VeryFoggy', 'ExtremeFog'] }),
1157
+ text: 'Deployments are dealt out in turn like orders, so their order is information. Deploy next to the ' +
1158
+ 'opponent first and in the back afterwards: a deployment out of its sight that lands before your ' +
1159
+ 'border one tells it you had income to spare, and lets it count how much.',
1160
+ source: S.clanGuide,
1161
+ basis: 'source',
1162
+ },
1163
+ {
1164
+ id: 'timing-transfer-only-reinforce',
1165
+ topic: 'timing',
1166
+ when: on({ transferOnlyAllowed: true }),
1167
+ text: 'When you move armies into a territory of yours that the enemy could take first this turn, make the ' +
1168
+ 'order Transfer Only: if it has fallen, the armies stay put instead of attacking the stack that took ' +
1169
+ 'it. In warapp_submit_turn, set the move\'s mode "transfer-only" (not yet verified live); a plain order would attack.',
1170
+ source: S.attackTransferOnly,
1171
+ basis: 'source',
1172
+ },
1173
+ {
1174
+ id: 'timing-attack-only-retake',
1175
+ topic: 'timing',
1176
+ when: on({ attackOnlyAllowed: true }),
1177
+ text: 'To answer an attack you only suspect, give a late Attack Only order onto your own threatened ' +
1178
+ 'territory from a neighbouring stack big enough to beat what would survive taking it: it strikes only ' +
1179
+ 'if the territory fell. In warapp_submit_turn, set the move\'s mode "attack-only" (not yet verified live); a plain order would ' +
1180
+ 'be a transfer.',
1181
+ source: S.forumAttackTransferOrders,
1182
+ basis: 'source',
1183
+ },
1184
+ {
1185
+ id: 'timing-percentage-remainder',
1186
+ topic: 'timing',
1187
+ when: on({ percentageAllowed: true }),
1188
+ text: 'A percentage order is worked out when it runs, from the armies still able to move, so an enemy ' +
1189
+ 'attack that lands first shrinks what it sends, not the share that stays. Use one when the armies ' +
1190
+ 'left behind matter more. In warapp_submit_turn, set `percent` on the move and give the percentage as `armies` ' +
1191
+ '(not yet verified live).',
1192
+ source: S.percentageAttacks,
1193
+ basis: 'source',
1194
+ },
1195
+ // ---- fighting: stacks in contact, ahead and behind (second research pass) ----
1196
+ {
1197
+ id: 'fighting-trade-zones',
1198
+ topic: 'fighting',
1199
+ when: on({ defaultKillRates: true, exact: true, phase: ['contact', 'late'] }),
1200
+ text: "Size an attack on a stack against its armies after its owner's deployment. Below roughly seven " +
1201
+ 'sixths of that number you lose more than you kill; from there to about five thirds you kill more ' +
1202
+ 'without capturing, still a good exchange; above that you capture (small stacks a little sooner: ' +
1203
+ 'three take two).',
1204
+ source: S.combat,
1205
+ basis: 'derived',
1206
+ },
1207
+ {
1208
+ id: 'fighting-ahead-worst-case',
1209
+ topic: 'fighting',
1210
+ when: on({ standing: ['ahead'], format: ['1v1', 'teams'] }),
1211
+ text: 'Ahead, pick the plan that still works when the opponent guesses right: holds that survive its whole ' +
1212
+ 'income, attacks sized for its full deployment, and no more armies than each objective needs. Time is ' +
1213
+ 'on your side, so the gambles belong to the player who is behind.',
1214
+ source: S.smallEarthGuide,
1215
+ basis: 'derived',
1216
+ encoded: "warapp_check_plan runs a list of orders against the opponent's single-deploy replies",
1217
+ },
1218
+ {
1219
+ id: 'fighting-doomed-stack',
1220
+ topic: 'fighting',
1221
+ when: (p, x) => noteMatches({ phase: ['contact', 'late'] }, p, x) && (x.defensiveKillRate ?? DEFAULT_DEFENSIVE_KILL_RATE) < 100,
1222
+ text: 'A stack that is wiped out on defence kills fewer armies than it loses. If the attackers in reach can ' +
1223
+ 'take it even after your deployment, do not reinforce it: move it back to where it can be joined, and ' +
1224
+ 'spend the income on a break where the opponent is weak.',
1225
+ source: S.forumBattleTactics,
1226
+ basis: 'source',
1227
+ encoded: 'the planner concedes a border it cannot hold and withdraws from it',
1228
+ },
1229
+ {
1230
+ id: 'fighting-pin',
1231
+ topic: 'fighting',
1232
+ when: on({ format: ['1v1', 'teams'], phase: ['contact', 'late'], exact: true }),
1233
+ text: "Where, counting both sides' deployments, each exchange leaves your stack larger relative to theirs, " +
1234
+ 'keep attacking even at a small loss: a defender that is only just holding cannot deploy one army ' +
1235
+ 'elsewhere without losing the territory a few turns later. Stop the turn the ratio stops improving.',
1236
+ source: S.forumSkillChecklist,
1237
+ basis: 'source',
1238
+ },
1239
+ {
1240
+ id: 'fighting-cover-valuable-attack-cheap',
1241
+ topic: 'fighting',
1242
+ when: on({ format: ['1v1', 'teams'], phase: ['contact', 'late'] }),
1243
+ text: 'When you can cover only one of two threatened points, cover the more valuable one most turns but not ' +
1244
+ 'every turn; when you can hit only one of two, go for the less valuable one more often. Always ' +
1245
+ 'guarding the big bonus, or always striking at it, is a pattern the other side can plan around.',
1246
+ source: S.clanGuide,
1247
+ basis: 'source',
1248
+ },
1249
+ {
1250
+ id: 'fighting-standoff-grow-elsewhere',
1251
+ topic: 'fighting',
1252
+ when: on({ format: ['1v1', 'teams'], phase: ['contact', 'late'] }),
1253
+ text: 'When two big stacks face each other, count the next turns out before calling it stuck. If attacking every ' +
1254
+ 'turn breaks it, do that; if the opponent could do that to you, keep deploying what holds. Only armies ' +
1255
+ 'beyond that are surplus: put them into a bonus the opponent cannot see or reach, if every hold still ' +
1256
+ 'survives.',
1257
+ source: S.forumSkillChecklist,
1258
+ basis: 'derived',
1259
+ },
1260
+ {
1261
+ id: 'fighting-go-round',
1262
+ topic: 'fighting',
1263
+ when: on({ phase: ['contact', 'late'] }),
1264
+ text: 'Stuck at a walled border, look for the other way in: a wasteland beside a blockade is often the ' +
1265
+ 'cheaper obstacle, and a neighbour that touches the enemy bonus in two places makes the defender ' +
1266
+ 'guess. Do not spend the main stack breaking a large blockade when another route or bonus pays ' +
1267
+ 'sooner.',
1268
+ source: S.smallEarthGuide,
1269
+ basis: 'source',
1270
+ },
1271
+ {
1272
+ id: 'fighting-hidden-stack',
1273
+ topic: 'fighting',
1274
+ when: on({ fog: ['LightFog', 'Foggy', 'ModerateFog', 'VeryFoggy', 'ExtremeFog'], phase: ['contact', 'late'], moveOrder: ['Cycle', 'NoLuckCycle'] }),
1275
+ text: 'A transfer between two territories the opponent cannot see is invisible to it. Build a stack one ' +
1276
+ 'step behind the front and, on a turn you are sure to move first, transfer it with your first order ' +
1277
+ 'into the territory its stack is about to take, enough to make that attack fail. If it falls first, ' +
1278
+ 'the transfer is an attack.',
1279
+ source: S.forumSkillChecklist,
1280
+ basis: 'source',
1281
+ },
1282
+ {
1283
+ id: 'fighting-trade-bonus-up',
1284
+ topic: 'fighting',
1285
+ when: on({ format: ['1v1', 'teams'], phase: ['contact', 'late'], standing: ['even', 'behind'] }),
1286
+ text: 'If the stack attacking your bonus stands on a territory of a richer bonus of its own, hold a stack ' +
1287
+ 'back, pad your list, and take that territory with your last order once its armies have left: you ' +
1288
+ 'lose the smaller bonus, it loses the bigger. It works only if the stack attacks; send no more than ' +
1289
+ 'you can afford to lose if it stays.',
1290
+ source: S.forumSkillChecklist,
1291
+ basis: 'source',
1292
+ },
1293
+ // ---- reading: fog, picks and what the opponent shows (second research pass) ----
1294
+ {
1295
+ id: 'reading-fog-owners-shown',
1296
+ topic: 'reading',
1297
+ when: on({ fog: ['LightFog', 'ModerateFog'] }),
1298
+ text: "This fog level shows the owner of every territory, so an opponent's income is not a guess: add the " +
1299
+ 'bonuses it holds in full to its base or territory income. Only army counts are hidden, so follow ' +
1300
+ 'what it earns and loses each turn to judge how large its unseen stacks can be.',
1301
+ source: S.fog,
1302
+ basis: 'derived',
1303
+ },
1304
+ {
1305
+ id: 'reading-fog-border-armies-hidden',
1306
+ topic: 'reading',
1307
+ when: on({ fog: ['ModerateFog', 'VeryFoggy'] }),
1308
+ text: 'At this fog level even the territories next to yours show only their owner, never their armies. Do ' +
1309
+ 'not size a hold or an attack from the board: reckon what the opponent can have there from its income ' +
1310
+ 'and its losses, and keep a margin for what you cannot see.',
1311
+ source: S.fog,
1312
+ basis: 'derived',
1313
+ },
1314
+ {
1315
+ id: 'reading-fog-attacks-reveal',
1316
+ topic: 'reading',
1317
+ when: on({ fog: ['LightFog', 'Foggy', 'ModerateFog', 'VeryFoggy', 'ExtremeFog'] }),
1318
+ text: 'Every attack on your own territory shows where it came from, whose it was and how many armies were ' +
1319
+ "sent, even out of the fog. One onto another player's territory shows its size only if it captured, " +
1320
+ "and only where you can see that territory's armies. Note each with its turn: it fixes a stack you " +
1321
+ 'cannot otherwise see.',
1322
+ source: S.fog,
1323
+ basis: 'source',
1324
+ },
1325
+ {
1326
+ id: 'reading-stack-arrival',
1327
+ topic: 'reading',
1328
+ when: on({ fog: ['LightFog', 'Foggy', 'ModerateFog', 'VeryFoggy', 'ExtremeFog'], phase: ['contact', 'late'] }),
1329
+ text: 'When a stack you saw goes out of view, count the turns it needs to walk to each of your borders and ' +
1330
+ 'expect it from that turn on. Do not advance toward where it must be unless you are sure to move ' +
1331
+ 'first; and when a deployment drops with no fight to explain it, add the missing armies to that ' +
1332
+ 'stack.',
1333
+ source: S.forumImprovingGameplay,
1334
+ basis: 'source',
1335
+ },
1336
+ {
1337
+ id: 'reading-deploy-order-leak',
1338
+ topic: 'reading',
1339
+ when: on({ fog: ['LightFog', 'Foggy', 'ModerateFog', 'VeryFoggy', 'ExtremeFog'] }),
1340
+ text: "Deployments alternate like orders. When more of yours run before an opponent's first visible " +
1341
+ 'deployment than the move order allows, it has deployed somewhere out of your sight first, so its ' +
1342
+ 'income is larger than what arrives at your border.',
1343
+ source: S.clanGuide,
1344
+ basis: 'source',
1345
+ },
1346
+ {
1347
+ id: 'reading-pick-move-order',
1348
+ topic: 'reading',
1349
+ when: on({ format: ['1v1'], distribution: 'manual', moveOrder: ['Cycle'], phase: ['opening', 'expansion'] }),
1350
+ text: 'Under a Cycle move order the pick award is turn 0: whoever was awarded first moves second on turn 1 ' +
1351
+ 'and first on turn 2. If your k-th granted pick was number 2k on your list you know which: k odd, you ' +
1352
+ 'were awarded second and move first on turn 1; k even, the reverse.',
1353
+ source: S.forumIntelBeforeTurn1,
1354
+ basis: 'source',
1355
+ },
1356
+ {
1357
+ id: 'reading-unpicked-starts',
1358
+ topic: 'reading',
1359
+ when: on({ distribution: 'manual', phase: ['opening', 'expansion'] }),
1360
+ text: 'A pickable territory nobody was granted turns into a neutral of the in-distribution size. When you ' +
1361
+ 'see one still neutral at that size, cross it off the list of possible enemy starts; plan captures ' +
1362
+ 'through it at that size, which is often more than an ordinary neutral.',
1363
+ source: S.strategic1v1,
1364
+ basis: 'derived',
1365
+ },
1366
+ {
1367
+ id: 'reading-opponent-opening-pace',
1368
+ topic: 'reading',
1369
+ when: on({ distribution: 'manual', phase: ['opening', 'expansion'], fog: ['Foggy', 'VeryFoggy', 'ExtremeFog'] }),
1370
+ text: 'Before you can see the opponent, price their best start: from the pickable territories you were not ' +
1371
+ 'granted, work out which bonuses fall on turn 1 or 2 and the income that gives by turn 3. Size your ' +
1372
+ 'first borders against that pace, not against base income.',
1373
+ source: S.forumPickingGuide,
1374
+ basis: 'derived',
1375
+ },
1376
+ {
1377
+ id: 'reading-commander-first-award',
1378
+ topic: 'reading',
1379
+ when: on({ format: ['1v1'], distribution: 'manual', commanders: true, phase: ['opening', 'expansion'] }),
1380
+ text: 'A commander starts on the first territory its player was awarded. In a two-player game, if you did ' +
1381
+ 'not get your first pick, the opponent was awarded it first and their commander is on it. If you got ' +
1382
+ 'your first and third picks but not your second, their commander is on your second for certain only ' +
1383
+ 'if you were awarded second.',
1384
+ source: S.commanders,
1385
+ basis: 'derived',
1386
+ },
1387
+ // ---- format: free-for-all and teams (second research pass) ----
1388
+ {
1389
+ id: 'ffa-leader-only',
1390
+ topic: 'format',
1391
+ when: on({ format: ['ffa'], phase: ['contact', 'late'], standing: ['even', 'behind'] }),
1392
+ text: 'With a clear leader who is not you, the smaller players lose by fighting each other. Attack a ' +
1393
+ "smaller neighbour only if its income added to yours would match the leader's; otherwise hold that " +
1394
+ 'border and attack the leader only where the exchange favours you. With three left, hitting the ' +
1395
+ 'weakest hands the leader the game.',
1396
+ source: S.forumKeepingPlayers,
1397
+ basis: 'derived',
1398
+ encoded: "in part (#201): adapting, the planner finishes off or presses a smaller player who is not the leader only when its income added to mine reaches the leader's (warapp_plan_turn)",
1399
+ },
1400
+ {
1401
+ id: 'ffa-hide-strength',
1402
+ topic: 'format',
1403
+ when: on({ format: ['ffa'] }),
1404
+ text: 'The armies neighbours see you deploy are what they count. Where fog hides it, deploy out of their ' +
1405
+ 'sight and move up when you can spare the turn; everywhere, keep border stacks no larger than the ' +
1406
+ 'hold needs: where every owner is visible, the largest player is the one the others combine against.',
1407
+ source: S.advancedStrategy,
1408
+ basis: 'source',
1409
+ },
1410
+ {
1411
+ id: 'ffa-peaceful-stacker',
1412
+ topic: 'format',
1413
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
1414
+ text: 'The player at peace with both of its neighbours while they fight is the real leader. Rank opponents ' +
1415
+ 'by the armies they have built as well as by income, and expect it to turn on the weaker neighbour ' +
1416
+ 'when that fight ends.',
1417
+ source: S.forumFfaGames,
1418
+ basis: 'derived',
1419
+ },
1420
+ {
1421
+ id: 'ffa-finish-or-spare',
1422
+ topic: 'format',
1423
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
1424
+ text: 'A player you have broken but not eliminated has nothing left to lose and may throw every army at ' +
1425
+ 'you. Either take its last territories, or do not cripple it and leave it able to fight someone else.',
1426
+ source: S.forumKingmaking,
1427
+ basis: 'derived',
1428
+ encoded: "in part (#201): the planner warns when a capture breaks an FFA player's bonus without eliminating it (warapp_plan_turn)",
1429
+ },
1430
+ {
1431
+ id: 'ffa-neighbour-leaves',
1432
+ topic: 'format',
1433
+ when: on({ format: ['ffa'] }),
1434
+ text: 'When a neighbour surrenders or is booted, its land goes to an AI or turns neutral (set separately ' +
1435
+ "for each; neutral after a boot is players' report), and any truce ends. Neutral land keeps its " +
1436
+ 'armies, so thin bonuses there are cheap. An AI fights on, goes for neutral bonuses first, and its ' +
1437
+ 'player may take the seat back.',
1438
+ source: S.playersIntoAis,
1439
+ basis: 'derived',
1440
+ },
1441
+ {
1442
+ id: 'teams-score-team',
1443
+ topic: 'format',
1444
+ when: on({ format: ['teams'] }),
1445
+ text: 'Judge your turn by what the team gains. Tying down two opponents while a teammate takes bonuses is a ' +
1446
+ 'good trade even if you stay on base income all game; expanding for yourself instead of fighting ' +
1447
+ 'there is the usual mistake.',
1448
+ source: S.clanGuide,
1449
+ basis: 'source',
1450
+ },
1451
+ {
1452
+ id: 'teams-one-owner-per-bonus',
1453
+ topic: 'format',
1454
+ when: on({ format: ['teams'] }),
1455
+ text: 'A bonus pays only when one player holds every territory in it. Settle who owns each bonus; the other ' +
1456
+ 'teammate moves out all but one army, then the owner takes the territory with an order set to treat ' +
1457
+ 'teammates as enemies (no card piece): `attack_teammates` in warapp_submit_turn (not yet ' +
1458
+ 'verified live); a ' +
1459
+ 'plain order there is a transfer.',
1460
+ source: S.teamGames,
1461
+ basis: 'source',
1462
+ },
1463
+ {
1464
+ id: 'teams-transfer-not-deploy',
1465
+ topic: 'format',
1466
+ when: on({ format: ['teams'] }),
1467
+ text: "You may transfer armies onto a teammate's territory but never deploy there. Pass idle armies across " +
1468
+ "a shared border to the teammate nearer the fight: they are the teammate's from then on, and can be " +
1469
+ 'used from the next turn.',
1470
+ source: S.teamGames,
1471
+ basis: 'derived',
1472
+ },
1473
+ {
1474
+ id: 'teams-shared-hand',
1475
+ topic: 'format',
1476
+ when: on({ format: ['teams'], anyCards: true }),
1477
+ text: 'A team holds one hand of cards between its players, with one limit on how many it may keep. Before ' +
1478
+ "you play a card, check which teammate's turn gains most from it and that it has not been played " +
1479
+ 'already: played by whoever commits first, it is gone for the teammate in the fight that decides the ' +
1480
+ 'game.',
1481
+ source: S.teamGames,
1482
+ basis: 'source',
1483
+ },
1484
+ {
1485
+ id: 'teams-reinforce-capture',
1486
+ topic: 'format',
1487
+ when: on({ format: ['teams'], transferOnlyAllowed: true }),
1488
+ text: "To strengthen a teammate's capture in the same turn, it captures with its first order and you " +
1489
+ 'transfer in at least one order later, marked Transfer Only so a failed capture leaves your armies ' +
1490
+ 'home. In warapp_submit_turn, set the move\'s mode "transfer-only" (not yet verified live); a plain order would attack and ' +
1491
+ 'take the territory.',
1492
+ source: S.forumTeamStrategy,
1493
+ basis: 'source',
1494
+ },
1495
+ {
1496
+ id: 'teams-ai-teammate',
1497
+ topic: 'format',
1498
+ when: on({ format: ['teams'] }),
1499
+ text: "An AI in a teammate's seat plays no card of its own accord while a human is on the team, though the " +
1500
+ "rules can force a play for the team. It may attack a teammate's territory to finish a bonus (one " +
1501
+ 'thread reports it taking only one-army ones: keep two on yours beside it). Armies you transfer to it ' +
1502
+ "become the AI's: defend from your land.",
1503
+ source: S.ai,
1504
+ basis: 'derived',
1505
+ },
1506
+ // ---- the end-game (third research pass): stand-offs, finishing, behind, leavers ----
1507
+ {
1508
+ id: 'fighting-grind-threshold',
1509
+ topic: 'fighting',
1510
+ when: on({ phase: ['contact', 'late'], exact: true, defaultKillRates: true }),
1511
+ text: 'With both sides deploying everything at one border, attacking every turn wins from about 1.1 to 1.15 ' +
1512
+ "times the defender's stack at 100 armies or more (1.2 to 1.3 times at 20, more with large incomes), " +
1513
+ 'though the first attacks lose more than they kill. Short of that it feeds the defender; with neither ' +
1514
+ 'side that far ahead: a stand-off.',
1515
+ source: S.forumSkillChecklist,
1516
+ basis: 'derived',
1517
+ },
1518
+ {
1519
+ id: 'fighting-income-lead-clock',
1520
+ topic: 'fighting',
1521
+ when: on({ phase: ['contact', 'late'], standing: ['ahead'], exact: true, defaultKillRates: true }),
1522
+ text: 'From equal stacks at one border, more income breaks it by stacking a few turns, then attacking every ' +
1523
+ 'turn: a fifth more (12 against 10) takes about 8 to 12 turns, half as much again 4 or 5, double 3. A ' +
1524
+ 'tenth more may never get through there: spend that lead on a second point of contact.',
1525
+ source: S.strategyGuideDoc,
1526
+ basis: 'derived',
1527
+ },
1528
+ {
1529
+ id: 'fighting-army-lead-expires',
1530
+ topic: 'fighting',
1531
+ when: on({ format: ['1v1', 'teams'], phase: ['contact', 'late'], exact: true, defaultKillRates: true }),
1532
+ text: 'More armies with less income is a lead that shrinks every turn. At 40 against 20 with 7 income against ' +
1533
+ '10, attacking every turn from now breaks the border in 2 turns; wait 2 turns first and the same attacks ' +
1534
+ 'are ground down. Spend such a lead at once on a capture that cuts their income, or do not count on it.',
1535
+ source: S.combat,
1536
+ basis: 'derived',
1537
+ },
1538
+ {
1539
+ id: 'fighting-failed-attack-reply',
1540
+ topic: 'fighting',
1541
+ when: on({ phase: ['contact', 'late'], exact: true, defaultKillRates: true }),
1542
+ text: 'A failed attack leaves your territory thin. If the stack you hit is larger than your attack (from about ' +
1543
+ '1.06 times at 100 armies to 1.2 times at 10) and has not moved yet, its reply takes your territory as ' +
1544
+ 'well. Near parity, attack only after that stack has attacked, or with enough to capture.',
1545
+ source: S.forumSkillChecklist,
1546
+ basis: 'source',
1547
+ },
1548
+ {
1549
+ id: 'fighting-double-border-safety',
1550
+ topic: 'fighting',
1551
+ when: on({ phase: ['contact', 'late'], exact: true, defaultKillRates: true }),
1552
+ text: 'A territory survives an attack of A only with more than 0.6 × A armies (61 against 100). One enemy ' +
1553
+ 'stack touching two territories you must keep needs that on each, about 1.2 × A in all, 1.8 × A for ' +
1554
+ 'three: with less you are guessing. To break a one-border deadlock, walk your stack to a territory ' +
1555
+ 'touching two of theirs.',
1556
+ source: S.forumStalemate,
1557
+ basis: 'derived',
1558
+ },
1559
+ {
1560
+ id: 'fighting-finish-contain',
1561
+ topic: 'fighting',
1562
+ when: on({ format: ['1v1', 'teams'], phase: ['late'], standing: ['ahead'] }),
1563
+ text: 'To end a won game, pen the last stack in rather than taking the map: a stack beside each way out, a ' +
1564
+ 'small late attack retaking each territory it leaves, and your first order on it on a turn you move ' +
1565
+ 'first, sized for its armies plus its whole income. On a turn it moves first, a strike where it ' +
1566
+ 'stands misses if it runs.',
1567
+ source: S.forumNeverSurrender,
1568
+ basis: 'source',
1569
+ },
1570
+ {
1571
+ id: 'fighting-ahead-stop-expanding',
1572
+ topic: 'fighting',
1573
+ when: on({ format: ['1v1', 'teams'], phase: ['late'], standing: ['ahead'] }),
1574
+ text: "Once the game is yours, count the turns to finish it: the steps to the opponent's farthest territory, or the " +
1575
+ 'armies its land needs over what you can spare each turn, whichever is more. Take a neutral bonus only ' +
1576
+ "if it repays its cost within that time and opens no border; every other army goes at the opponent's " +
1577
+ 'bonuses and stacks.',
1578
+ source: S.forumNeverSurrender,
1579
+ basis: 'derived',
1580
+ encoded: 'in part (#201): once the outlook says the game is decided, every payback test counts the turns it has left (warapp_plan_turn)',
1581
+ },
1582
+ {
1583
+ id: 'fighting-more-threats-than-deploy',
1584
+ topic: 'fighting',
1585
+ when: on({ phase: ['contact', 'late'], standing: ['ahead'] }),
1586
+ text: 'The opponent has one deployment to share among every territory you can take this turn. Ahead, set up ' +
1587
+ 'more captures than it can save, each sized to win unless reinforced and aimed at different bonuses: ' +
1588
+ 'whatever it guesses some fall and its income drops, unless it strikes back instead (warapp_check_plan ' +
1589
+ 'tries that).',
1590
+ source: S.forumGuessMultiBorder,
1591
+ basis: 'derived',
1592
+ },
1593
+ {
1594
+ id: 'fighting-behind-take-variance',
1595
+ topic: 'fighting',
1596
+ when: on({ format: ['1v1'], phase: ['contact', 'late'], standing: ['behind'] }),
1597
+ text: 'Well behind, the safe plan only loses more slowly. Prefer lines that win if one guess is right: an ' +
1598
+ 'attack sized for where the opponent will not deploy, a stack sent past its front. Make them while your ' +
1599
+ 'stack still outweighs a turn of its income, and vary your targets so it cannot read you.',
1600
+ source: S.forumTougherOpponents,
1601
+ basis: 'source',
1602
+ },
1603
+ {
1604
+ id: 'fighting-raid-back-line',
1605
+ topic: 'fighting',
1606
+ when: on({ format: ['1v1', 'teams'], phase: ['contact', 'late'] }),
1607
+ text: 'Armies defending a border the other side can overrun are wasted; past its front they threaten every ' +
1608
+ 'bonus they touch, and it must garrison them all or turn back. Each turn move the stack on to a ' +
1609
+ 'territory touching two bonuses rather than holding what it took. Facing one, turn a stack on it ' +
1610
+ 'while your front keeps advancing.',
1611
+ source: S.forumLargeFront,
1612
+ basis: 'derived',
1613
+ },
1614
+ {
1615
+ id: 'fighting-vote-to-end',
1616
+ topic: 'fighting',
1617
+ when: on({ phase: ['contact', 'late'], standing: ['even'] }),
1618
+ text: 'A game nobody can win can end by vote, but only if every player still alive votes for it, and never ' +
1619
+ 'in ladder, tournament, quickmatch, clan-war or coin games. It then has no winner and counts as a loss ' +
1620
+ 'for anyone already out. Propose it in chat once nothing is left to try; the vote is cast in the game ' +
1621
+ 'client.',
1622
+ source: S.voteToEnd,
1623
+ basis: 'source',
1624
+ },
1625
+ {
1626
+ id: 'fighting-not-risk',
1627
+ topic: 'fighting',
1628
+ when: on({ phase: ['contact', 'late'], defenceBeatsOffence: true, multiAttack: false }),
1629
+ text: 'Risk habits mislead here. A defender kills more per army, so attacking an equal stack loses more than it ' +
1630
+ 'kills; it deploys before your attack lands, so size for that; armies move one step a turn, so nothing ' +
1631
+ 'is swept in one turn; and cards have fixed effects, with no rule page paying you for eliminating a player.',
1632
+ source: S.combat,
1633
+ basis: 'derived',
1634
+ },
1635
+ {
1636
+ id: 'reading-net-gain',
1637
+ topic: 'reading',
1638
+ when: on({ phase: ['contact', 'late'] }),
1639
+ text: "Measure a lead in armies, not income alone: each turn take your income plus the armies you killed, " +
1640
+ "less the opponent's income and the armies you lost. A smaller income that wins its exchanges is " +
1641
+ 'gaining; a larger one that loses them is not. Judge it over a few turns, not one.',
1642
+ source: S.forumSkillChecklist,
1643
+ basis: 'source',
1644
+ },
1645
+ {
1646
+ id: 'reading-when-lost',
1647
+ topic: 'reading',
1648
+ when: on({ format: ['1v1'], phase: ['contact', 'late'], standing: ['behind'] }),
1649
+ text: 'Call a two-player game lost only when this has held for several turns: no bonus of yours survives, ' +
1650
+ 'the opponent out-deploys you by far and shows more armies, none of its bonuses breaks against its ' +
1651
+ 'full deployment, its commander (if any) is out of reach, and fog hides no other picture. Then ' +
1652
+ 'surrender rather than run a stack to delay.',
1653
+ source: S.forumTellingSurrender,
1654
+ basis: 'derived',
1655
+ },
1656
+ {
1657
+ id: 'reading-surrender-checks',
1658
+ topic: 'reading',
1659
+ when: on({ phase: ['contact', 'late'], standing: ['behind'] }),
1660
+ text: 'Before you surrender, read the settings. Where surrenders must be accepted, you keep playing until every ' +
1661
+ 'other player has accepted. Your land then turns neutral or passes to an AI, as the game is set; with ' +
1662
+ 'more than two sides that can decide the game between the others, so see who borders it.',
1663
+ source: S.surrender,
1664
+ basis: 'source',
1665
+ },
1666
+ {
1667
+ id: 'reading-leaver-replan',
1668
+ topic: 'reading',
1669
+ when: on({ format: ['ffa', 'teams'] }),
1670
+ text: 'Players report that a surrender or boot shows at once to anyone who has not committed, who can re-plan ' +
1671
+ 'the same turn. When a neighbour is near its boot time or has asked to surrender, read the game again ' +
1672
+ 'just before you commit: its land may be neutral already, or played by an AI that keeps no truce.',
1673
+ source: S.forumTurningAi,
1674
+ basis: 'source',
1675
+ },
1676
+ {
1677
+ id: 'timing-setup-then-first-order',
1678
+ topic: 'timing',
1679
+ when: on({ format: ['1v1'], moveOrder: ['Cycle', 'NoLuckCycle'], phase: ['contact', 'late'] }),
1680
+ text: 'Under a cyclic order you move first every other turn. On the turn before yours, step beside the target ' +
1681
+ 'late in your list; next turn, strike with your first order. The opponent gets a deployment in between ' +
1682
+ 'but no move, so size the strike for its stack plus its whole income.',
1683
+ source: S.forumSkillChecklist,
1684
+ basis: 'source',
1685
+ },
1686
+ {
1687
+ id: 'settings-commander-kill-ends-game',
1688
+ topic: 'settings',
1689
+ when: on({ format: ['1v1'], commanders: true }),
1690
+ text: 'In a two-player game the game ends the moment a commander dies, and no later order runs. If both ' +
1691
+ 'commanders can be killed this turn, the kill that runs first wins: make it your first order and know ' +
1692
+ 'who moves first. If the opponent may hold Order Priority, play yours: two cancel and the usual order ' +
1693
+ 'stands.',
1694
+ source: S.forumCommanderDeath,
1695
+ basis: 'derived',
1696
+ },
1697
+ {
1698
+ id: 'settings-commander-guard-numbers',
1699
+ topic: 'settings',
1700
+ when: on({ commanders: true, exact: true, defaultKillRates: true }),
1701
+ text: 'A commander with g armies on its territory dies to the attack that takes g + 7: alone 11, with 5 armies 20, ' +
1702
+ 'with 10 28, with 20 45. To make an attack of A fail, keep round(0.6 × A) − 6 armies with it (6 against ' +
1703
+ '20, 54 against 100). A smaller attack kills armies, never the commander.',
1704
+ source: S.commanders,
1705
+ basis: 'derived',
1706
+ },
1707
+ {
1708
+ id: 'settings-commander-keep-back',
1709
+ topic: 'settings',
1710
+ when: on({ commanders: true }),
1711
+ text: 'A commander is attacked only from a territory next to it: with no enemy or fogged territory beside ' +
1712
+ 'it, it is safe this turn; with none within two steps, next turn too (under Multi-Attack count chains). ' +
1713
+ 'Ahead, keep it that far back. Move it with `commander` on a move in ' +
1714
+ 'warapp_submit_turn (not yet verified live).',
1715
+ source: S.commanders,
1716
+ basis: 'derived',
1717
+ },
1718
+ {
1719
+ id: 'settings-commander-snipe-behind',
1720
+ topic: 'settings',
1721
+ when: on({ format: ['1v1'], commanders: true, phase: ['contact', 'late'], standing: ['behind'] }),
1722
+ text: 'Behind in a commander game, killing theirs wins whatever the incomes. Work out where it can be: its ' +
1723
+ 'first awarded territory or last sighting, one step for each turn since (anywhere its owner holds, after ' +
1724
+ 'an Airlift). Keep one stack able to cover its guard, its 7 and a full deployment, and bring it within ' +
1725
+ 'reach.',
1726
+ source: S.commanders,
1727
+ basis: 'derived',
1728
+ },
1729
+ {
1730
+ id: 'settings-commander-kill-neutral',
1731
+ topic: 'settings',
1732
+ when: on({ format: ['ffa', 'teams'], commanders: true }),
1733
+ text: 'With more than two players a commander kill pays nothing directly: all its owner held turns neutral ' +
1734
+ 'where it stands, armies included. Its stacks facing you become neutral walls, and its thin land is ' +
1735
+ 'cheap for whoever borders it. Before the strike, see who that is: you, or a rival.',
1736
+ source: S.commanders,
1737
+ basis: 'derived',
1738
+ },
1739
+ {
1740
+ id: 'cards-priority-catch-runner',
1741
+ topic: 'cards',
1742
+ when: on({ format: ['1v1'], cardsInPlay: ['Order Priority'], phase: ['late'], standing: ['ahead'] }),
1743
+ text: 'A stack that keeps moving away is caught only on a turn your attack runs before its move: every other ' +
1744
+ 'turn under a cyclic order, an even chance each turn under a random one. Order Priority on your first ' +
1745
+ 'order makes it certain unless the opponent plays one too. Save the card for the strike that ' +
1746
+ 'eliminates.',
1747
+ source: S.orderPriority,
1748
+ basis: 'derived',
1749
+ },
1750
+ {
1751
+ id: 'cards-bomb-standoff-size',
1752
+ topic: 'cards',
1753
+ when: on({ cardsInPlay: ['Bomb'], phase: ['contact', 'late'], exact: true, defaultKillRates: true }),
1754
+ text: 'A Bomb halves a stack after its deployment and before any attack, so the capture drops from five ' +
1755
+ 'thirds of the stack to about five sixths: 83 instead of 166 against 100. With one, a stack about equal ' +
1756
+ 'to theirs captures the turn you play it; facing one, keep the stacks beside its holder split. ' +
1757
+ 'warapp_submit_turn plays it (unverified live).',
1758
+ source: S.bomb,
1759
+ basis: 'derived',
1760
+ },
1761
+ {
1762
+ id: 'cards-diplomacy-three-sides',
1763
+ topic: 'cards',
1764
+ when: on({ format: ['ffa'], cardsInPlay: ['Diplomacy'] }),
1765
+ text: 'With three sides left a Diplomacy card makes a two-on-one while it runs: the two at peace can attack ' +
1766
+ 'only the third. Play it on the opponent you want facing the other; if your two opponents end up at ' +
1767
+ 'peace by card, expect both on you from the next turn. warapp_submit_turn plays it (unverified live).',
1768
+ source: S.diplomacy,
1769
+ basis: 'derived',
1770
+ },
1771
+ {
1772
+ id: 'cards-sanctions-on-leader',
1773
+ topic: 'cards',
1774
+ when: on({ format: ['ffa', 'teams'], cardsInPlay: ['Sanctions'] }),
1775
+ text: 'A Sanctions card with a positive percentage takes a share of income, so it costs the largest player ' +
1776
+ 'most, and two on one player compound. When several of you face one leader, play them on it for the ' +
1777
+ 'same turns, the turn before you attack: the cut starts with its next income. warapp_submit_turn plays ' +
1778
+ 'it (unverified live).',
1779
+ source: S.sanctions,
1780
+ basis: 'derived',
1781
+ },
1782
+ {
1783
+ id: '1v1-opponent-replaced-by-ai',
1784
+ topic: 'format',
1785
+ when: on({ format: ['1v1'], phase: ['contact', 'late'] }),
1786
+ text: 'An opponent who surrenders or is booted may be replaced by an AI that plays on, and its player may take ' +
1787
+ 'the seat back a limited number of times; whether the AI gives up once you are the last human is a ' +
1788
+ 'setting. Until the game shows as won, keep every hold and keep finishing.',
1789
+ source: S.playersIntoAis,
1790
+ basis: 'source',
1791
+ },
1792
+ {
1793
+ id: '1v1-beaten-opponent-chat',
1794
+ topic: 'format',
1795
+ when: on({ format: ['1v1'], phase: ['late'], standing: ['ahead'] }),
1796
+ text: 'If a beaten opponent plays on, do not tell it to surrender. Say once, politely, what the board shows ' +
1797
+ '(incomes, armies) and keep committing promptly; that often ends it. Repeated demands are rude, can draw ' +
1798
+ 'a warning and make some players dig in. Only the boot timer removes a player who stops moving.',
1799
+ source: S.forumTellingSurrender,
1800
+ basis: 'source',
1801
+ },
1802
+ {
1803
+ id: 'ffa-last-human',
1804
+ topic: 'format',
1805
+ when: on({ format: ['ffa', 'teams'] }),
1806
+ text: 'Where AIs give up once one human is left (in a team game, one team with humans), they surrender as ' +
1807
+ 'soon as the last other human is out, whatever they hold: with AI seats in play, count the humans ' +
1808
+ 'still in and finish that one first. Where they do not, an AI plays to the end and can win, even for ' +
1809
+ 'a booted leader.',
1810
+ source: S.aiSurrenders,
1811
+ basis: 'derived',
1812
+ },
1813
+ {
1814
+ id: 'ffa-coalition-match-commitment',
1815
+ topic: 'format',
1816
+ when: on({ format: ['ffa'], phase: ['contact', 'late'], standing: ['even', 'behind'] }),
1817
+ text: 'When you and another smaller player both face a runaway leader, match the effort the other puts in. ' +
1818
+ 'A league player warns that whoever throws everything at the leader while the other also guards your ' +
1819
+ 'shared border is squeezed from both sides and falls first; if both hold back, the leader beats you ' +
1820
+ 'one at a time.',
1821
+ source: S.forumFfaLeague,
1822
+ basis: 'source',
1823
+ },
1824
+ {
1825
+ id: 'ffa-two-player-moment',
1826
+ topic: 'format',
1827
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
1828
+ text: "With three left, the game turns two-player when the leader's income collapses, not when its last " +
1829
+ 'territory falls, and any pact against it ends there. Before helping to finish anyone, compare what you ' +
1830
+ 'and the other survivor would hold afterwards: whoever is clearly behind then usually loses within a ' +
1831
+ 'turn or two.',
1832
+ source: S.forumFfaLeague,
1833
+ basis: 'derived',
1834
+ },
1835
+ {
1836
+ id: 'ffa-second-needs-third',
1837
+ topic: 'format',
1838
+ when: on({ format: ['ffa'], phase: ['contact', 'late'], standing: ['even', 'behind'] }),
1839
+ text: 'Only first place wins. Second of three, you cannot win without the third, so helping the leader finish ' +
1840
+ 'it only buys second place. Third, the second needs you alive and fighting the leader: that is worth a ' +
1841
+ 'quiet border from it, and you can ask for one.',
1842
+ source: S.forumKeepingPlayers,
1843
+ basis: 'source',
1844
+ },
1845
+ {
1846
+ id: 'ffa-leader-combined-holds',
1847
+ topic: 'format',
1848
+ when: on({ format: ['ffa'], phase: ['contact', 'late'], standing: ['ahead'] }),
1849
+ text: 'Clearly the largest, be ready for the others to stop fighting each other and turn on you. Size each border ' +
1850
+ 'for every neighbour touching it attacking in the same turn, fight one neighbour at a time and finish ' +
1851
+ 'it, show no more than a border needs, and keep quiet in public chat: naming the leader starts the ' +
1852
+ 'pile-on.',
1853
+ source: S.forumFfaLeague,
1854
+ basis: 'derived',
1855
+ encoded: 'in part (#201): leading an FFA, the planner holds each border against every adjacent opponent together and sizes breaks against one deploy (warapp_plan_turn)',
1856
+ },
1857
+ {
1858
+ id: 'ffa-buffer-neighbour',
1859
+ topic: 'format',
1860
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
1861
+ text: 'Eliminating a player pays the land you take, and no rule page gives the eliminator more. Before ' +
1862
+ 'finishing a weak neighbour, see who stands behind it: if its land keeps a stronger player off you, its ' +
1863
+ 'income holds that border for free. Finish it when its bonuses would otherwise go to a rival, or it can ' +
1864
+ 'still hurt you.',
1865
+ source: S.forumKeepingPlayers,
1866
+ basis: 'derived',
1867
+ },
1868
+ {
1869
+ id: 'ffa-surrender-veto',
1870
+ topic: 'format',
1871
+ when: on({ format: ['ffa'] }),
1872
+ text: 'Where surrenders must be accepted, every other player must accept before a loser leaves; its land then ' +
1873
+ 'turns neutral or goes to an AI, as the game is set. Accept when that helps you more than your rivals; ' +
1874
+ 'if it would mostly feed a rival, refusing keeps the player in (it must move or be booted). Accept in ' +
1875
+ 'the game client.',
1876
+ source: S.surrender,
1877
+ basis: 'derived',
1878
+ },
1879
+ {
1880
+ id: 'ffa-truce-end',
1881
+ topic: 'format',
1882
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
1883
+ text: 'Every truce in a free-for-all ends, since only one player wins. End yours before the partner grows too ' +
1884
+ 'strong to beat, but not while the leader still gains from your fight. If you agreed terms, give the ' +
1885
+ 'notice they name, and expect the partner to use it to move stacks to your border.',
1886
+ source: S.forumFfaTruce,
1887
+ basis: 'source',
1888
+ },
1889
+ {
1890
+ id: 'ffa-lost-game-exit',
1891
+ topic: 'format',
1892
+ when: on({ format: ['ffa'], phase: ['contact', 'late'], standing: ['behind'] }),
1893
+ text: 'When you cannot win a free-for-all, staying on is accepted while your moves still affect the result, ' +
1894
+ 'unlike in a two-player game. Leaving is a move as well: your land turns neutral or passes to an AI, and ' +
1895
+ 'whoever borders it can profit. Before surrendering, see which opponent your land would feed.',
1896
+ source: S.forumBadSurrender,
1897
+ basis: 'source',
1898
+ },
1899
+ {
1900
+ id: 'ffa-boot-clock',
1901
+ topic: 'format',
1902
+ when: on({ format: ['ffa', 'teams'] }),
1903
+ text: 'Past the direct-boot time any player may boot one who has not committed (in the game client), when ' +
1904
+ 'it chooses; the seat goes to an AI where the game says so, and players report it turns neutral ' +
1905
+ 'otherwise. Near a deadline, note which neighbours have not committed and what their bonuses would ' +
1906
+ 'cost, and commit your own turn in good time.',
1907
+ source: S.booting,
1908
+ basis: 'derived',
1909
+ },
1910
+ {
1911
+ id: 'teams-commander-weakest',
1912
+ topic: 'format',
1913
+ when: on({ format: ['teams'], commanders: true }),
1914
+ text: "In a team game a commander's death removes only its owner; the teammate plays on alone and the dead " +
1915
+ "player's land turns neutral. The weaker or more exposed enemy's commander is the short way to " +
1916
+ "outnumbering them, and the same goes for your side: guard a teammate's commander by transferring " +
1917
+ 'armies onto its territory early in your orders.',
1918
+ source: S.forumTeamCommanders,
1919
+ basis: 'derived',
1920
+ },
1921
+ {
1922
+ id: 'teams-hand-over-before-leaving',
1923
+ topic: 'format',
1924
+ when: on({ format: ['teams'] }),
1925
+ text: 'A teammate who surrenders or is booted leaves its land to an AI or neutral, as the game is set; neutral, ' +
1926
+ "its income is gone from the team, as when one is eliminated. Armies about to be lost do more in a " +
1927
+ "teammate's hands: transfer them across a shared border first. Do not surrender alone; agree it with " +
1928
+ 'the team.',
1929
+ source: S.teamGames,
1930
+ basis: 'derived',
1931
+ },
1932
+ {
1933
+ id: 'teams-no-march-through',
1934
+ topic: 'format',
1935
+ when: on({ format: ['teams'] }),
1936
+ text: "An order into a teammate's territory hands the armies over and they stop there, so your stacks cannot " +
1937
+ "march through a teammate's land. Route around it, or hand armies over on purpose where the teammate " +
1938
+ 'faces the enemy and has nothing better coming.',
1939
+ source: S.teamGames,
1940
+ basis: 'derived',
1941
+ },
1942
+ // ---- diplomacy: deals between players who are not on a team (PLAN-TEAMS part E) ----
1943
+ {
1944
+ id: 'diplomacy-site-rules',
1945
+ topic: 'diplomacy',
1946
+ when: on({ format: ['ffa'] }),
1947
+ text: 'Players working together breaks no site rule and is not to be reported; what does is one person ' +
1948
+ 'playing two accounts in a game, or a rigged game nobody consented to. Etiquette players set is not ' +
1949
+ 'enforced like the rules, so a deal holds only while both sides keep it.',
1950
+ source: S.rules,
1951
+ basis: 'source',
1952
+ },
1953
+ {
1954
+ id: 'diplomacy-private-off',
1955
+ topic: 'diplomacy',
1956
+ when: on({ format: ['ffa'], privateMessaging: false }),
1957
+ text: 'With private messaging off, most posters in a long forum debate read it as the host asking for no ' +
1958
+ 'hidden deals, by mail or anywhere else; a few call mail fair. Take the stricter reading: the host ' +
1959
+ 'wants no deals, so propose none, in public chat or by mail.',
1960
+ source: S.forumFfaChatEtiquette,
1961
+ basis: 'derived',
1962
+ },
1963
+ {
1964
+ id: 'diplomacy-read-description',
1965
+ topic: 'diplomacy',
1966
+ when: on({ format: ['ffa'] }),
1967
+ text: "Read the host's description before any deal (warapp_advise_diplomacy shows it when the feed carries " +
1968
+ 'one). Where it rules out alliances or diplomacy, make none and accept none. Players disagree on what a ' +
1969
+ 'bare "FFA" allows; several say such a rule only counts when the description states it.',
1970
+ source: S.forumFfaChatEtiquette,
1971
+ basis: 'derived',
1972
+ },
1973
+ {
1974
+ id: 'diplomacy-first-contact',
1975
+ topic: 'diplomacy',
1976
+ when: on({ format: ['ffa'], phase: ['opening', 'expansion', 'contact'] }),
1977
+ text: 'In a large free-for-all a forum veteran calls a truce with the first neighbour you meet essential: ' +
1978
+ 'fighting it head-on usually costs you both (another disputes it). A truce across a bottleneck with even ' +
1979
+ 'stacks is the safe kind; one across a border where you can be flanked is not.',
1980
+ source: S.forumTreatyBreaking,
1981
+ basis: 'source',
1982
+ },
1983
+ {
1984
+ id: 'diplomacy-truce-scope-end',
1985
+ topic: 'diplomacy',
1986
+ when: on({ format: ['ffa'] }),
1987
+ text: 'A truce limited to named territories leaves every other border open: one poster who agreed one was ' +
1988
+ 'attacked outside it. Make it cover the whole shared front, or say plainly what it leaves out, and give ' +
1989
+ 'it a turn limit or a notice; one with no end may break any turn. Record it with warapp_record_agreement.',
1990
+ source: S.forumTreatyBreakingLater,
1991
+ basis: 'derived',
1992
+ },
1993
+ {
1994
+ id: 'diplomacy-truce-two-left',
1995
+ topic: 'diplomacy',
1996
+ when: on({ format: ['ffa'] }),
1997
+ text: 'A truce "until we two are the only ones left" was ended the turn the others surrendered, and the ' +
1998
+ 'one poster held that its letter was kept: nobody had said when a player counts as gone. Tie the end to a ' +
1999
+ 'turn or to notice, and read the game again before committing while players are leaving.',
2000
+ source: S.forumTruceTwoLeft,
2001
+ basis: 'source',
2002
+ },
2003
+ {
2004
+ id: 'diplomacy-stack-behind',
2005
+ topic: 'diplomacy',
2006
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
2007
+ text: 'Whoever has stacked most near a truce border usually wins when it breaks, and players admit keeping ' +
2008
+ 'big stacks just behind one. Keep what holds the border (or the agreed cap, with a stack one step back) ' +
2009
+ "and read a partner's stacks arriving there as a warning, whatever chat says.",
2010
+ source: S.forumTreatyBreaking,
2011
+ basis: 'derived',
2012
+ },
2013
+ {
2014
+ id: 'diplomacy-notice-early',
2015
+ topic: 'diplomacy',
2016
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
2017
+ text: 'One player admits ending truces in the last seconds of a turn so the partner cannot change orders; ' +
2018
+ 'others ask for a turn\'s warning. Read chat (warapp_get_chat) again just before you commit, and give ' +
2019
+ 'your own notice early, with the turns agreed, never with the attack.',
2020
+ source: S.forumTreatyBreaking,
2021
+ basis: 'derived',
2022
+ },
2023
+ {
2024
+ id: 'diplomacy-betrayal-cost',
2025
+ topic: 'diplomacy',
2026
+ when: on({ format: ['ffa'] }),
2027
+ text: 'Attacking without warning breaks no site rule, but it is remembered: a betrayed player may turn its ' +
2028
+ 'armies on the breaker for the rest of the game and block it from later ones. Count that before ending ' +
2029
+ 'any deal, and end one only with the notice agreed.',
2030
+ source: S.forumTreatyBreakingLater,
2031
+ basis: 'source',
2032
+ },
2033
+ {
2034
+ id: 'diplomacy-restate-terms',
2035
+ topic: 'diplomacy',
2036
+ when: on({ format: ['ffa'] }),
2037
+ text: 'In multi-day games players forget what they agreed: one was asked for a truce agreed six turns ' +
2038
+ 'earlier. Restate the terms in chat when they come to matter, and say in them whether stacking on the ' +
2039
+ 'shared border counts as a breach, since players read that differently.',
2040
+ source: S.forumTrucePsychology,
2041
+ basis: 'source',
2042
+ },
2043
+ {
2044
+ id: 'diplomacy-no-gang-up-calls',
2045
+ topic: 'diplomacy',
2046
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
2047
+ text: 'Calling the others to gang up on the leader, or posting its income, is resented by some players: one ' +
2048
+ 'forum poster calls it a popularity contest and blocks whoever sends it. Leave the board to make the ' +
2049
+ 'case, and keep any message to your own position and your own border.',
2050
+ source: S.forumFfaChatEtiquette,
2051
+ basis: 'derived',
2052
+ },
2053
+ {
2054
+ id: 'diplomacy-unspoken-truce',
2055
+ topic: 'diplomacy',
2056
+ when: on({ format: ['ffa'] }),
2057
+ text: 'Two neighbours who deploy nothing on their shared border for three or four turns are read as having ' +
2058
+ 'an unspoken truce, which even a league that banned deals accepted while no words passed. It binds ' +
2059
+ 'nobody: keep that border held as if it were live.',
2060
+ source: S.forumFfaLeague,
2061
+ basis: 'source',
2062
+ },
2063
+ {
2064
+ id: 'diplomacy-others-dealing',
2065
+ topic: 'diplomacy',
2066
+ when: on({ format: ['ffa'], phase: ['contact', 'late'] }),
2067
+ text: 'A neighbour left alone where attacking it would plainly pay is the sign posters cite of two players ' +
2068
+ 'teaming. It cannot be proven and breaks no rule, and nothing in the game punishes it; one answer given ' +
2069
+ 'is a deal of your own, where the game allows one.',
2070
+ source: S.forumHiddenTeaming,
2071
+ basis: 'source',
2072
+ },
2073
+ {
2074
+ id: 'diplomacy-two-against-one',
2075
+ topic: 'diplomacy',
2076
+ when: (p) => p.format === 'ffa' && p.opponents === 2,
2077
+ text: 'A forum poster says two against one happens a lot in free-for-alls, and asks whether the skill is not ' +
2078
+ 'being the one, or breaking up the two. Our reading, with three players: the pair that has stopped ' +
2079
+ 'fighting each other is the two; if it is the other two, give one a reason to turn before both reach you.',
2080
+ source: S.forumFfaGames,
2081
+ basis: 'derived',
2082
+ },
2083
+ {
2084
+ id: 'diplomacy-fog-checkable-terms',
2085
+ topic: 'diplomacy',
2086
+ when: on({ format: ['ffa'], fog: ['Foggy', 'ModerateFog', 'VeryFoggy', 'ExtremeFog'] }),
2087
+ text: 'Diplomacy-style games mostly use no fog or light fog so players can see that the rules are kept. Under ' +
2088
+ 'heavier fog agree only terms you can check from your own side, such as no attacks across named ' +
2089
+ 'territories (an attack on you always shows where it came from), not promises about what you cannot see.',
2090
+ source: S.diplomacyGames,
2091
+ basis: 'derived',
2092
+ },
2093
+ {
2094
+ id: 'diplomacy-card-farming',
2095
+ topic: 'diplomacy',
2096
+ when: on({ format: ['ffa'], anyCards: true }),
2097
+ text: 'Card farming: one neighbour gives up a territory and the other takes it back the same turn, so both ' +
2098
+ 'earn card pieces for a few armies (4 with the guard on, 2 without). Players who do not know it can ' +
2099
+ 'take it for a war; between two neighbours it is a deal, not a fight.',
2100
+ source: S.diplomacyGames,
2101
+ basis: 'source',
2102
+ },
2103
+ {
2104
+ id: 'teams-team-chat',
2105
+ topic: 'format',
2106
+ when: on({ format: ['teams'] }),
2107
+ text: 'Besides the public chat each team has its own, read only by the team. Plan there, never in public: ' +
2108
+ 'send with `channel: "team"` in warapp_send_chat, and read it every turn with warapp_get_chat.',
2109
+ source: S.teamGames,
2110
+ basis: 'source',
2111
+ },
2112
+ ];
2113
+ /** Every note, or one topic's, in the table's order. */
2114
+ export function generalNotes(topic) {
2115
+ return STRATEGY_NOTES.filter((n) => topic === undefined || n.topic === topic);
2116
+ }
2117
+ /** The notes that apply to a game with this profile (optionally one topic). */
2118
+ export function notesFor(profile, topic, context = {}) {
2119
+ return generalNotes(topic).filter((n) => n.when(profile, context));
2120
+ }
2121
+ /**
2122
+ * A game's profile from GameFeed alone: format, settings and phase. It is seen from the
2123
+ * first seated player — the format does not depend on the seat — and the phase reads
2124
+ * GameFeed's standing when there is one (without it no contact or territory-share late
2125
+ * game can be seen). The standing is `unknown`: it needs income estimates, which
2126
+ * warapp_plan_turn makes.
2127
+ */
2128
+ export function feedProfile(input) {
2129
+ const playing = input.players.filter((p) => (p.state ?? 'Playing') === 'Playing');
2130
+ const me = (playing[0] ?? input.players[0])?.id ?? 0;
2131
+ return gameProfile({
2132
+ graph: input.graph,
2133
+ board: input.board ?? { source: 'gamefeed', territories: [], verified: false },
2134
+ me,
2135
+ players: input.players.length ? input.players : [{ id: me }],
2136
+ ...(input.settings ? { settings: input.settings } : {}),
2137
+ ...(input.turn !== undefined ? { turn: input.turn } : {}),
2138
+ ...(input.picking !== undefined ? { picking: input.picking } : {}),
2139
+ income: 0,
2140
+ estimates: [],
2141
+ });
2142
+ }
2143
+ export const TOPIC_TITLES = {
2144
+ format: 'Format: 1v1, free-for-all, teams',
2145
+ settings: 'Settings',
2146
+ cards: 'Cards',
2147
+ reading: 'Reading the game',
2148
+ opening: 'The opening: picks and the first turns',
2149
+ timing: 'Timing: the order of orders within a turn',
2150
+ fighting: 'Fighting: stacks in contact, ahead and behind',
2151
+ diplomacy: 'Diplomacy: truces and deals in a free-for-all',
2152
+ map: 'The map',
2153
+ };
2154
+ /** Notes as markdown, grouped by topic, each with its id and source link. */
2155
+ export function notesMarkdown(notes, title = 'war.app strategy notes') {
2156
+ const lines = [`# ${title}`, ''];
2157
+ for (const t of NOTE_TOPICS) {
2158
+ const these = notes.filter((n) => n.topic === t);
2159
+ if (!these.length)
2160
+ continue;
2161
+ lines.push(`## ${TOPIC_TITLES[t]}`, '');
2162
+ for (const n of these) {
2163
+ lines.push(`- \`${n.id}\` — ${n.text} ([source](${n.source})${n.basis === 'derived' ? ', our reasoning from it' : ''})`);
2164
+ }
2165
+ lines.push('');
2166
+ }
2167
+ return lines.join('\n');
2168
+ }