Exemplo n.º 1
0
        public override void BossLoot(ref string name, ref int potionType)
        {
            ErilipahWorld.downedTaintedSkull = true;
            potionType = ItemID.HealingPotion;

            Loot.DropItem(npc, mod.ItemType("PureFlower"), 3, 4, 100, 1.5f);
            if (Main.expertMode)
            {
                npc.DropBossBags();
            }
            else
            {
                Loot.DropItem(npc, ItemType <ShellChunk>(), 6, 11);
                Loot.DropItem(npc, ItemType <MadnessFocus>(), 9, 16);

                System.Collections.Generic.List <int> types = new System.Collections.Generic.List <int> {
                    ItemType <TyrantEye>(),
                    ItemType <VoidSpike>(),
                    ItemType <TorchOfSoul>(),
                    ItemType <ScepterOfEternalAbyss>(),
                    ItemType <LEECH>()
                };

                for (int i = 0; i < 2; i++)
                {
                    int chosen = Main.rand.Next(types);
                    Loot.DropItem(npc, chosen);
                    types.Remove(chosen);
                }
            }
        }
Exemplo n.º 2
0
        public override void Update()
        {
            if (Broken)
            {
                if (!active)
                {
                    Crack++;
                }
                if (Crack > 36000)
                {
                    Crack  = 0;
                    Broken = false;
                }
                return;
            }
            if (Crack == 60 || Crack == 120)
            {
                Main.PlaySound(0, Position.ToVector2() * 16);
                Crack++;
            }
            if (Crack > SoulStatue.CrackingPoint * 2)
            {
                if (!Broken && Main.netMode != 1)
                {
                    Main.PlaySound(4, Position.X * 16, Position.Y * 16, 23);
                    int target = Helper.FindClosestPlayer(new Vector2(Position.X * 16 + 8, Position.Y * 16 + 8), 1000);
                    if (target == -1)
                    {
                        target = 255;
                    }
                    NPC.NewNPC(Position.X * 16 + 8, Position.Y * 16 + 32, NPCType <Abomination>(), Target: target);
                    Loot.DropItem(new Rectangle(Position.X * 16, Position.Y * 16, 32, 48), ItemType <SoulRubble>(), 1, 1, 50);

                    Broken = true;
                }
            }
            if (!active)
            {
                if (Crack < SoulStatue.CrackingPoint && Crack > 0)
                {
                    Crack--;
                }
                return;
            }

            int plrIndex = Helper.FindClosestPlayer(new Vector2(Position.X * 16 + 8, Position.Y * 16 + 8), 1000);

            if (plrIndex == -1 || Main.myPlayer != plrIndex)
            {
                return;
            }

            Player plr          = Main.player[plrIndex];
            bool   canSeePlayer = Collision.CanHitLine(plr.Center, 1, 1, new Vector2(Position.X * 16, Position.Y * 16) + new Vector2(10, 12), 1, 1);

            if (canSeePlayer)
            {
                Crack++;
            }
        }
Exemplo n.º 3
0
        public override void HitEffect(int hitDirection, double damage)
        {
            if (npc.life > 0)
            {
                Main.PlaySound(3, (int)npc.Center.X, (int)npc.Center.Y, Main.rand.Next(1, 58), 0.9f, Main.rand.NextFloat(-0.9f, 0.9f));
            }
            else
            {
                Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, Main.rand.Next(1, 63), 0.9f, Main.rand.NextFloat(-0.9f, 0.9f));
            }
            int coin = (int)(damage * 11.254924);

            if (coin >= 1000000)
            {
                Loot.DropItem(npc.getRect(), ItemID.PlatinumCoin, coin / 1000000, coin / 1000000, 100, 2);
            }
            if (coin >= 10000)
            {
                Loot.DropItem(npc.getRect(), ItemID.GoldCoin, coin / 10000 % 1000000, coin / 10000 % 1000000, 100, 2);
            }
            if (coin >= 100)
            {
                Loot.DropItem(npc.getRect(), ItemID.SilverCoin, coin / 100 % 10000, coin / 100 % 10000, 100, 2);
            }
            if (coin % 100 > 0)
            {
                Loot.DropItem(npc.getRect(), ItemID.CopperCoin, coin % 100, coin % 100, 100, 2);
            }
        }
Exemplo n.º 4
0
 public override void KillTile(int i, int j, int type, ref bool fail, ref bool effectOnly, ref bool noItem)
 {
     base.KillTile(i, j, type, ref fail, ref effectOnly, ref noItem);
     if ((type == TileID.Plants || type == TileID.JunglePlants || type == TileID.JunglePlants2 || type == TileID.Plants2) &&
         !noItem && PlayerHasSeedChaingun(i, j))
     {
         Loot.DropItem(new Rectangle(i * 16, j * 16, 16, 16), ItemID.Seed, 1, 2, 90);
     }
 }
Exemplo n.º 5
0
 public override void Kill(int timeLeft)
 {
     for (int i = 0; i < 4; i++)
     {
         Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("CrystallineDust"));
     }
     if (projectile.thrown)
     {
         Loot.DropItem(projectile.Hitbox, mod.ItemType(GetType().Name.Remove(GetType().Name.Length - 4)), 1, 1, 25);
     }
 }
Exemplo n.º 6
0
 public override void NPCLoot()
 {
     if (npc.ai[1] == 1)
     {
         Loot.DropItem(npc, ItemID.Heart, 1, 1, 50);
     }
     else
     {
         Loot.DropItem(npc, ItemType <PutridFlesh>(), 1, 1, 18);
     }
 }
Exemplo n.º 7
0
        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            if (!WorldGen.gen && Main.netMode != 1)
            {
                Rectangle area = new Rectangle(i * 16, j * 16, 32, 32);
                switch (Main.rand.Next(12))
                {
                case 0:
                    Loot.DropItem(area, ItemType <ReductionPot>());
                    break;

                case 1:
                    Loot.DropItem(area, ItemType <SlowingPot>());
                    break;

                case 2:
                    Loot.DropItem(area, ItemType <EffulgencePot>());
                    break;

                case 3:
                    Loot.DropItem(area, ItemID.SilverCoin, 1, 12, 100, 2);
                    Loot.DropItem(area, ItemID.CopperCoin, 1, 100, 100, 1);
                    break;

                case 4:
                    Loot.DropItem(area, ItemID.HealingPotion);
                    break;

                case 5:
                    Loot.DropItem(area, ItemID.ShinePotion);
                    break;

                case 6:
                    Loot.DropItem(area, ItemID.Heart);
                    break;

                case 7: goto case 3;

                case 8:
                    Loot.DropItem(area, ItemID.Heart, 2, 3, 100, 1);
                    break;

                case 9: goto case 5;

                case 10: goto case 3;

                case 11:
                    Loot.DropItem(area, ItemType <MadnessFocus>(), 2, 5, 100, 1.75f);
                    break;
                }
            }
        }
Exemplo n.º 8
0
        public override void NPCLoot()
        {
            if (npc.scale >= 0.8f)
            {
                Loot.DropItem(npc, ItemType <StablePhlogiston>(), 1, 1, 20);
            }

            if (npc.scale > 0.65f && Main.netMode != 1)
            {
                for (int i = -1; i < 2; i += 2)
                {
                    NPC child = Main.npc[NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, npc.type, Target: npc.target)];
                    child.scale    = npc.scale * 0.7f;
                    child.velocity = new Vector2(i * 3, -2);
                }
            }
        }
Exemplo n.º 9
0
 public override void Kill(int timeLeft)
 {
     if (DustTrailType != DustTrailTypes.None)
     {
         for (int i = 0; i < Math.Min(30, TrailThickness * 4); i++)
         {
             Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, DustType, Scale: TrailScale)];
             if (NoDustLight)
             {
                 dust.noLight = true;
             }
         }
     }
     if (DropItem && ItemSource != null && ItemSource.consumable &&
         ItemSource.thrown && projectile.owner == Main.myPlayer && !projectile.noDropItem)
     {
         float chance    = 1 - (projectile.width + projectile.height) / 100;
         float minChance = MathHelper.Clamp(chance, 0.0f, 0.2f);
         Loot.DropItem(projectile.getRect(), ItemSource.type, 1, 1, minChance * 100);
     }
 }
Exemplo n.º 10
0
 public override void NPCLoot()
 {
     Loot.DropItem(npc, ItemType <Dracocell>(), 1, 1, 55);
     Loot.DropItem(npc, ItemID.SilverCoin, 30, 50, 100, 2);
 }
Exemplo n.º 11
0
 public override void NPCLoot() => Loot.DropItem(npc, ItemType <Dracocell>(), 1, 1, 3);
Exemplo n.º 12
0
 public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
 {
     Loot.DropItem(new Rectangle(i * 16, j * 16, 16, 16), ItemType <CrystallineTileItem>(), 1, 3);
 }
Exemplo n.º 13
0
 public override void NPCLoot()
 {
     Loot.DropItem(npc, ItemType <PutridFlesh>(), 1, 1, 18);
 }
Exemplo n.º 14
0
 public override void NPCLoot()
 {
     Loot.DropItem(npc, ItemID.Heart);
 }
Exemplo n.º 15
0
 public override void NPCLoot()
 {
     Loot.DropItem(npc, ItemType <Items.Phlogiston.StablePhlogiston>(), 2, 3, 100, 1.5f);
 }
Exemplo n.º 16
0
 public override void NPCLoot()
 {
     Loot.DropItem(npc, ItemType <Items.ErilipahBiome.PutridFlesh>(), 1, 1, 18);
     Loot.DropItem(npc, ItemID.Heart, 1, 1, 50);
 }