public override void Load()
        {
            Instance = this;
            foreach (string checkMod in ModLoader.GetLoadedMods())
            {
                if (checkMod == "ExampleMod")
                {
                    throw new Exception("ExampleMod and Bluemagic cannot be loaded at the same time");
                }
            }
            InterfaceHelper.Initialize();
            AddEquipTexture(null, EquipType.Back, "DarkLightningPack_Back", "Bluemagic/Blushie/DarkLightningPack_Back");
            for (int k = 1; k <= 4; k++)
            {
                AddBossHeadTexture(captiveElementHead + k);
                AddBossHeadTexture(captiveElement2Head + k);
            }
            Filters.Scene["Bluemagic:PuritySpirit"]       = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh);
            SkyManager.Instance["Bluemagic:PuritySpirit"] = new PuritySpiritSky();
            Filters.Scene["Bluemagic:MonolithVoid"]       = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium);
            SkyManager.Instance["Bluemagic:MonolithVoid"] = new VoidSky();
            Filters.Scene["Bluemagic:ChaosSpirit"]        = new Filter(new ChaosSpiritScreenShaderData("FilterMiniTower").UseColor(0.9f, 0.4f, 0.4f).UseOpacity(0.25f), EffectPriority.VeryHigh);
            SkyManager.Instance["Bluemagic:ChaosSpirit"]  = new ChaosSpiritSky();
            Filters.Scene["Bluemagic:TerraSpirit"]        = new Filter(new TerraSpiritScreenShaderData("FilterMiniTower").UseColor(0f, 0f, 0f).UseOpacity(0.1f), EffectPriority.VeryHigh);
            SkyManager.Instance["Bluemagic:TerraSpirit"]  = new TerraSpiritSky();
            SkyManager.Instance["Bluemagic:BlushieBoss"]  = new BlushieSky();

            ModTranslation text = CreateTranslation("PhantomSummon");

            text.SetDefault("You feel something cold leeching your life...");
            AddTranslation(text);
            text = CreateTranslation("ElementalUnleash");
            text.SetDefault("The elements have been unleashed!");
            AddTranslation(text);
            text = CreateTranslation("PuriumOreGen");
            text.SetDefault("Your world has been blessed with Purium!");
            AddTranslation(text);
            text = CreateTranslation("NPCTalk");
            text.SetDefault("<{0}> {1}");
            AddTranslation(text);
            text = CreateTranslation("LivesLeft");
            text.SetDefault("{0} has {1} lives left!");
            AddTranslation(text);
            text = CreateTranslation("LifeLeft");
            text.SetDefault("{0} has 1 life left!");
            AddTranslation(text);
            text = CreateTranslation("ChaosDpsCap");
            text.SetDefault("A heavy pressure protects the chaos from rapid damage.");
            AddTranslation(text);
            text = CreateTranslation("ChaosPressureStart");
            text.SetDefault("The air grows heavy with chaotic pressure");
            AddTranslation(text);
            text = CreateTranslation("ChaosPressureLight");
            text.SetDefault("A protective sphere of light has appeared!");
            AddTranslation(text);
            text = CreateTranslation("CataclysmCountdown");
            text.SetDefault("{0} seconds until the end");
            AddTranslation(text);
            text = CreateTranslation("TerraSpiritExpert");
            text.SetDefault("The Spirit of Purity is losing control!");
            AddTranslation(text);
            text = CreateTranslation("ExtraLives");
            text.SetDefault("Everyone has been granted 3 extra lives!");
            AddTranslation(text);
        }
Beispiel #2
0
        public override void AI()
        {
            Player player = Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)];

            Main.dayTime      = false;
            Main.monolithType = 3;
            Main.time         = 0.0;
            counter4++;
            if (npc.life < npc.lifeMax && counter4 >= 2)
            {
                npc.life++;
                counter4 = 0;
            }
            if (npc.velocity.X < 0)
            {
                npc.rotation        = 1.25f;
                npc.spriteDirection = -1;
            }
            else
            {
                npc.rotation        = -1.25f;
                npc.spriteDirection = 1;
            }
            if (introduction >= 300)
            {
                counter5++;
                if (counter5 == 1)
                {
                    Vector2 delta     = player.Center - npc.Center;
                    float   magnitude = (float)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
                    if (magnitude > 0)
                    {
                        delta *= (5f / magnitude);
                    }
                    else
                    {
                        delta = new Vector2(0f, 5f);
                    }
                    delta       *= 2f;
                    npc.velocity = delta;
                }
                if (counter5 == 60)
                {
                    Vector2 delta     = player.Center - npc.Center;
                    float   magnitude = (float)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
                    if (magnitude > 0)
                    {
                        delta *= (5f / magnitude);
                    }
                    else
                    {
                        delta = new Vector2(0f, 5f);
                    }
                    delta       *= 2f;
                    npc.velocity = delta;
                }
                if (counter5 == 120)
                {
                    Vector2 delta     = player.Center - npc.Center;
                    float   magnitude = (float)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
                    if (magnitude > 0)
                    {
                        delta *= (5f / magnitude);
                    }
                    else
                    {
                        delta = new Vector2(0f, 5f);
                    }
                    delta       *= 2f;
                    npc.velocity = delta;
                }
                if (counter5 == 600)
                {
                    counter5 = 0;
                }
            }
            float TPX      = npc.position.X + npc.width * 0.5f - player.Center.X;
            float TPY      = npc.position.Y + npc.height * 0.5f - player.Center.Y;
            float distance = (float)Math.Sqrt(TPX * TPX + TPY * TPY);

            if (player.name == "Bill")
            {
                if (introduction < 1)
                {
                    Main.NewText("What? Are you my namesake? Well, I don't want to fight you.", 10, 255, 10);
                    Main.NewText("Here, catch my present! Bye!", 10, 255, 10);
                    player.QuickSpawnItem(mod.ItemType("BillCipherBag"));
                }
                npc.boss      = false;
                npc.velocity  = new Vector2(0, -10);
                npc.velocity *= 3f;
            }
            if (distance > 2500f && introduction >= 300)
            {
                Main.NewText("Don't think that you can hide from me, mortal!", 10, 255, 10);
                switch (Main.rand.Next(2))
                {
                case 0:
                    npc.Center = player.Center - new Vector2(350, 100);
                    break;

                case 1:
                    npc.Center = player.Center - new Vector2(-350, -100);
                    break;
                }
            }
            if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
            {
                player.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("AbyssalShell")] = true;
                npc.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("AParalyzed")]      = true;
                npc.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("Paralyzed")]       = true;
            }
            npc.buffImmune[mod.BuffType("ArmorDestruction")] = true;
            npc.buffImmune[mod.BuffType("Twilight")]         = true;
            npc.buffImmune[mod.BuffType("Electrocute")]      = true;
            npc.buffImmune[mod.BuffType("Patience")]         = true;
            if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
            {
                npc.buffImmune[ModLoader.GetMod("CalamityMod").BuffType("SilvaStun")]      = true;
                npc.buffImmune[ModLoader.GetMod("CalamityMod").BuffType("GlacialState")]   = true;
                npc.buffImmune[ModLoader.GetMod("CalamityMod").BuffType("ExoFreeze")]      = true;
                npc.buffImmune[ModLoader.GetMod("CalamityMod").BuffType("MarkedforDeath")] = true;
            }
            int damage1 = 200;
            int damage2 = 150;
            int damage3 = 250;

            if (introduction < 300)
            {
                npc.dontTakeDamage = true;
            }
            if (npc.life > npc.lifeMax / 2 && !player.dead && !npc.GetGlobalNPC <ModGlobalNPC>(mod).intermission1)
            {
                introduction++;

                if (introduction > 300)
                {
                    npc.dontTakeDamage = false;
                    if (counter2 >= 15)
                    {
                        counter2 = 0;
                        Vector2 delta     = player.Center - npc.Center;
                        float   magnitude = (float)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
                        if (magnitude > 0)
                        {
                            delta *= (5f / magnitude);
                        }
                        else
                        {
                            delta = new Vector2(0f, 5f);
                        }
                        delta *= 4f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta.X, delta.Y, mod.ProjectileType("DeadlyLaser"), 500, 0, Main.myPlayer);
                    }
                    if (counter >= 30)
                    {
                        counter = 0;
                        Vector2 delta     = player.Center - npc.Center;
                        float   magnitude = (float)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
                        if (magnitude > 0)
                        {
                            delta *= 5f / magnitude;
                        }
                        else
                        {
                            delta = new Vector2(0f, 5f);
                        }
                        delta *= 1.8f;
                        Vector2 delta2 = delta.RotatedByRandom(MathHelper.ToRadians(15));
                        Vector2 delta3 = delta.RotatedByRandom(MathHelper.ToRadians(15));
                        Vector2 delta4 = delta.RotatedByRandom(MathHelper.ToRadians(35));
                        Vector2 delta5 = delta.RotatedByRandom(MathHelper.ToRadians(35));
                        Vector2 delta6 = delta.RotatedByRandom(MathHelper.ToRadians(50));
                        Vector2 delta7 = delta.RotatedByRandom(MathHelper.ToRadians(50));
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta.X, delta.Y, 100, damage1, 0, Main.myPlayer);
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta2.X, delta2.Y, 100, damage1, 0, Main.myPlayer);
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta3.X, delta3.Y, 100, damage1, 0, Main.myPlayer);
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta4.X, delta3.Y, 100, damage1, 0, Main.myPlayer);
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta5.X, delta3.Y, 100, damage1, 0, Main.myPlayer);
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta6.X, delta3.Y, 100, damage1, 0, Main.myPlayer);
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta7.X, delta3.Y, 100, damage1, 0, Main.myPlayer);
                    }
                    counter++;
                    counter2++;
                }
            }
            if (npc.life < npc.lifeMax / 2 && npc.life > npc.lifeMax * 0.15f && !player.dead && !npc.GetGlobalNPC <ModGlobalNPC>(mod).intermission2)
            {
                player.AddBuff((mod.BuffType("Madness")), 2);
                if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
                {
                    if (CalamityModRevengeance)
                    {
                        counter3++;
                        if (counter3 <= 900)
                        {
                            player.gravDir = -1f;
                        }
                        if (counter3 > 900 && counter3 <= 1800)
                        {
                            player.gravDir = 1f;
                        }
                        if (counter3 > 1800)
                        {
                            counter3 = 0;
                        }
                    }
                }
                if (counter >= 30)
                {
                    counter = 0;
                    Vector2 delta     = player.Center - npc.Center;
                    float   magnitude = (float)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
                    if (magnitude > 0)
                    {
                        delta *= (5f / magnitude);
                    }
                    else
                    {
                        delta = new Vector2(0f, 5f);
                    }
                    delta *= 2f;
                    Vector2 delta2 = delta.RotatedByRandom(MathHelper.ToRadians(20));
                    Vector2 delta3 = delta.RotatedByRandom(MathHelper.ToRadians(20));
                    Vector2 delta4 = delta.RotatedByRandom(MathHelper.ToRadians(15));
                    Vector2 delta5 = delta.RotatedByRandom(MathHelper.ToRadians(15));
                    Vector2 delta6 = delta.RotatedByRandom(MathHelper.ToRadians(10));
                    Vector2 delta7 = delta.RotatedByRandom(MathHelper.ToRadians(10));
                    Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta.X, delta.Y, mod.ProjectileType("DeadlyLaser"), 500, 0, Main.myPlayer);
                    Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta2.X, delta2.Y, 100, damage2, 0, Main.myPlayer);
                    Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta3.X, delta3.Y, 100, damage2, 0, Main.myPlayer);
                    Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta4.X, delta4.Y, 100, damage2, 0, Main.myPlayer);
                    Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta5.X, delta5.Y, 100, damage2, 0, Main.myPlayer);
                    Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta6.X, delta7.Y, mod.ProjectileType("DeadlyLaser"), 500, 0, Main.myPlayer);
                    Projectile.NewProjectile(npc.Center.X, npc.Center.Y, delta6.X, delta7.Y, mod.ProjectileType("DeadlyLaser"), 500, 0, Main.myPlayer);
                }
                counter++;
            }
            if (npc.life < npc.lifeMax * 0.15f && !player.dead)
            {
                player.AddBuff((mod.BuffType("Madness")), 2);
                if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
                {
                    if (CalamityModRevengeance)
                    {
                        counter3++;
                        if (counter3 <= 900)
                        {
                            player.gravDir = -1f;
                        }
                        if (counter3 > 900 && counter3 <= 1800)
                        {
                            player.gravDir = 1f;
                        }
                        if (counter3 > 1800)
                        {
                            counter3 = 0;
                        }
                    }
                }
                if (counter2 >= 20)
                {
                    for (int i = 0; i < 10; i++)
                    {
                        int  dustType  = Main.rand.Next(51, 54);
                        int  dustIndex = Dust.NewDust(npc.position, npc.width, npc.height, dustType);
                        Dust dust      = Main.dust[dustIndex];
                        dust.velocity.X = dust.velocity.X + Main.rand.Next(-50, 51) * 0.01f;
                        dust.velocity.Y = dust.velocity.Y + Main.rand.Next(-50, 51) * 0.01f;
                        dust.scale     *= 0.8f;
                        dust.noGravity  = true;
                    }
                }
                if (counter2 >= 40)
                {
                    Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 62);
                    counter2 = 0;
                    Vector2 delta     = player.Center - npc.Center;
                    float   magnitude = (float)Math.Sqrt(delta.X * delta.X + delta.Y * delta.Y);
                    if (magnitude > 0)
                    {
                        delta *= (5f / magnitude);
                    }
                    else
                    {
                        delta = new Vector2(0f, 5f);
                    }
                    delta *= 6f;
                    float numberProjectiles = 15;
                    float rotation          = MathHelper.ToRadians(2);
                    delta += Vector2.Normalize(new Vector2(delta.X, delta.Y)) * 45f;
                    for (int i = 0; i < numberProjectiles; i++)
                    {
                        Vector2 perturbedSpeed = new Vector2(delta.X, delta.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numberProjectiles - 1))) * .2f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, mod.ProjectileType("Vaporizer"), damage3, 0, player.whoAmI);
                    }
                }
                counter2++;
            }
            if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
            {
                if (CalamityModRevengeance)
                {
                    RnAReset(player);
                }
            }
            if (((AlchemistNPCPlayer)player.GetModPlayer(mod, "AlchemistNPCPlayer")).CursedMirror == true)
            {
                npc.reflectingProjectiles = true;
            }
            if (((AlchemistNPCPlayer)player.GetModPlayer(mod, "AlchemistNPCPlayer")).CursedMirror == false)
            {
                npc.reflectingProjectiles = false;
            }
        }
Beispiel #3
0
 internal static List <string> SaveUsedMods(Player player)
 {
     return(ModLoader.GetLoadedMods().Except(new string[] { "ModLoader" }).ToList());
 }
 public override void ModifyTooltips(Item item, List <TooltipLine> tooltips)
 {
     if (item.type == ItemID.KingSlimeBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "KingSlime", "King Slime Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.EyeOfCthulhuBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "EyeofCthulhu", "Eye of Cthulhu Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.EaterOfWorldsBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "EaterOfWorlds", "Eater Of Worlds Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.BrainOfCthulhuBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "BrainOfCthulhu", "Brain Of Cthulhu Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.QueenBeeBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "QueenBeeBossBag", "Queen Bee Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.SkeletronBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "Skeletron", "Skeletron Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.WallOfFleshBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "WallOfFleshBoss", "Wall Of Flesh Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.DestroyerBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "Destroyer", "Destroyer Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.TwinsBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "Twins", "Twins Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.SkeletronPrimeBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "SkeletronPrime", "Skeletron Prime Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.PlanteraBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "Plantera", "Plantera Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.GolemBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "Golem", "Golem Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.FishronBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "DukeFishron", "Duke Fishron Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (item.type == ItemID.MoonLordBossBag)
     {
         TooltipLine line = new TooltipLine(mod, "MoonLord", "Moon Lord Treasure Bag");
         line.overrideColor = Color.LimeGreen;
         tooltips.Insert(1, line);
     }
     if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
     {
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("DesertScourgeBag")))
         {
             TooltipLine line = new TooltipLine(mod, "DesertScourge", "Desert Scourge Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("CrabulonBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Crabulon", "Crabulon Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("HiveMindBag")))
         {
             TooltipLine line = new TooltipLine(mod, "HiveMind", "The Hive Mind Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("PerforatorBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Perforator", "The Perforators Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("SlimeGodBag")))
         {
             TooltipLine line = new TooltipLine(mod, "SlimeGod", "The Slime God Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("CryogenBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Cryogen", "Cryogen Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("BrimstoneWaifuBag")))
         {
             TooltipLine line = new TooltipLine(mod, "BrimstoneElemental", "Brimstone Elemental Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("AquaticScourgeBag")))
         {
             TooltipLine line = new TooltipLine(mod, "AquaticScourge", "Aquatic Scourge Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("CalamitasBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Calamitas", "Calamitas Doppelganger Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("AstrageldonBag")))
         {
             TooltipLine line = new TooltipLine(mod, "AstrageldonSlime", "Astrageldon Slime Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("AstrumDeusBag")))
         {
             TooltipLine line = new TooltipLine(mod, "AstrumDeus", "Astrum Deus Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("LeviathanBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Leviathan", "The Leviathan Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("PlaguebringerGoliathBag")))
         {
             TooltipLine line = new TooltipLine(mod, "PlaguebringerGoliath", "The Plaguebringer Goliath Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("RavagerBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Ravager", "Ravager Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("ProvidenceBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Providence", "Providence Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("PolterghastBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Polterghast", "Polterghast Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("DevourerofGodsBag")))
         {
             TooltipLine line = new TooltipLine(mod, "DevourerofGods", "The Devourer of Gods Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("BumblebirbBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Bumblebirb", "Bumblebirb Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("CalamityMod").ItemType("YharonBag")))
         {
             TooltipLine line = new TooltipLine(mod, "Yharon", "Yharon Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
     }
     if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
     {
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("ThunderBirdBag")))
         {
             TooltipLine line = new TooltipLine(mod, "ThunderBird", "The Great Thunder Bird Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("JellyFishBag")))
         {
             TooltipLine line = new TooltipLine(mod, "QueenJellyfish", "The Queen Jellyfish Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("GraniteBag")))
         {
             TooltipLine line = new TooltipLine(mod, "GraniteEnergyStorm", "Granite Energy Storm Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("HeroBag")))
         {
             TooltipLine line = new TooltipLine(mod, "TheBuriedChampion", "The Buried Champion Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("ScouterBag")))
         {
             TooltipLine line = new TooltipLine(mod, "TheStarScouter", "The Star Scouter Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("BoreanBag")))
         {
             TooltipLine line = new TooltipLine(mod, "BoreanStrider", "Borean Strider Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("BeholderBag")))
         {
             TooltipLine line = new TooltipLine(mod, "CoznixTheFallenBeholder", "Coznix, The Fallen Beholder Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("LichBag")))
         {
             TooltipLine line = new TooltipLine(mod, "TheLich", "The Lich Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("AbyssionBag")))
         {
             TooltipLine line = new TooltipLine(mod, "AbyssionTheForgottenOne", "Abyssion, The Forgotten One Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
         if (item.type == (ModLoader.GetMod("ThoriumMod").ItemType("RagBag")))
         {
             TooltipLine line = new TooltipLine(mod, "TheRagnarok", "The Ragnarok Treasure Bag");
             line.overrideColor = Color.LimeGreen;
             tooltips.Insert(1, line);
         }
     }
 }
Beispiel #5
0
 public override void SetupShop(Chest shop, ref int nextSlot)
 {
     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("VanTankCombination"));
     shop.item[nextSlot].shopCustomPrice = 90000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("TankCombination"));
     shop.item[nextSlot].shopCustomPrice = 160000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BattleCombination"));
     shop.item[nextSlot].shopCustomPrice = 120000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("RangerCombination"));
     shop.item[nextSlot].shopCustomPrice = 75000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("MageCombination"));
     shop.item[nextSlot].shopCustomPrice = 90000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BuilderCombination"));
     shop.item[nextSlot].shopCustomPrice = 35000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ExplorerCombination"));
     shop.item[nextSlot].shopCustomPrice = 60000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("SummonerCombination"));
     shop.item[nextSlot].shopCustomPrice = 30000;
     nextSlot++;
     if (Main.player[Main.myPlayer].anglerQuestsFinished >= 5)
     {
         shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("FishingCombination"));
         shop.item[nextSlot].shopCustomPrice = 100000;
         nextSlot++;
     }
     if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
     {
         if (NPC.downedGolemBoss)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("CalamityCombination"));
             shop.item[nextSlot].shopCustomPrice = 500000;
             nextSlot++;
         }
     }
     if (NPC.downedMoonlord)
     {
         shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("UniversalCombination"));
         shop.item[nextSlot].shopCustomPrice = 500000;
         nextSlot++;
     }
     shop.item[nextSlot].SetDefaults(ItemID.FlaskofPoison);
     shop.item[nextSlot].shopCustomPrice = 10000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ItemID.FlaskofFire);
     shop.item[nextSlot].shopCustomPrice = 10000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ItemID.FlaskofParty);
     shop.item[nextSlot].shopCustomPrice = 10000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ItemID.FlaskofGold);
     shop.item[nextSlot].shopCustomPrice = 15000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ItemID.FlaskofIchor);
     shop.item[nextSlot].shopCustomPrice = 25000;
     nextSlot++;
     shop.item[nextSlot].SetDefaults(ItemID.FlaskofCursedFlames);
     shop.item[nextSlot].shopCustomPrice = 25000;
     nextSlot++;
     if (NPC.downedPlantBoss)
     {
         shop.item[nextSlot].SetDefaults(ItemID.FlaskofVenom);
         shop.item[nextSlot].shopCustomPrice = 30000;
         nextSlot++;
         shop.item[nextSlot].SetDefaults(ItemID.FlaskofNanites);
         shop.item[nextSlot].shopCustomPrice = 30000;
         nextSlot++;
     }
     {
         for (int k = 0; k < 255; k++)
         {
             Player player = Main.player[k];
             if (player.active)
             {
                 for (int j = 0; j < player.inventory.Length; j++)
                 {
                     if (player.inventory[j].type == mod.ItemType("WatcherAmulet") || player.inventory[j].type == mod.ItemType("Autoinjector"))
                     {
                         shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("RainbowFlask"));
                         shop.item[nextSlot].shopCustomPrice = 1000000;
                         nextSlot++;
                     }
                 }
             }
         }
     }
     if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
     {
         if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("CalamitasBrew"));
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
         }
     }
     if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
     {
         if (Main.hardMode)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("GasContainerItem"));
             shop.item[nextSlot].shopCustomPrice = 200;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("CorrosionBeaker"));
             shop.item[nextSlot].shopCustomPrice = 350;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("CombustionFlask"));
             shop.item[nextSlot].shopCustomPrice = 350;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("NitrogenVial"));
             shop.item[nextSlot].shopCustomPrice = 350;
             nextSlot++;
         }
     }
 }
Beispiel #6
0
        public override string GetChat()
        {                                           //npc chat
            string EntryA1   = Language.GetTextValue("Mods.AlchemistNPC.EntryA1");
            string EntryA2   = Language.GetTextValue("Mods.AlchemistNPC.EntryA2");
            string EntryA3   = Language.GetTextValue("Mods.AlchemistNPC.EntryA3");
            string EntryA4   = Language.GetTextValue("Mods.AlchemistNPC.EntryA4");
            string EntryA5   = Language.GetTextValue("Mods.AlchemistNPC.EntryA5");
            string EntryA6   = Language.GetTextValue("Mods.AlchemistNPC.EntryA6");
            string EntryA7   = Language.GetTextValue("Mods.AlchemistNPC.EntryA7");
            string EntryA8   = Language.GetTextValue("Mods.AlchemistNPC.EntryA8");
            string EntryA9   = Language.GetTextValue("Mods.AlchemistNPC.EntryA9");
            string EntryA10  = Language.GetTextValue("Mods.AlchemistNPC.EntryA10");
            string EntryA11  = Language.GetTextValue("Mods.AlchemistNPC.EntryA11");
            string EntryA12  = Language.GetTextValue("Mods.AlchemistNPC.EntryA12");
            string EntryA13  = Language.GetTextValue("Mods.AlchemistNPC.EntryA13");
            string EntryA14  = Language.GetTextValue("Mods.AlchemistNPC.EntryA14");
            string EntryA15  = Language.GetTextValue("Mods.AlchemistNPC.EntryA15");
            string EntryA16  = Language.GetTextValue("Mods.AlchemistNPC.EntryA16");
            string EntryA17  = Language.GetTextValue("Mods.AlchemistNPC.EntryA17");
            string EntryA18  = Language.GetTextValue("Mods.AlchemistNPC.EntryA18");
            string EntryA19  = Language.GetTextValue("Mods.AlchemistNPC.EntryA19");
            string EntryA20  = Language.GetTextValue("Mods.AlchemistNPC.EntryA20");
            string EntryA21  = Language.GetTextValue("Mods.AlchemistNPC.EntryA21");
            string EntryA22  = Language.GetTextValue("Mods.AlchemistNPC.EntryA22");
            string EntryA23  = Language.GetTextValue("Mods.AlchemistNPC.EntryA23");
            string EntryA24  = Language.GetTextValue("Mods.AlchemistNPC.EntryA24");
            int    Brewer    = NPC.FindFirstNPC(mod.NPCType("Brewer"));
            int    partyGirl = NPC.FindFirstNPC(NPCID.PartyGirl);

            if (Main.bloodMoon && partyGirl >= 0 && Main.rand.Next(4) == 0)
            {
                return(EntryA23 + Main.npc[partyGirl].GivenName + EntryA24);
            }
            if (Main.bloodMoon)
            {
                switch (Main.rand.Next(3))
                {
                case 0:
                    return(EntryA20);

                case 1:
                    return(EntryA21);

                case 2:
                    return(EntryA22);
                }
            }
            if (Main.invasionType == 1)
            {
                return(EntryA17);
            }
            if (Main.invasionType == 3)
            {
                return(EntryA18);
            }
            if (Main.invasionType == 4)
            {
                return(EntryA19);
            }
            if (Brewer >= 0 && Main.rand.Next(5) == 0)
            {
                return(EntryA15 + Main.npc[Brewer].GivenName + EntryA16);
            }
            if (ModLoader.GetLoadedMods().Contains("Tremor"))
            {
                int Alch = NPC.FindFirstNPC(ModLoader.GetMod("Tremor").NPCType("Alchemist"));
                if (Alch >= 0 && Main.rand.Next(4) == 0)
                {
                    return(EntryA12 + Main.npc[Alch].GivenName + EntryA13);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("Tremor"))
            {
                if (NPC.downedBoss3 && Main.rand.Next(6) == 0)
                {
                    return(EntryA14);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
            {
                int DA = NPC.FindFirstNPC(ModLoader.GetMod("ThoriumMod").NPCType("DesertTraveler"));
                if (DA >= 0 && Main.rand.Next(7) == 0)
                {
                    return(EntryA9 + Main.npc[DA].GivenName + EntryA10);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
            {
                int DA = NPC.FindFirstNPC(ModLoader.GetMod("ThoriumMod").NPCType("DesertTraveler"));
                if (DA >= 0 && Brewer >= 0 && Main.rand.Next(8) == 0)
                {
                    return(EntryA11);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("Peculiarity") && Main.rand.Next(5) == 0)
            {
                return(EntryA8);
            }
            switch (Main.rand.Next(7))
            {
            case 0:
                return(EntryA1);

            case 1:
                return(EntryA2);

            case 2:
                return(EntryA3);

            case 3:
                return(EntryA4);

            case 4:
                return(EntryA5);

            case 5:
                return(EntryA6);

            default:
                return(EntryA7);
            }
        }
Beispiel #7
0
 public override void SetupShop(int type, Chest shop, ref int nextSlot)
 {
     if (ModLoader.GetLoadedMods().Contains("Tremor"))
     {
         if (type == ModLoader.GetMod("Tremor").NPCType("Lady Moon"))
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("DarkMass"));
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("CarbonSteel"));
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("Doomstone"));
             shop.item[nextSlot].shopCustomPrice = 25000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("NightmareBar"));
             shop.item[nextSlot].shopCustomPrice = 25000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("VoidBar"));
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("AngryShard"));
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("Phantaplasm"));
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("ClusterShard"));
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("DragonCapsule"));
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("HuskofDusk"));
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("NightCore"));
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("GoldenClaw"));
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("StoneDice"));
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("ConcentratedEther"));
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("Squorb"));
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("ToothofAbraxas"));
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("CosmicFuel"));
             shop.item[nextSlot].shopCustomPrice = 1000000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("EyeofOblivion"));
             shop.item[nextSlot].shopCustomPrice = 3000000;
             nextSlot++;
         }
     }
 }
        public override void ProcessTriggers(TriggersSet triggersSet)
        {
            if (GlobalTeleporter || GlobalTeleporterUp)
            {
                bool allow = true;
                for (int v = 0; v < 200; ++v)
                {
                    NPC npc = Main.npc[v];
                    if (npc.active && npc.boss)
                    {
                        allow = false;
                        break;
                    }
                }
                if (GlobalTeleporterUp && allow && Main.mapFullscreen == true && Main.mouseRight && Main.keyState.IsKeyUp(Microsoft.Xna.Framework.Input.Keys.LeftControl))
                {
                    int     mapWidth       = Main.maxTilesX * 16;
                    int     mapHeight      = Main.maxTilesY * 16;
                    Vector2 cursorPosition = new Vector2(Main.mouseX, Main.mouseY);

                    cursorPosition.X -= Main.screenWidth / 2;
                    cursorPosition.Y -= Main.screenHeight / 2;

                    Vector2 mapPosition         = Main.mapFullscreenPos;
                    Vector2 cursorWorldPosition = mapPosition;

                    cursorPosition      /= 16;
                    cursorPosition      *= 16 / Main.mapFullscreenScale;
                    cursorWorldPosition += cursorPosition;
                    cursorWorldPosition *= 16;

                    cursorWorldPosition.Y -= player.height;
                    if (cursorWorldPosition.X < 0)
                    {
                        cursorWorldPosition.X = 0;
                    }
                    else if (cursorWorldPosition.X + player.width > mapWidth)
                    {
                        cursorWorldPosition.X = mapWidth - player.width;
                    }
                    if (cursorWorldPosition.Y < 0)
                    {
                        cursorWorldPosition.Y = 0;
                    }
                    else if (cursorWorldPosition.Y + player.height > mapHeight)
                    {
                        cursorWorldPosition.Y = mapHeight - player.height;
                    }

                    player.Teleport(cursorWorldPosition, 0, 0);
                    NetMessage.SendData(65, -1, -1, (NetworkText)null, 0, (float)player.whoAmI, (float)cursorWorldPosition.X, (float)cursorWorldPosition.Y, 1, 0, 0);
                    Main.mapFullscreen = false;

                    for (int index = 0; index < 120; ++index)
                    {
                        Main.dust[Dust.NewDust(player.position, player.width, player.height, 15, Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-10f, 10f), 150, Color.Cyan, 1.2f)].velocity *= 0.75f;
                    }
                }
                if (GlobalTeleporter && allow && Main.mapFullscreen == true && Main.mouseRight && Main.keyState.IsKeyUp(Microsoft.Xna.Framework.Input.Keys.LeftControl))
                {
                    int     mapWidth       = Main.maxTilesX * 16;
                    int     mapHeight      = Main.maxTilesY * 16;
                    Vector2 cursorPosition = new Vector2(Main.mouseX, Main.mouseY);

                    cursorPosition.X -= Main.screenWidth / 2;
                    cursorPosition.Y -= Main.screenHeight / 2;

                    Vector2 mapPosition         = Main.mapFullscreenPos;
                    Vector2 cursorWorldPosition = mapPosition;

                    cursorPosition      /= 16;
                    cursorPosition      *= 16 / Main.mapFullscreenScale;
                    cursorWorldPosition += cursorPosition;
                    cursorWorldPosition *= 16;

                    cursorWorldPosition.Y -= player.height;
                    if (cursorWorldPosition.X < 0)
                    {
                        cursorWorldPosition.X = 0;
                    }
                    else if (cursorWorldPosition.X + player.width > mapWidth)
                    {
                        cursorWorldPosition.X = mapWidth - player.width;
                    }
                    if (cursorWorldPosition.Y < 0)
                    {
                        cursorWorldPosition.Y = 0;
                    }
                    else if (cursorWorldPosition.Y + player.height > mapHeight)
                    {
                        cursorWorldPosition.Y = mapHeight - player.height;
                    }

                    player.Teleport(cursorWorldPosition, 0, 0);
                    NetMessage.SendData(65, -1, -1, (NetworkText)null, 0, (float)player.whoAmI, (float)cursorWorldPosition.X, (float)cursorWorldPosition.Y, 1, 0, 0);
                    Main.mapFullscreen = false;
                    Item[] inventory = player.inventory;
                    for (int k = 0; k < inventory.Length; k++)
                    {
                        if (inventory[k].type == mod.ItemType("GlobalTeleporter"))
                        {
                            inventory[k].stack--;
                            break;
                        }
                    }
                    for (int index = 0; index < 120; ++index)
                    {
                        Main.dust[Dust.NewDust(player.position, player.width, player.height, 15, Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-10f, 10f), 150, Color.Cyan, 1.2f)].velocity *= 0.75f;
                    }
                }
            }
            if (AlchemistNPC.LampLight.JustPressed)
            {
                if (lamp == 0 && trigger)
                {
                    trigger = false;
                    lamp++;
                    lf = true;
                }
                if (lamp == 1 && !trigger && !lf)
                {
                    trigger = true;
                    lamp    = 0;
                }
                lf = false;
            }
            if (AlchemistNPC.PipBoyTP.JustPressed && PB4K)
            {
                PipBoyTPMenu.visible = true;
            }
            if (DistantPotionsUse && PlayerInput.Triggers.Current.QuickBuff)
            {
                LegacySoundStyle type1 = (LegacySoundStyle)null;
                for (int index1 = 0; index1 < 40; ++index1)
                {
                    if (player.CountBuffs() == 22)
                    {
                        return;
                    }
                    if (player.bank.item[index1].stack > 0 && player.bank.item[index1].type > 0 && (player.bank.item[index1].buffType > 0 && !player.bank.item[index1].summon) && player.bank.item[index1].buffType != 90)
                    {
                        int  type2 = player.bank.item[index1].buffType;
                        bool flag  = true;
                        for (int index2 = 0; index2 < 22; ++index2)
                        {
                            if (type2 == 27 && (player.buffType[index2] == type2 || player.buffType[index2] == 101 || player.buffType[index2] == 102))
                            {
                                flag = false;
                                break;
                            }
                            if (player.buffType[index2] == type2)
                            {
                                flag = false;
                                break;
                            }
                            if (Main.meleeBuff[type2] && Main.meleeBuff[player.buffType[index2]])
                            {
                                flag = false;
                                break;
                            }
                        }
                        if (Main.lightPet[player.bank.item[index1].buffType] || Main.vanityPet[player.bank.item[index1].buffType])
                        {
                            for (int index2 = 0; index2 < 22; ++index2)
                            {
                                if (Main.lightPet[player.buffType[index2]] && Main.lightPet[player.bank.item[index1].buffType])
                                {
                                    flag = false;
                                }
                                if (Main.vanityPet[player.buffType[index2]] && Main.vanityPet[player.bank.item[index1].buffType])
                                {
                                    flag = false;
                                }
                            }
                        }
                        if (player.bank.item[index1].mana > 0 & flag)
                        {
                            if (player.statMana >= (int)((double)player.bank.item[index1].mana * (double)player.manaCost))
                            {
                                player.manaRegenDelay = (int)player.maxRegenDelay;
                                player.statMana       = player.statMana - (int)((double)player.bank.item[index1].mana * (double)player.manaCost);
                            }
                            else
                            {
                                flag = false;
                            }
                        }
                        if (player.whoAmI == Main.myPlayer && player.bank.item[index1].type == 603 && !Main.cEd)
                        {
                            flag = false;
                        }
                        if (type2 == 27)
                        {
                            type2 = Main.rand.Next(3);
                            if (type2 == 0)
                            {
                                type2 = 27;
                            }
                            if (type2 == 1)
                            {
                                type2 = 101;
                            }
                            if (type2 == 2)
                            {
                                type2 = 102;
                            }
                        }
                        if (flag)
                        {
                            type1 = player.bank.item[index1].UseSound;
                            int time1 = player.bank.item[index1].buffTime;
                            if (time1 == 0)
                            {
                                time1 = 3600;
                            }
                            if (KeepBuffs == 1)
                            {
                                player.AddBuff(type2, time1 * 2, true);
                            }
                            if (KeepBuffs == 0)
                            {
                                player.AddBuff(type2, time1, true);
                            }
                            if (player.bank.item[index1].consumable)
                            {
                                if (AlchemistCharmTier4 == true)
                                {
                                    if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
                                    {
                                        if (CalamityModDownedSCal)
                                        {
                                        }
                                    }
                                    if (Main.rand.NextFloat() >= .25f)
                                    {
                                    }
                                    else
                                    {
                                        --player.bank.item[index1].stack;
                                    }
                                }

                                else if (AlchemistCharmTier3 == true)
                                {
                                    if (Main.rand.Next(2) == 0)
                                    {
                                    }
                                    else
                                    {
                                        --player.bank.item[index1].stack;
                                    }
                                }

                                else if (AlchemistCharmTier2 == true)
                                {
                                    if (Main.rand.Next(4) == 0)
                                    {
                                    }
                                    else
                                    {
                                        --player.bank.item[index1].stack;
                                    }
                                }

                                else if (AlchemistCharmTier1 == true)
                                {
                                    if (Main.rand.Next(10) == 0)
                                    {
                                    }
                                    else
                                    {
                                        --player.bank.item[index1].stack;
                                    }
                                }
                                else
                                {
                                    --player.bank.item[index1].stack;
                                }
                                if (player.bank.item[index1].stack <= 0)
                                {
                                    player.bank.item[index1].TurnToAir();
                                }
                            }
                        }
                    }
                }
                if (type1 == null)
                {
                    return;
                }
                Main.PlaySound(type1, player.position);
                Recipe.FindRecipes();
            }
            if (AlchemistNPC.DiscordBuff.JustPressed)
            {
                if (Main.myPlayer == player.whoAmI && player.HasBuff(mod.BuffType("DiscordBuff")))
                {
                    Vector2 vector2 = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY);
                    if (!Collision.SolidCollision(vector2, player.width, player.height))
                    {
                        player.Teleport(vector2, 1, 0);
                        NetMessage.SendData(65, -1, -1, (NetworkText)null, 0, (float)player.whoAmI, (float)vector2.X, (float)vector2.Y, 1, 0, 0);
                        if (player.chaosState)
                        {
                            player.statLife = player.statLife - player.statLifeMax2 / 3;
                            PlayerDeathReason damageSource = PlayerDeathReason.ByOther(13);
                            if (Main.rand.Next(2) == 0)
                            {
                                damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15);
                            }
                            if (player.statLife <= 0)
                            {
                                player.KillMe(damageSource, 1.0, 0, false);
                            }
                            player.lifeRegenCount = 0;
                            player.lifeRegenTime  = 0;
                        }
                        player.AddBuff(88, 600, true);
                        player.AddBuff(164, 60, true);
                    }
                }
                if (Main.myPlayer == player.whoAmI && player.HasBuff(mod.BuffType("TrueDiscordBuff")))
                {
                    Vector2 vector2 = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY);
                    if (!Collision.SolidCollision(vector2, player.width, player.height))
                    {
                        player.Teleport(vector2, 1, 0);
                        NetMessage.SendData(65, -1, -1, (NetworkText)null, 0, (float)player.whoAmI, (float)vector2.X, (float)vector2.Y, 1, 0, 0);
                        if (player.chaosState)
                        {
                            player.statLife = player.statLife - player.statLifeMax2 / 7;
                            PlayerDeathReason damageSource = PlayerDeathReason.ByOther(13);
                            if (Main.rand.Next(2) == 0)
                            {
                                damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15);
                            }
                            if (player.statLife <= 0)
                            {
                                player.KillMe(damageSource, 1.0, 0, false);
                            }
                            player.lifeRegenCount = 0;
                            player.lifeRegenTime  = 0;
                        }
                        player.AddBuff(88, 360, true);
                    }
                }
            }
        }
Beispiel #9
0
 public override void SetupShop(Chest shop, ref int nextSlot)
 {
     if (S1)
     {
         if (!NPC.downedMechBossAny)
         {
             shop.item[nextSlot].SetDefaults(576);
             nextSlot++;
         }
         if (NPC.downedMechBossAny)
         {
             shop.item[nextSlot].SetDefaults(562);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(563);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(564);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(565);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(566);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(568);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(569);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(570);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(571);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(573);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1596);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1597);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1598);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1600);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1601);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1602);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1603);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1604);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1605);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1608);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1610);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1964);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(2742);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(3237);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(3796);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             if (NPC.downedPlantBoss)
             {
                 shop.item[nextSlot].SetDefaults(567);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(572);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(574);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 if (NPC.downedQueenBee)
                 {
                     shop.item[nextSlot].SetDefaults(1599);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedGolemBoss)
                 {
                     shop.item[nextSlot].SetDefaults(1607);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 shop.item[nextSlot].SetDefaults(1606);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 if (NPC.downedMoonlord)
                 {
                     shop.item[nextSlot].SetDefaults(3044);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedGoblins)
                 {
                     shop.item[nextSlot].SetDefaults(3371);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedPirates)
                 {
                     shop.item[nextSlot].SetDefaults(3236);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (DD2Event.DownedInvasionT1)
                 {
                     shop.item[nextSlot].SetDefaults(3869);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 shop.item[nextSlot].SetDefaults(1609);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 if (NPC.downedHalloweenKing)
                 {
                     shop.item[nextSlot].SetDefaults(1963);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedChristmasIceQueen)
                 {
                     shop.item[nextSlot].SetDefaults(1965);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedMartians)
                 {
                     shop.item[nextSlot].SetDefaults(3235);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedMoonlord)
                 {
                     shop.item[nextSlot].SetDefaults(3370);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
             }
         }
     }
     if (S2)
     {
         if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
         {
             if (NPC.downedMoonlord)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("DesertScourgeMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("CrabulonMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("HiveMindMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("PerforatorMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("SlimeGodMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("SulphurousMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("HigherAbyssMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("CryogenMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("AquaticScourgeMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("CalamitasMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("AstralMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("AstrageldonMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("PlaguebringerMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("RavagerMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 if (CalamityModDownedGuardian)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("ProfanedGuardianMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
                 if (CalamityModDownedProvidence)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("ProvidenceMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("StormWeaverMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("CeaselessVoidMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("SignusMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
                 if (CalamityModDownedPolter)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("PolterghastMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
                 if (CalamityModDownedDOG)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityMod").ItemType("DoGMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
             }
         }
         if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
         {
             if (NPC.downedMoonlord)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("ThunderBirdMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("ViscountMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("BoreanStriderMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("FallenBeholderMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("DepthsMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
         }
     }
 }
Beispiel #10
0
 public override void Update(Player player, ref int buffIndex)
 {
     player.thrownDamage   += 0.1f;
     player.meleeDamage    += 0.1f;
     player.rangedDamage   += 0.1f;
     player.magicDamage    += 0.35f;
     player.minionDamage   += 0.1f;
     player.meleeCrit      += 10;
     player.rangedCrit     += 10;
     player.magicCrit      += 12;
     player.thrownCrit     += 10;
     player.statManaMax2   += 20;
     player.manaCost       -= 0.02f;
     player.manaRegenBuff   = true;
     player.statDefense    += 8;
     player.archery         = true;
     player.ammoPotion      = true;
     player.lifeRegen      += 4;
     player.lavaImmune      = true;
     player.fireWalk        = true;
     player.buffImmune[24]  = true;
     player.buffImmune[29]  = true;
     player.buffImmune[39]  = true;
     player.buffImmune[44]  = true;
     player.buffImmune[46]  = true;
     player.buffImmune[47]  = true;
     player.buffImmune[69]  = true;
     player.buffImmune[110] = true;
     player.buffImmune[112] = true;
     player.buffImmune[113] = true;
     player.buffImmune[114] = true;
     player.buffImmune[115] = true;
     player.buffImmune[117] = true;
     player.buffImmune[150] = true;
     player.buffImmune[mod.BuffType("BattleComb")]     = true;
     player.buffImmune[mod.BuffType("TankComb")]       = true;
     player.buffImmune[mod.BuffType("VanTankComb")]    = true;
     player.buffImmune[mod.BuffType("RangerComb")]     = true;
     player.buffImmune[mod.BuffType("MageComb")]       = true;
     player.buffImmune[mod.BuffType("SummonerComb")]   = true;
     player.buffImmune[mod.BuffType("LongInvincible")] = true;
     player.buffImmune[mod.BuffType("TitanSkin")]      = true;
     player.buffImmune[1]  = true;
     player.buffImmune[2]  = true;
     player.buffImmune[5]  = true;
     player.buffImmune[6]  = true;
     player.buffImmune[7]  = true;
     player.buffImmune[13] = true;
     player.buffImmune[14] = true;
     player.endurance     += 0.1f;
     player.lifeForce      = true;
     player.statLifeMax2  += player.statLifeMax / 5 / 20 * 20;
     ++player.maxMinions;
     ++player.maxMinions;
     if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
     {
         ThoriumBoosts(player);
     }
     if (ModLoader.GetLoadedMods().Contains("Redemption"))
     {
         RedemptionBoost(player);
     }
 }
Beispiel #11
0
        public override void PostUpdate()
        {
            if (KeyPress(Keys.F3))
            {
                draw = !draw;
            }
            if (update)
            {
                Main.chatRelease = true;
                Main.chatText    = string.Empty;
                if (info == null)
                {
                    Init();
                }
                if (itemName.active)
                {
                    itemName.InputText();
                    if (KeyPress(Keys.Enter) || (HoverOver(enter.box) && LeftClick()))
                    {
                        foreach (string mod in ModLoader.GetLoadedMods())
                        {
                            getMod  = ModLoader.GetMod(mod);
                            modItem = getMod.GetItem(itemName.input);
                            output  = getMod.Name;
                            if (modItem != null)
                            {
                                item    = modItem.item;
                                output += ", " + item.Name;
                                break;
                            }
                        }
                    }
                }
                for (int i = 0; i < max; i++)
                {
                    if (LeftClick())
                    {
                        if (HoverOver(itemName.box))
                        {
                            itemName.active = !itemName.active;
                            selected        = -1;
                        }
                        if (HoverOver(info[i].box))
                        {
                            info[i].active  = !info[i].active;
                            itemName.active = false;
                            selected        = i;
                            break;
                        }
                    }
                    if (KeyPress(Keys.Tab))
                    {
                        if (selected++ < max - 1)
                        {
                            ;
                        }
                        else
                        {
                            selected = 0;
                        }
                        if (itemName.active)
                        {
                            selected        = 0;
                            itemName.active = false;
                        }
                        info[selected].active = true;
                        break;
                    }
                    if (i != selected)
                    {
                        info[i].active = false;
                    }
                    if (info[i].active)
                    {
                        info[i].InputValues();
                    }
                    if (i < button.Length)
                    {
                        if (item == null)
                        {
                            continue;
                        }
                        if (HoverOver(button[i].box) && LeftClick())
                        {
                            switch (button[i].text)
                            {
                            case "Apply":
                                for (int j = 0; j < max; j++)
                                {
                                    int.TryParse(info[j].input, out values[j]);
                                }
                                item.width  = values[0];
                                item.height = values[1];
                                item.damage = values[2];
                                float.TryParse(info[3].input, out item.knockBack);
                                item.useTime      = values[4];
                                item.useAnimation = values[5];
                                item.useStyle     = values[6];
                                break;

                            case "Clear":
                                foreach (TextLine line in info)
                                {
                                    line.input = string.Empty;
                                }
                                break;

                            case "Output":
                                info[0].input = item.width.ToString();
                                info[1].input = item.height.ToString();
                                info[2].input = item.damage.ToString();
                                info[3].input = item.knockBack.ToString();
                                info[4].input = item.useTime.ToString();
                                info[5].input = item.useAnimation.ToString();
                                info[6].input = item.useStyle.ToString();
                                break;

                            case "Get Item":
                                Main.item[0]          = item;
                                Main.item[0].stack    = item.maxStack;
                                Main.item[0].active   = true;
                                Main.item[0].position = player.Center;
                                break;

                            case "Export":
                                using (StreamWriter sw = new StreamWriter(ModLoader.ModPath + "\\" + getMod.Name + "\\" + modItem.Name + ".ini"))
                                    foreach (TextLine line in info)
                                    {
                                        sw.Write(line.input + "\r\n");
                                    }
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
                if (info == null || itemName == null)
                {
                    return;
                }
                foreach (TextLine line in info.Where(t => t != null))
                {
                    line.active = false;
                }
                itemName.active = false;
            }
        }
Beispiel #12
0
        public override void SetupShop(Chest shop, ref int nextSlot)
        {
            shop.item[nextSlot].SetDefaults(ItemID.Wood);
            shop.item[nextSlot].value = 10;
            nextSlot++;

            shop.item[nextSlot].SetDefaults(ItemID.BorealWood);
            shop.item[nextSlot].value = 10;
            nextSlot++;

            shop.item[nextSlot].SetDefaults(ItemID.RichMahogany);
            shop.item[nextSlot].value = 15;
            nextSlot++;

            shop.item[nextSlot].SetDefaults(ItemID.PalmWood);
            shop.item[nextSlot].value = 15;
            nextSlot++;

            shop.item[nextSlot].SetDefaults(ItemID.Ebonwood);
            shop.item[nextSlot].value = 15;
            nextSlot++;

            shop.item[nextSlot].SetDefaults(ItemID.Shadewood);
            shop.item[nextSlot].value = 15;
            nextSlot++;

            if (Fargowiltas.instance.tremorLoaded)
            {
                shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("GlacierWood"));
                shop.item[nextSlot].value = 15;
                nextSlot++;
            }

            if (Fargowiltas.instance.crystiliumLoaded)
            {
                shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CrystiliumMod").ItemType("CrystalWood"));
                shop.item[nextSlot].value = 20;
                nextSlot++;
            }

            if (ModLoader.GetLoadedMods().Contains("CosmeticVariety") && (NPC.downedBoss2))
            {
                shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CosmeticVariety").ItemType("Starwood"));
                shop.item[nextSlot].value = 20;
                nextSlot++;
            }

            shop.item[nextSlot].SetDefaults(ItemID.Pearlwood);
            shop.item[nextSlot].value = 20;
            nextSlot++;

            if (NPC.downedHalloweenKing)
            {
                shop.item[nextSlot].SetDefaults(ItemID.SpookyWood);
                shop.item[nextSlot].value = 50;
                nextSlot++;
            }

            if (Fargowiltas.instance.sacredToolsLoaded)
            {
                if (SacredToolsDownedSerpent)
                {
                    shop.item[nextSlot].SetDefaults(ModLoader.GetMod("SacredTools").ItemType("FlameWood"));
                    shop.item[nextSlot].value = 2000;
                    nextSlot++;
                }
            }

            if (Fargowiltas.instance.redemptionLoaded)
            {
                shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Redemption").ItemType("AncientWood"));
                shop.item[nextSlot].value = 20;
                nextSlot++;
            }

            if (Fargowiltas.instance.aaLoaded)
            {
                shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AAmod").ItemType("Razewood"));
                shop.item[nextSlot].value = 50;
                nextSlot++;


                shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AAmod").ItemType("Bogwood"));
                shop.item[nextSlot].value = 50;
                nextSlot++;
            }

            shop.item[nextSlot].SetDefaults(ItemID.Cactus);
            shop.item[nextSlot].value = 10;
            nextSlot++;

            shop.item[nextSlot].SetDefaults(mod.ItemType("LumberJaxe"));
            shop.item[nextSlot].value = 10000;
            nextSlot++;

            shop.item[nextSlot].SetDefaults(ItemID.SharpeningStation);
            shop.item[nextSlot].value = 100000;
            nextSlot++;
        }
Beispiel #13
0
 public override void NPCLoot(NPC npc)
 {
     if (AlchemistNPC.Extractor && npc.boss == true && npc.lifeMax >= 50000 && (Main.rand.Next(3) == 0))
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SoulEssence"));
     }
     if (AlchemistNPC.Extractor && npc.boss == true && npc.lifeMax >= 55000 && (Main.rand.Next(10) == 0))
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HateVial"));
     }
     if (npc.type == mod.NPCType("Operator"))
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("APMC"));
     }
     if (npc.type == NPCID.MoonLordCore && AlchemistNPC.PGSWear)
     {
         if (Main.rand.Next(4) == 0)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KnucklesUgandaDoll"));
         }
     }
     if (npc.type == NPCID.DungeonGuardian)
     {
         if (!Main.expertMode)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EmagledFragmentation"), Main.rand.Next(5, 10));
             if (Main.rand.Next(10) == 0)
             {
                 Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OtherworldlyAmulet"));
             }
         }
         if (Main.expertMode)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EmagledFragmentation"), Main.rand.Next(15, 20));
             if (Main.rand.Next(5) == 0)
             {
                 Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OtherworldlyAmulet"));
             }
         }
     }
     if (npc.type == NPCID.EyeofCthulhu && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote1"));
     }
     if (npc.type == NPCID.BrainofCthulhu && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote2"));
     }
     if (npc.type == NPCID.EaterofWorldsHead && !NPC.AnyNPCs(NPCID.EaterofWorldsTail) && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote2"));
     }
     if (npc.type == NPCID.EaterofWorldsTail && !NPC.AnyNPCs(NPCID.EaterofWorldsHead) && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote2"));
     }
     if (npc.type == NPCID.SkeletronHead && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote3"));
     }
     if (npc.type == NPCID.SkeletronPrime && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote4"));
     }
     if (npc.type == NPCID.Spazmatism && !NPC.AnyNPCs(NPCID.Retinazer) && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote5"));
     }
     if (npc.type == NPCID.Retinazer && !NPC.AnyNPCs(NPCID.Spazmatism) && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote5"));
     }
     if (npc.type == NPCID.TheDestroyer && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote6"));
     }
     if (npc.type == NPCID.Plantera && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote7"));
     }
     if (npc.type == NPCID.Golem && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote8"));
     }
     if (npc.type == NPCID.Golem)
     {
         if (Main.rand.Next(10) == 0)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Fuaran"));
         }
     }
     if (npc.type == NPCID.MoonLordCore && Config.TornNotesDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornNote9"));
     }
     if (npc.type == NPCID.KingSlime && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(1, 3));
     }
     if (npc.type == NPCID.EyeofCthulhu && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(3, 6));
     }
     if (npc.type == NPCID.BrainofCthulhu && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(6, 9));
     }
     if (npc.type == NPCID.EaterofWorldsHead && !NPC.AnyNPCs(NPCID.EaterofWorldsTail) && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(6, 9));
     }
     if (npc.type == NPCID.EaterofWorldsTail && !NPC.AnyNPCs(NPCID.EaterofWorldsHead) && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(6, 9));
     }
     if (npc.type == NPCID.QueenBee && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(9, 12));
     }
     if (npc.type == NPCID.SkeletronHead && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(12, 15));
     }
     if (npc.type == NPCID.WallofFlesh && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier2"), Main.rand.Next(1, 3));
     }
     if (npc.type == NPCID.SkeletronPrime && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(1, 3));
     }
     if (npc.type == NPCID.Spazmatism && !NPC.AnyNPCs(NPCID.Retinazer) && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(1, 3));
     }
     if (npc.type == NPCID.Retinazer && !NPC.AnyNPCs(NPCID.Spazmatism) && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(1, 3));
     }
     if (npc.type == NPCID.TheDestroyer && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(1, 3));
     }
     if (npc.type == NPCID.Plantera && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(3, 6));
     }
     if (npc.type == NPCID.Golem && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier4"), Main.rand.Next(1, 3));
     }
     if (npc.type == NPCID.DukeFishron && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier4"), Main.rand.Next(3, 6));
     }
     if (npc.type == NPCID.CultistBoss && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier4"), Main.rand.Next(3, 6));
     }
     if (npc.type == NPCID.MoonLordCore && Config.CoinsDrop)
     {
         Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier4"), Main.rand.Next(6, 9));
     }
     if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
     {
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("DesertScourgeHead")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(1, 3));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("CrabulonIdle")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("HiveMindP2")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("PerforatorHive")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("SlimeGodCore")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier2"), Main.rand.Next(1, 3));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("Cryogen")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier2"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("BrimstoneElemental")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("AquaticScourgeHead")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("SoulSeeker")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(1, 2));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("Leviathan")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("Astrageldon")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("AstrumDeusHead")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("PlaguebringerGoliath")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(9, 12));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("ScavangerBody")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(9, 12));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("ProfanedGuardianBoss")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier4"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("ProfanedGuardianBoss2")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier4"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("ProfanedGuardianBoss3")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier5"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("Providence")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier5"), Main.rand.Next(12, 15));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("Polterghast")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier6"), Main.rand.Next(1, 3));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("DevourerofGodsHeadS")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier6"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("Bumblefuck")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier6"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("Yharon")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier6"), Main.rand.Next(12, 15));
         }
         if (npc.type == (ModLoader.GetMod("CalamityMod").NPCType("SupremeCalamitas")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier6"), 66);
         }
     }
     if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
     {
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("TheGrandThunderBirdv2")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(1, 2));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("QueenJelly")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("GraniteEnergyStorm")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("TheBuriedWarrior")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("ThePrimeScouter")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier1"), Main.rand.Next(6, 9));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("BoreanStriderPopped")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier2"), Main.rand.Next(1, 3));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("FallenDeathBeholder2")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier2"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("LichHeadless")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier3"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("AbyssionReleased")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier4"), Main.rand.Next(3, 6));
         }
         if (npc.type == (ModLoader.GetMod("ThoriumMod").NPCType("RealityBreaker")) && Config.CoinsDrop)
         {
             Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ReversivityCoinTier4"), 33);
         }
     }
 }
Beispiel #14
0
        public override void AI()
        {
            Player player = Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)];

            if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
            {
                player.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("AbyssalShell")] = true;
                npc.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("AParalyzed")]      = true;
                npc.buffImmune[ModLoader.GetMod("ThoriumMod").BuffType("Paralyzed")]       = true;
            }
            npc.buffImmune[mod.BuffType("ArmorDestruction")] = true;
            npc.buffImmune[mod.BuffType("Twilight")]         = true;
            npc.buffImmune[mod.BuffType("Electrocute")]      = true;
            npc.buffImmune[mod.BuffType("Patience")]         = true;
            if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
            {
                npc.buffImmune[ModLoader.GetMod("CalamityMod").BuffType("SilvaStun")] = true;
                npc.buffImmune[ModLoader.GetMod("CalamityMod").BuffType("ExoFreeze")] = true;
            }
            npc.velocity *= 1.2f;
            npc.defense   = 1;
            int damage1 = 200;
            int damage2 = 300;
            int damage3 = 350;

            if (Main.player[(int)Player.FindClosest(npc.position, npc.width, npc.height)].GetModPlayer <AlchemistNPCPlayer>(mod).MemersRiposte)
            {
                damage1 = mod.ProjectileType("DeadlyLaser");
                damage2 = 150;
                damage3 = 175;
            }
            if (player.statDefense > 250 || player.endurance > 0.50f || player.statLifeMax2 > 1300)
            {
                damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15);
                player.KillMe(damageSource, 1.0, 0, false);
                if (player.dead)
                {
                    npc.velocity  = new Vector2(2, -10);
                    npc.velocity *= 3f;
                }
                damage1 = 666666;
                damage2 = 666666;
                damage3 = 666666;
            }
            if (!Main.expertMode)
            {
                if (npc.life > 166666)
                {
                    if (Main.rand.Next(20) == 0)
                    {
                        Vector2 vel = new Vector2(-1, -1);
                        vel *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel2 = new Vector2(1, 1);
                        vel2 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel3 = new Vector2(1, -1);
                        vel3 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel4 = new Vector2(-1, 1);
                        vel4 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel5 = new Vector2(0, -1);
                        vel5 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel6 = new Vector2(0, 1);
                        vel6 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel7 = new Vector2(1, 0);
                        vel7 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel8 = new Vector2(-1, 0);
                        vel8 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                    }
                }
                else
                {
                    if (Main.rand.Next(25) == 0)
                    {
                        Vector2 vel = new Vector2(-1, -1);
                        vel *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel2 = new Vector2(1, 1);
                        vel2 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel3 = new Vector2(1, -1);
                        vel3 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel4 = new Vector2(-1, 1);
                        vel4 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel5 = new Vector2(0, -1);
                        vel5 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel6 = new Vector2(0, 1);
                        vel6 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel7 = new Vector2(1, 0);
                        vel7 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel8 = new Vector2(-1, 0);
                        vel8 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 449, damage2, 0, Main.myPlayer);
                    }
                    if (Main.rand.Next(60) == 0)
                    {
                        Vector2 vel = new Vector2(-1, -1);
                        vel *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel2 = new Vector2(1, 1);
                        vel2 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel3 = new Vector2(1, -1);
                        vel3 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel4 = new Vector2(-1, 1);
                        vel4 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel5 = new Vector2(0, -1);
                        vel5 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel6 = new Vector2(0, 1);
                        vel6 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel7 = new Vector2(1, 0);
                        vel7 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel8 = new Vector2(-1, 0);
                        vel8 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 448, damage2, 0, Main.myPlayer);
                    }
                }
            }
            if (Main.expertMode)
            {
                if (npc.life > 333333)
                {
                    if (Main.rand.Next(20) == 0)
                    {
                        Vector2 vel = new Vector2(-1, -1);
                        vel *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel2 = new Vector2(1, 1);
                        vel2 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel3 = new Vector2(1, -1);
                        vel3 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel4 = new Vector2(-1, 1);
                        vel4 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel5 = new Vector2(0, -1);
                        vel5 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel6 = new Vector2(0, 1);
                        vel6 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel7 = new Vector2(1, 0);
                        vel7 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                        Vector2 vel8 = new Vector2(-1, 0);
                        vel8 *= 8f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, mod.ProjectileType("DeadlyLaser"), damage1, 0, Main.myPlayer);
                    }
                }
                if (npc.life > 166666 && npc.life < 333333)
                {
                    if (Main.rand.Next(25) == 0)
                    {
                        Vector2 vel = new Vector2(-1, -1);
                        vel *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel2 = new Vector2(1, 1);
                        vel2 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel3 = new Vector2(1, -1);
                        vel3 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel4 = new Vector2(-1, 1);
                        vel4 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel5 = new Vector2(0, -1);
                        vel5 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel6 = new Vector2(0, 1);
                        vel6 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel7 = new Vector2(1, 0);
                        vel7 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 449, damage2, 0, Main.myPlayer);
                        Vector2 vel8 = new Vector2(-1, 0);
                        vel8 *= 9f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 449, damage2, 0, Main.myPlayer);
                    }
                    if (Main.rand.Next(60) == 0)
                    {
                        Vector2 vel = new Vector2(-1, -1);
                        vel *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel2 = new Vector2(1, 1);
                        vel2 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel3 = new Vector2(1, -1);
                        vel3 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel4 = new Vector2(-1, 1);
                        vel4 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel5 = new Vector2(0, -1);
                        vel5 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel6 = new Vector2(0, 1);
                        vel6 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel7 = new Vector2(1, 0);
                        vel7 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 448, damage2, 0, Main.myPlayer);
                        Vector2 vel8 = new Vector2(-1, 0);
                        vel8 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 448, damage2, 0, Main.myPlayer);
                    }
                }
                if (npc.life < 166666)
                {
                    if (Main.rand.Next(20) == 0)
                    {
                        Vector2 vel = new Vector2(-1, -1);
                        vel *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 449, damage3, 0, Main.myPlayer);
                        Vector2 vel2 = new Vector2(1, 1);
                        vel2 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 449, damage3, 0, Main.myPlayer);
                        Vector2 vel3 = new Vector2(1, -1);
                        vel3 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 449, damage3, 0, Main.myPlayer);
                        Vector2 vel4 = new Vector2(-1, 1);
                        vel4 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 449, damage3, 0, Main.myPlayer);
                        Vector2 vel5 = new Vector2(0, -1);
                        vel5 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 449, damage3, 0, Main.myPlayer);
                        Vector2 vel6 = new Vector2(0, 1);
                        vel6 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 449, damage3, 0, Main.myPlayer);
                        Vector2 vel7 = new Vector2(1, 0);
                        vel7 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 449, damage3, 0, Main.myPlayer);
                        Vector2 vel8 = new Vector2(-1, 0);
                        vel8 *= 12f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 449, damage3, 0, Main.myPlayer);
                    }
                    if (Main.rand.Next(50) == 0)
                    {
                        Vector2 vel = new Vector2(-1, -1);
                        vel *= 14f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel.X, vel.Y, 448, damage3, 0, Main.myPlayer);
                        Vector2 vel2 = new Vector2(1, 1);
                        vel2 *= 14f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel2.X, vel2.Y, 448, damage3, 0, Main.myPlayer);
                        Vector2 vel3 = new Vector2(1, -1);
                        vel3 *= 14f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel3.X, vel3.Y, 448, damage3, 0, Main.myPlayer);
                        Vector2 vel4 = new Vector2(-1, 1);
                        vel4 *= 14f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel4.X, vel4.Y, 448, damage3, 0, Main.myPlayer);
                        Vector2 vel5 = new Vector2(0, -1);
                        vel5 *= 14f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel5.X, vel5.Y, 448, damage3, 0, Main.myPlayer);
                        Vector2 vel6 = new Vector2(0, 1);
                        vel6 *= 14f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel6.X, vel6.Y, 448, damage3, 0, Main.myPlayer);
                        Vector2 vel7 = new Vector2(1, 0);
                        vel7 *= 14f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel7.X, vel7.Y, 448, damage3, 0, Main.myPlayer);
                        Vector2 vel8 = new Vector2(-1, 0);
                        vel8 *= 14f;
                        Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vel8.X, vel8.Y, 448, damage3, 0, Main.myPlayer);
                    }
                }
            }
        }
Beispiel #15
0
        public override string GetChat()
        {
            string EntryM1  = Language.GetTextValue("Mods.AlchemistNPC.EntryM1");
            string EntryM2  = Language.GetTextValue("Mods.AlchemistNPC.EntryM2");
            string EntryM3  = Language.GetTextValue("Mods.AlchemistNPC.EntryM3");
            string EntryM4  = Language.GetTextValue("Mods.AlchemistNPC.EntryM4");
            string EntryM5  = Language.GetTextValue("Mods.AlchemistNPC.EntryM5");
            string EntryM6  = Language.GetTextValue("Mods.AlchemistNPC.EntryM6");
            string EntryM7  = Language.GetTextValue("Mods.AlchemistNPC.EntryM7");
            string EntryM8  = Language.GetTextValue("Mods.AlchemistNPC.EntryM8");
            string EntryM9  = Language.GetTextValue("Mods.AlchemistNPC.EntryM9");
            string EntryM10 = Language.GetTextValue("Mods.AlchemistNPC.EntryM10");
            string EntryM11 = Language.GetTextValue("Mods.AlchemistNPC.EntryM11");
            string EntryM12 = Language.GetTextValue("Mods.AlchemistNPC.EntryM12");
            string EntryM13 = Language.GetTextValue("Mods.AlchemistNPC.EntryM13");
            string EntryM14 = Language.GetTextValue("Mods.AlchemistNPC.EntryM14");
            string EntryM15 = Language.GetTextValue("Mods.AlchemistNPC.EntryM15");
            string EntryM16 = Language.GetTextValue("Mods.AlchemistNPC.EntryM16");
            string EntryM17 = Language.GetTextValue("Mods.AlchemistNPC.EntryM17");
            string EntryM18 = Language.GetTextValue("Mods.AlchemistNPC.EntryM18");
            string EntryM19 = Language.GetTextValue("Mods.AlchemistNPC.EntryM19");
            string EntryM20 = Language.GetTextValue("Mods.AlchemistNPC.EntryM20");
            string EntryM21 = Language.GetTextValue("Mods.AlchemistNPC.EntryM21");
            string Gamma    = Language.GetTextValue("Mods.AlchemistNPC.Gamma");
            int    Cyborg   = NPC.FindFirstNPC(NPCID.Cyborg);
            int    Mechanic = NPC.FindFirstNPC(NPCID.Mechanic);
            int    Clothier = NPC.FindFirstNPC(NPCID.Clothier);
            int    Wizard   = NPC.FindFirstNPC(NPCID.Wizard);
            int    Explorer = NPC.FindFirstNPC(mod.NPCType("Explorer"));
            int    Musician = NPC.FindFirstNPC(mod.NPCType("Musician"));

            if (Main.musicVolume == 0)
            {
                return(EntryM19);
            }
            if (Main.bloodMoon)
            {
                return(EntryM20);
            }
            if (Cyborg >= 0 && Main.npc[Cyborg].GivenName == "Gamma" && Main.npc[Musician].GivenName == Gamma && Main.rand.Next(15) == 0)
            {
                return(EntryM3);
            }
            if (Explorer >= 0 && Main.rand.Next(20) == 0)
            {
                return(EntryM7);
            }
            if (Mechanic >= 0 && Main.rand.Next(20) == 0)
            {
                return(EntryM8 + Main.npc[Mechanic].GivenName + EntryM9);
            }
            if (Wizard >= 0 && Main.rand.Next(20) == 0)
            {
                return(EntryM10 + Main.npc[Wizard].GivenName + EntryM11);
            }
            if (Clothier >= 0 && Main.rand.Next(20) == 0)
            {
                return(EntryM12 + Main.npc[Clothier].GivenName + EntryM13);
            }
            if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
            {
                if (Main.rand.Next(15) == 0)
                {
                    return(EntryM18);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("CalamityModMusic"))
            {
                if (Main.rand.Next(15) == 0)
                {
                    return(EntryM17);
                }
            }
            switch (Main.rand.Next(9))
            {
            case 0:
                return(EntryM1);

            case 1:
                return(EntryM2);

            case 2:
                return(EntryM4);

            case 3:
                return(EntryM5);

            case 4:
                return(EntryM6);

            case 5:
                return(EntryM14);

            case 6:
                return(EntryM15);

            case 7:
                return(EntryM16);

            case 8:
                return(EntryM21);

            default:
                return(EntryM1);
            }
        }
Beispiel #16
0
        public override void SetDefaults()
        {
            Main.tileLighted[Type]        = true;
            Main.tileFrameImportant[Type] = true;
            Main.tileNoAttach[Type]       = true;
            Main.tileLavaDeath[Type]      = true;
            TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4);
            TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 18 };
            TileObjectData.newTile.StyleHorizontal   = true;
            TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile);
            TileObjectData.addTile(Type);
            ModTranslation name = CreateMapEntryName();

            name.SetDefault("Materia Transmutator MK2");
            name.AddTranslation(GameCulture.Russian, "Преобразователь Материи MK2");
            AddMapEntry(new Color(200, 200, 200), name);
            disableSmartCursor = true;
            adjTiles           = new int[]
            {
                mod.TileType("MateriaTransmutator"),
                mod.TileType("WingoftheWorld"),
                TileID.WorkBenches,
                TileID.Anvils,
                TileID.Furnaces,
                TileID.Hellforge,
                TileID.Bookcases,
                TileID.Sinks,
                TileID.Solidifier,
                TileID.Blendomatic,
                TileID.MeatGrinder,
                TileID.Loom,
                TileID.LivingLoom,
                TileID.FleshCloningVat,
                TileID.GlassKiln,
                TileID.BoneWelder,
                TileID.SteampunkBoiler,
                TileID.Bottles,
                TileID.LihzahrdFurnace,
                TileID.ImbuingStation,
                TileID.DyeVat,
                TileID.Kegs,
                TileID.HeavyWorkBench,
                TileID.Tables,
                TileID.Chairs,
                TileID.CookingPots,
                TileID.DemonAltar,
                TileID.Sawmill,
                TileID.CrystalBall,
                TileID.AdamantiteForge,
                TileID.MythrilAnvil,
                TileID.TinkerersWorkbench,
                TileID.Autohammer,
                TileID.IceMachine,
                TileID.SkyMill,
                TileID.HoneyDispenser,
                TileID.AlchemyTable,
                TileID.LunarCraftingStation
            };
            if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
            {
                Array.Resize(ref adjTiles, adjTiles.Length + 3);
                adjTiles[adjTiles.Length - 1] = ModLoader.GetMod("ThoriumMod").TileType("ThoriumAnvil");
                adjTiles[adjTiles.Length - 1] = ModLoader.GetMod("ThoriumMod").TileType("ArcaneArmorFabricator");
                adjTiles[adjTiles.Length - 1] = ModLoader.GetMod("ThoriumMod").TileType("SoulForge");
            }
            if (ModLoader.GetLoadedMods().Contains("Fargowiltas"))
            {
                Array.Resize(ref adjTiles, adjTiles.Length + 1);
                adjTiles[adjTiles.Length - 1] = ModLoader.GetMod("Fargowiltas").TileType("CrucibleCosmosSheet");
            }
            if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
            {
                Array.Resize(ref adjTiles, adjTiles.Length + 1);
                adjTiles[adjTiles.Length - 1] = ModLoader.GetMod("CalamityMod").TileType("DraedonsForge");
            }
            dustType             = mod.DustType("JustitiaPale");
            animationFrameHeight = 74;
        }
Beispiel #17
0
 public override void SetupShop(Chest shop, ref int nextSlot)
 {
     if (S1)
     {
         if (!NPC.downedMechBossAny)
         {
             shop.item[nextSlot].SetDefaults(576);
             nextSlot++;
         }
         if (NPC.downedMechBossAny)
         {
             shop.item[nextSlot].SetDefaults(562);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(563);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(564);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(565);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(566);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(568);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(569);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(570);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(571);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(573);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1596);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1597);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1598);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1600);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1601);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1602);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1603);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1604);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1605);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1608);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1610);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(1964);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(2742);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(3237);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(3796);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             if (NPC.downedPlantBoss)
             {
                 shop.item[nextSlot].SetDefaults(567);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(572);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(574);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 if (NPC.downedQueenBee)
                 {
                     shop.item[nextSlot].SetDefaults(1599);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedGolemBoss)
                 {
                     shop.item[nextSlot].SetDefaults(1607);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 shop.item[nextSlot].SetDefaults(1606);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 if (NPC.downedMoonlord)
                 {
                     shop.item[nextSlot].SetDefaults(3044);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedGoblins)
                 {
                     shop.item[nextSlot].SetDefaults(3371);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedPirates)
                 {
                     shop.item[nextSlot].SetDefaults(3236);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (DD2Event.DownedInvasionT1)
                 {
                     shop.item[nextSlot].SetDefaults(3869);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 shop.item[nextSlot].SetDefaults(1609);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 if (NPC.downedHalloweenKing)
                 {
                     shop.item[nextSlot].SetDefaults(1963);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedChristmasIceQueen)
                 {
                     shop.item[nextSlot].SetDefaults(1965);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedMartians)
                 {
                     shop.item[nextSlot].SetDefaults(3235);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
                 if (NPC.downedMoonlord)
                 {
                     shop.item[nextSlot].SetDefaults(3370);
                     shop.item[nextSlot].shopCustomPrice = 100000;
                     nextSlot++;
                 }
             }
         }
     }
     if (S2)
     {
         if (ModLoader.GetLoadedMods().Contains("CalamityMod") && ModLoader.GetLoadedMods().Contains("CalamityModMusic"))
         {
             if (CalamityModMusicDownedDesertScourge)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("DesertScourgeMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedCrabulon)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CrabulonMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedHiveMind)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("HiveMindMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedPerforators)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("PerforatorMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedSlimeGod)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SlimeGodMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CragMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SirenIdleMusicbox"));
             shop.item[nextSlot].shopCustomPrice = 150000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SulphurousMusicbox"));
             shop.item[nextSlot].shopCustomPrice = 150000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("HigherAbyssMusicbox"));
             shop.item[nextSlot].shopCustomPrice = 150000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AbyssLowerMusicbox"));
             shop.item[nextSlot].shopCustomPrice = 150000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("VoidMusicbox"));
             shop.item[nextSlot].shopCustomPrice = 150000;
             nextSlot++;
             if (CalamityModMusicDownedCryogen)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CryogenMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedAquaticScourge)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AquaticScourgeMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedBrimstoneElemental)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("BrimmyMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedCalamitas)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CalamitasMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CalamityMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedLeviathan)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SirenMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("LeviathanMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedAstrum)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AstralMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AstrageldonMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("AstrumDeusMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (CalamityModMusicDownedPlaguebringer)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("PlaguebringerMusicbox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 if (CalamityModMusicDownedRavager)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("RavagerMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
                 if (NPC.downedMoonlord)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CultistMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
                 if (CalamityModMusicDownedGuardian)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("ProfanedGuardianMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
                 if (CalamityModMusicDownedProvidence)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("ProvidenceMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 250000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("StormWeaverMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("CeaselessVoidMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SignusMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
                 if (CalamityModMusicDownedPolter)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("PolterghastMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 300000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SunkenSeaMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 300000;
                     nextSlot++;
                 }
                 if (CalamityModMusicDownedDOG)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("DoGMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("DoGP2Musicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                 }
                 if (CalamityModMusicDownedYharon)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("Yharon1Musicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("Yharon2Musicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("Yharon3Musicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                 }
                 if (CalamityModMusicDownedSCal)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SCalGMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SCalLMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SCalEMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("CalamityModMusic").ItemType("SCalAMusicbox"));
                     shop.item[nextSlot].shopCustomPrice = 500000;
                     nextSlot++;
                 }
             }
         }
     }
     if (S3)
     {
         if (Main.hardMode)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("FieldsMusicBox"));
             shop.item[nextSlot].shopCustomPrice = 400000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("SheamMusicBox"));
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ChaosKingMusicBox"));
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("TheWorldRevolvingMusicBox"));
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
         }
         if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
         {
             if (ThoriumModDownedGTBird)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("ThunderBirdMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (ThoriumModDownedViscount)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("ViscountMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (ThoriumModDownedBoreanStrider)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("BoreanStriderMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (ThoriumModDownedFallenBeholder)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("FallenBeholderMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (ThoriumModDownedAbyssion)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("DepthsMusicBox"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
         }
     }
 }
Beispiel #18
0
 public override void SetupShop(Chest shop, ref int nextSlot)
 {
     if (OH)
     {
         shop.item[nextSlot].SetDefaults(ItemID.Amethyst);
         shop.item[nextSlot].shopCustomPrice = 1000;
         nextSlot++;
         shop.item[nextSlot].SetDefaults(ItemID.Topaz);
         shop.item[nextSlot].shopCustomPrice = 1000;
         nextSlot++;
         if (NPC.downedBoss2)
         {
             shop.item[nextSlot].SetDefaults(ItemID.Sapphire);
             shop.item[nextSlot].shopCustomPrice = 3000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.Emerald);
             shop.item[nextSlot].shopCustomPrice = 3000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.Amber);
             shop.item[nextSlot].shopCustomPrice = 5000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.FossilOre);
             shop.item[nextSlot].shopCustomPrice = 5000;
             nextSlot++;
             if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("Opal"));
                 shop.item[nextSlot].shopCustomPrice = 5000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("Onyx"));
                 shop.item[nextSlot].shopCustomPrice = 5000;
                 nextSlot++;
             }
             shop.item[nextSlot].SetDefaults(ItemID.BandofStarpower);
             shop.item[nextSlot].shopCustomPrice = 30000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.BandofRegeneration);
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             if (Main.netMode == 1 || Main.netMode == 2)
             {
                 shop.item[nextSlot].SetDefaults(ItemID.LifeCrystal);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
                 if (NPC.downedGolemBoss)
                 {
                     shop.item[nextSlot].SetDefaults(ItemID.LifeFruit);
                     shop.item[nextSlot].shopCustomPrice = 200000;
                     nextSlot++;
                 }
             }
         }
         if (NPC.downedBoss3)
         {
             shop.item[nextSlot].SetDefaults(ItemID.Ruby);
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.Diamond);
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.DiamondRing);
             shop.item[nextSlot].shopCustomPrice = 2000000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("HorrifyingSkull"));
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             if (ModLoader.GetLoadedMods().Contains("Tremor"))
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("Rupicide"));
                 shop.item[nextSlot].shopCustomPrice = 5000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("Opal"));
                 shop.item[nextSlot].shopCustomPrice = 30000;
                 nextSlot++;
                 if (Main.hardMode)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("MagiumShard"));
                     shop.item[nextSlot].shopCustomPrice = 7500;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("RuneBar"));
                     shop.item[nextSlot].shopCustomPrice = 7500;
                     nextSlot++;
                 }
                 if (NPC.downedMoonlord)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("LapisLazuli"));
                     shop.item[nextSlot].shopCustomPrice = 150000;
                     nextSlot++;
                 }
             }
             if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("GraniteEnergyCore"));
                 shop.item[nextSlot].shopCustomPrice = 10000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("BronzeFragments"));
                 shop.item[nextSlot].shopCustomPrice = 10000;
                 nextSlot++;
             }
             if (ModLoader.GetLoadedMods().Contains("SpiritMod"))
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("SpiritMod").ItemType("GraniteChunk"));
                 shop.item[nextSlot].shopCustomPrice = 10000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("SpiritMod").ItemType("MarbleChunk"));
                 shop.item[nextSlot].shopCustomPrice = 10000;
                 nextSlot++;
             }
             if (Main.hardMode)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("AlchemistHorcrux"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BrewerHorcrux"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("JewelerHorcrux"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ArchitectHorcrux"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("MusicianHorcrux"));
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
         }
     }
     if (AS)
     {
         shop.item[nextSlot].SetDefaults(ItemID.Campfire);
         shop.item[nextSlot].shopCustomPrice = 5000;
         nextSlot++;
         if (NPC.downedBoss2)
         {
             if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("Mistletoe"));
                 shop.item[nextSlot].shopCustomPrice = 50000;
                 nextSlot++;
             }
         }
         if (NPC.downedBoss3)
         {
             shop.item[nextSlot].SetDefaults(ItemID.WaterBucket);
             shop.item[nextSlot].shopCustomPrice = 15000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.HoneyBucket);
             shop.item[nextSlot].shopCustomPrice = 30000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.LavaBucket);
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.HeartLantern);
             shop.item[nextSlot].shopCustomPrice = 30000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.StarinaBottle);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.WaterCandle);
             shop.item[nextSlot].shopCustomPrice = 30000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.PeaceCandle);
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.Spike);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.DartTrap);
             shop.item[nextSlot].shopCustomPrice = 30000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.GeyserTrap);
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.SharpeningStation);
             shop.item[nextSlot].shopCustomPrice = 150000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.BewitchingTable);
             shop.item[nextSlot].shopCustomPrice = 150000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.AmmoBox);
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             if (Main.hardMode)
             {
                 shop.item[nextSlot].SetDefaults(ItemID.CrystalBall);
                 shop.item[nextSlot].shopCustomPrice = 150000;
                 nextSlot++;
             }
             if (NPC.downedGolemBoss)
             {
                 shop.item[nextSlot].SetDefaults(ItemID.WoodenSpike);
                 shop.item[nextSlot].shopCustomPrice = 20000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ItemID.SpearTrap);
                 shop.item[nextSlot].shopCustomPrice = 50000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ItemID.SpikyBallTrap);
                 shop.item[nextSlot].shopCustomPrice = 50000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ItemID.SuperDartTrap);
                 shop.item[nextSlot].shopCustomPrice = 750000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ItemID.FlameTrap);
                 shop.item[nextSlot].shopCustomPrice = 100000;
                 nextSlot++;
             }
         }
     }
 }
Beispiel #19
0
        public override string GetChat()
        {                                           //npc chat
            string EntryO1  = Language.GetTextValue("Mods.AlchemistNPC.EntryO1");
            string EntryO2  = Language.GetTextValue("Mods.AlchemistNPC.EntryO2");
            string EntryO3  = Language.GetTextValue("Mods.AlchemistNPC.EntryO3");
            string EntryO4  = Language.GetTextValue("Mods.AlchemistNPC.EntryO4");
            string EntryO5  = Language.GetTextValue("Mods.AlchemistNPC.EntryO5");
            string EntryO6  = Language.GetTextValue("Mods.AlchemistNPC.EntryO6");
            string EntryO7  = Language.GetTextValue("Mods.AlchemistNPC.EntryO7");
            string EntryO8  = Language.GetTextValue("Mods.AlchemistNPC.EntryO8");
            string EntryO9  = Language.GetTextValue("Mods.AlchemistNPC.EntryO9");
            string EntryO10 = Language.GetTextValue("Mods.AlchemistNPC.EntryO10");
            string EntryO11 = Language.GetTextValue("Mods.AlchemistNPC.EntryO11");
            string EntryO12 = Language.GetTextValue("Mods.AlchemistNPC.EntryO12");
            string EntryO13 = Language.GetTextValue("Mods.AlchemistNPC.EntryO13");
            string EntryO14 = Language.GetTextValue("Mods.AlchemistNPC.EntryO14");
            string EntryO15 = Language.GetTextValue("Mods.AlchemistNPC.EntryO15");
            string EntryO16 = Language.GetTextValue("Mods.AlchemistNPC.EntryO16");
            string EntryO17 = Language.GetTextValue("Mods.AlchemistNPC.EntryO17");
            string EntryO18 = Language.GetTextValue("Mods.AlchemistNPC.EntryO18");

            if (Main.bloodMoon)
            {
                switch (Main.rand.Next(3))
                {
                case 0:
                    return(EntryO14);

                case 1:
                    return(EntryO15);

                case 2:
                    return(EntryO16);
                }
            }
            if (Main.invasionType == 1)
            {
                return(EntryO11);
            }
            if (Main.invasionType == 3)
            {
                return(EntryO12);
            }
            if (Main.invasionType == 4)
            {
                return(EntryO13);
            }
            if (Main.rand.Next(5) == 0)
            {
                if (!WorldGen.crimson)
                {
                    return(EntryO5);
                }
                if (WorldGen.crimson)
                {
                    return(EntryO8);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("CalamityMod") && NPC.downedBoss3)
            {
                if (Main.rand.Next(7) == 0)
                {
                    return(EntryO17);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("CalamityMod") && NPC.downedMoonlord)
            {
                if (Main.rand.Next(7) == 0)
                {
                    return(EntryO18);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
            {
                if (Main.rand.Next(6) == 0)
                {
                    return(EntryO2);
                }
            }
            if (ModLoader.GetLoadedMods().Contains("ThoriumMod") && Main.hardMode)
            {
                if (Main.rand.Next(6) == 0)
                {
                    return(EntryO6);
                }
            }
            if (Main.rand.Next(5) == 0 && Main.hardMode)
            {
                switch (Main.rand.Next(2))
                {
                case 0:
                    return(EntryO9);

                case 1:
                    return(EntryO10);
                }
            }
            switch (Main.rand.Next(4))
            {
            case 0:
                return(EntryO1);

            case 1:
                return(EntryO3);

            case 2:
                return(EntryO4);

            default:
                return(EntryO7);
            }
        }
Beispiel #20
0
 public override bool CanUseItem(Player player)
 {
     if (NPC.downedSlimeKing)
     {
         item.damage = 25;
     }
     if (NPC.downedBoss1)
     {
         item.damage = 30;
     }
     if (NPC.downedBoss2)
     {
         item.damage = 35;
     }
     if (NPC.downedQueenBee)
     {
         item.damage = 40;
     }
     if (NPC.downedBoss3)
     {
         item.damage = 45;
     }
     if (Main.hardMode)
     {
         item.damage = 50;
     }
     if (NPC.downedMechBossAny)
     {
         item.damage = 75;
     }
     if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3)
     {
         item.damage = 100;
     }
     if (NPC.downedPlantBoss)
     {
         item.damage = 125;
     }
     if (NPC.downedGolemBoss)
     {
         item.damage = 150;
     }
     if (NPC.downedFishron)
     {
         item.damage = 200;
     }
     if (NPC.downedAncientCultist)
     {
         item.damage = 300;
     }
     if (NPC.downedMoonlord)
     {
         item.damage = 500;
     }
     if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
     {
         if (CalamityModDownedGuardian)
         {
             item.damage = 600;
         }
     }
     if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
     {
         if (ThoriumModDownedRagnarok)
         {
             item.damage = 1000;
         }
     }
     if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
     {
         if (CalamityModDownedProvidence)
         {
             item.damage = 1200;
         }
         if (CalamityModDownedPolter)
         {
             item.damage = 1500;
         }
         if (CalamityModDownedDOG)
         {
             item.damage = 3500;
         }
         if (CalamityModDownedYharon)
         {
             item.damage = 6000;
         }
         if (CalamityModDownedSCal)
         {
             item.damage = 10000;
         }
     }
     return(true);
 }
Beispiel #21
0
 public override void SetupShop(Chest shop, ref int nextSlot)
 {
     for (int k = 0; k < 255; k++)
     {
         Player player = Main.player[k];
         if (player.active)
         {
             for (int j = 0; j < player.inventory.Length; j++)
             {
                 if (player.inventory[j].type == mod.ItemType("OtherworldlyAmulet"))
                 {
                     OA = true;
                 }
             }
         }
     }
     if (Shop1)
     {
         if (!WorldGen.crimson)
         {
             shop.item[nextSlot].SetDefaults(ItemID.DemoniteOre);
             shop.item[nextSlot].shopCustomPrice = 2500;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.ShadowScale);
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
         }
         if (WorldGen.crimson)
         {
             shop.item[nextSlot].SetDefaults(ItemID.CrimtaneOre);
             shop.item[nextSlot].shopCustomPrice = 2500;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.TissueSample);
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
         }
         if (NPC.downedQueenBee)
         {
             shop.item[nextSlot].SetDefaults(ItemID.BeeWax);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
         }
         if (NPC.downedMechBossAny)
         {
             shop.item[nextSlot].SetDefaults(ItemID.SoulofLight);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.SoulofNight);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("DivineLava"));
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("CursedIce"));
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
         }
         if (NPC.downedMechBoss1)
         {
             shop.item[nextSlot].SetDefaults(ItemID.SoulofMight);
             shop.item[nextSlot].shopCustomPrice = 30000;
             nextSlot++;
         }
         if (NPC.downedMechBoss2)
         {
             shop.item[nextSlot].SetDefaults(ItemID.SoulofSight);
             shop.item[nextSlot].shopCustomPrice = 30000;
             nextSlot++;
         }
         if (NPC.downedMechBoss3)
         {
             shop.item[nextSlot].SetDefaults(ItemID.SoulofFright);
             shop.item[nextSlot].shopCustomPrice = 30000;
             nextSlot++;
         }
         if (NPC.downedMechBoss1 && NPC.downedMechBoss3 && NPC.downedMechBoss3)
         {
             shop.item[nextSlot].SetDefaults(ItemID.HallowedBar);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
         }
         if (NPC.downedGolemBoss)
         {
             shop.item[nextSlot].SetDefaults(ItemID.ShinyStone);
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.BeetleHusk);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
         }
         if (NPC.downedMoonlord && OA)
         {
             shop.item[nextSlot].SetDefaults(ItemID.FragmentSolar);
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.FragmentNebula);
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.FragmentVortex);
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.FragmentStardust);
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
         }
     }
     if (Shop2)
     {
         if (NPC.downedBoss3)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("TheBeak"));
             shop.item[nextSlot].shopCustomPrice = 200000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("LaetitiaRibbon"));
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("LaetitiaCoat"));
             shop.item[nextSlot].shopCustomPrice = 200000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("LaetitiaLeggings"));
             shop.item[nextSlot].shopCustomPrice = 150000;
             nextSlot++;
         }
         if (NPC.downedMechBossAny)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("FuneralofDeadButterflies"));
             shop.item[nextSlot].shopCustomPrice = 350000;
             nextSlot++;
         }
         if (NPC.downedMechBoss1 && NPC.downedMechBoss3 && NPC.downedMechBoss3)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("LaetitiaGift"));
             shop.item[nextSlot].shopCustomPrice = 300000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ReverberationHead"));
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ReverberationBody"));
             shop.item[nextSlot].shopCustomPrice = 350000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("ReverberationLegs"));
             shop.item[nextSlot].shopCustomPrice = 300000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("Reverberation"));
             shop.item[nextSlot].shopCustomPrice = 350000;
             nextSlot++;
         }
         if (NPC.downedPlantBoss)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BigBirdLamp"));
             shop.item[nextSlot].shopCustomPrice = 750000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("GrinderMK4"));
             shop.item[nextSlot].shopCustomPrice = 500000;
             nextSlot++;
         }
         if (NPC.downedGolemBoss)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("Spore"));
             shop.item[nextSlot].shopCustomPrice = 1000000;
             nextSlot++;
         }
     }
     if (Shop3)
     {
         if (NPC.downedBoss3 && Main.expertMode)
         {
             shop.item[nextSlot].SetDefaults(ItemID.KingSlimeBossBag);
             shop.item[nextSlot].shopCustomPrice = 250000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.EyeOfCthulhuBossBag);
             shop.item[nextSlot].shopCustomPrice = 500000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.EaterOfWorldsBossBag);
             shop.item[nextSlot].shopCustomPrice = 750000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.BrainOfCthulhuBossBag);
             shop.item[nextSlot].shopCustomPrice = 750000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.QueenBeeBossBag);
             shop.item[nextSlot].shopCustomPrice = 1000000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.SkeletronBossBag);
             shop.item[nextSlot].shopCustomPrice = 1500000;
             nextSlot++;
         }
         if (Main.hardMode && Main.expertMode)
         {
             shop.item[nextSlot].SetDefaults(ItemID.WallOfFleshBossBag);
             shop.item[nextSlot].shopCustomPrice = 2000000;
             nextSlot++;
         }
         if (NPC.downedPlantBoss && Main.expertMode)
         {
             shop.item[nextSlot].SetDefaults(ItemID.DestroyerBossBag);
             shop.item[nextSlot].shopCustomPrice = 2000000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.TwinsBossBag);
             shop.item[nextSlot].shopCustomPrice = 2000000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.SkeletronPrimeBossBag);
             shop.item[nextSlot].shopCustomPrice = 2000000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.PlanteraBossBag);
             shop.item[nextSlot].shopCustomPrice = 3000000;
             nextSlot++;
         }
         if (NPC.downedMoonlord && Main.expertMode)
         {
             shop.item[nextSlot].SetDefaults(ItemID.GolemBossBag);
             shop.item[nextSlot].shopCustomPrice = 3000000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.FishronBossBag);
             shop.item[nextSlot].shopCustomPrice = 4000000;
             nextSlot++;
         }
         if (ModLoader.GetLoadedMods().Contains("CalamityMod"))
         {
             if (CalamityModDownedGuardian)
             {
                 shop.item[nextSlot].SetDefaults(ItemID.MoonLordBossBag);
                 shop.item[nextSlot].shopCustomPrice = 7500000;
                 nextSlot++;
             }
         }
     }
 }
Beispiel #22
0
 public override void SetupShop(Chest shop, ref int nextSlot)
 {
     if (baseShop)
     {
         shop.item[nextSlot].SetDefaults(ItemID.LesserHealingPotion);
         shop.item[nextSlot].shopCustomPrice = 1000;
         nextSlot++;
         if (NPC.downedBoss2)
         {
             shop.item[nextSlot].SetDefaults(ItemID.HealingPotion);
             shop.item[nextSlot].shopCustomPrice = 5000;
             nextSlot++;
         }
         if (Main.hardMode)
         {
             shop.item[nextSlot].SetDefaults(ItemID.GreaterHealingPotion);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
         }
         if (NPC.downedMoonlord)
         {
             shop.item[nextSlot].SetDefaults(ItemID.SuperHealingPotion);
             shop.item[nextSlot].shopCustomPrice = 25000;
             nextSlot++;
         }
         shop.item[nextSlot].SetDefaults(ItemID.LesserManaPotion);
         shop.item[nextSlot].shopCustomPrice = 500;
         nextSlot++;
         if (NPC.downedBoss2)
         {
             shop.item[nextSlot].SetDefaults(ItemID.ManaPotion);
             shop.item[nextSlot].shopCustomPrice = 1000;
             nextSlot++;
         }
         if (Main.hardMode)
         {
             shop.item[nextSlot].SetDefaults(ItemID.GreaterManaPotion);
             shop.item[nextSlot].shopCustomPrice = 5000;
             nextSlot++;
         }
         if (Main.hardMode && NPC.downedMechBoss1 && (NPC.downedMechBoss2 && NPC.downedMechBoss3))
         {
             shop.item[nextSlot].SetDefaults(ItemID.SuperManaPotion);
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
         }
         shop.item[nextSlot].SetDefaults(ItemID.RecallPotion);
         shop.item[nextSlot].shopCustomPrice = 5000;
         nextSlot++;
         shop.item[nextSlot].SetDefaults(ItemID.WormholePotion);
         shop.item[nextSlot].shopCustomPrice = 5000;
         nextSlot++;
         if (Main.hardMode)
         {
             shop.item[nextSlot].SetDefaults(ItemID.TeleportationPotion);
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
         }
         if (ModLoader.GetLoadedMods().Contains("imkSushisMod"))
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("imkSushisMod").ItemType("BaseSummoningPotion"));
             shop.item[nextSlot].shopCustomPrice = 2500;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("imkSushisMod").ItemType("AnglerAmnesiaPotion"));
             shop.item[nextSlot].shopCustomPrice = 10000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("imkSushisMod").ItemType("MeteoritePotion"));
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("imkSushisMod").ItemType("ResurrectionPotion"));
             shop.item[nextSlot].shopCustomPrice = 25000;
             nextSlot++;
         }
         if (NPC.downedBoss2)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BeachTeleporterPotion"));
             shop.item[nextSlot].shopCustomPrice = 20000;
             nextSlot++;
         }
         if (NPC.downedBoss3)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("OceanTeleporterPotion"));
             shop.item[nextSlot].shopCustomPrice = 20000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("DungeonTeleportationPotion"));
             shop.item[nextSlot].shopCustomPrice = 25000;
             nextSlot++;
         }
         if (Main.hardMode)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("UnderworldTeleportationPotion"));
             shop.item[nextSlot].shopCustomPrice = 50000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("BeaconTeleportator"));
             shop.item[nextSlot].shopCustomPrice = 25000;
             nextSlot++;
         }
         if (NPC.downedPlantBoss)
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("TempleTeleportationPotion"));
             shop.item[nextSlot].shopCustomPrice = 100000;
             nextSlot++;
         }
         shop.item[nextSlot].SetDefaults(ItemID.Bottle);
         shop.item[nextSlot].shopCustomPrice = 100;
         nextSlot++;
         shop.item[nextSlot].SetDefaults(ItemID.BottledWater);
         shop.item[nextSlot].shopCustomPrice = 500;
         nextSlot++;
         shop.item[nextSlot].SetDefaults(ItemID.Mushroom);
         shop.item[nextSlot].shopCustomPrice = 500;
         nextSlot++;
         shop.item[nextSlot].SetDefaults(ItemID.GlowingMushroom);
         shop.item[nextSlot].shopCustomPrice = 1000;
         nextSlot++;
         if (NPC.downedBoss2)
         {
             shop.item[nextSlot].SetDefaults(ItemID.VileMushroom);
             shop.item[nextSlot].shopCustomPrice = 1000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.ViciousMushroom);
             shop.item[nextSlot].shopCustomPrice = 1000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.FallenStar);
             nextSlot++;
         }
         shop.item[nextSlot].SetDefaults(ItemID.Gel);
         shop.item[nextSlot].shopCustomPrice = 100;
         nextSlot++;
         if (NPC.downedBoss2)
         {
             shop.item[nextSlot].SetDefaults(ItemID.PinkGel);
             shop.item[nextSlot].shopCustomPrice = 1000;
             nextSlot++;
         }
         if (ModLoader.GetLoadedMods().Contains("ThoriumMod"))
         {
             if (NPC.downedBoss2)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("WaterChestnut"));
                 shop.item[nextSlot].shopCustomPrice = 3500;
                 nextSlot++;
             }
             if (NPC.downedBoss3)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("ThoriumMod").ItemType("Jelly"));
                 shop.item[nextSlot].shopCustomPrice = 7500;
                 nextSlot++;
             }
         }
         if (Main.hardMode)
         {
             shop.item[nextSlot].SetDefaults(ItemID.PixieDust);
             shop.item[nextSlot].shopCustomPrice = 5000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.CrystalShard);
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.UnicornHorn);
             shop.item[nextSlot].shopCustomPrice = 15000;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.CursedFlame);
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ItemID.Ichor);
             shop.item[nextSlot].shopCustomPrice = 7500;
             nextSlot++;
         }
         {
             for (int k = 0; k < 255; k++)
             {
                 Player player = Main.player[k];
                 if (player.active)
                 {
                     for (int j = 0; j < player.inventory.Length; j++)
                     {
                         if (player.inventory[j].type == mod.ItemType("OtherworldlyAmulet"))
                         {
                             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("AlchemistNPC").ItemType("EmagledFragmentation"));
                             shop.item[nextSlot].shopCustomPrice = 80000;
                             nextSlot++;
                         }
                     }
                 }
             }
         }
     }
     if (tremorShop)
     {
         if (ModLoader.GetLoadedMods().Contains("Tremor"))
         {
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("BasicFlask"));
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("FrostLiquidFlask"));
             nextSlot++;
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("LesserHealingFlack"));
             nextSlot++;
             if (Main.hardMode)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("BigHealingFlack"));
                 nextSlot++;
             }
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("LesserManaFlask"));
             nextSlot++;
             if (Main.hardMode)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("BigManaFlask"));
                 nextSlot++;
             }
             if (NPC.downedMoonlord)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("SuperManaFlask"));
                 nextSlot++;
             }
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("LesserPoisonFlask"));
             nextSlot++;
             if (Main.hardMode)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("BigPoisonFlask"));
                 nextSlot++;
             }
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("BoomFlask"));
             nextSlot++;
             if (Main.hardMode)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("ExtendedBoomFlask"));
                 nextSlot++;
             }
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("FreezeFlask"));
             nextSlot++;
             if (Main.hardMode)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("ExtendedFreezeFlask"));
                 nextSlot++;
             }
             if (NPC.downedBoss3)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("GoldFlask"));
                 nextSlot++;
             }
             shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("BurningFlask"));
             nextSlot++;
             if (Main.hardMode)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("ExtendedBurningFlask"));
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("HealthSupportFlask"));
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("ManaSupportFlask"));
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("LesserVenomFlask"));
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("BigVenomFlask"));
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("CrystalFlask"));
                 shop.item[nextSlot].shopCustomPrice = 150;
                 nextSlot++;
                 if (NPC.downedPlantBoss)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("PhantomFlask"));
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("PlagueFlask"));
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("SparkingFlask"));
                     nextSlot++;
                 }
                 if (NPC.downedMoonlord)
                 {
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("MoonDustFlask"));
                     shop.item[nextSlot].shopCustomPrice = 250;
                     nextSlot++;
                     shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("ClusterFlask"));
                     shop.item[nextSlot].shopCustomPrice = 300;
                     nextSlot++;
                 }
             }
             if (NPC.downedBoss3)
             {
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("Gloomstone"));
                 shop.item[nextSlot].shopCustomPrice = 100;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("UntreatedFlesh"));
                 shop.item[nextSlot].shopCustomPrice = 100;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("LightBulb"));
                 shop.item[nextSlot].shopCustomPrice = 500;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("AtisBlood"));
                 shop.item[nextSlot].shopCustomPrice = 2500;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("TearsofDeath"));
                 shop.item[nextSlot].shopCustomPrice = 2500;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("TornPapyrus"));
                 shop.item[nextSlot].shopCustomPrice = 5000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("PhantomSoul"));
                 shop.item[nextSlot].shopCustomPrice = 5000;
                 nextSlot++;
                 shop.item[nextSlot].SetDefaults(ModLoader.GetMod("Tremor").ItemType("TheRib"));
                 shop.item[nextSlot].shopCustomPrice = 7500;
                 nextSlot++;
             }
         }
     }
 }
Beispiel #23
0
        internal static void Setup(Mod recipeBrowserMod)
        {
            // Save format:

            /*
             * .. hmm, vanilla item drops...do I have to recalculate each time? New Set of mods => complete refresh?
             *
             * RecipeBrowserVersion // So if we add more features we can ignore this file
             * [ of Mod Info
             * -> ModName
             * -> Version
             * -> [ of npc drop info? or item info?
             * -->  Tuple<JSONNPC, LootItem[]> or
             * -->  JSONNPC<T>
             * -->
             * ---> OR
             * --> Item Info
             * ---> ["NPCInfo" with droprate]
             * -->
             * -> ]
             * ]
             *
             * hmm, instead of mod info, just a list of npc? just a list of Item?
             *
             * <Mod, Version>[] --> For knowing which have updated....for now, any update or unaccounted mod, recalculate allll
             * ItemInfo[] JSONNPC and array of JSONNPC that drop it. (forget droprates for now?)
             *
             *
             * item to npc or npc to item....
             */
            string    json;
            string    filename         = "LootCache.json";
            string    folder           = Path.Combine(Main.SavePath, "Mods", "Cache");
            string    path             = Path.Combine(folder, filename);
            LootCache li               = new LootCache();
            bool      needsRecalculate = true;

            LootCacheManagerActive = true;
            List <string> modsThatNeedRecalculate = new List <string>();

            if (File.Exists(path))
            {
                using (StreamReader r = new StreamReader(path))
                {
                    json = r.ReadToEnd();
                    li   = JsonConvert.DeserializeObject <LootCache>(json, new JsonSerializerSettings {
                        Converters = { new Newtonsoft.Json.Converters.VersionConverter() }
                    });
                    needsRecalculate = false;
                    if (li == null)                     // Investigate why some people get LootCache.json with only 0s in it.
                    {
                        li = new LootCache();
                    }
                }
            }

            // New Recipe Browser version, assume total reset needed (adjust this logic next update.)
            if (li.recipeBrowserVersion != recipeBrowserMod.Version)
            {
                li.lootInfos.Clear();
                li.cachedMods.Clear();
                li.recipeBrowserVersion = recipeBrowserMod.Version;
                needsRecalculate        = true;
            }

            // If we aren't up to date on each mod...
            foreach (var mod in ModLoader.GetLoadedMods())
            {
                if (/*mod == "ModLoader" || */ mod == "RecipeBrowser")
                {
                    continue;
                }
                Mod    m       = ModLoader.GetMod(mod);
                string modName = m.Name == "ModLoader" ? "Terraria" : m.Name;
                if (!li.cachedMods.Any(x => x.Key == modName && x.Value == m.Version))                 // if this mod is either updated or doesn't exist yet
                //if (li.cachedMods.ContainsKey(modName) && li.cachedMods[modName] == m.Version)
                {
                    needsRecalculate = true;
                    // Remove mod from list
                    li.cachedMods.Remove(modName);
                    // Remove items from this mod
                    var toRemove = li.lootInfos.Where(pair => pair.Key.mod == modName)                     // Can't detect if a vanilla npc dropping a vanilla is because of mod. It's fine
                                   .Select(pair => pair.Key)
                                   .ToList();
                    foreach (var key in toRemove)
                    {
                        li.lootInfos.Remove(key);
                    }
                    // Remove npc from items.
                    foreach (var itemToNPCs in li.lootInfos)
                    {
                        itemToNPCs.Value.RemoveAll(x => x.mod == modName);
                    }
                    modsThatNeedRecalculate.Add(modName);
                    li.cachedMods[modName] = m.Version;                     // (new Tuple<string, Version>(modName, m.Version));
                }
            }
            //li.cachedMods.Add(new Tuple<string, Version>(m.Name, m.Version));

            if (needsRecalculate)
            {
                // Temp variables
                float soundVolume = Main.soundVolume;
                Main.soundVolume = 0f;
                if (!Main.dedServ)
                {
                    Reflect();
                }
                setLoadProgressText?.Invoke("Recipe Browser: Rebuilding Loot Cache");
                setLoadProgressProgress?.Invoke(0f);

                // expert drops?
                for (int playernum = 0; playernum < 256; playernum++)
                {
                    Main.player[playernum] = new Player();
                }
                //Main.player[0].active = true;
                int oldMx = Main.maxTilesX;
                Main.maxTilesX = 2100;
                int oldMy = Main.maxTilesY;
                Main.maxTilesY = 600;
                for (int x = 0; x < Main.maxTilesX; x++)
                {
                    for (int y = 0; y < Main.maxTilesY; y++)
                    {
                        Main.tile[x, y]      = new Tile();
                        Main.tile[x, y].type = 0;
                        if (y > Main.maxTilesY * 0.3f)
                        {
                            Main.tile[x, y].active(true);
                        }
                    }
                }
                Main.worldSurface = 200;
                //Main.netMode = 1; // hope this doesn't do anything weird
                NPC  npc  = new NPC();
                Item item = new Item();
                loots = new HashSet <int>();
                string lastMod = "";
                var    watch   = Stopwatch.StartNew();
                var    oldRand = Main.rand;
                if (Main.rand == null)
                {
                    Main.rand = new Terraria.Utilities.UnifiedRandom();
                }

                for (int i = 1; i < NPCLoader.NPCCount; i++)                 // for every npc...
                {
                    npc.SetDefaults(i);
                    npc.value = 0;                     // Causes some drops to be missed, why is this here?
                    string currentMod = npc.modNPC?.mod.Name ?? "Terraria";
                    if (!modsThatNeedRecalculate.Contains(currentMod))
                    {
                        continue;
                    }
                    if (lastMod != currentMod)
                    {
                        lastMod = currentMod;
                        setLoadSubProgressText?.Invoke(lastMod);
                    }
                    setLoadProgressProgress?.Invoke((float)i / NPCLoader.NPCCount);
                    JSONNPC jsonNPC = new JSONNPC(npc.modNPC?.mod.Name ?? "Terraria", npc.modNPC?.Name ?? npc.TypeName, npc.modNPC != null ? 0 : i);

                    loots.Clear();
                    CalculateLoot(npc);                      // ...calculate drops

                    foreach (var loot in loots)
                    {
                        if (ignoreItemIDS.Contains(loot))
                        {
                            continue;
                        }

                        item.SetDefaults(loot, true);

                        //JSONItem jsonitem = new JSONItem(item.modItem?.mod.Name ?? "Terraria", Lang.GetItemNameValue(loot), item.modItem != null ? 0 : loot);
                        JSONItem       jsonitem = new JSONItem(item.modItem?.mod.Name ?? "Terraria", item.modItem?.Name ?? Lang.GetItemNameValue(loot), item.modItem != null ? 0 : loot);
                        List <JSONNPC> npcsthatdropme;
                        if (!li.lootInfos.TryGetValue(jsonitem, out npcsthatdropme))
                        {
                            li.lootInfos.Add(jsonitem, npcsthatdropme = new List <JSONNPC>());
                        }
                        npcsthatdropme.Add(jsonNPC);
                    }
                }
                loots.Clear();
                // Reset temp values
                Main.rand = oldRand;                 // value 8 seconds.  // don't value to 0 and ignore.contains: 5 seconds.
                // value to 0, contains, 4 seconds.   .6 seconds without contains.
                Main.maxTilesX   = oldMx;
                Main.maxTilesY   = oldMy;
                Main.soundVolume = soundVolume;

                // Save json:
                watch.Stop();
                var elapsedMs = watch.ElapsedMilliseconds;
                //li.iterations = MaxNumberLootExperiments;
                li.lastUpdateTime = elapsedMs;
                Directory.CreateDirectory(folder);
                json = JsonConvert.SerializeObject(li, Formatting.Indented, new JsonSerializerSettings {
                    Converters = { new Newtonsoft.Json.Converters.VersionConverter() }
                });
                File.WriteAllText(path, json);

                // Reset Load Mods Progress bar
                setLoadSubProgressText?.Invoke("");
                setLoadProgressText?.Invoke("Adding Recipes");
                setLoadProgressProgress?.Invoke(0f);
            }
            LootCacheManagerActive = false;
            LootCache.instance     = li;
        }
Beispiel #24
0
 public override bool Autoload(ref string name)
 {
     return(ModLoader.GetLoadedMods().Contains("ThoriumMod"));
 }
        public override void OnInitialize()
        {
            // Is initialize called? (Yes it is called on reload) I want to reset nicely with new character or new loaded mods: visible = false;

            announce          = false;    // overwritten by modplayer
            collectChestItems = false;
            showBadge         = false;

            checklistPanel = new UIPanel();
            checklistPanel.SetPadding(10);
            checklistPanel.Left.Pixels = 0;
            checklistPanel.HAlign      = 1f;
            checklistPanel.Top.Set(85f, 0f);
            checklistPanel.Left.Set(-40f, 0f);
            checklistPanel.Width.Set(250f, 0f);
            checklistPanel.Height.Set(-125, 1f);
            checklistPanel.BackgroundColor = new Color(73, 94, 171);

            int top  = 0;
            int left = 0;

            // Because OnInitialize Happens during load and because we need it to happen for OnEnterWorld, use dummy sprite.
            buttonsHaveDummyTextures = true;

            foundFilterButton               = new UIHoverImageButton(Main.magicPixel, "Cycle Found Filter: ??");
            foundFilterButton.OnClick      += (a, b) => ToggleFoundFilterButtonClicked(a, b, true);
            foundFilterButton.OnRightClick += (a, b) => ToggleFoundFilterButtonClicked(a, b, false);
            foundFilterButton.Top.Pixels    = top;
            checklistPanel.Append(foundFilterButton);
            left += (int)spacing * 2 + 28;

            //sortButton = new UIHoverImageButton(sortButtonTexture, "Cycle Sort Method: ??");
            //sortButton.OnClick += (a, b) => ToggleSortButtonClicked(a, b, true);
            //sortButton.OnRightClick += (a, b) => ToggleSortButtonClicked(a, b, false);
            //sortButton.Left.Pixels = spacing * 4 + 28 * 2;
            //sortButton.Top.Pixels = top;
            //checklistPanel.Append(sortButton);

            modFilterButton               = new UIHoverImageButton(Main.magicPixel, "Cycle Mod Filter: ??");
            modFilterButton.OnClick      += (a, b) => ToggleModFilterButtonClicked(a, b, true);
            modFilterButton.OnRightClick += (a, b) => ToggleModFilterButtonClicked(a, b, false);
            modFilterButton.Left.Pixels   = left;
            modFilterButton.Top.Pixels    = top;
            checklistPanel.Append(modFilterButton);
            left += (int)spacing * 2 + 28;

            muteButton             = new UIToggleHoverImageButton(Main.magicPixel, ItemChecklist.instance.GetTexture("UIElements/closeButton"), "Toggle Messages", announce);
            muteButton.OnClick    += ToggleMuteButtonClicked;
            muteButton.Left.Pixels = left;
            muteButton.Top.Pixels  = top;
            checklistPanel.Append(muteButton);
            left += (int)spacing * 2 + 28;

            collectChestItemsButton             = new UIToggleHoverImageButton(Main.magicPixel, ItemChecklist.instance.GetTexture("UIElements/closeButton"), "Toggle Collect Chest Items", collectChestItems);
            collectChestItemsButton.OnClick    += ToggleFindChestItemsButtonClicked;
            collectChestItemsButton.Left.Pixels = left;
            collectChestItemsButton.Top.Pixels  = top;
            checklistPanel.Append(collectChestItemsButton);
            left += (int)spacing * 2 + 28;

            showBadgeButton             = new UIToggleHoverImageButton(Main.magicPixel, ItemChecklist.instance.GetTexture("UIElements/closeButton"), "Show Sort Value Text", showBadge);
            showBadgeButton.OnClick    += ToggleShowBadgeButtonClicked;
            showBadgeButton.Left.Pixels = left;
            showBadgeButton.Top.Pixels  = top;
            checklistPanel.Append(showBadgeButton);
            left += (int)spacing * 2 + 28;

            top += 34;

            itemNameFilter = new NewUITextBox("Filter by Name");
            itemNameFilter.OnTextChanged += () => { ValidateItemFilter(); updateNeeded = true; };
            itemNameFilter.OnTabPressed  += () => { itemDescriptionFilter.Focus(); };
            itemNameFilter.Top.Pixels     = top;
            //itemNameFilter.Left.Set(-152, 1f);
            itemNameFilter.Width.Set(0, 1f);
            itemNameFilter.Height.Set(25, 0f);
            checklistPanel.Append(itemNameFilter);

            top += 30;

            itemDescriptionFilter = new NewUITextBox("Filter by tooltip");
            itemDescriptionFilter.OnTextChanged += () => { ValidateItemDescription(); updateNeeded = true; };
            itemDescriptionFilter.OnTabPressed  += () => { itemNameFilter.Focus(); };
            itemDescriptionFilter.Top.Pixels     = top;
            //itemDescriptionFilter.Left.Set(-152, 1f);
            itemDescriptionFilter.Width.Set(0, 1f);
            itemDescriptionFilter.Height.Set(25, 0f);
            checklistPanel.Append(itemDescriptionFilter);

            top += 30;

            sharedUI = new SharedUI();
            sharedUI.Initialize();

            sharedUI.sortsAndFiltersPanel.Top.Set(top, 0f);
            sharedUI.sortsAndFiltersPanel.Width.Set(0f, 1);
            sharedUI.sortsAndFiltersPanel.Height.Set(60, 0f);
            checklistPanel.Append(sharedUI.sortsAndFiltersPanel);

            top += 68;

            checklistGrid = new UIGrid(5);
            checklistGrid.alternateSort = ItemGridSort;
            checklistGrid.Top.Pixels    = top;
            checklistGrid.Width.Set(-25f, 1f);
            checklistGrid.Height.Set(-top, 1f);
            checklistGrid.ListPadding = 2f;
            checklistPanel.Append(checklistGrid);

            FixedUIScrollbar checklistListScrollbar = new FixedUIScrollbar();

            checklistListScrollbar.SetView(100f, 1000f);
            checklistListScrollbar.Top.Pixels = top;
            checklistListScrollbar.Height.Set(-top, 1f);
            checklistListScrollbar.HAlign = 1f;
            checklistPanel.Append(checklistListScrollbar);
            checklistGrid.SetScrollbar(checklistListScrollbar);

            // Checklistlist populated when the panel is shown: UpdateCheckboxes()

            Append(checklistPanel);

            // load time impact, do this on first show?
            itemSlots = new UIItemSlot[ItemLoader.ItemCount];
            Item[] itemSlotItems = new Item[ItemLoader.ItemCount];
            for (int i = 0; i < ItemLoader.ItemCount; i++)
            {
                itemSlots[i]     = new UIItemSlot(i);
                itemSlotItems[i] = itemSlots[i].item;
            }

            FieldInfo inventoryGlowHue  = typeof(Terraria.UI.ItemSlot).GetField("inventoryGlowHue", BindingFlags.Static | BindingFlags.NonPublic);
            FieldInfo inventoryGlowTime = typeof(Terraria.UI.ItemSlot).GetField("inventoryGlowTime", BindingFlags.Static | BindingFlags.NonPublic);

            MethodInfo SortMethod = typeof(ItemSorting).GetMethod("Sort", BindingFlags.Static | BindingFlags.NonPublic);

            object[] parametersArray = new object[] { itemSlotItems, new int[0] };

            inventoryGlowHue.SetValue(null, new float[ItemLoader.ItemCount]);
            inventoryGlowTime.SetValue(null, new int[ItemLoader.ItemCount]);
            SortMethod.Invoke(null, parametersArray);
            inventoryGlowHue.SetValue(null, new float[58]);
            inventoryGlowTime.SetValue(null, new int[58]);

            int[] vanillaIDsInSortOrderTemp = itemSlotItems.Select((x) => x.type).ToArray();
            vanillaIDsInSortOrder = new int[ItemLoader.ItemCount];
            for (int i = 0; i < ItemLoader.ItemCount; i++)
            {
                vanillaIDsInSortOrder[i] = Array.FindIndex(vanillaIDsInSortOrderTemp, x => x == i);
            }

            modnames = new List <string>()
            {
                "All", "Vanilla"
            };
            modnames.AddRange(ModLoader.GetLoadedMods() /*.Where(x => x != "ModLoader")*/);

            updateNeeded = true;
        }