summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-02-19 12:15:20 -0500
committerJoël Simoneau <simoneaujoel@gmail.com>2025-02-19 12:15:20 -0500
commit7f0d7c4203b263c28a91fed4fca8ca8d79e73101 (patch)
tree3cdf42ecf50541808e4f1caf31a3bda01fe573a3
parentcfe74b0842ddc33e281570e9c186868431529a36 (diff)
downloadvijayanagara-7f0d7c4203b263c28a91fed4fca8ca8d79e73101.tar.gz
Event 25.
-rw-r--r--events.txt14
-rw-r--r--rules.js50
2 files changed, 59 insertions, 5 deletions
diff --git a/events.txt b/events.txt
index 4316caa..cf9eb3c 100644
--- a/events.txt
+++ b/events.txt
@@ -416,10 +416,20 @@ SHADED 24
endspace
EVENT 25
- log "NOT IMPLEMENTED"
+ current REBEL_FACTIONS
+ event_25
SHADED 25
- log "NOT IMPLEMENTED"
+ current DS
+ prompt "Place up to 2 Troops in 3 Provinces adjance to Goa or Warangal."
+ space_opt 3 (is_adjacent_to_city(C_GOA, s) || is_adjacent_to_city(C_WARANGAL, s))
+ mark_space
+ place_opt 2 DS TROOPS
+ endspace
+ prompt "Govern in one of the selected Province."
+ space 1 (can_govern_in_space(s) && set_has(game.vm.m, s))
+ free_govern
+ endspace
EVENT 26
log "NOT IMPLEMENTED"
diff --git a/rules.js b/rules.js
index 4e0f149..237bebf 100644
--- a/rules.js
+++ b/rules.js
@@ -258,7 +258,7 @@ exports.setup = function (seed, scenario, _options) {
}
function setup_deck() {
- game.deck = [ 22, 21, 20, 35, 29, 15, 17, 16, 18, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
+ game.deck = [ 22, 21, 20, 25, 29, 15, 17, 16, 18, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
}
function setup_standard() {
@@ -4117,6 +4117,40 @@ function vm_free_rally() {
goto_rally_space()
}
+// VM: EVENT_25
+
+function vm_event_25() {
+ game.state = "event_25"
+}
+
+states.event_25 = {
+ prompt() {
+
+ if (game.current === BK) {
+ event_prompt("Trade or gain 3 Resources.")
+ view.actions.trade = 1
+ } else if (game.current === VE) {
+ event_prompt("Tax or gain 3 Resources.")
+ view.actions.tax = 1
+ }
+
+ gen_action_resources(game.current)
+ },
+ resources(f) {
+ add_resources(game.current, 3)
+ log_resources(game.current, 3)
+ vm_next()
+ },
+ tax() {
+ goto_tax()
+ },
+ trade() {
+ goto_trade()
+ }
+}
+
+
+
// === CONST ===
// Factions
@@ -4722,13 +4756,23 @@ CODE[24 * 2 + 1] = [
// EVENT 25
CODE[25 * 2 + 0] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_current, REBEL_FACTIONS ],
+ [ vm_event_25 ],
[ vm_return ],
]
// SHADED 25
CODE[25 * 2 + 1] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_current, DS ],
+ [ vm_prompt, "Place up to 2 Troops in 3 Provinces adjance to Goa or Warangal." ],
+ [ vm_space, true, 0, 3, (s)=>(is_adjacent_to_city(C_GOA, s) || is_adjacent_to_city(C_WARANGAL, s)) ],
+ [ vm_mark_space ],
+ [ vm_place, false, 1, 2, DS, TROOPS ],
+ [ vm_endspace ],
+ [ vm_prompt, "Govern in one of the selected Province." ],
+ [ vm_space, true, 1, 1, (s)=>(can_govern_in_space(s) && set_has(game.vm.m, s)) ],
+ [ vm_free_govern ],
+ [ vm_endspace ],
[ vm_return ],
]