diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-04-23 13:35:24 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-04-23 13:36:59 +0200 |
commit | 75b1985ff2d1245434b977d68429c47527abd3cb (patch) | |
tree | b033887b4475e8c480edaa6ee7d4aafc2c44e632 /rules.ts | |
parent | 4edfad996c57a840f5b024200c8da2190a5c8079 (diff) | |
download | plantagenet-75b1985ff2d1245434b977d68429c47527abd3cb.tar.gz |
clean up can_add_transport uses
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -2850,10 +2850,9 @@ states.muster_lord = { // Add Transport // TODO: 1.7.3 English Ships -- no more than 9 lords may have ships - if ((is_seaport(here) || is_exile_box(here)) && get_lord_assets(game.command, SHIP) < 2) + if (can_add_transport_ship(game.command, here)) view.actions.take_ship = 1 - - if (can_add_transport(game.command, CART)) + if (can_add_transport_cart(game.command)) view.actions.take_cart = 1 if (can_add_troops(here)) @@ -3254,8 +3253,17 @@ function can_add_troops_sof(lord: Lord, locale: Locale) { // === 3.4.5 LEVY TRANSPORT -function can_add_transport(who: Lord, what: Asset) { - return get_lord_assets(who, what) < 15 +function can_add_transport_ship(who: Lord, here: Locale) { + if (is_seaport(here) || is_exile_box(here)) { + // TODO: 1.7.3 English Ships -- no more than 9 lords may have ships + if (get_lord_assets(who, SHIP) < 2) + return true + } + return false +} + +function can_add_transport_cart(who: Lord) { + return get_lord_assets(who, CART) < 15 } // === 3.4.6 LEVY CAPABILITY === |