More settings & Optimize & A little something for April Fools :) HF

This commit is contained in:
Gurge44 committed 2024-03-31 21:36:00 +02:00
1 parent d58338988c
commit 9fae719e1b
12 files changed
+282 -26

No files matched your search

+1
View File
@@ -5,6 +5,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EHR/@EntryIndexedValue">EHR</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EHR/@EntryIndexedValue">EHR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFA/@EntryIndexedValue">FFA</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFA/@EntryIndexedValue">FFA</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFF/@EntryIndexedValue">FFF</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FFF/@EntryIndexedValue">FFF</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FPS/@EntryIndexedValue">FPS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GM/@EntryIndexedValue">GM</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GM/@EntryIndexedValue">GM</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HUD/@EntryIndexedValue">HUD</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HUD/@EntryIndexedValue">HUD</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RPC/@EntryIndexedValue">RPC</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RPC/@EntryIndexedValue">RPC</s:String>
+2 -2
View File
@@ -37,9 +37,9 @@ namespace EHR
public static void AssignRoles(ref Dictionary<PlayerControl, CustomRoles> result) public static void AssignRoles(ref Dictionary<PlayerControl, CustomRoles> result)
{ {
List<PlayerControl> allPlayers = [.. Main.AllAlivePlayerControls]; List<PlayerControl> allPlayers = [.. Main.AllAlivePlayerControls];
allPlayers.Shuffle(IRandom.Instance); allPlayers = allPlayers.Shuffle(IRandom.Instance).ToList();
int seekerNum = Main.RealOptionsData.GetInt(Int32OptionNames.NumImpostors); int seekerNum = Math.Min(Main.RealOptionsData.GetInt(Int32OptionNames.NumImpostors), 1);
Dictionary<CustomRoles, int> roles = Assembly Dictionary<CustomRoles, int> roles = Assembly
.GetExecutingAssembly() .GetExecutingAssembly()
+16 -10
View File
@@ -26,7 +26,6 @@ public class ClientOptionItem
var mouseMoveToggle = optionsMenuBehaviour.DisableMouseMovement; var mouseMoveToggle = optionsMenuBehaviour.DisableMouseMovement;
// 1つ目のボタンの生成時に背景も生成
if (CustomBackground == null) if (CustomBackground == null)
{ {
numOptions = 0; numOptions = 0;
@@ -48,15 +47,19 @@ public class ClientOptionItem
UiElement[] selectableButtons = optionsMenuBehaviour.ControllerSelectable.ToArray(); UiElement[] selectableButtons = optionsMenuBehaviour.ControllerSelectable.ToArray();
PassiveButton leaveButton = null; PassiveButton leaveButton = null;
PassiveButton returnButton = null; PassiveButton returnButton = null;
for (int i = 0; i < selectableButtons.Length; i++) foreach (var button in selectableButtons)
{ {
var button = selectableButtons[i];
if (button == null) continue; if (button == null) continue;
if (button.name == "LeaveGameButton") switch (button.name)
leaveButton = button.GetComponent<PassiveButton>(); {
else if (button.name == "ReturnToGameButton") case "LeaveGameButton":
returnButton = button.GetComponent<PassiveButton>(); leaveButton = button.GetComponent<PassiveButton>();
break;
case "ReturnToGameButton":
returnButton = button.GetComponent<PassiveButton>();
break;
}
} }
var generalTab = mouseMoveToggle.transform.parent.parent.parent; var generalTab = mouseMoveToggle.transform.parent.parent.parent;
@@ -70,8 +73,11 @@ public class ClientOptionItem
modOptionsPassiveButton.OnClick = new(); modOptionsPassiveButton.OnClick = new();
modOptionsPassiveButton.OnClick.AddListener(new Action(() => { CustomBackground.gameObject.SetActive(true); })); modOptionsPassiveButton.OnClick.AddListener(new Action(() => { CustomBackground.gameObject.SetActive(true); }));
if (leaveButton != null) if (leaveButton != null && leaveButton.transform != null)
{
leaveButton.transform.localPosition = new(-1.35f, -2.411f, -1f); leaveButton.transform.localPosition = new(-1.35f, -2.411f, -1f);
}
if (returnButton != null) if (returnButton != null)
returnButton.transform.localPosition = new(1.35f, -2.411f, -1f); returnButton.transform.localPosition = new(1.35f, -2.411f, -1f);
} }
@@ -89,7 +95,7 @@ public class ClientOptionItem
passiveButton.OnClick = new(); passiveButton.OnClick = new();
passiveButton.OnClick.AddListener(new Action(() => passiveButton.OnClick.AddListener(new Action(() =>
{ {
config.Value = !config.Value; if (config != null) config.Value = !config.Value;
UpdateToggle(); UpdateToggle();
additionalOnClickAction?.Invoke(); additionalOnClickAction?.Invoke();
})); }));
@@ -114,7 +120,7 @@ public class ClientOptionItem
{ {
if (ToggleButton == null) return; if (ToggleButton == null) return;
var color = Config.Value ? new(255, 192, 203, byte.MaxValue) : new Color32(77, 77, 77, byte.MaxValue); var color = Config is { Value: true } ? new(255, 192, 203, byte.MaxValue) : new Color32(77, 77, 77, byte.MaxValue);
ToggleButton.Background.color = color; ToggleButton.Background.color = color;
ToggleButton.Rollover?.ChangeOutColor(color); ToggleButton.Rollover?.ChangeOutColor(color);
} }
+8 -1
View File
@@ -137,7 +137,7 @@ internal static class CustomRoleSelector
foreach (var role in EnumHelper.GetAllValues<CustomRoles>()) foreach (var role in EnumHelper.GetAllValues<CustomRoles>())
{ {
int chance = role.GetMode(); int chance = role.GetMode();
if (role.IsVanilla() || chance == 0 || role.IsAdditionRole() || (role.OnlySpawnsWithPets() && !Options.UsePets.GetBool())) continue; if (role.IsVanilla() || chance == 0 || role.IsAdditionRole() || (role.OnlySpawnsWithPets() && !Options.UsePets.GetBool()) || (role != CustomRoles.Randomizer && role.IsCrewmate() && Options.AprilFoolsMode.GetBool())) continue;
switch (role) switch (role)
{ {
case CustomRoles.Commander when optImpNum <= 1 && Commander.CannotSpawnAsSoloImp.GetBool(): case CustomRoles.Commander when optImpNum <= 1 && Commander.CannotSpawnAsSoloImp.GetBool():
@@ -155,6 +155,13 @@ internal static class CustomRoleSelector
} }
int count = role.GetCount(); int count = role.GetCount();
if (role == CustomRoles.Randomizer && Options.AprilFoolsMode.GetBool())
{
chance = 100;
count = 15;
}
RoleAssignInfo info = new(role, chance, count); RoleAssignInfo info = new(role, chance, count);
if (role.IsImpostor()) Roles[RoleAssignType.Impostor].Add(info); if (role.IsImpostor()) Roles[RoleAssignType.Impostor].Add(info);
+1
View File
@@ -10,6 +10,7 @@ namespace EHR;
/* /*
* Roles that use the same code as another role: * Roles that use the same code as another role:
*
* Nuker = Bomber * Nuker = Bomber
* Undertaker = Assassin * Undertaker = Assassin
* Chameleon = Swooper * Chameleon = Swooper
+12
View File
@@ -740,6 +740,9 @@ public static class Options
public static OptionItem SpawnAdditionalRefugeeOnImpsDead; public static OptionItem SpawnAdditionalRefugeeOnImpsDead;
public static OptionItem SpawnAdditionalRefugeeWhenNKAlive; public static OptionItem SpawnAdditionalRefugeeWhenNKAlive;
public static OptionItem SpawnAdditionalRefugeeMinAlivePlayers;
public static OptionItem AprilFoolsMode;
// 投票モード // 投票モード
@@ -1733,6 +1736,15 @@ public static class Options
.SetGameMode(CustomGameMode.Standard) .SetGameMode(CustomGameMode.Standard)
.SetColor(Color.magenta) .SetColor(Color.magenta)
.SetParent(SpawnAdditionalRefugeeOnImpsDead); .SetParent(SpawnAdditionalRefugeeOnImpsDead);
SpawnAdditionalRefugeeMinAlivePlayers = IntegerOptionItem.Create(23859, "SpawnAdditionalRefugeeMinAlivePlayers", new(1, 14, 1), 7, TabGroup.TaskSettings, false)
.SetGameMode(CustomGameMode.Standard)
.SetColor(Color.magenta)
.SetParent(SpawnAdditionalRefugeeOnImpsDead);
AprilFoolsMode = BooleanOptionItem.Create(23860, "AprilFoolsMode", Main.IsAprilFools, TabGroup.TaskSettings, false)
.SetGameMode(CustomGameMode.Standard)
.SetHeader(true)
.SetColor(new Color32(255, 153, 153, byte.MaxValue));
//Disable Short Tasks //Disable Short Tasks
+167
View File
@@ -0,0 +1,167 @@
using HarmonyLib;
using Il2CppSystem;
using static CosmeticsLayer;
namespace EHR.Patches;
[HarmonyPatch(typeof(AprilFoolsMode), nameof(AprilFoolsMode.ShouldShowAprilFoolsToggle))]
public static class ShouldShowTogglePatch
{
public static void Postfix(ref bool __result)
{
__result = false;
}
}
[HarmonyPatch(typeof(NormalGameManager), nameof(NormalGameManager.GetBodyType))]
public static class GetNormalBodyTypePatch
{
public static void Postfix(ref PlayerBodyTypes __result)
{
if (Main.HorseMode.Value)
{
__result = PlayerBodyTypes.Horse;
return;
}
if (Main.LongMode.Value)
{
__result = PlayerBodyTypes.Long;
return;
}
__result = PlayerBodyTypes.Normal;
}
}
[HarmonyPatch(typeof(HideAndSeekManager), nameof(HideAndSeekManager.GetBodyType))]
public static class GetHnsBodyTypePatch
{
public static void Postfix(ref PlayerBodyTypes __result, [HarmonyArgument(0)] PlayerControl player)
{
if (player == null || player.Data == null || player.Data.Role == null)
{
if (Main.HorseMode.Value)
{
__result = PlayerBodyTypes.Horse;
return;
}
if (Main.LongMode.Value)
{
__result = PlayerBodyTypes.Long;
return;
}
__result = PlayerBodyTypes.Normal;
}
else if (Main.HorseMode.Value)
{
if (player.Data.Role.IsImpostor)
{
__result = PlayerBodyTypes.Normal;
return;
}
__result = PlayerBodyTypes.Horse;
}
else if (Main.LongMode.Value)
{
if (player.Data.Role.IsImpostor)
{
__result = PlayerBodyTypes.LongSeeker;
return;
}
__result = PlayerBodyTypes.Long;
}
else
{
if (player.Data.Role.IsImpostor)
{
__result = PlayerBodyTypes.Seeker;
return;
}
__result = PlayerBodyTypes.Normal;
}
}
}
[HarmonyPatch(typeof(LongBoiPlayerBody))]
public static class LongBoiPatches
{
[HarmonyPatch(nameof(LongBoiPlayerBody.Awake))]
[HarmonyPrefix]
public static bool LongBoyAwake_Patch(LongBoiPlayerBody __instance)
{
__instance.cosmeticLayer.OnSetBodyAsGhost += (Action)__instance.SetPoolableGhost;
__instance.cosmeticLayer.OnColorChange += (Action<int>)__instance.SetHeightFromColor;
__instance.cosmeticLayer.OnCosmeticSet += (Action<string, int, CosmeticKind>)__instance.OnCosmeticSet;
__instance.gameObject.layer = 8;
return false;
}
[HarmonyPatch(nameof(LongBoiPlayerBody.Start))]
[HarmonyPrefix]
public static bool LongBoyStart_Patch(LongBoiPlayerBody __instance)
{
__instance.ShouldLongAround = true;
if (__instance.hideCosmeticsQC)
{
__instance.cosmeticLayer.SetHatVisorVisible(false);
}
__instance.SetupNeckGrowth();
if (__instance.isExiledPlayer)
{
ShipStatus instance = ShipStatus.Instance;
if (instance == null || instance.Type != ShipStatus.MapType.Fungle)
{
__instance.cosmeticLayer.AdjustCosmeticRotations(-17.75f);
}
}
if (!__instance.isPoolablePlayer)
{
__instance.cosmeticLayer.ValidateCosmetics();
}
if (__instance.myPlayerControl)
{
__instance.StopAllCoroutines();
__instance.SetHeightFromColor(__instance.myPlayerControl.Data.DefaultOutfit.ColorId);
}
return false;
}
[HarmonyPatch(nameof(LongBoiPlayerBody.SetHeighFromDistanceHnS))]
[HarmonyPrefix]
public static bool LongBoyNeckSize_Patch(LongBoiPlayerBody __instance, ref float distance)
{
__instance.targetHeight = distance / 10f + 0.5f;
__instance.SetupNeckGrowth(true);
return false;
}
[HarmonyPatch(typeof(HatManager), nameof(HatManager.CheckLongModeValidCosmetic))]
[HarmonyPrefix]
public static bool CheckLongMode_Patch(HatManager __instance, out bool __result, ref string cosmeticID, ref bool ignoreLongMode)
{
if (AprilFoolsMode.ShouldHorseAround() || AprilFoolsMode.ShouldLongAround())
{
__result = true;
return false;
}
if (string.Equals("skin_rhm", cosmeticID))
{
__result = false;
return false;
}
__result = true;
return false;
}
}
+53
View File
@@ -16,6 +16,8 @@ public static class OptionsMenuBehaviourStartPatch
private static ClientOptionItem EnableCustomSoundEffect; private static ClientOptionItem EnableCustomSoundEffect;
private static ClientOptionItem SwitchVanilla; private static ClientOptionItem SwitchVanilla;
private static ClientOptionItem DarkTheme; private static ClientOptionItem DarkTheme;
private static ClientOptionItem HorseMode;
private static ClientOptionItem LongMode;
#if DEBUG #if DEBUG
private static ClientOptionItem VersionCheat; private static ClientOptionItem VersionCheat;
private static ClientOptionItem GodMode; private static ClientOptionItem GodMode;
@@ -26,6 +28,7 @@ public static class OptionsMenuBehaviourStartPatch
if (__instance.DisableMouseMovement == null) return; if (__instance.DisableMouseMovement == null) return;
Main.SwitchVanilla.Value = false; Main.SwitchVanilla.Value = false;
if (Main.ResetOptions || !DebugModeManager.AmDebugger) if (Main.ResetOptions || !DebugModeManager.AmDebugger)
{ {
Main.ResetOptions = false; Main.ResetOptions = false;
@@ -48,9 +51,11 @@ public static class OptionsMenuBehaviourStartPatch
Logger.SendInGame(string.Format(Translator.GetString("FPSSetTo"), Application.targetFrameRate)); Logger.SendInGame(string.Format(Translator.GetString("FPSSetTo"), Application.targetFrameRate));
} }
} }
if (AutoStart == null || AutoStart.ToggleButton == null) if (AutoStart == null || AutoStart.ToggleButton == null)
{ {
AutoStart = ClientOptionItem.Create("AutoStart", Main.AutoStart, __instance, AutoStartButtonToggle); AutoStart = ClientOptionItem.Create("AutoStart", Main.AutoStart, __instance, AutoStartButtonToggle);
static void AutoStartButtonToggle() static void AutoStartButtonToggle()
{ {
if (Main.AutoStart.Value == false && GameStates.IsCountDown) if (Main.AutoStart.Value == false && GameStates.IsCountDown)
@@ -60,35 +65,83 @@ public static class OptionsMenuBehaviourStartPatch
} }
} }
} }
if (ForceOwnLanguage == null || ForceOwnLanguage.ToggleButton == null) if (ForceOwnLanguage == null || ForceOwnLanguage.ToggleButton == null)
{ {
ForceOwnLanguage = ClientOptionItem.Create("ForceOwnLanguage", Main.ForceOwnLanguage, __instance); ForceOwnLanguage = ClientOptionItem.Create("ForceOwnLanguage", Main.ForceOwnLanguage, __instance);
} }
if (ForceOwnLanguageRoleName == null || ForceOwnLanguageRoleName.ToggleButton == null) if (ForceOwnLanguageRoleName == null || ForceOwnLanguageRoleName.ToggleButton == null)
{ {
ForceOwnLanguageRoleName = ClientOptionItem.Create("ForceOwnLanguageRoleName", Main.ForceOwnLanguageRoleName, __instance); ForceOwnLanguageRoleName = ClientOptionItem.Create("ForceOwnLanguageRoleName", Main.ForceOwnLanguageRoleName, __instance);
} }
if (EnableCustomButton == null || EnableCustomButton.ToggleButton == null) if (EnableCustomButton == null || EnableCustomButton.ToggleButton == null)
{ {
EnableCustomButton = ClientOptionItem.Create("EnableCustomButton", Main.EnableCustomButton, __instance); EnableCustomButton = ClientOptionItem.Create("EnableCustomButton", Main.EnableCustomButton, __instance);
} }
if (EnableCustomSoundEffect == null || EnableCustomSoundEffect.ToggleButton == null) if (EnableCustomSoundEffect == null || EnableCustomSoundEffect.ToggleButton == null)
{ {
EnableCustomSoundEffect = ClientOptionItem.Create("EnableCustomSoundEffect", Main.EnableCustomSoundEffect, __instance); EnableCustomSoundEffect = ClientOptionItem.Create("EnableCustomSoundEffect", Main.EnableCustomSoundEffect, __instance);
} }
if (SwitchVanilla == null || SwitchVanilla.ToggleButton == null) if (SwitchVanilla == null || SwitchVanilla.ToggleButton == null)
{ {
SwitchVanilla = ClientOptionItem.Create("SwitchVanilla", Main.SwitchVanilla, __instance, SwitchVanillaButtonToggle); SwitchVanilla = ClientOptionItem.Create("SwitchVanilla", Main.SwitchVanilla, __instance, SwitchVanillaButtonToggle);
static void SwitchVanillaButtonToggle() static void SwitchVanillaButtonToggle()
{ {
Harmony.UnpatchAll(); Harmony.UnpatchAll();
Main.Instance.Unload(); Main.Instance.Unload();
} }
} }
if (DarkTheme == null || DarkTheme.ToggleButton == null) if (DarkTheme == null || DarkTheme.ToggleButton == null)
{ {
DarkTheme = ClientOptionItem.Create("EnableDarkTheme", Main.DarkTheme, __instance); DarkTheme = ClientOptionItem.Create("EnableDarkTheme", Main.DarkTheme, __instance);
} }
if (HorseMode == null || HorseMode.ToggleButton == null)
{
HorseMode = ClientOptionItem.Create("HorseMode", Main.HorseMode, __instance, SwitchHorseMode);
static void SwitchHorseMode()
{
Main.LongMode.Value = false;
HorseMode.UpdateToggle();
LongMode.UpdateToggle();
foreach (var pc in Main.AllPlayerControls)
{
pc.MyPhysics.SetBodyType(pc.BodyType);
if (pc.BodyType == PlayerBodyTypes.Normal)
{
pc.cosmetics.currentBodySprite.BodySprite.transform.localScale = new(0.5f, 0.5f, 1f);
}
}
}
}
if (LongMode == null || LongMode.ToggleButton == null)
{
LongMode = ClientOptionItem.Create("LongMode", Main.LongMode, __instance, SwitchLongMode);
static void SwitchLongMode()
{
Main.HorseMode.Value = false;
HorseMode.UpdateToggle();
LongMode.UpdateToggle();
foreach (var pc in Main.AllPlayerControls)
{
pc.MyPhysics.SetBodyType(pc.BodyType);
if (pc.BodyType == PlayerBodyTypes.Normal)
{
pc.cosmetics.currentBodySprite.BodySprite.transform.localScale = new(0.5f, 0.5f, 1f);
}
}
}
}
#if DEBUG #if DEBUG
if ((VersionCheat == null || VersionCheat.ToggleButton == null) && DebugModeManager.AmDebugger) if ((VersionCheat == null || VersionCheat.ToggleButton == null) && DebugModeManager.AmDebugger)
{ {
+1 -2
View File
@@ -163,7 +163,7 @@ class ExileControllerWrapUpPatch
if (map != null) Main.AllAlivePlayerControls.Do(map.RandomTeleport); if (map != null) Main.AllAlivePlayerControls.Do(map.RandomTeleport);
} }
if (exiled != null && Options.SpawnAdditionalRefugeeOnImpsDead.GetBool() && !Main.AllAlivePlayerControls.Any(x => x.PlayerId != exiled.PlayerId && (x.Is(CustomRoleTypes.Impostor) || (x.IsNeutralKiller() && Options.SpawnAdditionalRefugeeWhenNKAlive.GetBool())))) if (exiled != null && Options.SpawnAdditionalRefugeeOnImpsDead.GetBool() && Main.AllAlivePlayerControls.Length >= Options.SpawnAdditionalRefugeeMinAlivePlayers.GetInt() && !CustomRoles.Refugee.RoleExist(countDead: true) && !Main.AllAlivePlayerControls.Any(x => x.PlayerId != exiled.PlayerId && (x.Is(CustomRoleTypes.Impostor) || (x.IsNeutralKiller() && Options.SpawnAdditionalRefugeeWhenNKAlive.GetBool()))))
{ {
PlayerControl[] ListToChooseFrom = Options.UsePets.GetBool() ? Main.AllAlivePlayerControls.Where(x => x.PlayerId != exiled.PlayerId && x.Is(CustomRoleTypes.Crewmate)).ToArray() : Main.AllAlivePlayerControls.Where(x => x.PlayerId != exiled.PlayerId && x.Is(CustomRoleTypes.Crewmate) && x.GetCustomRole().GetRoleTypes() == RoleTypes.Impostor).ToArray(); PlayerControl[] ListToChooseFrom = Options.UsePets.GetBool() ? Main.AllAlivePlayerControls.Where(x => x.PlayerId != exiled.PlayerId && x.Is(CustomRoleTypes.Crewmate)).ToArray() : Main.AllAlivePlayerControls.Where(x => x.PlayerId != exiled.PlayerId && x.Is(CustomRoleTypes.Crewmate) && x.GetCustomRole().GetRoleTypes() == RoleTypes.Impostor).ToArray();
@@ -172,7 +172,6 @@ class ExileControllerWrapUpPatch
var index = IRandom.Instance.Next(0, ListToChooseFrom.Length); var index = IRandom.Instance.Next(0, ListToChooseFrom.Length);
var pc = ListToChooseFrom[index]; var pc = ListToChooseFrom[index];
pc.RpcSetCustomRole(CustomRoles.Refugee); pc.RpcSetCustomRole(CustomRoles.Refugee);
pc.ResetKillCooldown();
pc.SetKillCooldown(); pc.SetKillCooldown();
Logger.Warn($"{pc.GetRealName()} is now a Refugee since all Impostors are dead", "Add Refugee"); Logger.Warn($"{pc.GetRealName()} is now a Refugee since all Impostors are dead", "Add Refugee");
} }
+3
View File
@@ -2892,6 +2892,9 @@
"WhackAMole": "Whack-A-Mole", "WhackAMole": "Whack-A-Mole",
"SpawnAdditionalRefugeeOnImpsDead": "Random <#8cffff>Crewmate</color> Turns To <#ff1919>Renegade</color> When All <#ff1919>Impostors</color> Die", "SpawnAdditionalRefugeeOnImpsDead": "Random <#8cffff>Crewmate</color> Turns To <#ff1919>Renegade</color> When All <#ff1919>Impostors</color> Die",
"SpawnAdditionalRefugeeWhenNKAlive": "Spawn Even If a <#ffab1b>Neutral Killer</color> is Alive", "SpawnAdditionalRefugeeWhenNKAlive": "Spawn Even If a <#ffab1b>Neutral Killer</color> is Alive",
"SpawnAdditionalRefugeeMinAlivePlayers": "Minimum Number of Alive Players to Spawn",
"HorseMode": "Horse Mode",
"LongMode": "Long Mode",
"NoPetActionMsg1": "You just ate a cookie", "NoPetActionMsg1": "You just ate a cookie",
"NoPetActionMsg2": "You look around", "NoPetActionMsg2": "You look around",
"NoPetActionMsg3": "You start wondering whether you are sus or not", "NoPetActionMsg3": "You start wondering whether you are sus or not",
+14 -11
View File
@@ -99,19 +99,22 @@ public class Werewolf : RoleBase
var now = Utils.TimeStamp; var now = Utils.TimeStamp;
if (lastTime != -10 && !player.IsModClient()) if (lastTime != -10)
{ {
var cooldown = lastTime + (long)RampageCD.GetFloat() - now; if (!player.IsModClient())
if ((int)cooldown != CD) player.Notify(string.Format(GetString("CDPT"), cooldown + 1), 1.1f); {
CD = (int)cooldown; var cooldown = lastTime + (long)RampageCD.GetFloat() - now;
} if ((int)cooldown != CD) player.Notify(string.Format(GetString("CDPT"), cooldown + 1), 1.1f);
CD = (int)cooldown;
}
if (lastTime + (long)RampageCD.GetFloat() < now) if (lastTime + (long)RampageCD.GetFloat() < now)
{ {
lastTime = -10; lastTime = -10;
if (!player.IsModClient()) player.Notify(GetString("WWCanRampage")); if (!player.IsModClient()) player.Notify(GetString("WWCanRampage"));
SendRPC(); SendRPC();
CD = 0; CD = 0;
}
} }
if (lastFixedTime != now && RampageTime != -10) if (lastFixedTime != now && RampageTime != -10)
+4
View File
@@ -64,6 +64,8 @@ public class Main : BasePlugin
public static ConfigEntry<bool> VersionCheat { get; private set; } public static ConfigEntry<bool> VersionCheat { get; private set; }
public static ConfigEntry<bool> GodMode { get; private set; } public static ConfigEntry<bool> GodMode { get; private set; }
public static ConfigEntry<bool> DarkTheme { get; private set; } public static ConfigEntry<bool> DarkTheme { get; private set; }
public static ConfigEntry<bool> HorseMode { get; private set; }
public static ConfigEntry<bool> LongMode { get; private set; }
public static Dictionary<byte, PlayerVersion> PlayerVersion = []; public static Dictionary<byte, PlayerVersion> PlayerVersion = [];
@@ -221,6 +223,8 @@ public class Main : BasePlugin
VersionCheat = Config.Bind("Client Options", "VersionCheat", false); VersionCheat = Config.Bind("Client Options", "VersionCheat", false);
GodMode = Config.Bind("Client Options", "GodMode", false); GodMode = Config.Bind("Client Options", "GodMode", false);
DarkTheme = Config.Bind("Client Options", "DarkTheme", false); DarkTheme = Config.Bind("Client Options", "DarkTheme", false);
HorseMode = Config.Bind("Client Options", "HorseMode", false);
LongMode = Config.Bind("Client Options", "LongMode", false);
Logger = BepInEx.Logging.Logger.CreateLogSource("EHR"); Logger = BepInEx.Logging.Logger.CreateLogSource("EHR");
EHR.Logger.Enable(); EHR.Logger.Enable();