Example #1
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);
        }
 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);
 }
Example #4
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)
        {
            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);
        }
Example #7
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);
        }
Example #8
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);
        }
Example #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);
        }
Example #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);
        }
Example #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);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="player"></param>
        /// <param name="mod"></param>
        /// <param name="parryWindow"></param>
        /// <param name="parryCooldown">Determines time between parries. Success triples, effect lasts double</param>
        /// <returns></returns>
        public bool AtlFunctionParry(Player player, Mod mod, int parryWindow, int parryCooldown)
        {
            parryCooldownSave = parryCooldown;

            PlayerFX pfx = player.GetModPlayer <PlayerFX>();

            if (player.itemAnimation == 0 && pfx.parryTime == 0)
            {
                pfx.parryTimeMax = parryWindow + parryCooldown;
                pfx.parryTime    = pfx.parryTimeMax;
                pfx.parryActive  = pfx.parryTimeMax - parryWindow;

                CheezeMod.NetUpdateParry(mod, pfx);
                return(true);
            }
            return(false);
        }
Example #15
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);
        }
Example #16
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     return((CheezeMod.NoBiomeNormalSpawn(spawnInfo) && (Main.dayTime) && (Main.hardMode) && (spawnInfo.spawnTileY < Main.rockLayer)) ? 0.105f : 0f);
 }
Example #17
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     return((CheezeMod.NormalSpawn(spawnInfo)) && (spawnInfo.granite) ? 0.25f : 0f);
 }
Example #18
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     return((CheezeMod.NormalSpawn(spawnInfo) && NPC.downedBoss2 && (spawnInfo.spawnTileY > CheezeMod.HellLayer)) ? Main.hardMode ? 0.0325f : 0.0475f : 0f);
 }
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     return((CheezeMod.NoBiomeNormalSpawn(spawnInfo) && (Main.dayTime) && (spawnInfo.spawnTileY < CheezeMod.HellLayer - 400)) ? ((Main.hardMode) ? 0.05f : 0.105f) : 0f);
 }
Example #20
0
        public override float SpawnChance(NPCSpawnInfo spawnInfo)
        {
            Player player = spawnInfo.player;

            return((CheezeMod.NormalSpawn(spawnInfo) && NPC.downedBoss1 && player.ZoneJungle && !Main.dayTime) ? spawnInfo.spawnTileY > Main.worldSurface ? 0.05f : 0.105f : 0f);
        }
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     return((CheezeMod.NoBiomeNormalSpawn(spawnInfo) && (spawnInfo.spawnTileY > Main.worldSurface + 50) && (spawnInfo.spawnTileY < CheezeMod.CavernLayer)) ? 0.125f : 0f);
 }