mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Add Guardian Angel protection checks
This commit is contained in:
1 parent
5680d27db1
commit
6199e55110
2 files changed
+16
-1
No files matched your search
@@ -93,7 +93,12 @@ public static class CustomMurderRpc
|
||||
beforeMurderEvent.Cancel();
|
||||
}
|
||||
|
||||
if (beforeMurderEvent.IsCancelled)
|
||||
if (target.ProtectedByGa())
|
||||
{
|
||||
beforeMurderEvent.Cancel();
|
||||
murderResultFlags = MurderResultFlags.FailedProtected;
|
||||
}
|
||||
else if (beforeMurderEvent.IsCancelled)
|
||||
{
|
||||
murderResultFlags = MurderResultFlags.FailedError;
|
||||
}
|
||||
|
||||
@@ -156,6 +156,16 @@ public static class Extensions
|
||||
return TutorialManager.InstanceExists || AmongUsClient.Instance.HostId == playerControl.OwnerId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if a PlayerControl is protected by a Guardian Angel.
|
||||
/// </summary>
|
||||
/// <param name="playerControl">The player you're checking for.</param>
|
||||
/// <returns>If the player is protected, true, else false.</returns>
|
||||
public static bool ProtectedByGa(this PlayerControl playerControl)
|
||||
{
|
||||
return playerControl.protectedByGuardianId > -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to convert a System.Collections.Generic.List to Il2cppSystem.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user