summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-07-15 13:06:44 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:39 +0100
commit163e2eaa1803c26231bc24bb0b6fe33239296f3c (patch)
tree24183605bcaa6183738bb8ba11104465671dc335 /rules.js
parente95a550388b9a5ff51d95fefac5071693068cdaf (diff)
downloadcrusader-rex-163e2eaa1803c26231bc24bb0b6fe33239296f3c.tar.gz
crusader: Improve UI for sending Asasssins event.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js33
1 files changed, 23 insertions, 10 deletions
diff --git a/rules.js b/rules.js
index 9e3cc1c..1feae19 100644
--- a/rules.js
+++ b/rules.js
@@ -1342,31 +1342,44 @@ states.assassins = {
states.assassins_show_1 = {
prompt: function (view, current) {
view.assassinate = game.who;
+ view.who = ASSASSINS;
if (is_inactive_player(current))
return view.prompt = "Assassins: Waiting for " + game.active + ".";
view.prompt = "Assassins: The assassins target " + block_name(game.who) + " in " + game.where + ".";
gen_action(view, 'next');
+ gen_action(view, 'block', game.who);
+ gen_action(view, 'block', ASSASSINS);
},
- next: function () {
- assassinate(game.who, game.where);
- game.state = 'assassins_show_2';
- },
+ next: assassins_next_1,
+ block: assassins_next_1,
+}
+
+function assassins_next_1() {
+ assassinate(game.who, game.where);
+ game.state = 'assassins_show_2';
}
states.assassins_show_2 = {
prompt: function (view, current) {
view.assassinate = game.who;
+ view.who = ASSASSINS;
if (is_inactive_player(current))
return view.prompt = "Assassins: Waiting for " + game.active + ".";
view.prompt = "Assassins: The assassins hit " + block_name(game.who) + " in " + game.where + ".";
gen_action(view, 'next');
+ gen_action(view, 'block', ASSASSINS);
+ gen_action(view, 'town', MASYAF);
},
- next: function () {
- game.location[ASSASSINS] = MASYAF;
- game.who = null;
- game.where = null;
- end_player_turn();
- },
+ next: assassins_next_2,
+ block: assassins_next_2,
+ town: assassins_next_2,
+}
+
+function assassins_next_2() {
+ game.location[ASSASSINS] = MASYAF;
+ game.who = null;
+ game.where = null;
+ end_player_turn();
}
function assassinate(who, where) {