summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-01-30 22:27:29 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:39 +0100
commitdf2880f3fafd3be2321ecfd0a26b3917f516ebfd (patch)
treecaa4442d97224e298eeafaf4b020db3f9de8c348
parent7f68f6bcc1ac1486d7e518ace6786d3105c72cac (diff)
downloadnevsky-df2880f3fafd3be2321ecfd0a26b3917f516ebfd.tar.gz
Only log the final feed.
-rw-r--r--rules.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index cab3922..7799040 100644
--- a/rules.js
+++ b/rules.js
@@ -667,7 +667,10 @@ function feed_lord_skip(lord) {
function feed_lord(lord) {
// reuse "moved" flag for hunger
- set_lord_moved(lord, get_lord_moved(lord) - 1)
+ let n = get_lord_moved(lord) - 1
+ set_lord_moved(lord, n)
+ if (n === 0)
+ log(`Fed L${lord}.`)
}
function get_lord_array_position(lord) {
@@ -9918,13 +9921,11 @@ states.feed = {
},
prov(lord) {
push_undo()
- log(`Fed L${lord}.`)
add_lord_assets(lord, PROV, -1)
feed_lord(lord)
},
loot(lord) {
push_undo()
- log(`Fed L${lord}.`)
add_lord_assets(lord, LOOT, -1)
feed_lord(lord)
},
@@ -9968,14 +9969,12 @@ states.feed_lord_shared = {
},
prov(lord) {
push_undo()
- log(`Fed L${game.who}.`)
add_lord_assets(lord, PROV, -1)
feed_lord(game.who)
resume_feed_lord_shared()
},
loot(lord) {
push_undo()
- log(`Fed L${game.who}.`)
add_lord_assets(lord, LOOT, -1)
feed_lord(game.who)
resume_feed_lord_shared()