summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteisuru <31881306+teisuru@users.noreply.github.com>2023-06-29 11:02:38 +0200
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commit9c6d4931d437626a5a9b269c1c3e0afd1cf57abe (patch)
treedab39d93a6fafeac73dcda3e707a860f7d194768
parenta75cfe9b3dd138045bbfe760b12371229662427f (diff)
downloadplantagenet-9c6d4931d437626a5a9b269c1c3e0afd1cf57abe.tar.gz
fix levy troops
-rw-r--r--rules.js51
1 files changed, 27 insertions, 24 deletions
diff --git a/rules.js b/rules.js
index 8ace9a7..35889a0 100644
--- a/rules.js
+++ b/rules.js
@@ -2052,30 +2052,33 @@ states.levy_muster_lord = {
levy_troops() {
push_undo()
let info = data.lords[game.who]
- if (is_calais(get_lord_locale(game.who))) {
- add_lord_forces(game.who, MEN_AT_ARMS, info.forces.men_at_arms | 2)
- add_lord_forces(game.who, LONGBOWMEN, info.forces.longbowmen | 1)
- }
- else if (is_london(get_lord_locale(game.who))){
- add_lord_forces(game.who, MEN_AT_ARMS, info.forces.men_at_arms | 1)
- add_lord_forces(game.who, LONGBOWMEN, info.forces.longbowmen | 1)
- add_lord_forces(game.who, MILITIA, info.forces.militia | 1)
- }
- else if (is_harlech(get_lord_locale(game.who))) {
- add_lord_forces(game.who, MEN_AT_ARMS, info.forces.men_at_arms | 1)
- add_lord_forces(game.who, LONGBOWMEN, info.forces.longbowmen | 2)
- }
- else if (is_city(get_lord_locale(game.who))){
- add_lord_forces(game.who, LONGBOWMEN, info.forces.longbowmen | 1)
- add_lord_forces(game.who, MILITIA, info.forces.militia | 1)
- }
- else if (is_town(get_lord_locale(game.who))){
- add_lord_forces(game.who, MILITIA, info.forces.militia | 2)
- }
- else {
- add_lord_forces(game.who, MEN_AT_ARMS, info.forces.men_at_arms | 1)
- add_lord_forces(game.who, MILITIA, info.forces.militia | 1)
- }
+ let locale = data.locales[get_lord_locale(game.who)].type
+ switch(locale) {
+ case "calais":
+ add_lord_forces(game.who, MEN_AT_ARMS, 2)
+ add_lord_forces(game.who, LONGBOWMEN,1)
+ break
+ case "london":
+ add_lord_forces(game.who, MEN_AT_ARMS, 1)
+ add_lord_forces(game.who, LONGBOWMEN, 1)
+ add_lord_forces(game.who, MILITIA, 1)
+ break
+ case "harlech":
+ add_lord_forces(game.who, MEN_AT_ARMS, 1)
+ add_lord_forces(game.who, LONGBOWMEN, 2)
+ break
+ case "city":
+ add_lord_forces(game.who, LONGBOWMEN, 1)
+ add_lord_forces(game.who, MILITIA, 1)
+ break
+ case "town":
+ add_lord_forces(game.who, MILITIA, 2)
+ break
+ case "fortress":
+ add_lord_forces(game.who, MEN_AT_ARMS, 1)
+ add_lord_forces(game.who, MILITIA, 1)
+ break
+ }
resume_levy_muster_lord()
},