mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-19 15:51:58 +00:00
37 lines
872 B
C#
37 lines
872 B
C#
namespace EHR.Roles;
|
|
|
|
public class PhantomEHR : RoleBase
|
|
{
|
|
public static bool On;
|
|
|
|
public override bool IsEnable => On;
|
|
|
|
public override void SetupCustomOption() { }
|
|
|
|
public override void Init()
|
|
{
|
|
On = false;
|
|
}
|
|
|
|
public override void Add(byte playerId)
|
|
{
|
|
On = true;
|
|
}
|
|
|
|
public override bool OnVanish(PlayerControl pc)
|
|
{
|
|
pc.RpcMakeInvisible(phantom: true);
|
|
LateTask.New(() =>
|
|
{
|
|
if (ReportDeadBodyPatch.MeetingStarted || GameStates.IsMeeting) return;
|
|
pc.RpcMakeVisible(phantom: true);
|
|
pc.RpcResetAbilityCooldown();
|
|
}, ImpostorVanillaRoles.PhantomDuration.GetFloat(), "PhantomEHR Appear");
|
|
return false;
|
|
}
|
|
|
|
public override bool CanUseKillButton(PlayerControl pc)
|
|
{
|
|
return !Main.Invisible.Contains(pc.PlayerId);
|
|
}
|
|
} |