summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.js9
-rw-r--r--rules.js34
2 files changed, 26 insertions, 17 deletions
diff --git a/play.js b/play.js
index 44a9afc..73ec4b8 100644
--- a/play.js
+++ b/play.js
@@ -1298,6 +1298,7 @@ function sub_space(match, p1) {
function on_log(text) {
let p = document.createElement("div")
+ let sub_text = ""
if (text.match(/^>/)) {
text = text.substring(1)
@@ -1312,11 +1313,15 @@ function on_log(text) {
text = text.substring(19)
p.className = "h1 mi"
}
+ else if (text.match(/^\.h1 succ/)) {
+ sub_text = text.substring(4, 9)
+ text = text.substring(10)
+ p.className = "h1 " + sub_text
+ }
else if (text.match(/^\.h1/)) {
text = text.substring(4)
p.className = "h1"
- }
- else if (text.match(/^\.h2 Delhi Sultanate/)) {
+ } else if (text.match(/^\.h2 Delhi Sultanate/)) {
text = text.substring(4)
p.className = "h2 ds"
}
diff --git a/rules.js b/rules.js
index 0ce76ad..eedc18a 100644
--- a/rules.js
+++ b/rules.js
@@ -352,7 +352,7 @@ function goto_card() {
log_h1("Mongol Invaders C" + this_card())
goto_mongol_invaders(VE)
} else if (this_card() >= 45 && this_card() <= 47) {
- log_h1("C" + this_card())
+ log_h1(`succ${this_card()-44} C` + this_card())
succession()
} else if (this_card() >= 48 && this_card() <= 49) {
log_h1("Mongol Invaders C" + this_card())
@@ -4517,36 +4517,40 @@ function vm_remove_influence() {
// VM: RESOURCES
-function vm_resources() {
- if (vm_operand(3) !== 0)
- game.state = "vm_resources"
- else {
- logi("Nothing")
- vm_next()
- }
-}
+function vm_resources() { game.state = "vm_resources" }
states.vm_resources = {
prompt() {
let skip = vm_operand(1)
let f = vm_operand(2)
let n = vm_operand(3)
- if (n > 0)
+ if (n > 0) {
event_prompt(`${faction_name[f]} +${n} Resources.`)
- else
+ gen_action_resources(f)
+ }
+ else if (n === 0) {
+ event_prompt("No Resource.")
+ view.actions.skip = 1
+ }
+ else {
event_prompt(`${faction_name[f]} ${n} Resources.`)
- gen_action_resources(f)
+ gen_action_resources(f)
+ }
if (skip)
view.actions.skip = 1
},
resources(f) {
let n = vm_operand(3)
- log_resources(f, n)
+ if (!is_succession())
+ log_resources(f, n)
+ else
+ logi_resources(f, n)
add_resources(f, n)
vm_next()
},
skip() {
+ logi("Nothing")
vm_next()
}
}
@@ -4837,7 +4841,7 @@ states.influence_succession = {
if (game.inf[game.cmd.who] > 0)
view.actions.remove_influence = 1
}
- view.actions.next = 1
+ view.actions.skip = 1
},
influence(f) {
game.cmd.who = f
@@ -4852,7 +4856,7 @@ states.influence_succession = {
remove_influence(game.cmd.who)
game.cmd.count -= 1
},
- next: vm_next
+ skip: vm_next
}
// VM : TIMURID ADVANCE