summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-24 02:42:32 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-24 02:42:32 +0200
commit7df24c0ab1c6d0875c0aa6fb6c6956f78d218c18 (patch)
tree97b38f8082a338d92e596f1635b6b04b7095aa63 /rules.js
parentbaec22320d3d41be6ad1f144a1e85204f0f4f56c (diff)
downloadmaria-7df24c0ab1c6d0875c0aa6fb6c6956f78d218c18.tar.gz
fix annexation (remove correct markers)
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js77
1 files changed, 32 insertions, 45 deletions
diff --git a/rules.js b/rules.js
index d0b8338..ba1f512 100644
--- a/rules.js
+++ b/rules.js
@@ -1,40 +1,33 @@
"use strict"
-// RULE QUESTIONS: subsidy contract - if major fortress enemy controlled? - ignore contract or waste card?
-
-/* TODO
-
-check inactive prompts
-check push_undo/clear_undo for political phase and political changes
+// TODO: subsidy contracts
+// TODO: remove hussars when retreating across them
+// TODO: austria + pragmatic action stage intermixing on flanders
+// TODO: austria + pragmatic stack if both agree
-add undo steps and pauses for saxony neutral return pieces
+/*
-show who controls which power in player list
+OPTIMIZE: fewer/smarter/smaller lists, smarter power control checks
+OPTIMIZE: range checks instead of set checks
-austria/pragmatic move order on flanders (start with pragmatic)
-only stack if agree (undo/move to previous space)
+POLISH: check inactive prompts
+POLISH: check push_undo/clear_undo for political phase and political changes
+POLISH: add undo steps and pauses for saxony neutral return pieces
-winter scoring
+UI: show who controls which power in player list
+UI: show TC modifiers
+UI: show subsidy contracts
when are subsidies given?
+when are subsidies created?
example france subsidy to prussia
at france's stage?
at prussia's stage?
-tc subsidies
- minor when major fortress enemy occupied
-subsidy contracts
-imperial election
+ what happens to subsidy when minor's fortress is enemy occupied
*/
-// TODO: austria/pragmatic action stage - show both sides cards and interleave movement on flanders map
-// PLAN: move all austria on bohemia first, then alternate pragmatic and austria activations on flanders map
-// TODO: confirm mixed stack creation on flanders map (force "undo" to previous location if denied?)
-
-// TODO: TC subsidies
-// TODO: subsidy markers?
-
const R_LOUIS_XV = "Louis XV"
const R_FREDERICK = "Frederick"
const R_MARIA_THERESA = "Maria Theresa"
@@ -1181,6 +1174,9 @@ function end_action_stage() {
if (check_instant_victory())
return
+ if (game.power === P_PRUSSIA)
+ game.flags &= ~F_PRUSSIA_NEUTRAL
+
if (game.power === P_PRUSSIA && has_prussia_conquered_silesia()) {
game.state = "offer_peace"
return
@@ -1627,8 +1623,6 @@ function resume_supply() {
goto_supply_suffer()
else
end_supply()
- // TODO: pause
- // game.state = "supply_done"
}
function goto_supply_hussars() {
@@ -2252,7 +2246,7 @@ function search_force_march(p, came_from, start) {
return seen
}
-// TODO: choose not-shortest path to capture hussars during force march?
+// WONTFIX: choose not-shortest path to capture hussars during force march?
states.force_march = {
inactive: "move",
prompt() {
@@ -2898,8 +2892,6 @@ function next_combat() {
if (game.combat.length > 0)
game.state = "combat"
else
- // TODO: a bit abrupt, but saves time if
- // game.state = "combat_done"
goto_retroactive_conquest()
}
@@ -2918,18 +2910,6 @@ states.combat = {
},
}
-// TODO: unused for now
-states.combat_done = {
- inactive: "attack",
- prompt() {
- prompt("Combat done.")
- view.actions.end_combat = 1
- },
- end_combat() {
- goto_retroactive_conquest()
- },
-}
-
states.combat_target = {
inactive: "attack",
prompt() {
@@ -4052,11 +4032,13 @@ function goto_mannheim_to_french_control() {
next_execute_political_card()
}
-function goto_pragmatic_general_to_england() {
- throw "TODO"
+function goto_france_minus_tc_this_turn() {
+ log("France -1 TC this turn.")
+ game.flags |= F_WAR_OF_JENKINS_EAR
+ next_execute_political_card()
}
-function goto_france_minus_tc_this_turn() {
+function goto_pragmatic_general_to_england() {
throw "TODO"
}
@@ -4504,20 +4486,25 @@ function goto_annex_silesia() {
game.flags |= F_PRUSSIA_NEUTRAL
// remove all austrian markers in prussia
- // set aside half prussian markers in prussia
- let n = 0
for (let s of all_prussian_and_silesian_fortresses) {
let pow = map_get(game.victory, s, -1)
if (pow === P_AUSTRIA) {
map_delete(game.victory, s)
}
+ }
+ log("Removed all Austrian victory markers in Prussia.")
+
+ // set aside half prussian markers in prussia
+ let n = 0
+ for (let s of all_core_austria_fortresses) {
+ let pow = map_get(game.victory, s, -1)
if (pow === P_PRUSSIA) {
map_delete(game.victory, s)
++n
}
}
+ log("Removed " + n + " Prussian victory markers in Austria.")
n = (n + 1) >> 1
- log("Removed all Austrian victory markers.")
log("Set aside " + n + " Prussian victory markers.")
game.vp[SET_ASIDE_PRUSSIA] = n