This commit is contained in:
Gurge44 committed 2024-05-23 10:08:47 +02:00
1 parent 101079e0b9
commit fdf706e293
6 files changed
+12 -45

No files matched your search

+1
View File
@@ -228,6 +228,7 @@ internal class RPCHandlerPatch
public static void Postfix(PlayerControl __instance, [HarmonyArgument(0)] byte callId, [HarmonyArgument(1)] MessageReader reader)
{
if (AmongUsClient.Instance.AmHost) return;
var rpcType = (CustomRPC)callId;
switch (rpcType)
{
+1
View File
@@ -1496,6 +1496,7 @@ class FixedUpdatePatch
{
Suffix.Append(Bloodmoon.GetSuffix(seer));
if (seer.Is(CustomRoles.Asthmatic)) Suffix.Append(Asthmatic.GetSuffixText(seer.PlayerId));
if (seer.Is(CustomRoles.Sonar)) Suffix.Append(Sonar.GetSuffix(seer, GameStates.IsMeeting));
}
switch (Options.CurrentGameMode)
+1 -1
View File
@@ -263,7 +263,7 @@ public static class SabotageSystemTypeRepairDamagePatch
return false;
}
if (player.Is(CustomRoleTypes.Impostor) && !player.IsAlive() && Options.DeadImpCantSabotage.GetBool()) return false;
if (player.Is(Team.Impostor) && !player.IsAlive() && Options.DeadImpCantSabotage.GetBool()) return false;
bool allow = player.GetCustomRole() switch
{
CustomRoles.Jackal when Jackal.CanSabotage.GetBool() => true,
+1 -1
View File
@@ -120,7 +120,7 @@ class RepairSystemPatch
return false;
}
if (player.Is(CustomRoleTypes.Impostor) && !player.IsAlive() && Options.DeadImpCantSabotage.GetBool()) return false;
if (player.Is(Team.Impostor) && !player.IsAlive() && Options.DeadImpCantSabotage.GetBool()) return false;
return player.GetCustomRole() switch
{
CustomRoles.Jackal when Jackal.CanSabotage.GetBool() => true,
+3 -2
View File
@@ -44,7 +44,7 @@ namespace EHR.Neutral
var opts = Main.RealOptionsData;
Stats = (
opts.GetFloat(FloatOptionNames.KillCooldown),
Options.DefaultKillCooldown,
false,
opts.GetFloat(FloatOptionNames.CrewLightMod),
opts.GetFloat(FloatOptionNames.PlayerSpeedMod),
@@ -116,7 +116,7 @@ namespace EHR.Neutral
{
var banned = new List<Upgrade>();
if (Stats.KillCooldown <= Limits.MinKillCooldown) banned.Add(Upgrade.DecreaseKillCooldown);
if (Stats.Vision >= Limits.MaxVision) banned.Add(Upgrade.GainImpostorVision);
if (Stats.ImpostorVision) banned.Add(Upgrade.GainImpostorVision);
if (Stats.Vision >= Limits.MaxVision) banned.Add(Upgrade.IncreaseVision);
if (Stats.Speed >= Limits.MaxSpeed) banned.Add(Upgrade.IncreaseSpeed);
if (Stats.KillDistance >= Limits.MaxKillDistance) banned.Add(Upgrade.IncreaseKillDistance);
@@ -197,6 +197,7 @@ namespace EHR.Neutral
Stats.SabotageUseLimit = Math.Max(Stats.SabotageUseLimit, 0);
Utils.NotifyRoles(SpecifySeer: EvolverPC, SpecifyTarget: EvolverPC);
Logger.Info($" KCD: {Stats.KillCooldown}, Vision: {Stats.Vision}, Speed: {Stats.Speed}, KDis: {Stats.KillDistance}", "Evolver Stats");
}
public override void OnPet(PlayerControl pc)
+5 -41
View File
@@ -66,48 +66,12 @@ namespace EHR.Neutral
{
if (!base.OnCheckMurder(killer, target)) return false;
WasShifter.Add(killer.PlayerId);
var killerId = killer.PlayerId;
killer.PlayerId = target.PlayerId;
target.PlayerId = killerId;
killer.RpcSetCustomRole(target.GetCustomRole());
if (StealProgress.GetBool())
{
Main.PlayerStates[killer.PlayerId].Role = Main.PlayerStates[target.PlayerId].Role;
killer.SetAbilityUseLimit(target.GetAbilityUseLimit());
}
if (StealAddons.GetBool())
{
var killerSubRoles = killer.GetCustomSubRoles();
var targetSubRoles = target.GetCustomSubRoles();
if (targetSubRoles.Count > 0)
{
killer.RpcSetCustomRole(targetSubRoles[0], replaceAllAddons: true);
targetSubRoles.Skip(1).Do(x => killer.RpcSetCustomRole(x));
}
if (killerSubRoles.Count > 0)
{
target.RpcSetCustomRole(killerSubRoles[0], replaceAllAddons: true);
killerSubRoles.Skip(1).Do(x => target.RpcSetCustomRole(x));
}
}
Main.AbilityCD.Remove(killer.PlayerId);
killer.SyncSettings();
// ------------------------------------------------------------------------------------------
target.RpcSetCustomRole(CustomRoles.Shifter);
Main.AbilityUseLimit.Remove(target.PlayerId);
Utils.SendRPC(CustomRPC.RemoveAbilityUseLimit, target.PlayerId);
target.SyncSettings();
target.SetKillCooldown();
// ------------------------------------------------------------------------------------------
Utils.NotifyRoles(SpecifyTarget: killer);
Utils.NotifyRoles(SpecifyTarget: target);
Utils.SyncAllSettings();
Utils.NotifyRoles(NoCache: true);
return false;
}