diff --git a/SingleplayerCoopEmotes.cs b/SingleplayerCoopEmotes.cs index 1d7b53f..3f9ea5e 100644 --- a/SingleplayerCoopEmotes.cs +++ b/SingleplayerCoopEmotes.cs @@ -11,7 +11,7 @@ namespace SingleplayerCoopEmotes { - [BepInPlugin("sabreml.singleplayercoopemotes", "SingleplayerCoopEmotes", "1.1.2")] + [BepInPlugin("sabreml.singleplayercoopemotes", "SingleplayerCoopEmotes", "1.1.3")] public class SingleplayerCoopEmotes : BaseUnityPlugin { public void OnEnable() @@ -40,6 +40,7 @@ private static void Init(On.RainWorld.orig_OnModsInit orig, RainWorld self) On.Player.JollyPointUpdate += JollyPointUpdateHK; On.Player.GraphicsModuleUpdated += GraphicsModuleUpdatedHK; On.Player.checkInput += checkInputHK; + On.PlayerGraphics.PlayerBlink += PlayerBlinkHK; // Manual hook to override the `Player.RevealMap` property getter. new Hook( @@ -135,6 +136,22 @@ private static void checkInputHK(On.Player.orig_checkInput orig, Player self) ModManager.CoopAvailable = false; } + // Called by `PlayerGraphics.Update()` when the player has fully curled up to sleep. + // + // This override is the same as the original except without the Spearmaster check, as it made them inconsistent with + // the other slugcats, and it didn't seem like it was actually used for anything. + private static void PlayerBlinkHK(On.PlayerGraphics.orig_PlayerBlink orig, PlayerGraphics self) + { + if (UnityEngine.Random.value < 0.033333335f) + { + self.blink = Math.Max(2, self.blink); + } + if (self.player.sleepCurlUp == 1f) + { + self.blink = Math.Max(2, self.blink); + } + } + // Same as the original, except without a `ModManager.CoopAvailable` check. private static bool get_RevealMapHK(Func orig, Player self) diff --git a/SingleplayerCoopEmotes/modinfo.json b/SingleplayerCoopEmotes/modinfo.json index 0c331a4..00efdfc 100644 --- a/SingleplayerCoopEmotes/modinfo.json +++ b/SingleplayerCoopEmotes/modinfo.json @@ -1,7 +1,7 @@ { "id": "sabreml.singleplayercoopemotes", "name": "Singleplayer Co-op Emotes", - "version": "1.1.2", + "version": "1.1.3", "target_game_version": "v1.9.05", "authors": "SabreML", "description": "Makes the Jolly Co-op emotes work in singleplayer!"