public static void Prefix(KillAnimation __instance, ref PlayerControl KMMMAPHIMLH, ref PlayerControl IGLDJOKKFJE) { if (Vampire.vampire != null && Vampire.vampire == KMMMAPHIMLH && Vampire.bitten != null && Vampire.bitten == IGLDJOKKFJE) { KMMMAPHIMLH = IGLDJOKKFJE; } }
public static void Prefix(KillAnimation __instance, ref PlayerControl CPKODPCJPOO, ref PlayerControl PAIBDFDMIGK) { if (Vampire.vampire != null && Vampire.vampire == CPKODPCJPOO && Vampire.bitten != null && Vampire.bitten == PAIBDFDMIGK) { CPKODPCJPOO = PAIBDFDMIGK; } }
public static void Prefix(KillAnimation __instance, ref PlayerControl KIJHPICDEAD, ref PlayerControl DGDGDKCCKHJ) { if (Vampire.vampire != null && Vampire.vampire == KIJHPICDEAD && Vampire.bitten != null && Vampire.bitten == DGDGDKCCKHJ) { KIJHPICDEAD = DGDGDKCCKHJ; } }
public static void Prefix(KillAnimation __instance, [HarmonyArgument(0)] ref PlayerControl source, [HarmonyArgument(1)] ref PlayerControl target) { if (Vampire.vampire != null && Vampire.vampire == source && Vampire.bitten != null && Vampire.bitten == target) { source = target; } }
/// <summary> /// Api's reimplementation of <see cref="KillAnimation.CoPerformKill"/><br/> /// Shouldn't be used in regular code /// </summary> public static IEnumerator CoPerformCustomKill(this KillAnimation anim, PlayerControl source, PlayerControl target, CustomMurderOptions options) { FollowerCamera camera = Camera.main !.GetComponent <FollowerCamera>(); bool isParticipant = source == PlayerControl.LocalPlayer || target == PlayerControl.LocalPlayer; KillAnimation.SetMovement(target, false); if (isParticipant) { camera.Locked = true; } target.Die(DeathReason.Kill); DeadBody deadBody = Object.Instantiate(anim.bodyPrefab); // https://github.com/Herysia/AmongUsTryhard Vector3 vector = target.transform.position + anim.BodyOffset; vector.z = vector.y / 1000; deadBody.transform.position = vector; deadBody.ParentId = target.PlayerId; target.SetPlayerMaterialColors(deadBody.GetComponent <Renderer>()); if (!options.HasFlag(CustomMurderOptions.NoSnap)) { KillAnimation.SetMovement(source, false); SpriteAnim sourceAnim = source.GetComponent <SpriteAnim>(); yield return(new WaitForAnimationFinish(sourceAnim, anim.BlurAnim)); source.NetTransform.SnapTo(target.transform.position); sourceAnim.Play(source.MyPhysics.IdleAnim, 1f); KillAnimation.SetMovement(source, true); } KillAnimation.SetMovement(target, true); if (isParticipant) { camera.Locked = false; } }
public void ControlPlayer(PlayerControl controller, PlayerControl target) { target.MyPhysics.body.velocity = Vector2.zero; controller.MyPhysics.body.velocity = Vector2.zero; KillAnimation.SetMovement(controller, false); KillAnimation.SetMovement(controller, true); KillAnimation.SetMovement(target, false); KillAnimation.SetMovement(target, true); Reactor.Coroutines.Start(CoControlPlayer(controller, target)); }
public static void Prefix(KillAnimation __instance, [HarmonyArgument(0)] ref PlayerControl source, [HarmonyArgument(1)] ref PlayerControl target) { if (Vampire.vampire != null && Vampire.vampire == source && Vampire.bitten != null && Vampire.bitten == target) { source = target; } if (Warlock.warlock != null && Warlock.warlock == source && Warlock.curseKillTarget != null && Warlock.curseKillTarget == target) { source = target; Warlock.curseKillTarget = null; // Reset here } }
private static System.Collections.IEnumerator CoPerformKillFixed(KillAnimation __instance, PlayerControl source, PlayerControl target) { FollowerCamera cam = Camera.main.GetComponent <FollowerCamera>(); bool isParticipant = PlayerControl.LocalPlayer == source || PlayerControl.LocalPlayer == target; PlayerPhysics sourcePhys = source.MyPhysics; KillAnimation.SetMovement(source, false); KillAnimation.SetMovement(target, false); if (isParticipant) { cam.Locked = true; } target.Die(DeathReason.Kill); //We spawn dead body before WaitForAnimationFinish, to prevent having delay before the body spawns, while the target is already dead DeadBody deadBody = Object.Instantiate <DeadBody>(__instance.bodyPrefab); Vector3 vector = target.transform.position + __instance.BodyOffset; vector.z = vector.y / 1000f; deadBody.transform.position = vector; deadBody.ParentId = target.PlayerId; target.SetPlayerMaterialColors(deadBody.GetComponent <Renderer>()); // SpriteAnim sourceAnim = source.GetComponent <SpriteAnim>(); yield return(new WaitForAnimationFinish(sourceAnim, __instance.BlurAnim)); source.NetTransform.SnapTo(target.transform.position); sourceAnim.Play(sourcePhys.IdleAnim, 1f); KillAnimation.SetMovement(source, true); // KillAnimation.SetMovement(target, true); if (isParticipant) { cam.Locked = false; } yield break; }