summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index a66f665..fa93ae3 100644
--- a/rules.js
+++ b/rules.js
@@ -1649,13 +1649,13 @@ states.remove_attack_from_fronts = {
card_id === 6
? 'Remove an attack from a Front.'
: 'Remove attacks from a Front.';
- const front_data = f ?? {};
+ const front_data = f ?? [];
let is_front_with_attacks = false;
data_1.FRONTS.forEach((id) => {
if (game.fronts[id].value >= 0 || game.fronts[id].status !== null) {
return;
}
- if (card_id === 6 && front_data[id]) {
+ if (card_id === 6 && front_data.includes(id)) {
return;
}
is_front_with_attacks = true;
@@ -1673,10 +1673,10 @@ states.remove_attack_from_fronts = {
const { f, v: card_id } = get_active_node_args();
const removed_value = card_id === 6 ? 1 : Math.min(3, Math.abs(game.fronts[id].value));
update_front(id, removed_value, get_active_faction());
- const fronts = f ?? {};
- fronts[id] = removed_value;
+ const fronts = f ?? [];
+ fronts.push(id);
update_active_node_args({ f: fronts });
- if (card_id === 6 && Object.keys(fronts).length === 3) {
+ if (card_id === 6 && fronts.length === 3) {
resolve_active_and_proceed();
}
else if (card_id === 39 || card_id === 16) {
@@ -1691,7 +1691,7 @@ states.remove_attack_from_fronts = {
},
skip() {
const { f, v: card_id } = get_active_node_args();
- const values = Object.values(f ?? {});
+ const values = f ?? [];
if (card_id === 39 && values.length > 0) {
insert_after_active_node(create_state_node('attack_front', get_active_faction(), {
t: data_1.ANY,