mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Fix bugs
This commit is contained in:
1 parent
101079e0b9
commit
fdf706e293
6 files changed
+12
-45
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user