Esempio n. 1
0
 public override bool Drop(int i, int j, int type)
 {
     if (type == 28)
     {
         int potsType  = Main.tile[i, j].type;
         int potsIndex = Main.tile[i, j].frameY / 18;
         //Divide by 2 to get the right potion sprite and then -1 to get the right index
         if (potsIndex > 1)
         {
             potsType -= 1;
         }
         potsIndex = (int)(Math.Floor(potsType / 3f));
         //Get the actual pots type
         //Then get the coin modifier based on what type it is
         PotsRegistery.ExecuteDrop(i, j, potsIndex);
         return(false);
     }
     return(base.Drop(i, j, type));
 }
Esempio n. 2
0
        public MoneyPotsDrop(Func <int, int, bool> successFunc) : base("Money", successFunc)
        {
            modifyAmount += delegate(int x, int y, ref float money)
            {
                if ((double)y < Main.worldSurface)
                {
                    money *= 0.5f;
                }
                else if ((double)y < Main.rockLayer)
                {
                    money *= 0.75f;
                }
                else if (y > Main.maxTilesY - 250)
                {
                    money *= 1.25f;
                }
            };

            modifyAmount += (int x, int y, ref float money) => { money *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.rand.Next(4) == 0)
                {
                    money *= 1f + (float)Main.rand.Next(5, 11) * 0.01f;
                }
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.rand.Next(8) == 0)
                {
                    money *= 1f + (float)Main.rand.Next(10, 21) * 0.01f;
                }
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.rand.Next(12) == 0)
                {
                    money *= 1f + (float)Main.rand.Next(20, 41) * 0.01f;
                }
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.rand.Next(16) == 0)
                {
                    money *= 1f + (float)Main.rand.Next(40, 81) * 0.01f;
                }
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.rand.Next(20) == 0)
                {
                    money *= 1f + (float)Main.rand.Next(50, 101) * 0.01f;
                }
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.expertMode)
                {
                    money *= 2.5f;
                }
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.expertMode && Main.rand.Next(2) == 0)
                {
                    money *= 1.25f;
                }
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.expertMode && Main.rand.Next(3) == 0)
                {
                    money *= 1.5f;
                }
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (Main.expertMode && Main.rand.Next(4) == 0)
                {
                    money *= 1.75f;
                }
            };
            //Pots drop modifier
            modifyAmount += (int x, int y, ref float money) =>
            {
                float potsModifier;
                int   potsType = Main.tile[x, y].type;
                if (potsType == 28)
                {
                    int potsIndex = Main.tile[x, y].frameY / 18;
                    //Divide by 2 to get the right potion sprite and then -1 to get the right index
                    if (potsIndex > 1)
                    {
                        potsIndex = (int)(Math.Ceiling(potsType / 2f) - 1);
                    }
                    //Get the actual pots type
                    potsIndex /= 3;
                    //Then get the coin modifier based on what type it is
                    potsModifier = PotsRegistery.PotsSpecificModifer(potsIndex);
                    money       *= potsModifier;
                    return;
                }

                potsModifier = PotsRegistery.PotsSpecificModifer(Main.tile[x, y].type);
                money       *= potsModifier;
            };
            modifyAmount += (int x, int y, ref float money) =>
            {
                if (NPC.downedBoss1)
                {
                    money *= 1.1f;
                }

                if (NPC.downedBoss2)
                {
                    money *= 1.1f;
                }

                if (NPC.downedBoss3)
                {
                    money *= 1.1f;
                }

                if (NPC.downedMechBoss1)
                {
                    money *= 1.1f;
                }

                if (NPC.downedMechBoss2)
                {
                    money *= 1.1f;
                }

                if (NPC.downedMechBoss3)
                {
                    money *= 1.1f;
                }

                if (NPC.downedPlantBoss)
                {
                    money *= 1.1f;
                }

                if (NPC.downedQueenBee)
                {
                    money *= 1.1f;
                }

                if (NPC.downedGolemBoss)
                {
                    money *= 1.1f;
                }

                if (NPC.downedPirates)
                {
                    money *= 1.1f;
                }

                if (NPC.downedGoblins)
                {
                    money *= 1.1f;
                }

                if (NPC.downedFrost)
                {
                    money *= 1.1f;
                }
            };
            modifyAmount += (int x, int y, ref float money) => { };
        }