summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-05-11 20:48:17 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-11 20:48:17 +0200
commit54bddbe6a6973f1c71fe888d19f364aa0f4d53de (patch)
tree4b653f479f4d00a037732006a06d58b8b3d1aefc
parent7748eb4ab62eea38a7ecda0b6f9dc7bd6695ec78 (diff)
downloadandean-abyss-54bddbe6a6973f1c71fe888d19f364aa0f4d53de.tar.gz
Tweak Poppies to behave similar to Cultivate.
Select an available Shipment before placing it.
-rw-r--r--rules.js30
1 files changed, 21 insertions, 9 deletions
diff --git a/rules.js b/rules.js
index 76dddb3..3d36a89 100644
--- a/rules.js
+++ b/rules.js
@@ -7711,18 +7711,30 @@ states.vm_place_or_remove_shipment = {
for (let sh = 0; sh < 4; ++sh)
if (is_shipment_held_in_space(sh, game.vm.s))
gen_action_shipment(sh)
- if (has_available_shipment()) {
- gen_piece_in_space(game.vm.s, FARC, GUERRILLA)
- gen_piece_in_space(game.vm.s, AUC, GUERRILLA)
- gen_piece_in_space(game.vm.s, CARTELS, GUERRILLA)
- }
+ let sh = find_available_shipment()
+ if (sh >= 0)
+ gen_action_shipment(sh)
},
shipment(sh) {
push_undo()
- let p = get_held_shipment_piece(sh)
- log("Removed Shipment from " + piece_faction_name(p) + " in S" + piece_space(p) + ".")
- remove_shipment(sh)
- vm_next()
+ if (is_shipment_held_in_space(sh, game.vm.s)) {
+ let p = get_held_shipment_piece(sh)
+ log("Removed Shipment from " + piece_faction_name(p) + " in S" + piece_space(p) + ".")
+ remove_shipment(sh)
+ vm_next()
+ } else {
+ game.state = "vm_place_or_remove_shipment_place"
+ }
+ },
+}
+
+states.vm_place_or_remove_shipment_place = {
+ prompt() {
+ event_prompt(`Place Shipment in ${space_name[game.vm.s]}.`)
+ view.selected_shipment = find_available_shipment()
+ gen_piece_in_space(game.vm.s, FARC, GUERRILLA)
+ gen_piece_in_space(game.vm.s, AUC, GUERRILLA)
+ gen_piece_in_space(game.vm.s, CARTELS, GUERRILLA)
},
piece(p) {
push_undo()