diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-09 14:59:32 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-09 14:59:32 -0400 |
commit | 9b9cc01d9a8d8e177a8ba3f3b6245adc875ee506 (patch) | |
tree | 568e48341a6ae081bc6a3ac3aaf3a6efd444e9b9 | |
parent | 1499afe7b4fa9b7e87736106f83dff390d0e3ddb (diff) | |
download | vijayanagara-9b9cc01d9a8d8e177a8ba3f3b6245adc875ee506.tar.gz |
Event 28.
-rw-r--r-- | events.txt | 28 | ||||
-rw-r--r-- | rules.js | 59 |
2 files changed, 72 insertions, 15 deletions
@@ -571,10 +571,34 @@ SHADED 27 endspace EVENT 28 - log "NOT IMPLEMENTED" + add_influence BK + remove_influence VE + current BK + prompt "Spend a Cavalry token to place 2 Amirs and remove a Raja in Andhra." + space 1 ((s === S_ANDHRA) && (n_cavalry(BK) > 0)) + spend_cavalry 1 + auto_place BK ELITE + auto_place BK ELITE + piece 1 (is_raja(p) && is_piece_in_event_space(p)) + remove + endpiece + endspace SHADED 28 - log "NOT IMPLEMENTED" + current [DS VE] + if (game.current === DS) + prompt "In a space with Bahmani presence, you may add 2 Troops and free Attack without defenders." + else + prompt "In a space with Bahmani presence, you may add 2 Rajas and free Attack without defenders." + endif + space 1 (has_piece_faction(s, BK)) + if (game.current === DS) + place_opt 2 DS TROOPS + else + place_opt 2 VE ELITE + endif + free_attack BK + endspace EVENT 29 log "NOT IMPLEMENTED" @@ -997,6 +997,12 @@ function roll_attack() { if (game.cmd.target === BK && has_piece(game.cmd.where, BK, DISC)) game.dice[3] = 0 + + let is_shaded_28 = (game.vm && game.vm.fp === 57) + if (is_shaded_28) { + game.dice[4] = 0 + game.dice[5] = 0 + } } function attack_use_cavalry(d, f) { @@ -2933,7 +2939,7 @@ function gen_take_cavalry(faction) { return can_place } -function gen_take_faction_cavalry(faction) { +function gen_action_faction_cavalry(faction) { for (let c = 0; c <= LAST_CAVALRY; ++c) if (game.cavalry[c] === faction) gen_action_token(c) @@ -4255,6 +4261,15 @@ function vm_gain_cavalry() { goto_cavalry(vm_operand(1), "") } +function vm_spend_cavalry() { + let n = vm_inst(1) + for (let i = 0; i < n; ++i) { + game.cavalry[find_cavalry(game.current)] = AVAILABLE + } + log(`${faction_name[game.current]} spends ${n} Cavalry token.`) + vm_next() +} + // VM: INFLUENCE function vm_add_influence() { @@ -4379,7 +4394,7 @@ states.vm_steal_cavalry = { view.actions.skip = 1 } else { event_prompt(`Steal ${n} Calvary token from ${faction_name[f2]}.`) - gen_take_faction_cavalry(f2) + gen_action_faction_cavalry(f2) } }, token(c) { @@ -4524,9 +4539,7 @@ states.vm_conspire_trade = { // VM: EVENT_4 -function vm_event_4() { - game.state = "event_4" -} +function vm_event_4() { game.state = "event_4" } states.event_4 = { prompt() { @@ -4557,9 +4570,7 @@ function vm_shaded_6() { game.state = "campaign" } -function vm_shaded_6_2() { - game.state = "shaded_6_2" -} +function vm_shaded_6_2() { game.state = "shaded_6_2" } states.shaded_6_2 = { prompt() { @@ -4580,9 +4591,7 @@ states.shaded_6_2 = { // VM: EVENT_25 -function vm_event_25() { - game.state = "event_25" -} +function vm_event_25() { game.state = "event_25" } states.event_25 = { prompt() { @@ -5386,13 +5395,37 @@ CODE[27 * 2 + 1] = [ // EVENT 28 CODE[28 * 2 + 0] = [ - [ vm_log, "NOT IMPLEMENTED" ], + [ vm_add_influence, BK ], + [ vm_remove_influence, VE ], + [ vm_current, BK ], + [ vm_prompt, "Spend a Cavalry token to place 2 Amirs and remove a Raja in Andhra." ], + [ vm_space, true, 1, 1, (s)=>((s === S_ANDHRA) && (n_cavalry(BK) > 0)) ], + [ vm_spend_cavalry, 1 ], + [ vm_auto_place, false, 0, false, BK, ELITE ], + [ vm_auto_place, false, 0, false, BK, ELITE ], + [ vm_piece, false, 1, 1, (p,s)=>(is_raja(p) && is_piece_in_event_space(p)) ], + [ vm_remove ], + [ vm_endpiece ], + [ vm_endspace ], [ vm_return ], ] // SHADED 28 CODE[28 * 2 + 1] = [ - [ vm_log, "NOT IMPLEMENTED" ], + [ vm_current, [DS, VE] ], + [ vm_if, ()=>(game.current === DS) ], + [ vm_prompt, "In a space with Bahmani presence, you may add 2 Troops and free Attack without defenders." ], + [ vm_else ], + [ vm_prompt, "In a space with Bahmani presence, you may add 2 Rajas and free Attack without defenders." ], + [ vm_endif ], + [ vm_space, true, 1, 1, (s)=>(has_piece_faction(s, BK)) ], + [ vm_if, ()=>(game.current === DS) ], + [ vm_place, false, 1, 2, DS, TROOPS ], + [ vm_else ], + [ vm_place, false, 1, 2, VE, ELITE ], + [ vm_endif ], + [ vm_free_attack, BK ], + [ vm_endspace ], [ vm_return ], ] |