예제 #1
0
        public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            item.UseSound = SoundID.Item11;
            if (magazineSize <= 2)
            {
                Reload(player);
                magazineSize += 2;
            }
            else
            {
                item.reuseDelay   = 3;
                item.useTime      = DefaultUseTime;
                item.useAnimation = DefaultUseTime;
            }
            if (shotPastReload)
            {
                type           = 0;
                shotPastReload = false;
                return(false);
            }
            Main.PlaySound(2, player.position, 11);
            float spread = 0f;

            if (player.altFunctionUse == 2)
            {
                spread = 20f; // 20 degrees
                speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
                speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            }
            magazineSize--;
            SetMagazineToolTip(player);
            return(true);
        }
예제 #2
0
        public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float spread = 25f; // 25 degrees
            float baseX  = speedX;
            float baseY  = speedY;

            for (int i = 0; i <= 4 + Main.rand.Next(2); i++)
            {
                speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
                speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
                if (type == ProjectileID.Bullet || type == mod.ProjectileType("BlitzCannon"))
                {
                    type    = mod.ProjectileType("BlitzCannon");
                    speedX *= 6f;
                    speedY *= 6f;
                    damage *= (int)1.1;
                }
                int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer);
                Main.projectile[projectile].netUpdate = true;
                speedX = baseX;
                speedY = baseY;
            }
            type = 0;
            return(true);
        }
예제 #3
0
        public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float spread = 12.5f; // 12.5 degrees

            speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
            speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            if (type == 1)                  // If normal wooden arrow
            {
                if (Main.rand.Next(3) <= 0) // 1/3 chance to become a hellfire arrow
                {
                    type = 41;
                }
                else // 2/3 chance to become a flaming arrow
                {
                    type = 2;
                }
            }
            else if (type == 2)             // If flaming arrow
            {
                if (Main.rand.Next(2) <= 0) // 1/2 chance to become a hellfire arrow
                {
                    type = 41;
                }
            }
            return(true);
        }
 public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 {
     speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
     speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
     type   = mod.ProjectileType("HeavyBouncer");
     return(true);
 }
 public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 {
     for (int i = 0; i < 3; i++)
     {
         float spread = 16f; // 16 degrees
         speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
         speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
         if (type == 1)                  // If normal wooden arrow
         {
             if (Main.rand.Next(3) <= 0) // 1/3 chance to become a hellfire arrow
             {
                 type = 41;
             }
             else // 2/3 chance to become a flaming arrow
             {
                 type = 2;
             }
         }
         else if (type == 2)             // If flaming arrow
         {
             if (Main.rand.Next(2) <= 0) // 1/2 chance to become a hellfire arrow
             {
                 type = 41;
             }
         }
         int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer);
         Main.projectile[projectile].netUpdate = true;
     }
     ConsumeAmmo(player);
     return(false);
 }
        public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            item.UseSound = SoundID.Item114;
            if (magazineSize <= 2)
            {
                Reload(player);
                magazineSize += 2;
            }
            else
            {
                item.reuseDelay   = 0;
                item.useTime      = DefaultUseTime;
                item.useAnimation = DefaultUseTime;
            }
            if (shotPastReload)
            {
                type           = 0;
                shotPastReload = false;
                return(false);
            }
            float spread = 17f; // 17 degrees

            speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
            speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            magazineSize--;
            SetMagazineToolTip(player);
            if (type == ProjectileID.Bullet)
            {
                type = mod.ProjectileType("PulseGun");
            }
            return(true);
        }
        public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float spread = 1f; // 1 degrees

            speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
            speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            switch (type)
            {
            case ProjectileID.Grenade:
                type = mod.ProjectileType("BombGloveGrenade");
                break;

            case ProjectileID.StickyGrenade:
                type = mod.ProjectileType("BombGloveStickyGrenade");
                break;

            case ProjectileID.BouncyGrenade:
                type = mod.ProjectileType("BombGloveBouncyGrenade");
                break;

            case ProjectileID.Beenade:
                type = mod.ProjectileType("BombGloveBeenade");
                break;

            default:
                break;
            }

            return(true);
        }
예제 #8
0
        public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float spread = 2f; // 2 degrees

            speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
            speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            if (Main.rand.Next(4) == 0)
            {
                type   = mod.ProjectileType("EarthBoulder");
                damage = (int)(damage * 0.8);
                speedX = speedX * 1.2f;
                speedY = speedY * 1.2f;
            }
            else if (Main.rand.Next(3) == 0)
            {
                type   = mod.ProjectileType("FireBlast");
                damage = (int)(damage * 1.2);
            }
            else if (Main.rand.Next(2) == 0)
            {
                type   = type = mod.ProjectileType("WaterBlast");
                damage = (int)(damage * 0.8);
            }
            else
            {
                type   = mod.ProjectileType("WindBlast");
                speedX = speedX * 1.2f;
                speedY = speedY * 1.2f;
            }
            return(true);
        }
예제 #9
0
        public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float spread = 1f; // 1 degrees

            speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
            speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            return(true);
        }
예제 #10
0
        public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float spread = 1f; // 1 degrees

            speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
            speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            type   = mod.ProjectileType("UltraHeavyBouncer");
            return(true);
        }
예제 #11
0
 public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 {
     speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
     speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
     if (type == ProjectileID.Bullet)
     {
         type    = mod.ProjectileType("Lancer");
         damage *= (int)1.4;
     }
     return(true);
 }
 public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
 {
     speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
     speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
     damage = (int)(damage * 0.95f);
     if (type == ProjectileID.Grenade)
     {
         type = ProjectileID.GrenadeIII;
     }
     return(true);
 }
        public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float spread = 8f;//8 degrees converted to radians

            speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
            speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            if (type == 1)
            {
                if (Main.rand.Next(5) <= 0) // 1/5 chance to become a Unholy Arrow
                {
                    type = 4;
                }
            }
            return(true);
        }
예제 #14
0
        public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float  spread    = 2f; // 2 degrees
            float  baseSpeed = (float)Math.Sqrt(speedX * speedX + speedY * speedY);
            double baseAngle = Math.Atan2(speedX, speedY);

            speedX = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.X);
            speedY = CheezeMod.CalculateSpread(spread, speedX, speedY, CheezeMod.Direction.Y);
            if (Main.rand.Next(4) == 0)
            {
                type   = mod.ProjectileType("HugeEarthBoulder");
                damage = (int)(damage * 0.8);
            }
            else if (Main.rand.Next(3) == 0)
            {
                type = mod.ProjectileType("InfernoFireBlast");
            }
            else if (Main.rand.Next(2) == 0)
            {
                type   = type = mod.ProjectileType("SprayWaterBlast");
                damage = (int)(damage * 0.8);
            }
            else
            {
                baseSpeed *= 1.2f;
                float    spreadWind  = 15f * 0.0174f; // 5 degrees converted to radians
                double[] Angle       = { baseAngle + -1 * spreadWind, baseAngle + 0 * spreadWind, baseAngle + 1 * spreadWind };
                float[]  speedXArray = { baseSpeed *(float)Math.Sin(Angle[0]), baseSpeed *(float)Math.Sin(Angle[1]), baseSpeed *(float)Math.Sin(Angle[2]) };
                float[]  speedYArray = { baseSpeed *(float)Math.Cos(Angle[0]), baseSpeed *(float)Math.Cos(Angle[1]), baseSpeed *(float)Math.Cos(Angle[2]) };
                for (int i = 0; i < speedXArray.Length; i++)
                {
                    int projectile = Projectile.NewProjectile(position.X, position.Y, speedXArray[i], speedYArray[i], mod.ProjectileType("WindBlast"), (int)(damage * 0.65), knockBack, Main.myPlayer);
                    Main.projectile[projectile].netUpdate = true;
                }
            }
            return(true);
        }