From: gendelo3 Date: Sat, 11 Sep 2021 09:45:09 +0000 (+0200) Subject: Show an orange flash to the killer of the bait, can be turned of in settings X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=80a0a9060e68009af69a1ebf1e78ead7a216ed47;p=rhonda%2Ftheotherroles.git Show an orange flash to the killer of the bait, can be turned of in settings --- diff --git a/TheOtherRoles/CustomOptions.cs b/TheOtherRoles/CustomOptions.cs index e63afc0..041f7ef 100644 --- a/TheOtherRoles/CustomOptions.cs +++ b/TheOtherRoles/CustomOptions.cs @@ -165,6 +165,7 @@ namespace TheOtherRoles { public static CustomOption baitSpawnRate; public static CustomOption baitHighlightAllVents; public static CustomOption baitReportDelay; + public static CustomOption baitShowKillFlash; public static CustomOption maxNumberOfMeetings; public static CustomOption blockSkippingInEmergencyMeetings; @@ -339,6 +340,7 @@ namespace TheOtherRoles { baitSpawnRate = CustomOption.Create(330, cs(Bait.color, "Bait"), rates, null, true); baitHighlightAllVents = CustomOption.Create(331, "Highlight All Vents If A Vent Is Occupied", false, baitSpawnRate); baitReportDelay = CustomOption.Create(332, "Bait Report Delay", 0f, 0f, 10f, 1f, baitSpawnRate); + baitShowKillFlash = CustomOption.Create(335, "Show Flash to Baits Killer", true, baitSpawnRate); // Other options maxNumberOfMeetings = CustomOption.Create(3, "Number Of Meetings (excluding Mayor meeting)", 10, 0, 15, 1, null, true); diff --git a/TheOtherRoles/Patches/PlayerControlPatch.cs b/TheOtherRoles/Patches/PlayerControlPatch.cs index 96f0787..bfc7e6f 100644 --- a/TheOtherRoles/Patches/PlayerControlPatch.cs +++ b/TheOtherRoles/Patches/PlayerControlPatch.cs @@ -790,6 +790,26 @@ namespace TheOtherRoles.Patches { else BountyHunter.bountyHunter.SetKillTimer(PlayerControl.GameOptions.KillCooldown + BountyHunter.punishmentTime); } + + // Show flash on bait kill to the killer if enabled + if (Bait.bait != null && PlayerControl.LocalPlayer == deadPlayer.killerIfExisting && target == Bait.bait + && CustomOptionHolder.baitShowKillFlash.getBool() && __instance == PlayerControl.LocalPlayer) { + HudManager.Instance.FullScreen.enabled = true; + HudManager.Instance.StartCoroutine(Effects.Lerp(1f, new Action((p) => { + var renderer = HudManager.Instance.FullScreen; + if (p < 0.5) + { + if (renderer != null) + renderer.color = new Color(204f / 255f, 102f / 255f, 0f / 255f, Mathf.Clamp01(p * 2 * 0.75f)); + } + else + { + if (renderer != null) + renderer.color = new Color(204f / 255f, 102f / 255f, 0f / 255f, Mathf.Clamp01((1 - p) * 2 * 0.75f)); + } + if (p == 1f && renderer != null) renderer.enabled = false; + }))); + } } }