summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-03 19:14:10 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-03 19:14:22 +0200
commit8cf25a43b38905e761b0944becda4def592e986b (patch)
tree26c55656374d533178aa0bb03916f6c24cdff5c5
parent8c1dabca24e5dabcb42a62fae88fde73a98a1466 (diff)
downloadplantagenet-8cf25a43b38905e761b0944becda4def592e986b.tar.gz
show back side of vassal when disbanded
-rw-r--r--images/vassal_beaumont_b.pngbin0 -> 10005 bytes
-rw-r--r--images/vassal_bonville_b.pngbin0 -> 6495 bytes
-rw-r--r--images/vassal_clifford_b.pngbin0 -> 5255 bytes
-rw-r--r--images/vassal_devon_b.pngbin0 -> 7246 bytes
-rw-r--r--images/vassal_dudley_b.pngbin0 -> 8417 bytes
-rw-r--r--images/vassal_edward_b.pngbin0 -> 6180 bytes
-rw-r--r--images/vassal_essex_b.pngbin0 -> 8970 bytes
-rw-r--r--images/vassal_fauconberg_b.pngbin0 -> 7008 bytes
-rw-r--r--images/vassal_hastings_b.pngbin0 -> 3325 bytes
-rw-r--r--images/vassal_montagu_b.pngbin0 -> 3324 bytes
-rw-r--r--images/vassal_norfolk_b.pngbin0 -> 9600 bytes
-rw-r--r--images/vassal_oxford_b.pngbin0 -> 7601 bytes
-rw-r--r--images/vassal_shrewsbury_b.pngbin0 -> 9676 bytes
-rw-r--r--images/vassal_stanley_b.pngbin0 -> 5990 bytes
-rw-r--r--images/vassal_suffolk_b.pngbin0 -> 8957 bytes
-rw-r--r--images/vassal_thomas_stanley_b.pngbin0 -> 4621 bytes
-rw-r--r--images/vassal_trollope_b.pngbin0 -> 4427 bytes
-rw-r--r--images/vassal_westmoreland_b.pngbin0 -> 5027 bytes
-rw-r--r--images/vassal_worcester_b.pngbin0 -> 8976 bytes
-rw-r--r--play.js60
-rw-r--r--rules.ts65
-rw-r--r--tools/markers3.sh38
22 files changed, 89 insertions, 74 deletions
diff --git a/images/vassal_beaumont_b.png b/images/vassal_beaumont_b.png
new file mode 100644
index 0000000..e279cc8
--- /dev/null
+++ b/images/vassal_beaumont_b.png
Binary files differ
diff --git a/images/vassal_bonville_b.png b/images/vassal_bonville_b.png
new file mode 100644
index 0000000..9b5381b
--- /dev/null
+++ b/images/vassal_bonville_b.png
Binary files differ
diff --git a/images/vassal_clifford_b.png b/images/vassal_clifford_b.png
new file mode 100644
index 0000000..fc62cb3
--- /dev/null
+++ b/images/vassal_clifford_b.png
Binary files differ
diff --git a/images/vassal_devon_b.png b/images/vassal_devon_b.png
new file mode 100644
index 0000000..6c2574d
--- /dev/null
+++ b/images/vassal_devon_b.png
Binary files differ
diff --git a/images/vassal_dudley_b.png b/images/vassal_dudley_b.png
new file mode 100644
index 0000000..fe149c9
--- /dev/null
+++ b/images/vassal_dudley_b.png
Binary files differ
diff --git a/images/vassal_edward_b.png b/images/vassal_edward_b.png
new file mode 100644
index 0000000..3c8cf9b
--- /dev/null
+++ b/images/vassal_edward_b.png
Binary files differ
diff --git a/images/vassal_essex_b.png b/images/vassal_essex_b.png
new file mode 100644
index 0000000..4b18255
--- /dev/null
+++ b/images/vassal_essex_b.png
Binary files differ
diff --git a/images/vassal_fauconberg_b.png b/images/vassal_fauconberg_b.png
new file mode 100644
index 0000000..e42d501
--- /dev/null
+++ b/images/vassal_fauconberg_b.png
Binary files differ
diff --git a/images/vassal_hastings_b.png b/images/vassal_hastings_b.png
new file mode 100644
index 0000000..36f224a
--- /dev/null
+++ b/images/vassal_hastings_b.png
Binary files differ
diff --git a/images/vassal_montagu_b.png b/images/vassal_montagu_b.png
new file mode 100644
index 0000000..f66ae1e
--- /dev/null
+++ b/images/vassal_montagu_b.png
Binary files differ
diff --git a/images/vassal_norfolk_b.png b/images/vassal_norfolk_b.png
new file mode 100644
index 0000000..9297d85
--- /dev/null
+++ b/images/vassal_norfolk_b.png
Binary files differ
diff --git a/images/vassal_oxford_b.png b/images/vassal_oxford_b.png
new file mode 100644
index 0000000..7a4a436
--- /dev/null
+++ b/images/vassal_oxford_b.png
Binary files differ
diff --git a/images/vassal_shrewsbury_b.png b/images/vassal_shrewsbury_b.png
new file mode 100644
index 0000000..6b84908
--- /dev/null
+++ b/images/vassal_shrewsbury_b.png
Binary files differ
diff --git a/images/vassal_stanley_b.png b/images/vassal_stanley_b.png
new file mode 100644
index 0000000..af1b34c
--- /dev/null
+++ b/images/vassal_stanley_b.png
Binary files differ
diff --git a/images/vassal_suffolk_b.png b/images/vassal_suffolk_b.png
new file mode 100644
index 0000000..ba6a5a6
--- /dev/null
+++ b/images/vassal_suffolk_b.png
Binary files differ
diff --git a/images/vassal_thomas_stanley_b.png b/images/vassal_thomas_stanley_b.png
new file mode 100644
index 0000000..353ebdf
--- /dev/null
+++ b/images/vassal_thomas_stanley_b.png
Binary files differ
diff --git a/images/vassal_trollope_b.png b/images/vassal_trollope_b.png
new file mode 100644
index 0000000..355d3e5
--- /dev/null
+++ b/images/vassal_trollope_b.png
Binary files differ
diff --git a/images/vassal_westmoreland_b.png b/images/vassal_westmoreland_b.png
new file mode 100644
index 0000000..dc4d641
--- /dev/null
+++ b/images/vassal_westmoreland_b.png
Binary files differ
diff --git a/images/vassal_worcester_b.png b/images/vassal_worcester_b.png
new file mode 100644
index 0000000..5105eeb
--- /dev/null
+++ b/images/vassal_worcester_b.png
Binary files differ
diff --git a/play.js b/play.js
index d1a029e..7ef3baf 100644
--- a/play.js
+++ b/play.js
@@ -61,9 +61,13 @@ const LONDON_FOR_YORK = 300
const CAPTURE_OF_THE_KING = 400 // Ia. special rule (400 + lord ID that has him captured)
const VASSAL_READY = 29
-const VASSAL_CALENDAR = 30
+const VASSAL_DISBANDED = 30
const VASSAL_OUT_OF_PLAY = 31
+function is_special_vassal(v) {
+ return data.vassals[v].box === null
+}
+
const TOWN = "town"
const CITY = "city"
const FORTRESS = "fortress"
@@ -658,7 +662,7 @@ function build_map() {
data.vassals.forEach((vassal, ix) => {
let e
- if (vassal.box) {
+ if (!is_special_vassal(ix)) {
let { x, y, w, h } = vassal.box
e = ui.vassal_map[ix] = document.createElement("div")
let xc = Math.round(x + w / 2)
@@ -670,14 +674,14 @@ function build_map() {
register_action(e, "vassal", ix)
register_tooltip(e, data.vassals[ix].name)
document.getElementById("pieces").appendChild(e)
- }
- e = ui.vassal_cal[ix] = document.createElement("div")
- e.className = "hide unit vassal vassal_" + vassal.name.toLowerCase()
- e.style.position = "absolute"
- register_action(e, "vassal", ix)
- register_tooltip(e, data.vassals[ix].name)
- document.getElementById("pieces").appendChild(e)
+ e = ui.vassal_cal[ix] = document.createElement("div")
+ e.className = "hide unit vassal vassal_" + vassal.name.toLowerCase()
+ e.style.position = "absolute"
+ register_action(e, "vassal", ix)
+ register_tooltip(e, data.vassals[ix].name)
+ document.getElementById("pieces").appendChild(e)
+ }
e = ui.vassal_mat[ix] = document.createElement("div")
e.className = "unit vassal vassal_" + vassal.name.toLowerCase()
@@ -1253,36 +1257,30 @@ function update_court() {
function update_vassals() {
for (let v = first_vassal; v <= last_vassal; v++) {
+ if (is_special_vassal(v))
+ return
+
let loc = get_vassal_lord(v)
let srv = get_vassal_service(v)
+
if (loc === VASSAL_OUT_OF_PLAY) {
// not present
+ ui.vassal_map[v].classList.add("hide")
ui.vassal_cal[v].classList.add("hide")
- if (ui.vassal_map[v]) {
- ui.vassal_map[v].classList.add("hide")
- }
} else if (loc === VASSAL_READY) {
- // on map
+ // ready on map
+ ui.vassal_map[v].classList.remove("hide")
+ ui.vassal_map[v].classList.toggle("action", is_action("vassal", v))
+ ui.vassal_map[v].classList.toggle("selected", v === view.vassal || set_has(view.vassal, v))
ui.vassal_cal[v].classList.add("hide")
- if (ui.vassal_map[v]) {
- ui.vassal_map[v].classList.remove("hide")
- ui.vassal_map[v].classList.toggle("action", is_action("vassal", v))
- ui.vassal_map[v].classList.toggle("selected", v === view.vassal || set_has(view.vassal, v))
- }
} else {
- // on calendar (+ maybe on lord mat)
- if (data.vassals[v].service > 0) {
- ui.vassal_cal[v].classList.remove("hide")
- ui.vassal_cal[v].classList.toggle("action", is_action("vassal", v))
- ui.vassal_cal[v].classList.toggle("selected", v === view.vassal || set_has(view.vassal, v))
- calendar_layout_vassal[srv].push(ui.vassal_cal[v])
- } else {
- // special vassal not on calendar
- ui.vassal_cal[v].classList.add("hide")
- }
- if (ui.vassal_map[v]) {
- ui.vassal_map[v].classList.add("hide")
- }
+ // mustered or disbanded
+ ui.vassal_map[v].classList.add("hide")
+ ui.vassal_cal[v].classList.remove("hide")
+ ui.vassal_cal[v].classList.toggle("back", loc === VASSAL_DISBANDED)
+ ui.vassal_cal[v].classList.toggle("action", is_action("vassal", v))
+ ui.vassal_cal[v].classList.toggle("selected", v === view.vassal || set_has(view.vassal, v))
+ calendar_layout_vassal[srv].push(ui.vassal_cal[v])
}
}
}
diff --git a/rules.ts b/rules.ts
index 4b784f4..f8878b6 100644
--- a/rules.ts
+++ b/rules.ts
@@ -16,9 +16,18 @@
/*
EVENTS and CAPABILITIES trigger - Pass instead of Done
+ SEARCH BY SEA (RULES)
+ Supply -- by way only, if ships can end at port
+ Levy Parley -- by way only, except from exile box (or mix and match, distance matters)
+ Campaign Parley -- adjacent only (also adjacent via sea)
+ Tax -- by way and ship mix and match, distance doesn't matter (only seas for naval blockade)
+
NAVAL BLOCKADE - for Tax and Tax Collectors
NAVAL BLOCKADE - Great Ships
+ limited troop pieces (burgundians/mercenaries)
+ disbanded vassals show back on calendar
+
Review all undo steps.
Review all states for needless pauses.
Review all states for adding extra pauses to prevent loss of control.
@@ -356,7 +365,7 @@ const LONDON_FOR_YORK = 300 as Locale // extra london marker
const CAPTURE_OF_THE_KING = 400 as Locale // Ia. special rule (400 + lord ID that has him captured)
const VASSAL_READY = 29 as Lord
-const VASSAL_CALENDAR = 30 as Lord
+const VASSAL_DISBANDED = 30 as Lord
const VASSAL_OUT_OF_PLAY = 31 as Lord
const SUMMER = 0 as Season
@@ -1616,8 +1625,8 @@ function disband_vassal(vassal: Vassal) {
if (data.vassals[vassal].service > 0) {
let new_turn = current_turn() + (6 - data.vassals[vassal].service)
- set_vassal_lord_and_service(vassal, VASSAL_CALENDAR, new_turn)
- log(`Disband V${vassal} to turn ${current_turn() + (6 - data.vassals[vassal].service)}.`)
+ set_vassal_lord_and_service(vassal, VASSAL_DISBANDED, new_turn)
+ log(`Disband V${vassal} to T${current_turn() + (6 - data.vassals[vassal].service)}.`)
} else {
// TODO: special vassals with no service marker!?
set_vassal_lord_and_service(vassal, VASSAL_OUT_OF_PLAY, 0)
@@ -2529,7 +2538,7 @@ function do_pillage_disband(lord: Lord) {
disband_influence_penalty(lord)
// shipwreck if unfed at sea
if (is_lord_at_sea(lord))
- remove_lord(lord)
+ shipwreck_lord(lord)
else
disband_lord(lord)
}
@@ -2753,23 +2762,39 @@ function remove_lord(lord: Lord) {
clear_lord(lord)
}
+function death_lord(lord: Lord) {
+ if (game.scenario === SCENARIO_II) {
+ if (lord === LORD_WARWICK_L && game.battle.attacker === YORK)
+ foreign_haven_shift_lords()
+ }
+ log(`Death L${lord}.`)
+ set_lord_locale(lord, NOWHERE)
+ clear_lord(lord)
+}
+
+function shipwreck_lord(lord: Lord) {
+ log(`Shipwreck L${lord}.`)
+ set_lord_locale(lord, NOWHERE)
+ clear_lord(lord)
+}
+
function disband_lord(lord: Lord) {
let turn = current_turn()
set_lord_calendar(lord, turn + (6 - data.lords[lord].influence))
- log(`Disband L${lord} to ${get_lord_calendar(lord)}.`)
+ log(`Disband L${lord} T${get_lord_calendar(lord)}.`)
clear_lord(lord)
}
function exile_lord(lord: Lord) {
if (lord_has_capability(lord, AOW_YORK_ENGLAND_IS_MY_HOME) && !is_event_in_play(EVENT_LANCASTER_BLOCKED_FORD)) {
logcap(AOW_YORK_ENGLAND_IS_MY_HOME)
- log(`Disband L${lord} to ${current_turn() + 1}`)
+ log(`Disband L${lord} T${current_turn() + 1}`)
set_lord_calendar(lord, current_turn() + 1)
clear_lord(lord)
} else {
set_lord_calendar(lord, current_turn() + 6 - data.lords[lord].influence)
set_lord_in_exile(lord)
- log(`Exile L${lord} to ${get_lord_calendar(lord)}.`)
+ log(`Exile L${lord} to T${get_lord_calendar(lord)}.`)
clear_lord(lord)
}
}
@@ -4396,20 +4421,20 @@ function goto_forage() {
if (!has_adjacent_enemy(here) && is_neutral_locale(here)) {
let die = roll_die()
if (die <= 4) {
- log(`Forage 1-4 at S${here}: B${die}`)
+ log(`Forage at S${here} 1-4: B${die}`)
add_lord_assets(game.command, PROV, 1)
deplete_locale(here)
} else {
- log(`Forage 1-4 at S${here}: W${die}`)
+ log(`Forage at S${here} 1-4: W${die}`)
}
} else if (has_adjacent_enemy(here) || is_enemy_locale(here)) {
let die = roll_die()
if (die <= 3) {
- log(`Forage 1-3 at S${here}: B${die}`)
+ log(`Forage at S${here} 1-3: B${die}`)
add_lord_assets(game.command, PROV, 1)
deplete_locale(here)
} else {
- log(`Forage 1-3 at S${here}: W${die}`)
+ log(`Forage at S${here} 1-3: W${die}`)
}
} else {
log(`Forage at S${here}.`)
@@ -8163,7 +8188,7 @@ states.death_check = {
if (set_has(game.battle.fled, game.who)) {
if (die >= 5) {
logi("L" + game.who + " 5-6 B" + die)
- kill_lord(game.who)
+ death_lord(game.who)
} else {
logi("L" + game.who + " 5-6 W" + die)
disband_lord(game.who)
@@ -8171,7 +8196,7 @@ states.death_check = {
} else {
if (die >= 3) {
logi("L" + game.who + " 3-6 B" + die)
- kill_lord(game.who)
+ death_lord(game.who)
} else {
logi("L" + game.who + " 3-6 W" + die)
disband_lord(game.who)
@@ -8192,14 +8217,6 @@ states.death_check = {
card: action_held_event_at_death_check,
}
-function kill_lord(lord: Lord) {
- if (game.scenario === SCENARIO_II) {
- if (lord === LORD_WARWICK_L && game.battle.attacker === YORK)
- foreign_haven_shift_lords()
- }
- remove_lord(lord)
-}
-
// === DEATH CHECK CAPABILITY: BLOODY THOU ART ===
function is_bloody_thou_art_triggered() {
@@ -8240,7 +8257,7 @@ states.bloody_thou_art = {
}
},
lord(lord) {
- remove_lord(lord)
+ death_lord(lord)
set_delete(game.battle.routed, lord)
},
vassal(v) {
@@ -8477,7 +8494,7 @@ states.warden_of_the_marches = {
set_delete(game.battle.fled, lord)
set_delete(game.battle.routed, lord)
- logi(`Moved lord to ${locale_name[game.where]}`)
+ log(`L${lord} to S${game.where}.`)
set_lord_forces(lord, RETINUE, 1)
for (let x of all_force_types)
@@ -9028,7 +9045,7 @@ states.disembark = {
} else {
// Shipwreck!
disband_influence_penalty(game.who)
- remove_lord(game.who)
+ shipwreck_lord(game.who)
game.who = NOBODY
goto_disembark()
}
diff --git a/tools/markers3.sh b/tools/markers3.sh
index d79b834..120008d 100644
--- a/tools/markers3.sh
+++ b/tools/markers3.sh
@@ -106,19 +106,19 @@ single vassal_suffolk
single vassal_westmoreland
single vassal_worcester
-# single vassal_beaumont_b
-# single vassal_bonville_b
-# single vassal_devon_b
-# single vassal_dudley_b
-# single vassal_essex_b
-# single vassal_fauconberg_b
-# single vassal_norfolk_b
-# single vassal_oxford_b
-# single vassal_shrewsbury_b
-# single vassal_stanley_b
-# single vassal_suffolk_b
-# single vassal_westmoreland_b
-# single vassal_worcester_b
+single vassal_beaumont_b
+single vassal_bonville_b
+single vassal_devon_b
+single vassal_dudley_b
+single vassal_essex_b
+single vassal_fauconberg_b
+single vassal_norfolk_b
+single vassal_oxford_b
+single vassal_shrewsbury_b
+single vassal_stanley_b
+single vassal_suffolk_b
+single vassal_westmoreland_b
+single vassal_worcester_b
single vassal_clifford
single vassal_edward
@@ -127,12 +127,12 @@ single vassal_thomas_stanley
single vassal_trollope
single vassal_montagu
-# single vassal_clifford_b
-# single vassal_edward_b
-# single vassal_hastings_b
-# single vassal_thomas_stanley_b
-# single vassal_trollope_b
-# single vassal_montagu_b
+single vassal_clifford_b
+single vassal_edward_b
+single vassal_hastings_b
+single vassal_thomas_stanley_b
+single vassal_trollope_b
+single vassal_montagu_b
multi "#ffffff" 6x1 numbers_york \
HIRES/output/number_1_york.png \