summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js31
1 files changed, 27 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 2b541da..25fc3d3 100644
--- a/rules.js
+++ b/rules.js
@@ -4160,20 +4160,41 @@ function vm_do_remove_infl(space) {
function vm_do_remove_x_infl(space) {
push_undo()
const clicked_space = find_space_index(space)
- log(`Removed ${game.vm_available_ops} influence from %${clicked_space}.`)
if (game.remove_opponent_infl) {
if (game.active === COM) {
+ if (game.pieces[clicked_space].demInfl >= game.vm_available_ops) {
game.pieces[clicked_space].demInfl -= game.vm_available_ops
+ } else {
+ game.vm_available_ops = game.pieces[clicked_space].demInfl
+ game.pieces[clicked_space].demInfl -= game.vm_available_ops
+ }
} else {
- game.pieces[clicked_space].comInfl -= game.vm_available_ops
+ if (game.pieces[clicked_space].comInfl >= game.vm_available_ops) {
+ game.pieces[clicked_space].comInfl -= game.vm_available_ops
+ } else {
+ game.vm_available_ops = game.pieces[clicked_space].comInfl
+ game.pieces[clicked_space].comInfl -= game.vm_available_ops
+ }
}
} else {
if (game.active === COM) {
- game.pieces[clicked_space].comInfl -= game.vm_available_ops
+ if (game.pieces[clicked_space].comInfl >= game.vm_available_ops) {
+ game.pieces[clicked_space].comInfl -= game.vm_available_ops
+ } else {
+ game.vm_available_ops = game.pieces[clicked_space].comInfl
+ game.pieces[clicked_space].comInfl -= game.vm_available_ops
+ }
} else {
- game.pieces[clicked_space].demInfl -= game.vm_available_ops
+ if (game.pieces[clicked_space].demInfl >= game.vm_available_ops) {
+ game.pieces[clicked_space].demInfl -= game.vm_available_ops
+ } else {
+ game.vm_available_ops = game.pieces[clicked_space].demInfl
+ game.pieces[clicked_space].demInfl -= game.vm_available_ops
+ }
}
+
+ log(`Removed ${game.vm_available_ops} influence from %${clicked_space}`)
}
check_control_change(clicked_space)
@@ -4957,6 +4978,7 @@ function vm_the_tyrant_is_gone() {
game.playable_cards[41].playable = 0
game.playable_cards[101].playable = 0
game.playable_cards[107].playable = 0
+ console.log('game.vm_event', game.vm_event)
game.state = 'vm_the_tyrant_is_gone'
}
@@ -6805,6 +6827,7 @@ states.vm_the_tyrant_is_gone = {
},
infl(space) {
push_undo()
+ log(`The Ceausescus flee to %${space}`)
game.persistent_events['the_tyrant_is_gone'] = find_space_index(space)
},
done () {