Beispiel #1
0
 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);
     }
 }
Beispiel #2
0
        private static void ApplyPaletteHK(On.PlayerGraphics.orig_ApplyPalette orig, PlayerGraphics self,
                                           RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam, RoomPalette palette)
        {
            orig(self, sLeaser, rCam, palette);
            Color           body;
            AbsPhyObjFields field = AbstractPhysicalObjectHK.GetField(self.owner.abstractPhysicalObject);

            if (!MonklandSteamManager.isInGame)
            {
                body = PlayerGraphics.SlugcatColor(self.player.playerState.slugcatCharacter);
            }
            else
            {
                body = MonklandSteamManager.GameManager.playerColors[MonklandSteamManager.connectedPlayers.IndexOf(field.owner)];
            }
            Color eyes = palette.blackColor;

            if (self.malnourished > 0f)
            {
                float num = (!self.player.Malnourished) ? Mathf.Max(0f, self.malnourished - 0.005f) : self.malnourished;
                body = Color.Lerp(body, Color.gray, 0.4f * num);
                eyes = Color.Lerp(eyes, Color.Lerp(Color.white, palette.fogColor, 0.5f), 0.2f * num * num);
            }
            if (self.player.playerState.slugcatCharacter == 3)
            {
                eyes = Color.Lerp(new Color(1f, 1f, 1f), body, 0.3f);
                body = Color.Lerp(palette.blackColor, Custom.HSL2RGB(0.63055557f, 0.54f, 0.5f), Mathf.Lerp(0.08f, 0.04f, palette.darkness));
            }
            for (int i = 0; i < 12; i++) // Hardcoded sLeaser.sprites.Length to prevent ignoring sprite adding mods
            {
                sLeaser.sprites[i].color = body;
            }
            if (MonklandSteamManager.isInGame)
            {
                sLeaser.sprites[11].color = Color.Lerp(MonklandSteamManager.GameManager.playerColors[MonklandSteamManager.connectedPlayers.IndexOf(field.owner)], Color.white, 0.3f);
                sLeaser.sprites[10].color = MonklandSteamManager.GameManager.playerColors[MonklandSteamManager.connectedPlayers.IndexOf(field.owner)];
                sLeaser.sprites[9].color  = MonklandSteamManager.GameManager.playerEyeColors[MonklandSteamManager.connectedPlayers.IndexOf(field.owner)];
            }
            else
            {
                sLeaser.sprites[11].color = Color.Lerp(PlayerGraphics.SlugcatColor(self.player.playerState.slugcatCharacter), Color.white, 0.3f);
                sLeaser.sprites[10].color = PlayerGraphics.SlugcatColor(self.player.playerState.slugcatCharacter);
                sLeaser.sprites[9].color  = eyes;
            }
        }
Beispiel #3
0
 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);
     }
 }