diff options
-rw-r--r-- | events.txt | 15 | ||||
-rw-r--r-- | rules.js | 21 |
2 files changed, 30 insertions, 6 deletions
@@ -17,14 +17,21 @@ SHADED 1 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.` + mark_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]}` + if (has_piece_faction(game.vm.s, BK) || has_piece_faction(game.vm.s, VE)) + to_rebel BK + to_rebel VE + log_br + log `Opposing Units to Rebelling in ${SPACE_NAME[game.vm.s]}` + endif + endspace + prompt "Free Attack in selected Space." + space 1 (s === game.vm.m[0] && can_attack_in_space(s)) free_attack endspace + EVENT 2 stay_eligible prompt "Remove up to 2 Delhi Sultanate Units in both Mountain Passes and Punjab." @@ -2142,7 +2142,7 @@ states.campaign = { } } else if (game.decree.campaign.length < 4) { for (let s of SPACES[game.decree.campaign.at(-1)].adjacent) { - if (!game.decree.campaign.includes(s) && is_campaign_succ(s)) + if (!game.decree.campaign.includes(s) && is_campaign_succ(s) && has_valid_campaign_connection(s)) gen_action_space(s) } } @@ -2225,6 +2225,17 @@ function is_campaign_succ(s) { return true } +function has_valid_campaign_connection(s) { + if (game.decree.campaign.length === 3) + return true + + for (let ss of SPACES[s].adjacent) { + if (!game.decree.campaign.includes(ss)) + return true + } + return false +} + /* REBELS DECREES */ function can_build() { @@ -5801,11 +5812,17 @@ CODE[1 * 2 + 1] = [ [ 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_mark_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_if, ()=>(has_piece_faction(game.vm.s, BK) || has_piece_faction(game.vm.s, VE)) ], [ vm_to_rebel, BK ], [ vm_to_rebel, VE ], - [ vm_log, "" ], + [ vm_log_br ], [ vm_log, ()=>`Opposing Units to Rebelling in ${SPACE_NAME[game.vm.s]}` ], + [ vm_endif ], + [ vm_endspace ], + [ vm_prompt, "Free Attack in selected Space." ], + [ vm_space, true, 1, 1, (s)=>(s === game.vm.m[0] && can_attack_in_space(s)) ], [ vm_free_attack ], [ vm_endspace ], [ vm_return ], |