mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
min players for airship & fungle
This commit is contained in:
1 parent
92298abe0f
commit
5d68e25263
3 files changed
+17
No files matched your search
@@ -384,6 +384,8 @@ public static class Options
|
||||
public static OptionItem DleksChance;
|
||||
public static OptionItem AirshipChance;
|
||||
public static OptionItem FungleChance;
|
||||
public static OptionItem MinPlayersForAirship;
|
||||
public static OptionItem MinPlayersForFungle;
|
||||
|
||||
public static OptionItem GodfatherCancelVote;
|
||||
|
||||
@@ -1925,6 +1927,14 @@ public static class Options
|
||||
FungleChance = new IntegerOptionItem(19922, "FungleChance", new(0, 100, 5), 0, TabGroup.GameSettings)
|
||||
.SetParent(RandomMapsMode)
|
||||
.SetValueFormat(OptionFormat.Percent);
|
||||
|
||||
MinPlayersForAirship = new IntegerOptionItem(19915, "MinPlayersForAirship", new(1, 15, 1), 10, TabGroup.GameSettings)
|
||||
.SetParent(AirshipChance)
|
||||
.SetValueFormat(OptionFormat.Players);
|
||||
|
||||
MinPlayersForFungle = new IntegerOptionItem(19923, "MinPlayersForFungle", new(1, 15, 1), 8, TabGroup.GameSettings)
|
||||
.SetParent(FungleChance)
|
||||
.SetValueFormat(OptionFormat.Players);
|
||||
|
||||
LoadingPercentage = 69;
|
||||
|
||||
|
||||
@@ -589,6 +589,11 @@ public static class GameStartRandomMap
|
||||
5 => Options.FungleChance.GetInt(),
|
||||
_ => 0
|
||||
});
|
||||
|
||||
int playerCount = Main.AllPlayerControls.Length;
|
||||
if (playerCount < Options.MinPlayersForAirship.GetInt()) chance.Remove(4);
|
||||
if (playerCount < Options.MinPlayersForFungle.GetInt()) chance.Remove(5);
|
||||
|
||||
byte[] pool = chance.SelectMany(x => Enumerable.Repeat(x.Key, x.Value / 5)).ToArray();
|
||||
return pool.Length == 0 ? chance.Keys.RandomElement() : pool.RandomElement();
|
||||
}
|
||||
|
||||
@@ -3469,6 +3469,8 @@
|
||||
"DleksChance": "Chance that the map is <color=#66a186>dlekS ehT</color>",
|
||||
"AirshipChance": "Chance that the map is <color=#ed0007>Airship</color>",
|
||||
"FungleChance": "Chance that the map is <color=#ffa646>The Fungle</color>",
|
||||
"MinPlayersForAirship": "Minimum Players for <color=#ed0007>Airship</color>",
|
||||
"MinPlayersForFungle": "Minimum Players for <color=#ffa646>The Fungle</color>",
|
||||
"CamouflageMode.Default": "Default",
|
||||
"CamouflageMode.Host": "<color=#FFFF00>Host</color>",
|
||||
"CamouflageMode.Karpe": "<color=#ffc0cb>KARPED1EM</color>",
|
||||
|
||||
Reference in new issue
Block a user