summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.js3
-rw-r--r--rules.js129
2 files changed, 91 insertions, 41 deletions
diff --git a/play.js b/play.js
index 7182845..270e162 100644
--- a/play.js
+++ b/play.js
@@ -1639,6 +1639,9 @@ function on_update() {
action_button("end_wastage", "End Wastage")
action_button("end_withdraw", "End Withdraw")
+ action_button("add_militia", "Add Militia")
+ action_button("add_men_at_arms", "Add Men at Arms")
+
action_button("pass", "Pass")
action_button("done", "Done")
action_button("undo", "Undo")
diff --git a/rules.js b/rules.js
index aad1e19..930c3cf 100644
--- a/rules.js
+++ b/rules.js
@@ -432,8 +432,8 @@ const EVENT_LANCASTER_ESCAPE_SHIP = L3 // TODO
const EVENT_LANCASTER_BE_SENT_FOR = L4 // TODO
// This Levy. All Exiled lords on the calendar automatically muster inside their exile boxes (i'm not sure that part is coded yet)
const EVENT_LANCASTER_SUSPICION = L5 // TODO
-// Hold Event. Play at start of Battle AFTER ARRAY. Chose one friendly lord.
-// then choose enemy lord with Lower MODIFIED influence rating
+// Hold Event. Play at start of Battle AFTER ARRAY. Chose one friendly lord.
+// then choose enemy lord with Lower MODIFIED influence rating
// (through capabilities - function influence_capabilities())
// Influence check (cost is always 1)
// Success = disband enemy lord Failure no effect
@@ -451,12 +451,12 @@ const EVENT_LANCASTER_NEW_ACT_OF_PARLIAMENT = L10 // TODO
// This Campaign. Entire command card = is_first_action() === true
const EVENT_LANCASTER_BLOCKED_FORD = L11 // TODO
// Hold event. Play during APPROACH. This one is a bit tricky as it has odd interaction with EVENT PARLIAMENT'S TRUCE and CAPABILITY KING'S PARLEY
-// basically at best, you want the player that when he approaches,
+// basically at best, you want the player that when he approaches,
// he plays BLOCKED ford or not.
// but without the enemy knowing this.
// Then, the opponent may play PARLIAMENT'S TRUCE/KING'S PARLEY to cancel that approach
// and consider BLOCKED FORD to not have been used.
-// Blocked ford basically force the player being approached to choose battle rather
+// Blocked ford basically force the player being approached to choose battle rather
// then exile.
// Be careful about interaction aswell with EVENT FLANK ATTACK
// also note that there is a confirm_approach_sail state aswell.
@@ -465,12 +465,12 @@ const EVENT_LANCASTER_RAVINE = L12 // TODO
const EVENT_LANCASTER_ASPIELLES = L13 // TODO
// Play when you're the active player. Show all enemy Hidden cards and then
// select one of enemy's Lord mats to show it to you. Perhaps write those in the log ?
-const EVENT_LANCASTER_SCOTS = L14 // TODO
+const EVENT_LANCASTER_SCOTS = L14
// The addition by events are NEVER mandatory.
const EVENT_LANCASTER_HENRY_PRESSURES_PARLIAMENT = L15 // TODO
// count enemy vassals on all enemy lords and yorkists lose that amount of influence
const EVENT_LANCASTER_WARDEN_OF_THE_MARCHES = L16 // TODO
-// Play during Death and Disband step of Battle. All routed (flee or not)
+// Play during Death and Disband step of Battle. All routed (flee or not)
// select a stronghold in the north and go there (they will need to feed)
const EVENT_LANCASTER_MY_CROWN_IS_IN_MY_HEART = L17 // TODO
// This Levy 2 Parleys available in addition to the other Levy actions.
@@ -483,7 +483,7 @@ const EVENT_LANCASTER_HENRYS_PROCLAMATION = L19 // TODO
// Vassals to current turn box
const EVENT_LANCASTER_PARLIAMENT_TRUCE = L20 // TODO
// Can be played during Levy and Campaign
-// Read L11 Basically it forbids to go to locales where enemy are as long as
+// Read L11 Basically it forbids to go to locales where enemy are as long as
// this event is active (until end of this campaign)
const EVENT_LANCASTER_FRENCH_FLEET = L21 // TODO
// Forbid sail
@@ -492,7 +492,7 @@ const EVENT_LANCASTER_FRENCH_TROOPS = L22 // TODO
const EVENT_LANCASTER_WARWICKS_PROPAGANDA = [ L23, L24 ] // TODO
// Select 1 stronghold, then Yorkists may pay to keep. Then select a second, then Yorkist may pay to keep. Then select a third, then Yorkist may pay to keep
const EVENT_LANCASTER_WELSH_REBELLION = L25 // TODO
-// Works like Torzokh event in Nevsky with Domash, but with troops.
+// Works like Torzokh event in Nevsky with Domash, but with troops.
// if no Yorkist lord in Wales, remove 2 Yorkist favour (if possible)
const EVENT_LANCASTER_HENRY_RELEASED = L26 // TODO
// If London lancastrian, they gain 5 influence
@@ -515,7 +515,7 @@ const EVENT_LANCASTER_FRENCH_WAR_LOANS = L30 // TODO
const EVENT_LANCASTER_ROBINS_REBELLION = L31 // TODO
// It allows 3 shifts. You can't instantly go from Yorkists to lancastrians (there is a function for shifting)
const EVENT_LANCASTER_TUDOR_BANNERS = L32 // TODO
-// If Henry VI on friendly stronghold, all adjacent stronghold with no Yorkist lord get Lancastrian favour marker
+// If Henry VI on friendly stronghold, all adjacent stronghold with no Yorkist lord get Lancastrian favour marker
// works for both neutral and enemy locales
const EVENT_LANCASTER_SURPRISE_LANDING = L33 // TODO
// After a Sail, allows a free March action. NOT POSSIBLE ON PATH
@@ -535,13 +535,13 @@ const EVENT_YORK_FLANK_ATTACK = Y2 // TODO
const EVENT_YORK_ESCAPE_SHIP = [ Y3, Y9 ] // TODO
// Hold event. Play during the game state death_or_disband if battle locale is friendly and has a route of friendly locales (like supply) to a friendly port
const EVENT_YORK_JACK_CADE = Y4 // TODO
-// Each yorkist lord adjacent to dominated areas (inside tides_calc - you can probably add function about
-// directly checking if a region is dominated rather than checking individual cases.
+// Each yorkist lord adjacent to dominated areas (inside tides_calc - you can probably add function about
+// directly checking if a region is dominated rather than checking individual cases.
// The bottom line is that capability affects the Domination status
// ( adds 2 free successful parleys (no influence cost exceot if EVENT_YORK_AN_HONEST_TALE_SPEEDS_BEST active)
const EVENT_YORK_SUSPICION = Y5 // TODO
-// Hold Event. Play at start of Battle AFTER ARRAY. Chose one friendly lord.
-// then choose enemy lord with Lower MODIFIED influence rating
+// Hold Event. Play at start of Battle AFTER ARRAY. Chose one friendly lord.
+// then choose enemy lord with Lower MODIFIED influence rating
// (through capabilities - function influence_capabilities())
// Influence check (cost is always 1)
// Success = disband enemy lord Failure no effect
@@ -550,25 +550,25 @@ const EVENT_YORK_SEAMANSHIP = Y6 // TODO
const EVENT_YORK_YORKISTS_BLOCK_PARLIAMENT = Y7 // TODO
// No Levy vassal possible except by L7 FOR_TRUST_NOT_HIM
const EVENT_YORK_EXILE_PACT = Y8 // TODO
-// Placing = Not considered a march or sail or exile action. Simply move it
+// Placing = Not considered a march or sail or exile action. Simply move it
// to the scenario exile box without any other change.
// Marshall/Lieutenant may not take group (because no sail or march)
const EVENT_YORK_TAX_COLLECTORS = Y10 // TODO
-// Each lord may take a Tax action and receive double the coin. still exhaust and
+// Each lord may take a Tax action and receive double the coin. still exhaust and
// do the necessary influence checks if needed.
const EVENT_YORK_BLOCKED_FORD = Y11 // TODO
// Hold event. Play during APPROACH. This one is a bit tricky as it has odd interaction with EVENT PARLIAMENT'S TRUCE and CAPABILITY KING'S PARLEY
-// basically at best, you want the player that when he approaches,
+// basically at best, you want the player that when he approaches,
// he plays BLOCKED ford or not.
// but without the enemy knowing this.
// Then, the opponent may play PARLIAMENT'S TRUCE/KING'S PARLEY to cancel that approach
// and consider BLOCKED FORD to not have been used.
-// Blocked ford basically force the player being approached to choose battle rather
+// Blocked ford basically force the player being approached to choose battle rather
// then exile.
// Be careful about interaction aswell with EVENT FLANK ATTACK
const EVENT_YORK_PARLIAMENTS_TRUCE = Y12 // TODO
// Can be played during Levy and Campaign
-// Read L11 Basically it forbids to go to locales where enemy are as long as
+// Read L11 Basically it forbids to go to locales where enemy are as long as
// this event is active (until end of this campaign)
const EVENT_YORK_ASPIELLES = Y13 // TODO
// Play when you're the active player. Show all enemy Hidden cards and then
@@ -576,17 +576,17 @@ const EVENT_YORK_ASPIELLES = Y13 // TODO
const EVENT_YORK_RICHARD_OF_YORK = Y14 // TODO
// This Levy, game state parley, score += 1
const EVENT_YORK_LONDON_FOR_YORK = Y15 // TODO
-// That one is a bit tricky :
+// That one is a bit tricky :
// If Yorkist, Add a SECOND favour marker there
-// No Lancastrian Parley there unless L17 EVENT_LANCASTER_MY_CROWN_IS_IN_MY_HEART
+// No Lancastrian Parley there unless L17 EVENT_LANCASTER_MY_CROWN_IS_IN_MY_HEART
// or L18 events are active EVENT_LANCASTER_PARLIAMENT_VOTES
-// Henry VI/Margaret if their Seats are there may still Muster there BUT
+// Henry VI/Margaret if their Seats are there may still Muster there BUT
// it will not change the locale favour (contrary to other Muster than also change)
// the locale where the lord mustered to friendly
const EVENT_YORK_THE_COMMONS = Y16 // TODO
// This Levy Same as other add X events. Never mandatory
const EVENT_YORK_SHEWOLF_OF_FRANCE = Y17 // TODO
-// Shift each yorkists vassal marker +1 to the right
+// Shift each yorkists vassal marker +1 to the right
const EVENT_YORK_SUCCESSION = Y18 // TODO
// This Levy 1 Parley action each levy for each Lancastrian lord cost 1 less
// and automatic success (success = true)
@@ -603,10 +603,10 @@ const EVENT_YORK_LOYALTY_AND_TRUST = Y22 // TODO
const EVENT_YORK_CHARLES_THE_BOLD = Y23 // TODO
// Each lancastrian lord on map gain 1 Coin and 1 Provender
const EVENT_YORK_SUN_IN_SPLENDOUR = Y24 // TODO
-// Hold event only available in Levy.
+// Hold event only available in Levy.
// Muster Edward IV at Any friendly locale (no seat needed) with no enemy lord
const EVENT_YORK_OWAIN_GLYNDWR = Y25 // TODO
-// Impossible for Lancastrians to select stronghold in Wales after clicking on Sail or
+// Impossible for Lancastrians to select stronghold in Wales after clicking on Sail or
// for any March action. (even for "free march" or other sail enabling events)
const EVENT_YORK_DUBIOUS_CLARENCE = Y26 // TODO
// If both Edward IV and Clarence on map (on map = not calendar) Yorkist may influence check
@@ -617,10 +617,10 @@ const EVENT_YORK_GLOUCESTER_AS_HEIR = Y28 // TODO
// +3 Parley actions for Gloucester (still need to pay for them)
// Note that this event is very important for the I-III scenario (will need to put a flag if that card has been played or not)
const EVENT_YORK_DORSET = Y29 // TODO
-// This Campaign. Devon free successful parley at
+// This Campaign. Devon free successful parley at
// Wells, Dorchester, Launceston, and Plymouth
// If he/group has a ship, all stronghold adjacent to the English channel (data.way_port_2)
-// If he/group has ship and GREAT SHIPS CAPABILITY (Y6), all stronghold adjacent to all seats
+// If he/group has ship and GREAT SHIPS CAPABILITY (Y6), all stronghold adjacent to all seats
// (data.way_port_2, data.way_port_1, data.way_port_3)
const EVENT_YORK_REGROUP = Y30 // TODO
// Play in Battle at Battle Array step.
@@ -638,7 +638,7 @@ const EVENT_YORK_THE_KINGS_NAME = Y32 // TODO
const EVENT_YORK_EDWARD_V = Y33 // TODO
// Hold event : +3 Lordship for Gloucester 1 or 2 (same as nevsky events)
const EVENT_YORK_AN_HONEST_TALE_SPEEDS_BEST = Y34 // TODO
-// This Levy & This Campaign, +1 Extra influence point for all Parley actions (even for free successful cards like
+// This Levy & This Campaign, +1 Extra influence point for all Parley actions (even for free successful cards like
const EVENT_YORK_PRIVY_COUNCIL = Y35 // TODO
// This Levy. Yorkists influence ratings +1
const EVENT_YORK_SWIFT_MANEUVER = Y36 // TODO
@@ -2260,23 +2260,12 @@ function goto_immediate_event(c) {
set_add(game.events, c)
return end_immediate_event()
*/
- // Immediate effect
- /* case EVENT_RUSSIAN_DEATH_OF_THE_POPE:
- set_add(game.events, c)
- return goto_russian_event_death_of_the_pope()
- case EVENT_RUSSIAN_VALDEMAR:
- set_add(game.events, c)
- return goto_russian_event_valdemar()
- case EVENT_RUSSIAN_DIETRICH_VON_GRUNINGEN:
- set_add(game.events, c)
- return goto_russian_event_dietrich()
-
- */
+ // Immediate effect
// Discard - Immediate Events
- /*case EVENT_LANCASTER_SCOTS:
+ case EVENT_LANCASTER_SCOTS:
return goto_lancaster_event_scots()
- case EVENT_LANCASTER_HENRY_PRESSURES_PARLIAMENT:
+ /*case EVENT_LANCASTER_HENRY_PRESSURES_PARLIAMENT:
return goto_lancaster_event_henry_pressures_parliament()
case EVENT_LANCASTER_HENRYS_PROCLAMATION:
return goto_lancaster_event_henrys_proclamation()
@@ -2326,6 +2315,64 @@ function end_immediate_event() {
// === EVENTS: UNIQUE IMMEDIATE EVENTS ===
+// === EVENTS: LANCASTER SCOTS EVENT ===
+
+function goto_lancaster_event_scots() {
+ game.state = "scots"
+ game.who = NOBODY
+}
+
+function end_lancaster_event_scots() {
+ clear_lords_moved()
+ end_immediate_event()
+}
+
+states.scots = {
+ inactive: "Scots",
+ prompt() {
+ view.prompt = "Scots: You may add 1 Men-at-Arms and 1 Militia to each Lord."
+ view.actions.done = 1
+
+ for (let lord = first_lancaster_lord; lord <= last_lancaster_lord; lord++) {
+ if (is_lord_on_map(lord) && is_lord_unfed(lord) < 3) {
+ gen_action_lord(lord)
+ }
+ }
+
+ if (game.who !== NOBODY) {
+ let troops = is_lord_unfed(game.who)
+ if ((troops & 1) !== 1)
+ gen_action("add_militia")
+ if (((troops >> 1) & 1) !== 1)
+ gen_action("add_men_at_arms")
+ }
+ },
+ done() {
+ end_lancaster_event_scots()
+ },
+ add_militia() {
+ add_lord_forces(game.who, MILITIA, 1)
+ let troops = is_lord_unfed(game.who)
+ set_lord_unfed(game.who, troops + 1)
+
+ if (troops !== 0) {
+ game.who = NOBODY
+ }
+ },
+ add_men_at_arms() {
+ add_lord_forces(game.who, MEN_AT_ARMS, 1)
+ let troops = is_lord_unfed(game.who)
+ set_lord_unfed(game.who, troops + 2)
+
+ if (troops !== 0) {
+ game.who = NOBODY
+ }
+ },
+ lord(lord) {
+ game.who = lord
+ }
+}
+
// === EVENTS: SHIFT LORD OR SERVICE (IMMEDIATE) ===
/*
function prompt_shift_lord_on_calendar(boxes) {