Add Evader

This commit is contained in:
Gurge44 committed 2026-08-13 14:56:15 +02:00
1 parent 8a2ea406da
commit a8e0a5db02
6 files changed
+65 -5

No files matched your search

+1
View File
@@ -201,6 +201,7 @@ public enum CustomRoles
Electric,
Enigma,
Escort,
Evader,
Express,
Farmer,
Forensic,
+1
View File
@@ -513,6 +513,7 @@ public class Main : BasePlugin
{ CustomRoles.Vacuum, "#E44CD6" },
{ CustomRoles.Carrier, "#5DE2E7" },
{ CustomRoles.Transmitter, "#c9a11e" },
{ CustomRoles.Evader, "#A4B1DE" },
{ CustomRoles.Bouncer, "#95C8E8" },
{ CustomRoles.Operative, "#47f5d2" },
{ CustomRoles.Tar, "#8C796B" },
+2
View File
@@ -255,6 +255,7 @@ internal static class CustomRolesHelper
CustomRoles.Farmer => CustomRoles.Crewmate,
CustomRoles.Captain => CustomRoles.Crewmate,
CustomRoles.Transmitter => CustomRoles.Crewmate,
CustomRoles.Evader => CustomRoles.Crewmate,
CustomRoles.Bouncer => CustomRoles.Crewmate,
CustomRoles.Tar => CustomRoles.Crewmate,
CustomRoles.Sensor => CustomRoles.Crewmate,
@@ -1371,6 +1372,7 @@ internal static class CustomRolesHelper
CustomRoles.CameraMan => RoleOptionType.Crewmate_Miscellaneous,
CustomRoles.Carrier => RoleOptionType.Crewmate_Miscellaneous,
CustomRoles.Demolitionist => RoleOptionType.Crewmate_Miscellaneous,
CustomRoles.Evader => RoleOptionType.Crewmate_Miscellaneous,
CustomRoles.Express => RoleOptionType.Crewmate_Miscellaneous,
CustomRoles.LazyGuy => RoleOptionType.Crewmate_Miscellaneous,
CustomRoles.Journalist => RoleOptionType.Crewmate_Miscellaneous,
+35 -5
View File
@@ -181,7 +181,24 @@ internal static class UpdateSystemPatch
break;
}
case SystemTypes.Sabotage when AmongUsClient.Instance.NetworkMode != NetworkModes.FreePlay:
return SabotageSystemTypeUpdateSystemPatch.CheckSabotage(__instance.Systems[SystemTypes.Sabotage].CastFast<SabotageSystemType>(), player, systemType);
{
bool allowed = SabotageSystemTypeUpdateSystemPatch.CheckSabotage(__instance.Systems[SystemTypes.Sabotage].CastFast<SabotageSystemType>(), player, systemType);
if (allowed)
{
List<PlayerControl> pcs = Main.CachedAlivePlayerControls();
for (var index = 0; index < pcs.Count; index++)
{
PlayerControl pc = pcs[index];
if (pc.Is(CustomRoles.Evader))
pc.RpcMakeInvisible();
}
}
return allowed;
}
case SystemTypes.Security when amount == 1:
{
bool camerasDisabled = Main.CurrentMap switch
@@ -232,12 +249,25 @@ internal static class UpdateSystemPatch
{
bool petcd = !Options.UsePhantomBasis.GetBool();
foreach (PlayerControl pc in Main.CachedAlivePlayerControls())
List<PlayerControl> pcs = Main.CachedAlivePlayerControls();
for (var index = 0; index < pcs.Count; index++)
{
if (pc.Is(CustomRoles.Wiper))
PlayerControl pc = pcs[index];
switch (pc.GetCustomRole())
{
if (petcd) pc.AddAbilityCD();
else pc.RpcResetAbilityCooldown();
case CustomRoles.Wiper:
{
if (petcd) pc.AddAbilityCD();
else pc.RpcResetAbilityCooldown();
break;
}
case CustomRoles.Evader:
{
pc.RpcMakeVisible();
break;
}
}
}
}
+3
View File
@@ -766,6 +766,9 @@
"EscortBlockDuration": "Role-Block Duration",
"EscortKillButtonText": "Role-Block",
"EscortTargetHacked": "Target successfully role-blocked",
"Evader": "Evader",
"EvaderInfo": "You're Invisible During Sabotages",
"EvaderInfoLong": "(Crewmates):\\nAs the Evader, you are invisible during sabotages.",
"Examiner": "Examiner",
"ExaminerInfo": "Gather Info, Solve Murders",
"ExaminerInfoLong": "(Crewmates):\\nGrants Detective abilities for crewmate roles.",
@@ -0,0 +1,23 @@
namespace EHR.Roles;
public class Evader : RoleBase
{
public static bool On;
public override bool IsEnable => On;
public override void SetupCustomOption()
{
StartSetup(659800);
}
public override void Init()
{
On = false;
}
public override void Add(byte playerId)
{
On = true;
}
}