summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-25 11:58:58 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-26 00:00:01 +0200
commit5d81b4294bd8f9b20ac8a396a185f6cf9550c00f (patch)
tree1fd4e5fd1bbab268f3421cef825d6504b39d5370 /rules.js
parent7122c8101e49300b7e29266a939f355e9eb8ffd3 (diff)
download1989-dawn-of-freedom-5d81b4294bd8f9b20ac8a396a185f6cf9550c00f.tar.gz
Update client.
Fixed some spelling errors in space data table. Create tools directory and add Makefile. Add layout.svg with boxes drawn on top of locations. Add genlayout.js to create list of box locations. Add gencolors.js to create beveled marker border colors. Major rewrite of play.js and play.css with official assets.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js71
1 files changed, 34 insertions, 37 deletions
diff --git a/rules.js b/rules.js
index 877c4d8..6ce54dd 100644
--- a/rules.js
+++ b/rules.js
@@ -268,18 +268,13 @@ exports.view = function(state, player) {
// === ACTIONS ===========
function gen_action(action, argument) {
-//console.log('gen_action called with ', action, ' and ', argument)
if (argument === undefined) {
- //console.log('argument undefined')
view.actions[action] = 1
} else {
- if (!(action in view.actions)) {
- //console.log('push argument')
+ if (!(action in view.actions))
view.actions[action] = []
- }
view.actions[action].push(argument)
}
- //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action])
}
function gen_action_space(space){
@@ -9013,6 +9008,7 @@ states.vm_support_falters = {
/* =================== EVENTS ================================ */
// #region GENERATED EVENT CODE
+
const CODE = []
CODE[1] = [ // Legacy of Martial Law*
@@ -9875,43 +9871,44 @@ CODE[110] = [ // Malta Summit*
[ vm_remove_opp_infl, 5 ],
[ vm_return ],
]
-// #endregion
-
-// ============= TIANANMEN SQUARE TRACK AWARDS ====================
-CODE[203] = [//Tiananmen Square space 3 award
- [vm_tst_3],
- [vm_return]
-]
-CODE[204] = [//Tiananmen Square space 4 award
- [vm_valid_spaces_opponent],
- [vm_tst_4],
- [vm_return]
+CODE[203] = [ // Tiananmen Square space 3 award
+ [ vm_tst_3 ],
+ [ vm_return ],
]
-CODE[206] = [//Tiananmen Square space 6
- [vm_valid_spaces_sc],
- [vm_tst_6],
- [vm_return]
+
+CODE[204] = [ // Tiananmen Square space 4 award
+ [ vm_valid_spaces_opponent ],
+ [ vm_tst_4 ],
+ [ vm_return ],
]
-CODE[208] = [//Tiananmen Square space 8 event
- [vm_tst_8],
- [vm_return]
+
+CODE[206] = [ // Tiananmen Square space 6
+ [ vm_valid_spaces_sc ],
+ [ vm_tst_6 ],
+ [ vm_return ],
]
-// ============= POWER STRUGGLE WILDCARDS =========================
+CODE[208] = [ // Tiananmen Square space 8 event
+ [ vm_tst_8 ],
+ [ vm_return ],
+]
-CODE[349] = [//Scare Tactics
- [vm_scare_tactics],
- [vm_valid_spaces_country_opp],
- [vm_prompt, ()=>` from ${country_name(game.vm_active_country)}`],
- [vm_remove_opp_infl, 1],
- [vm_return]
+CODE[349] = [ // Scare Tactics
+ [ vm_scare_tactics ],
+ [ vm_valid_spaces_country_opp ],
+ [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ],
+ [ vm_remove_opp_infl, 1 ],
+ [ vm_return ],
]
-CODE[350] = [//Support Surges
- [vm_support_surges],
- [vm_return]
+
+CODE[350] = [ // Support Surges
+ [ vm_support_surges ],
+ [ vm_return ],
]
-CODE[351] = [//Support Falters
- [vm_support_falters],
- [vm_return]
+
+CODE[351] = [ // Support Falters
+ [ vm_support_falters ],
+ [ vm_return ],
]
+// #endregion