Example #1
0
        public override void PreUpdate()
        {
            if (!SetBonusActive)
            {
                return;
            }

            timer--;

            ShieldPlayer shieldPlayer = player.GetModPlayer <ShieldPlayer>();

            if ((storedGem == StoredGem.Topaz || storedGem == StoredGem.All) && player.ownedProjectileCounts[ModContent.ProjectileType <TopazShield>()] == 0 && shieldPlayer.MaxShield - shieldPlayer.Shield < 100)
            {
                Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType <TopazShield>(), 10, 7, player.whoAmI);
            }

            if (storedGem == StoredGem.All)
            {
                allTimer--;
                if (allTimer < 0)
                {
                    storedGem = StoredGem.None;
                }
            }

            ActivationCounter -= 0.03f;
            Lighting.AddLight(player.Center, (GetArmorColor(player)).ToVector3());
        }
Example #2
0
        public static Color GetArmorColor(Player player)
        {
            StoredGem storedGem = player.GetModPlayer <GeomancerPlayer>().storedGem;

            switch (storedGem)
            {
            case StoredGem.All:
                return(Main.hslToRgb((Main.GlobalTime * 0.1f) % 1, 1f, 0.5f));

            case StoredGem.Amethyst:
                return(Color.Purple);

            case StoredGem.Topaz:
                return(Color.Yellow);

            case StoredGem.Emerald:
                return(Color.Green);

            case StoredGem.Sapphire:
                return(Color.Blue);

            case StoredGem.Diamond:
                return(Color.Cyan);

            case StoredGem.Ruby:
                return(Color.Red);

            default:
                return(Color.White);
            }
        }
Example #3
0
        public override void ResetEffects()
        {
            if (!rainbowDyeInitialized)
            {
                rainbowDyeInitialized = true;
                rainbowDye            = new Item();
                rainbowDye.SetDefaults(ModContent.ItemType <RainbowCycleDye>());
                shaderValue = rainbowDye.dye;

                Item rainbowDye2 = new Item();
                rainbowDye2.SetDefaults(ModContent.ItemType <RainbowCycleDye2>());
                shaderValue2 = rainbowDye2.dye;
            }

            if (!SetBonusActive)
            {
                storedGem      = StoredGem.None;
                DiamondStored  = false;
                RubyStored     = false;
                EmeraldStored  = false;
                SapphireStored = false;
                TopazStored    = false;
                AmethystStored = false;
            }
            SetBonusActive = false;

            /*if (DiamondStored && RubyStored && EmeraldStored && SapphireStored && TopazStored && AmethystStored)
             * {
             *  DiamondStored = false;
             *  RubyStored = false;
             *  EmeraldStored = false;
             *  SapphireStored = false;
             *  TopazStored = false;
             *  AmethystStored = false;
             *
             *  storedGem = StoredGem.All;
             *
             *  allTimer = 150;
             * }*/
        }