diff options
-rw-r--r-- | events.txt | 8 | ||||
-rw-r--r-- | play.js | 4 | ||||
-rw-r--r-- | rules.js | 32 |
3 files changed, 41 insertions, 3 deletions
@@ -70,7 +70,13 @@ SHADED 3 EVENT 4 current REBEL_FACTIONS - log "NOT IMPLEMENTED" + prompt `Replace 1 Governor with an Obedient or Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.` + piece 1 is_governor(p) + set_piece_space + remove + auto_place (game.current) ELITE + event_4 + endpiece SHADED 4 current DS @@ -1176,6 +1176,10 @@ function on_update() { action_button("mi_attack", "Attack & Plunder") action_button("end_gifts", "Refuse Compromising Gifts") + // Event buttons + action_button("obedient", "Obedient") + action_button("rebelling", "Rebelling") + // Other buttons action_button("roll", "Roll") action_button("end_cavalry", "End Cavalry Selection") @@ -4354,6 +4354,29 @@ function vm_free_rally() { goto_rally_space() } +// VM: EVENT_4 + +function vm_event_4() { + game.state = "event_4" +} + +states.event_4 = { + prompt() { + event_prompt(`Obedient or Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.`) + + view.actions.obedient = 1 + view.actions.rebelling = 1 + }, + obedient() { + vm_next() + }, + rebelling() { + let p = find_piece(game.vm.s, game.current, ELITE) + to_rebel(p) + vm_next() + } +} + // VM: EVENT_25 function vm_event_25() { @@ -4387,7 +4410,6 @@ states.event_25 = { } - // === CONST === // Factions @@ -4522,7 +4544,13 @@ CODE[3 * 2 + 1] = [ // EVENT 4 CODE[4 * 2 + 0] = [ [ vm_current, REBEL_FACTIONS ], - [ vm_log, "NOT IMPLEMENTED" ], + [ vm_prompt, ()=>`Replace 1 Governor with an Obedient or Rebelling ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}.` ], + [ vm_piece, false, 1, 1, (p,s)=>is_governor(p) ], + [ vm_set_piece_space ], + [ vm_remove ], + [ vm_auto_place, false, 0, false, ()=>(game.current), ELITE ], + [ vm_event_4 ], + [ vm_endpiece ], [ vm_return ], ] |