summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-03-06 11:08:02 -0500
committerJoël Simoneau <simoneaujoel@gmail.com>2025-03-06 11:08:02 -0500
commitc437ca3e19203c5fbaa1e497dfc920fe052bdfbe (patch)
treebfae868aa0a53ec1a183810b72a812e225139fc0
parent6d20db3875e227cca6f4e1a9f9d99f53099e0c48 (diff)
downloadvijayanagara-c437ca3e19203c5fbaa1e497dfc920fe052bdfbe.tar.gz
Shaded 1.
-rw-r--r--events.txt12
-rw-r--r--rules.js45
2 files changed, 49 insertions, 8 deletions
diff --git a/events.txt b/events.txt
index 3658883..dc0939c 100644
--- a/events.txt
+++ b/events.txt
@@ -10,7 +10,17 @@ EVENT 1
endpiece
SHADED 1
- log "NOT IMPLEMENTED"
+ current DS
+ prompt "Select a Space to move in Units and Attack for free."
+ space 1 s
+ prompt `Move up to ${8-game.vm.pl.length} units in the selected space.`
+ move_to (game.vm.s) (is_ds_unit(p) && is_piece_on_map(p) && !is_piece_in_event_space(p) && game.vm.pl.length < 8)
+ to_rebel BK
+ to_rebel VE
+ log ""
+ log `Opposing Units to Rebelling in ${SPACE_NAME[game.vm.s]}`
+ free_attack
+ endspace
EVENT 2
prompt "Remove up to 2 Delhi Sultanate Units in both Mountain Passes and Punjab."
diff --git a/rules.js b/rules.js
index 0f667ee..71816b5 100644
--- a/rules.js
+++ b/rules.js
@@ -266,7 +266,7 @@ exports.setup = function (seed, scenario, _options) {
}
function setup_deck() {
- game.deck = [ 22, 38, 21, 39, 4, 1, 29, 15, 17, 16, 18, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
+ game.deck = [ 22, 1, 38, 21, 39, 4, 29, 15, 17, 16, 18, 5, 3, 36, 10, 37, 11, 2, 10, 1, 12, 13, 14 ]
}
function setup_standard() {
@@ -801,11 +801,14 @@ function init_command(type) {
}
function init_free_command(type, s) {
+ log_space(s, type)
game.cmd = {
type: type,
limited: s >= 0 ? 1 : 0,
free: 1,
spaces: [],
+ selected: [],
+ pieces: [],
where: s,
}
if (s >= 0)
@@ -4030,6 +4033,7 @@ function is_piece_in_event_space(p) {
function vm_move_to() {
push_summary()
+ game.vm.pl = []
game.state = "vm_move_to"
}
@@ -4053,19 +4057,20 @@ states.vm_move_to = {
},
piece(p) {
log_summary_place(p)
- place_piece(p, vm_inst(1))
+ place_piece(p, vm_operand(1))
+ set_add(game.vm.pl, p)
if (!vm_can_move_to(vm_inst(2)))
- end_vm_move_to(vm_inst(1))
+ end_vm_move_to(vm_operand(1))
},
skip() {
- end_vm_move_to(vm_inst(1))
+ end_vm_move_to(vm_operand(1))
}
}
function end_vm_move_to(s) {
if (game.summary && game.summary.length > 0) {
- log_space(vm_inst(1), "Move")
+ log_space(vm_operand(1), "Move")
pop_summary()
}
vm_next()
@@ -4253,6 +4258,13 @@ states.vm_steal = {
}
}
+// VM : REBEL
+
+function vm_to_rebel() {
+ to_rebel_space(game.vm.s, vm_operand(1))
+ vm_next()
+}
+
// VM: CONTROL
function vm_place_tributary() {
@@ -4267,6 +4279,15 @@ function vm_remove_tributary() {
vm_next()
}
+// VM: ATTACK
+
+function vm_free_attack() {
+ init_free_command("Attack", game.vm.s)
+ game.cmd.attacker = game.current
+ game.cmd.support_space = null
+ goto_attack_select()
+}
+
// VM: BUILD
function vm_free_build() {
@@ -4426,7 +4447,17 @@ CODE[1 * 2 + 0] = [
// SHADED 1
CODE[1 * 2 + 1] = [
- [ vm_log, "NOT IMPLEMENTED" ],
+ [ vm_current, DS ],
+ [ vm_prompt, "Select a Space to move in Units and Attack for free." ],
+ [ vm_space, true, 1, 1, (s)=>s ],
+ [ vm_prompt, ()=>`Move up to ${8-game.vm.pl.length} units in the selected space.` ],
+ [ vm_move_to, ()=>(game.vm.s), (p,s)=>(is_ds_unit(p) && is_piece_on_map(p) && !is_piece_in_event_space(p) && game.vm.pl.length < 8) ],
+ [ vm_to_rebel, BK ],
+ [ vm_to_rebel, VE ],
+ [ vm_log, "" ],
+ [ vm_log, ()=>`Opposing Units to Rebelling in ${SPACE_NAME[game.vm.s]}` ],
+ [ vm_free_attack ],
+ [ vm_endspace ],
[ vm_return ],
]
@@ -4476,7 +4507,7 @@ CODE[3 * 2 + 1] = [
// EVENT 4
CODE[4 * 2 + 0] = [
[ vm_current, REBEL_FACTIONS ],
- [ vm_prompt, "" ],
+ [ vm_log, "NOT IMPLEMENTED" ],
[ vm_return ],
]