// need the candestorytile, canexplode and candestoryaround hooks

        /// <summary>
        /// Called when the <see cref="Tile" /> is mined, blown up, etc.
        /// </summary>
        /// <param name="x">The X position of the <see cref="Tile" />.</param>
        /// <param name="y">The Y position of the <see cref="Tile" />.</param>
        /// <param name="fail">Wether it succeeded to kill the <see cref="Tile" /> or not. If false, the <see cref="Tile" /> is still active.</param>
        /// <param name="effectsOnly">A flag used to mark that only dust should be spawned.</param>
        /// <param name="noItem">Not sure.</param>
        public override void Kill(int x, int y, bool fail, bool effectsOnly, bool noItem)
        {
            base.Kill(x, y, fail, effectsOnly, noItem);

            if (!fail && !effectsOnly)
            {
                MWorld.SmashHallowAltar(x, y);
            }
        }
Exemple #2
0
 public override void KillTile(int x, int y, ref bool fail, ref bool effectOnly, ref bool noItem)
 {
     if (!fail && !effectOnly)
     {
         for (int i = x - 16; i < x + 16; i++)
         {
             for (int j = y - 16; j < y + 16; j++)
             {
                 if (Main.tile[i, j].type == mod.TileType("PhazonCore"))
                 {
                     Main.tile[i, j].active(false);
                     for (int k = 0; k < 10; k++)
                     {
                         int dustID = Dust.NewDust(new Vector2((x * 16) - 11, (y * 16) - 11), 22, 22, 68, Main.rand.Next(10) - 5, Main.rand.Next(10) - 5, 100, Color.White, 7f);
                         Main.dust[dustID].noGravity = true;
                     }
                     int num53 = Projectile.NewProjectile(x * 16, y * 16, Main.rand.Next(10) - 5, Main.rand.Next(10) - 5, mod.ProjectileType("PhazonExplosion"), 20, 0.1f, Main.myPlayer);
                 }
                 WorldGen.SquareTileFrame(i, j, true);
             }
         }
         for (int i = 0; i < 10; i++)
         {
             int dustID = Dust.NewDust(new Vector2((x * 16) - 11, (y * 16) - 11), 22, 22, 68, Main.rand.Next(10) - 5, Main.rand.Next(10) - 5, 100, Color.White, 7f);
             Main.dust[dustID].noGravity = true;
         }
         int num54 = Projectile.NewProjectile(x * 16, y * 16, Main.rand.Next(10) - 5, Main.rand.Next(10) - 5, mod.ProjectileType("PhazonExplosion"), 20, 0.1f, Main.myPlayer);
         Main.PlaySound(2, x * 16, y * 16, 14);
         Main.NewText("Your world has been corrupt with Phazon!", 50, 125, 255, false);
         int Amount_Of_Spawns = 100 + (int)(Main.maxTilesY / 5);
         for (int p = 0; p < Amount_Of_Spawns; p++)
         {
             MWorld.AddPhazon();
         }
     }
 }