summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-01-26 11:50:55 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:39 +0100
commitaaf41d556eabcaff13d571ab1fd9a6d919864949 (patch)
treea6bcc7bc5b6db3faa687cd04b191501a0353b056
parente11808c223256dbc05dd9ccaed464211534afca6 (diff)
downloadnevsky-aaf41d556eabcaff13d571ab1fd9a6d919864949.tar.gz
Tempest + hidden mats.
-rw-r--r--rules.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 4dbe95b..618cd89 100644
--- a/rules.js
+++ b/rules.js
@@ -2162,15 +2162,27 @@ states.tempest = {
inactive: "Tempest",
prompt() {
view.prompt = "Tempest: Remove all Ships from a Teutonic Lord (half if he has Cogs)."
- for (let lord = first_enemy_lord; lord <= last_enemy_lord; ++lord)
- if (get_lord_assets(lord, SHIP) > 0)
- gen_action_ship(lord)
+ for (let lord = first_enemy_lord; lord <= last_enemy_lord; ++lord) {
+ if (game.hidden) {
+ gen_action_lord(lord)
+ } else {
+ if (get_lord_assets(lord, SHIP) > 0)
+ gen_action_ship(lord)
+ }
+ }
+ },
+ lord(lord) {
+ this.ship(lord)
},
ship(lord) {
- log(`Removed Ships from L${lord}.`)
let n = 0
- if (lord_has_capability(lord, AOW_TEUTONIC_COGS))
+ if (lord_has_capability(lord, AOW_TEUTONIC_COGS)) {
+ logcap(AOW_TEUTONIC_COGS)
+ log(`Removed half Ships from L${lord}.`)
n = get_lord_assets(lord, SHIP) >> 1
+ } else {
+ log(`Removed all Ships from L${lord}.`)
+ }
set_lord_assets(lord, SHIP, n)
end_immediate_event()
},