]> git.deb.at Git - rhonda/theotherroles.git/commitdiff
Show an orange flash to the killer of the bait, can be turned of in settings
authorgendelo3 <gendelo3@gmail.com>
Sat, 11 Sep 2021 09:45:09 +0000 (11:45 +0200)
committergendelo3 <gendelo3@gmail.com>
Sat, 11 Sep 2021 09:45:09 +0000 (11:45 +0200)
TheOtherRoles/CustomOptions.cs
TheOtherRoles/Patches/PlayerControlPatch.cs

index e63afc0b307bb4f664f718c4450a42a06d4cc58a..041f7ef90ca87455042769ee58a1190dca1c7605 100644 (file)
@@ -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);
index 96f07872adb64e37f62acf8d6cd6bb4691fe6bef..bfc7e6f09219281846c0d4caa0779e182a3a9cb0 100644 (file)
@@ -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<float>((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;
+                })));
+            }
         }
     }