private static void PlayerGraphics_ApplyPalette(On.PlayerGraphics.orig_ApplyPalette orig, PlayerGraphics self, RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, RoomPalette palette) { orig.Invoke(self, sLeaser, rCam, palette); if (self.owner is Player && (self.owner as Player).Karma >= 9) { Color c = Color.Lerp(KarmaAppetite.GranOrange, Color.yellow, 0.3f); sLeaser.sprites[9].color = Color.Lerp(c, Color.white, 0.5f); } }
private void ApplyPaletteHook(On.PlayerGraphics.orig_ApplyPalette orig, PlayerGraphics self, RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, RoomPalette palette) { if (self.player.playerState.slugcatCharacter == PlayerManager.GetCustomPlayer("Electric").SlugcatIndex) { for (int i = 0; i < EVars.Count; i++) { if (EVars[i].ply == self.player) { Color color = PlayerGraphics.SlugcatColor(self.player.playerState.slugcatCharacter); Color color2 = palette.blackColor; if (self.malnourished > 0f) { float num = (!self.player.Malnourished) ? Mathf.Max(0f, self.malnourished - 0.005f) : self.malnourished; color = Color.Lerp(color, Color.gray, 0.4f * num); color2 = Color.Lerp(color2, Color.Lerp(Color.white, palette.fogColor, 0.5f), 0.2f * num * num); } color = EVars[i].ElectricBodyColor(EVars[i].chargedActive, EVars[i].chargedTimer, EVars[i].stunDelay); color2 = palette.blackColor; for (int s = 0; s < sLeaser.sprites.Length; s++) { sLeaser.sprites[s].color = color; } sLeaser.sprites[11].color = Color.Lerp(PlayerGraphics.SlugcatColor(self.player.playerState.slugcatCharacter), Color.white, 0.3f); sLeaser.sprites[9].color = color2; sLeaser.sprites[12].color = EVars[i].AntennaBaseColor(EVars[i].chargedActive); sLeaser.sprites[13].color = EVars[i].AntennaTipColor(EVars[i].chargedActive, EVars[i].receivingMessage); if (EVars[i].receivingMessage && EVars[i].chargedActive) { sLeaser.sprites[9].color = EVars[i].AntennaTipColor(true, true); } } } } else { orig.Invoke(self, sLeaser, rCam, palette); } }