Ejemplo n.º 1
0
        /// <summary>
        /// Checks if the region has albino leviathans configured
        /// </summary>
        private static void BigEel_ctor(On.BigEel.orig_ctor orig, BigEel self, AbstractCreature abstractCreature, World world)
        {
            orig(self, abstractCreature, world);

            if (world != null && !world.singleRoomWorld && world.region != null)
            {
                foreach (KeyValuePair <string, string> keyValues in CustomWorldMod.activatedPacks)
                {
                    if (CustomWorldMod.installedPacks[keyValues.Key].regionConfig.TryGetValue(world.region.name,
                                                                                              out CustomWorldStructs.RegionConfiguration config))
                    {
                        if (config.albinoLevi)
                        {
                            CustomWorldMod.Log($"Albino leviathan in [{world.region.name}] from [{CustomWorldMod.installedPacks[keyValues.Key].name}]",
                                               false, CustomWorldMod.DebugLevel.FULL);
                            self.albino = true;
                            self.iVars.patternColorB     = new HSLColor(0f, 0.6f, 0.75f);
                            self.iVars.patternColorA.hue = 0.5f;
                            self.iVars.patternColorA     = HSLColor.Lerp(self.iVars.patternColorA, new HSLColor(0.97f, 0.8f, 0.75f), 0.9f);
                            break;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public override void GrafUpdate(float dt)
        {
            base.GrafUpdate(dt);
            if (greyedOut)
            {
                this.label.label.color = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.VeryDarkGrey);
                this.rect.color        = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.VeryDarkGrey);
                return;
            }

            this.flash    = Custom.LerpAndTick(this.flash, 0f, 0.03f, 0.166666672f);
            this.greyFade = Custom.LerpAndTick(this.greyFade, (!PolishedMachine.Config.ConfigMenu.freezeMenu || this.held) ? 0f : 1f, 0.05f, 0.025f);
            Color color; //= Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.Black), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), this.flash);
            float num = 0.5f - 0.5f * Mathf.Sin(this.sin / 30f * 3.14159274f * 2f);

            num *= this.sizeBump;

            if (MouseOver || this.flashBool)
            {
                this.extraSizeBump = Mathf.Min(1f, this.extraSizeBump + 0.1f);
                this.sizeBump      = Custom.LerpAndTick(this.sizeBump, 1f, 0.1f, 0.1f);
                this.col           = Mathf.Min(1f, this.col + 0.1f);
                this.sin          += 1f;
                if (this.flashBool)
                {
                    this.flashBool = false;
                    this.flash     = 1f;
                }
            }
            else
            {
                this.extraSizeBump = 0f;
                this.sizeBump      = Custom.LerpAndTick(this.sizeBump, 0f, 0.1f, 0.05f);
                this.col           = Mathf.Max(0f, this.col - 0.0333333351f);
            }

            this.flash = Mathf.Max(0f, this.flash - 0.142857149f);

            this.rect.fillAlpha = Mathf.Lerp(0.3f, 0.6f, this.col);
            this.rect.addSize   = new Vector2(4f, 4f) * (this.sizeBump + 0.5f * Mathf.Sin(this.extraSizeBump * 3.14159274f));

            if (this.held)
            {
                color = Color.Lerp(Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.DarkGrey), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey), num), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), this.flash);
            }
            else
            {
                color = Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), Mathf.Max(num, this.greyFade));
            }
            this.label.label.color = color;

            if (this.held)
            {
                color = Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.VeryDarkGrey), Menu.Menu.MenuRGB(Menu.Menu.MenuColors.DarkGrey), this.flash);
            }
            else
            {
                HSLColor from = HSLColor.Lerp(Menu.Menu.MenuColor(Menu.Menu.MenuColors.MediumGrey), Menu.Menu.MenuColor(Menu.Menu.MenuColors.White), Mathf.Max(this.col, this.flash));
                color = HSLColor.Lerp(from, Menu.Menu.MenuColor(Menu.Menu.MenuColors.DarkGrey), this.greyFade).rgb;
            }
            this.rect.color = color;
        }