summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-01-07 12:43:24 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commit66109f31ee3b70436f264b9cc0abe55c5933b126 (patch)
treee639f61566c3977c4b55d8149cba35071e1ac18d /rules.js
parent0a7a9756c973438329ab18ec21b3a3cf6e485e88 (diff)
downloadnevsky-66109f31ee3b70436f264b9cc0abe55c5933b126.tar.gz
Remove/Discdard No Event as well as No Capability!
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js45
1 files changed, 30 insertions, 15 deletions
diff --git a/rules.js b/rules.js
index c0a123b..ec7708f 100644
--- a/rules.js
+++ b/rules.js
@@ -3051,9 +3051,33 @@ function draw_two_cards() {
return [ draw_card(deck), draw_card(deck) ]
}
+function discard_card_capability(c) {
+ if (is_no_event_card(c) && should_remove_no_event_card()) {
+ logi(`C${c} - removed`)
+ if (game.active === P1)
+ game.no1--
+ else
+ game.no2--
+ } else {
+ logi(`C${c} - discarded`)
+ }
+}
+
+function discard_card_event(c) {
+ if (is_no_event_card(c) && should_remove_no_event_card()) {
+ log(`Removed E${c}`)
+ if (game.active === P1)
+ game.no1--
+ else
+ game.no2--
+ } else {
+ log(`Discarded E${c}`)
+ }
+}
+
function goto_levy_arts_of_war_first() {
log_br()
- log(game.active)
+ log_h3(game.active)
game.state = "levy_arts_of_war_first"
game.what = draw_two_cards()
}
@@ -3104,21 +3128,12 @@ states.levy_arts_of_war_first = {
discard() {
push_undo()
let c = game.what.shift()
-
- if (is_no_event_card(c) && should_remove_no_event_card()) {
- logi(`C${c} - removed`)
- if (game.active === P1)
- game.no1--
- else
- game.no2--
- } else {
- logi(`C${c} - discarded`)
- }
-
+ discard_card_capability(c)
resume_levy_arts_of_war_first()
},
}
+
function end_levy_arts_of_war_first() {
clear_undo()
game.what = NOTHING
@@ -3133,7 +3148,7 @@ function end_levy_arts_of_war_first() {
function goto_levy_arts_of_war() {
log_br()
- log(game.active)
+ log_h3(game.active)
game.what = draw_two_cards()
resume_levy_arts_of_war()
}
@@ -3173,7 +3188,7 @@ states.levy_arts_of_war = {
},
hold() {
let c = game.what.shift()
- log(`Held event card.`)
+ log(`Held.`)
if (game.active === P1)
set_add(game.hand1, c)
else
@@ -3182,7 +3197,7 @@ states.levy_arts_of_war = {
},
discard() {
let c = game.what.shift()
- log(`Discarded E${c}.`)
+ discard_card_event(c)
resume_levy_arts_of_war()
},
}