diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -654,12 +654,23 @@ states.move_track = { const node = get_active_node(); const track = node.a.t; const value = node.a.v; - view.prompt = `Move ${tracks[track].name} ${value > 0 ? 'up' : 'down'}`; + const name = tracks[track].name; + view.prompt = `Move ${name} ${value > 0 ? 'up' : 'down'}`; + if (track === data_1.GOVERNMENT && value === data_1.TOWARDS_CENTER) { + view.prompt = `Move ${name} towards center`; + } + else if (track === data_1.GOVERNMENT && value === data_1.AWAY_FROM_CENTER) { + view.prompt = `Move ${name} away from center`; + } gen_action_standee(track); }, standee(s) { const node = get_active_node(); - const value = node.a.v; + let value = node.a.v; + if (s === data_1.GOVERNMENT && + (value === data_1.TOWARDS_CENTER || value === data_1.AWAY_FROM_CENTER)) { + value = get_government_track_direction(value); + } move_track(s, value); resolve_active_and_proceed(); }, @@ -933,6 +944,16 @@ function get_min_value_for_track(track_id) { return 0; } } +function get_government_track_direction(direction) { + const value = game.tracks[data_1.GOVERNMENT]; + if ((direction === data_1.TOWARDS_CENTER && value >= 6) || + (direction === data_1.AWAY_FROM_CENTER && value <= 5)) { + return -1; + } + else { + return 1; + } +} function move_track(track_id, change) { const current_value = game.tracks[track_id]; let new_value = current_value + change; |