From 8452a23078ad201a7e551309a9b1552ea1ac1730 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 6 Feb 2022 06:33:24 +0200 Subject: [PATCH 44/44] Scale revolen change speed to number of players See osdn #43386 Signed-off-by: Marko Lindqvist --- server/plrhand.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/plrhand.c b/server/plrhand.c index 56ab890d4a..a3e50a88a0 100644 --- a/server/plrhand.c +++ b/server/plrhand.c @@ -405,6 +405,7 @@ void government_change(struct player *pplayer, struct government *gov, int revolution_length(struct government *gov, struct player *plr) { int turns; + int change_speed; if (!untargeted_revolution_allowed() && gov == game.government_during_revolution) { @@ -424,7 +425,12 @@ int revolution_length(struct government *gov, struct player *plr) break; case REVOLEN_QUICKENING: case REVOLEN_RANDQUICK: - turns = game.server.revolution_length - gov->changed_to_times; + /* If everyone changes to this government once, the last 50% of players doing so + * will get the minimum time (1 turn) */ + change_speed = (player_count() / 2) / (game.server.revolution_length - 1); + /* It never takes zero players to make revlen shorter */ + change_speed = MAX(change_speed, 1); + turns = game.server.revolution_length - gov->changed_to_times / change_speed; turns = MAX(1, turns); if (game.info.revolentype == REVOLEN_RANDQUICK) { turns = fc_rand(turns) + 1; -- 2.34.1