mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
26 lines
764 B
C#
26 lines
764 B
C#
using HarmonyLib;
|
|
using MiraAPI.Events;
|
|
using MiraAPI.Events.Vanilla.Gameplay;
|
|
|
|
namespace MiraAPI.Patches;
|
|
|
|
/// <summary>
|
|
/// General patches for the KillAnimation class.
|
|
/// </summary>
|
|
[HarmonyPatch]
|
|
public static class KillAnimationPatches
|
|
{
|
|
/// <summary>
|
|
/// Used to trigger the <see cref="AfterMurderEvent"/>.
|
|
/// </summary>
|
|
/// <param name="source">The killer.</param>
|
|
/// <param name="target">The target.</param>
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch(typeof(KillAnimation), nameof(KillAnimation.CoPerformKill))]
|
|
public static void KillAnimPostfix(PlayerControl source, PlayerControl target)
|
|
{
|
|
var afterMurderEvent = new AfterMurderEvent(source, target);
|
|
MiraEventManager.InvokeEvent(afterMurderEvent);
|
|
}
|
|
}
|