diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-06-16 18:32:06 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:31:29 +0100 |
commit | 03fa05f2f083ab541749ee56a8a8056b298200b9 (patch) | |
tree | 5fc0d3964b0a18080b0de927a2bdb5b085db1aff | |
parent | 3e8fe76752d0be4d09744dc854bf0144cfc4a9a6 (diff) | |
download | pax-pamir-03fa05f2f083ab541749ee56a8a8056b298200b9.tar.gz |
Change results when resigning.
Opponent for 2P games.
None for multi-player games.
-rw-r--r-- | rules.js | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -2051,7 +2051,7 @@ states.battle = { } } } else { - view.prompt = `Battle on #${game.where} is over \u2014 undo will not be possible.`; + view.prompt = `Battle on #${game.where} is over \u2014 undo will not be possible.` } } gen_action('next') @@ -3133,8 +3133,19 @@ exports.resign = function (state, current) { load_game(state) logbr() log(`${current} resigned.`) - goto_game_over() + game.state = 'game_over' + game.active = 5 game.victory = `${current} resigned.` + + if (game.players.length === 2) { + if (current === player_names[0]) + game.result = player_names[1] + else + game.result = player_names[0] + } else { + game.result = "None" + } + return save_game() } |