Code Cleanup

This commit is contained in:
Gurge44 committed 2023-09-27 22:10:32 +02:00
1 parent 7390e0b152
commit 899f41884c
8 files changed
+15 -17

No files matched your search

-1
View File
@@ -2,7 +2,6 @@ using AmongUs.GameOptions;
using HarmonyLib;
using Hazel;
using InnerNet;
using LibCpp2IL.Elf;
using System;
using System.Collections.Generic;
using System.Linq;
+2 -1
View File
@@ -1767,7 +1767,8 @@ public static class Utils
public static async void NotifyRoles(bool isForMeeting = false, PlayerControl SpecifySeer = null, bool NoCache = false, bool ForceLoop = false, bool CamouflageIsForMeeting = false, bool GuesserIsForMeeting = false)
{
//if (Options.DeepLowLoad.GetBool()) await Task.Run(() => { DoNotifyRoles(isForMeeting, SpecifySeer, NoCache, ForceLoop, CamouflageIsForMeeting, GuesserIsForMeeting); });
/*else */await DoNotifyRoles(isForMeeting, SpecifySeer, NoCache, ForceLoop, CamouflageIsForMeeting, GuesserIsForMeeting);
/*else */
await DoNotifyRoles(isForMeeting, SpecifySeer, NoCache, ForceLoop, CamouflageIsForMeeting, GuesserIsForMeeting);
}
public static Task DoNotifyRoles(bool isForMeeting = false, PlayerControl SpecifySeer = null, bool NoCache = false, bool ForceLoop = false, bool CamouflageIsForMeeting = false, bool GuesserIsForMeeting = false)
+3 -3
View File
@@ -2,7 +2,6 @@ using AmongUs.GameOptions;
using HarmonyLib;
using Hazel;
using InnerNet;
using MS.Internal.Xml.XPath;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -1782,7 +1781,8 @@ class FixedUpdatePatch
}
//if (Options.DeepLowLoad.GetBool()) await Task.Run(() => { DoPostfix(__instance); });
/*else */await DoPostfix(__instance);
/*else */
await DoPostfix(__instance);
}
public static Task DoPostfix(PlayerControl __instance)
@@ -1831,7 +1831,7 @@ class FixedUpdatePatch
if (player.Is(CustomRoles.Vampire)) Vampire.OnFixedUpdate(player);
if (player.Is(CustomRoles.Poisoner)) Poisoner.OnFixedUpdate(player);
if (player.Is(CustomRoles.BountyHunter) && !lowLoad) BountyHunter.FixedUpdate(player);
if (player.Is(CustomRoles.Glitch) && !lowLoad) Glitch.UpdateHackCooldown(player);
if (player.Is(CustomRoles.Glitch) && !lowLoad) Glitch.UpdateHackCooldown(player);
if (player.Is(CustomRoles.SerialKiller)) SerialKiller.FixedUpdate(player);
if (GameStates.IsInTask && PlagueBearer.IsEnable)
if (player.Is(CustomRoles.PlagueBearer) && PlagueBearer.IsPlaguedAll(player))
+2 -2
View File
@@ -1,5 +1,5 @@
using Hazel;
using AmongUs.GameOptions;
using AmongUs.GameOptions;
using Hazel;
using System.Collections.Generic;
using static TOHE.Translator;
+7 -7
View File
@@ -1,9 +1,9 @@
using Hazel;
using System.Linq;
using AmongUs.GameOptions;
using Hazel;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using static TOHE.Options;
using AmongUs.GameOptions;
namespace TOHE.Roles.Neutral;
public static class Bandit
@@ -95,9 +95,9 @@ public static class Bandit
role == CustomRoles.Lovers || // Causes issues involving Lovers Suicide
(role.IsImpOnlyAddon() && !CanStealImpOnlyAddon.GetBool()) ||
(role.IsBetrayalAddon() && !CanStealBetrayalAddon.GetBool()))
{
Logger.Info($"Removed {role} from stealable addons", "Bandit");
AllSubRoles.Remove(role);
{
Logger.Info($"Removed {role} from stealable addons", "Bandit");
AllSubRoles.Remove(role);
}
}
@@ -124,7 +124,7 @@ public static class Bandit
var SelectedAddOn = SelectRandomAddon(target);
if (SelectedAddOn == null) return true; // no stealable addons found on the target.
if (StealMode.GetValue() == 1)
{
{
Main.PlayerStates[target.PlayerId].RemoveSubRole((CustomRoles)SelectedAddOn);
Logger.Info($"Successfully removed {SelectedAddOn} addon from {target.GetNameWithRole()}", "Bandit");
killer.RpcSetCustomRole((CustomRoles)SelectedAddOn);
+1 -1
View File
@@ -62,7 +62,7 @@ public static class Eclipse
float currentVision = Vision;
Vision += VisionIncrease.GetFloat();
if (Vision > MaxVision.GetFloat()) Vision = MaxVision.GetFloat();
if (Vision != currentVision) pc.SyncSettings();
}
}
-1
View File
@@ -1,6 +1,5 @@
using HarmonyLib;
using Hazel;
using MS.Internal.Xml.XPath;
using System.Collections.Generic;
using System.Linq;
using static TOHE.Options;
-1
View File
@@ -1,6 +1,5 @@
using HarmonyLib;
using Hazel;
using MS.Internal.Xml.XPath;
using System.Collections.Generic;
using System.Linq;
using static TOHE.Options;