mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-11-19 13:16:56 +00:00
heliopolis by mindcap (#716)
This commit is contained in:
1 parent
a931d04dd1
commit
dee256bdcf
3 files changed
+30
-1
No files matched your search
@@ -737,6 +737,8 @@ public static class Options
|
||||
public static OptionItem AnagramLanguage;
|
||||
public static OptionItem AnagramWordLength;
|
||||
public static OptionItem AnagramDifficulty;
|
||||
public static OptionItem Additional8BallResponses;
|
||||
public static OptionItem UseOGResponses;
|
||||
|
||||
public static OptionItem LadderDeath;
|
||||
public static OptionItem LadderDeathChance;
|
||||
@@ -3074,6 +3076,12 @@ public static class Options
|
||||
.SetParent(EnableAnagramCommand)
|
||||
.SetColor(new Color32(100, 220, 255, byte.MaxValue));
|
||||
|
||||
Additional8BallResponses = new BooleanOptionItem(23830, "Additional8BallResponses", false, TabGroup.GameSettings)
|
||||
.SetColor(new Color32(100, 220, 255, byte.MaxValue));
|
||||
|
||||
UseOGResponses = new BooleanOptionItem(23831, "UseOGResponses", true, TabGroup.GameSettings)
|
||||
.SetParent(Additional8BallResponses)
|
||||
.SetColor(new Color32(100, 220, 255, byte.MaxValue));
|
||||
|
||||
new TextOptionItem(100028, "MenuTitle.Other", TabGroup.GameSettings)
|
||||
.SetHeader(true)
|
||||
|
||||
@@ -1109,7 +1109,26 @@ internal static class ChatCommands
|
||||
return;
|
||||
}
|
||||
|
||||
Utils.SendMessage(GetString($"8BallResponse.{IRandom.Instance.Next(20)}"), player.IsAlive() ? byte.MaxValue : player.PlayerId, GetString("8BallResponseTitle"));
|
||||
var responsesFilePath = $"{Main.DataPath}/EHR_DATA/8BallResponses.txt";
|
||||
|
||||
if (!File.Exists(responsesFilePath))
|
||||
File.WriteAllText(responsesFilePath, string.Empty);
|
||||
|
||||
var responses = File.ReadAllLines(responsesFilePath)
|
||||
.Where(line => !string.IsNullOrWhiteSpace(line))
|
||||
.ToArray();
|
||||
|
||||
bool useAdditional = Options.Additional8BallResponses.GetBool();
|
||||
bool useOG = !useAdditional || responses.Length == 0 || Options.UseOGResponses.GetBool();
|
||||
|
||||
int ogCount = useOG ? 20 : 0;
|
||||
int customCount = useAdditional ? responses.Length : 0;
|
||||
int totalCount = ogCount + customCount;
|
||||
|
||||
int index = IRandom.Instance.Next(totalCount);
|
||||
string response = index < ogCount ? GetString($"8BallResponse.{index}") : responses[index - ogCount];
|
||||
|
||||
Utils.SendMessage(response, player.IsAlive() ? byte.MaxValue : player.PlayerId, GetString("8BallResponseTitle"));
|
||||
}
|
||||
|
||||
public static void GameModePollCommand(PlayerControl player, string text, string[] args)
|
||||
|
||||
@@ -9050,6 +9050,8 @@
|
||||
"AnagramDiff.Medium": "Medium",
|
||||
"AnagramDiff.MediumHard": "Medium-Hard",
|
||||
"AnagramDiff.Hard": "Hard",
|
||||
"Additional8BallResponses": "Enable Additional /8ball Responses",
|
||||
"UseOGResponses": "Keep using Original /8ball Responses",
|
||||
"MenuTitle.Other": "★ Different ★",
|
||||
"LadderDeath": "Fall From Ladders",
|
||||
"LadderDeathChance": "Fall To Death Chance",
|
||||
|
||||
Reference in new issue
Block a user