diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-14 17:22:18 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-14 17:22:18 -0400 |
commit | 1a7e3137d462e1b62ac467c91548521ef8e59359 (patch) | |
tree | f0c4e8f374c7cc12adfccc6a5a4472029c5d459b /rules.js | |
parent | 55587a61d739aebaf43b0dacff598f3cfd8689bb (diff) | |
download | vijayanagara-1a7e3137d462e1b62ac467c91548521ef8e59359.tar.gz |
Event resource with interaction
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 34 |
1 files changed, 19 insertions, 15 deletions
@@ -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 |