diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 24d584e853..412cbec7e0 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5403,12 +5403,7 @@ namespace CalamityMod.CalPlayer } if (umbraphileSet && proj.Calamity().rogue && (Main.rand.NextBool(4) || proj.Calamity().stealthStrike)) { - int newDamage = (int)(proj.damage * 0.25); - if (newDamage > 50) - { - newDamage = (int)((proj.damage * 0.25 - 50) * 0.1) + 50; - } - Projectile.NewProjectile(proj.Center.X, proj.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(proj.Center.X, proj.Center.Y, 0f, 0f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50), 0f, player.whoAmI, 0f, 0f); } if (bloodflareMelee && isTrueMelee) { diff --git a/CalamityMod.cs b/CalamityMod.cs index e697c98295..4e7b27a69f 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1348,7 +1348,6 @@ namespace CalamityMod ItemID.PhoenixBlaster, ItemID.DD2BetsyBow, ItemID.InfluxWaver, - ItemID.LaserMachinegun, ItemID.Xenopopper, ItemID.ElectrosphereLauncher }; diff --git a/Effects/Dyes/DefiledFlameDyeShader.xnb b/Effects/Dyes/DefiledFlameDyeShader.xnb index 73ea1c2d22..6ffdc1214b 100644 Binary files a/Effects/Dyes/DefiledFlameDyeShader.xnb and b/Effects/Dyes/DefiledFlameDyeShader.xnb differ diff --git a/Effects/Dyes/DragonSoulDyeShader.xnb b/Effects/Dyes/DragonSoulDyeShader.xnb index c08e9bdeaf..f1f7b0901c 100644 Binary files a/Effects/Dyes/DragonSoulDyeShader.xnb and b/Effects/Dyes/DragonSoulDyeShader.xnb differ diff --git a/Effects/Dyes/ElementalDyeShader.xnb b/Effects/Dyes/ElementalDyeShader.xnb new file mode 100644 index 0000000000..d1eb643a82 Binary files /dev/null and b/Effects/Dyes/ElementalDyeShader.xnb differ diff --git a/Effects/Dyes/ReaverDyeShader.xnb b/Effects/Dyes/ReaverDyeShader.xnb index 3028da4da3..a1985cce56 100644 Binary files a/Effects/Dyes/ReaverDyeShader.xnb and b/Effects/Dyes/ReaverDyeShader.xnb differ diff --git a/Effects/Dyes/ShadowspecDyeShader.xnb b/Effects/Dyes/ShadowspecDyeShader.xnb index 2abbdb9b90..6d2da86ec1 100644 Binary files a/Effects/Dyes/ShadowspecDyeShader.xnb and b/Effects/Dyes/ShadowspecDyeShader.xnb differ diff --git a/Effects/Dyes/StratusDyeShader.xnb b/Effects/Dyes/StratusDyeShader.xnb index 98f77a508a..60b17c7761 100644 Binary files a/Effects/Dyes/StratusDyeShader.xnb and b/Effects/Dyes/StratusDyeShader.xnb differ diff --git a/Items/Dyes/ElementalDye.cs b/Items/Dyes/ElementalDye.cs new file mode 100644 index 0000000000..793e4d343e --- /dev/null +++ b/Items/Dyes/ElementalDye.cs @@ -0,0 +1,38 @@ +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Dyes +{ + public class ElementalDye : BaseDye + { + public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref(mod.GetEffect("Effects/Dyes/ElementalDyeShader")), "DyePass").UseImage("Images/Misc/Perlin"); + public override void SafeSetStaticDefaults() + { + DisplayName.SetDefault("Elemental Dye"); + } + + public override void SafeSetDefaults() + { + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.Turquoise; + item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SolarDye); + recipe.AddIngredient(ItemID.VortexDye); + recipe.AddIngredient(ItemID.StardustDye); + recipe.AddIngredient(ItemID.NebulaDye); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.DyeVat); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Dyes/ElementalDye.png b/Items/Dyes/ElementalDye.png new file mode 100644 index 0000000000..2308343fb6 Binary files /dev/null and b/Items/Dyes/ElementalDye.png differ diff --git a/Items/Dyes/EndothermicDye.cs b/Items/Dyes/EndothermicDye.cs index d4b0ea8770..c145b058cb 100644 --- a/Items/Dyes/EndothermicDye.cs +++ b/Items/Dyes/EndothermicDye.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Dyes { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.DyeVat); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Dyes/ReaverDye.cs b/Items/Dyes/ReaverDye.cs index 64d462cce1..f437db45a9 100644 --- a/Items/Dyes/ReaverDye.cs +++ b/Items/Dyes/ReaverDye.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Placeables.Ores; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent.Dyes; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Dyes/ShadowspecDye.cs b/Items/Dyes/ShadowspecDye.cs index deaeab1a52..12c84124f1 100644 --- a/Items/Dyes/ShadowspecDye.cs +++ b/Items/Dyes/ShadowspecDye.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Dyes { public class ShadowspecDye : BaseDye { - public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref(mod.GetEffect("Effects/Dyes/DragonSoulDyeShader")), "DyePass"). + public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(new Ref(mod.GetEffect("Effects/Dyes/ShadowspecDyeShader")), "DyePass"). UseColor(new Color(46, 27, 60)).UseSecondaryColor(new Color(132, 142, 191)).UseImage("Images/Misc/Perlin"); public override void SafeSetStaticDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs index 95ba01c964..c5ac8b9fe2 100644 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/DraedonsArsenal/LaserRifle.cs b/Items/Weapons/DraedonsArsenal/LaserRifle.cs index f4dda677e9..38bbd2e6b6 100644 --- a/Items/Weapons/DraedonsArsenal/LaserRifle.cs +++ b/Items/Weapons/DraedonsArsenal/LaserRifle.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.useAmmo = AmmoID.Bullet; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 velocity = new Vector2(speedX, speedY); if (velocity.Length() > 5f) diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index d2c56e9d06..e3d9745c97 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return base.CanUseItem(player); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 velocity = new Vector2(speedX, speedY); if (velocity.Length() > 5f) diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index 9b25a662ec..afd41b0476 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.useAmmo = AmmoID.Bullet; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 velocity = new Vector2(speedX, speedY); if (velocity.Length() > 5f) diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 5dbe7c8bbb..91aec7d77a 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.useAmmo = AmmoID.Bullet; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 velocity = new Vector2(speedX, speedY); if (velocity.Length() > 5f) diff --git a/Items/Weapons/Magic/AquamarineStaff.cs b/Items/Weapons/Magic/AquamarineStaff.cs index 310d688085..b2a3f00265 100644 --- a/Items/Weapons/Magic/AquamarineStaff.cs +++ b/Items/Weapons/Magic/AquamarineStaff.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic return new Vector2(15, 15); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(2, 3); for (int index = 0; index < num6; ++index) diff --git a/Items/Weapons/Magic/DarkSpark.cs b/Items/Weapons/Magic/DarkSpark.cs index c1d7c22130..12d3301906 100644 --- a/Items/Weapons/Magic/DarkSpark.cs +++ b/Items/Weapons/Magic/DarkSpark.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -42,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; diff --git a/Items/Weapons/Magic/Downpour.cs b/Items/Weapons/Magic/Downpour.cs index b946a7036c..4451a7543b 100644 --- a/Items/Weapons/Magic/Downpour.cs +++ b/Items/Weapons/Magic/Downpour.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic return new Vector2(10, 10); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; diff --git a/Items/Weapons/Magic/Effervescence.cs b/Items/Weapons/Magic/Effervescence.cs index 7ccb16dea5..147a521634 100644 --- a/Items/Weapons/Magic/Effervescence.cs +++ b/Items/Weapons/Magic/Effervescence.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().customRarity = CalamityRarity.Turquoise; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int randomBullets = 0; randomBullets <= 4; randomBullets++) { diff --git a/Items/Weapons/Magic/GhastlyVisage.cs b/Items/Weapons/Magic/GhastlyVisage.cs index d380e2445d..777ab102c0 100644 --- a/Items/Weapons/Magic/GhastlyVisage.cs +++ b/Items/Weapons/Magic/GhastlyVisage.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Magic spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/GhastlyVisageGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Magic/Hematemesis.cs b/Items/Weapons/Magic/Hematemesis.cs index 85e32cc9ae..d9bebc5370 100644 --- a/Items/Weapons/Magic/Hematemesis.cs +++ b/Items/Weapons/Magic/Hematemesis.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic return new Vector2(15, 15); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; for (int x = 0; x < 10; x++) diff --git a/Items/Weapons/Magic/LightGodsBrilliance.cs b/Items/Weapons/Magic/LightGodsBrilliance.cs index b25236887d..c844846ad9 100644 --- a/Items/Weapons/Magic/LightGodsBrilliance.cs +++ b/Items/Weapons/Magic/LightGodsBrilliance.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().customRarity = CalamityRarity.Dedicated; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(2, 5); for (int index = 0; index < num6; ++index) diff --git a/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs b/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs index cdfdce12c8..e17ace5fba 100644 --- a/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs +++ b/Items/Weapons/Magic/MadAlchemistsCocktailGlove.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -55,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Magic return base.CanUseItem(player); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) { diff --git a/Items/Weapons/Magic/MagneticMeltdown.cs b/Items/Weapons/Magic/MagneticMeltdown.cs index 46fe27a1bc..77556128fd 100644 --- a/Items/Weapons/Magic/MagneticMeltdown.cs +++ b/Items/Weapons/Magic/MagneticMeltdown.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic return new Vector2(15, 15); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int index = 0; index < 4; ++index) { diff --git a/Items/Weapons/Magic/Mistlestorm.cs b/Items/Weapons/Magic/Mistlestorm.cs index ea864b3ab4..3871950373 100644 --- a/Items/Weapons/Magic/Mistlestorm.cs +++ b/Items/Weapons/Magic/Mistlestorm.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic return new Vector2(15, 15); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num106 = 2 + Main.rand.Next(3); for (int num107 = 0; num107 < num106; num107++) diff --git a/Items/Weapons/Magic/Purge.cs b/Items/Weapons/Magic/Purge.cs index fb62663478..5c9108e9ca 100644 --- a/Items/Weapons/Magic/Purge.cs +++ b/Items/Weapons/Magic/Purge.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -47,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddRecipe(); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs index 20e93320d7..fb150cfe9d 100644 --- a/Items/Weapons/Magic/RecitationoftheBeast.cs +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Magic; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; @@ -39,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().customRarity = CalamityRarity.DarkBlue; } - 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) + 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 = 60f * 0.0174f; double startAngle = Math.Atan2(speedX, speedY) - spread / 2; diff --git a/Items/Weapons/Magic/ShadecrystalTome.cs b/Items/Weapons/Magic/ShadecrystalTome.cs index 3a6e52a8ff..52e676c48b 100644 --- a/Items/Weapons/Magic/ShadecrystalTome.cs +++ b/Items/Weapons/Magic/ShadecrystalTome.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic item.shootSpeed = 16f; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(1, 3); for (int index = 0; index < num6; ++index) diff --git a/Items/Weapons/Magic/StormSpray.cs b/Items/Weapons/Magic/StormSpray.cs index 0865a9b195..1d39ed22ff 100644 --- a/Items/Weapons/Magic/StormSpray.cs +++ b/Items/Weapons/Magic/StormSpray.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Magic return new Vector2(10, 10); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; diff --git a/Items/Weapons/Magic/T1000.cs b/Items/Weapons/Magic/T1000.cs index 314379819f..b76bc6e8d1 100644 --- a/Items/Weapons/Magic/T1000.cs +++ b/Items/Weapons/Magic/T1000.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -49,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddRecipe(); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; diff --git a/Items/Weapons/Magic/TearsofHeaven.cs b/Items/Weapons/Magic/TearsofHeaven.cs index 159714b8f7..53538f21bf 100644 --- a/Items/Weapons/Magic/TearsofHeaven.cs +++ b/Items/Weapons/Magic/TearsofHeaven.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic item.shootSpeed = 5.5f; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(2, 3); for (int index = 0; index < num6; ++index) diff --git a/Items/Weapons/Magic/ThornBlossom.cs b/Items/Weapons/Magic/ThornBlossom.cs index fdace77015..84a18c02f6 100644 --- a/Items/Weapons/Magic/ThornBlossom.cs +++ b/Items/Weapons/Magic/ThornBlossom.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic return new Vector2(15, 15); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { player.statLife -= 5; if (player.statLife <= 0) diff --git a/Items/Weapons/Magic/Waywasher.cs b/Items/Weapons/Magic/Waywasher.cs index b9d608533f..6ff0f3baab 100644 --- a/Items/Weapons/Magic/Waywasher.cs +++ b/Items/Weapons/Magic/Waywasher.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Magic item.shootSpeed = 12f; } - 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) + 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 SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; diff --git a/Items/Weapons/Magic/Wingman.cs b/Items/Weapons/Magic/Wingman.cs index 42bc8cd60e..6edfcd2e38 100644 --- a/Items/Weapons/Magic/Wingman.cs +++ b/Items/Weapons/Magic/Wingman.cs @@ -1,3 +1,4 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Magic item.shoot = ProjectileID.LaserMachinegunLaser; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int beamAmt = 3; for (int index = 0; index < beamAmt; ++index) diff --git a/Items/Weapons/Melee/AstralScythe.cs b/Items/Weapons/Melee/AstralScythe.cs index 51794a157a..90852c6093 100644 --- a/Items/Weapons/Melee/AstralScythe.cs +++ b/Items/Weapons/Melee/AstralScythe.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,6 +34,12 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 5f; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.6), knockBack, player.whoAmI, 0f, 0f); + return false; + } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); diff --git a/Items/Weapons/Melee/BrinyBaron.cs b/Items/Weapons/Melee/BrinyBaron.cs index 7c09cf78f8..4cf4b19886 100644 --- a/Items/Weapons/Melee/BrinyBaron.cs +++ b/Items/Weapons/Melee/BrinyBaron.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 62; - item.damage = 80; + item.damage = 75; item.melee = true; item.useAnimation = 20; item.useTime = 20; diff --git a/Items/Weapons/Melee/CorpusAvertorMelee.cs b/Items/Weapons/Melee/CorpusAvertorMelee.cs index 768a0e7aa4..01a9f3d804 100644 --- a/Items/Weapons/Melee/CorpusAvertorMelee.cs +++ b/Items/Weapons/Melee/CorpusAvertorMelee.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -41,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee flat += lifeAmount * 0.2f * player.meleeDamage; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Melee/CosmicDischarge.cs b/Items/Weapons/Melee/CosmicDischarge.cs index 55ba0008b4..781b5bec93 100644 --- a/Items/Weapons/Melee/CosmicDischarge.cs +++ b/Items/Weapons/Melee/CosmicDischarge.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -38,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.ItemSpecific; } - 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) + 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 ai3 = (Main.rand.NextFloat() - 0.75f) * 0.7853982f; //0.5 Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, ai3); diff --git a/Items/Weapons/Melee/CrescentMoon.cs b/Items/Weapons/Melee/CrescentMoon.cs index 3b266c61d3..20211d1cd5 100644 --- a/Items/Weapons/Melee/CrescentMoon.cs +++ b/Items/Weapons/Melee/CrescentMoon.cs @@ -1,6 +1,7 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Ores; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -38,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shoot = ModContent.ProjectileType(); } - 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) + 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 ai3 = (Main.rand.NextFloat() - 0.5f) * 0.7853982f; //0.5 Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, ai3); diff --git a/Items/Weapons/Melee/DevilsSunrise.cs b/Items/Weapons/Melee/DevilsSunrise.cs index e0efd6d5f8..d47472a4fe 100644 --- a/Items/Weapons/Melee/DevilsSunrise.cs +++ b/Items/Weapons/Melee/DevilsSunrise.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -40,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 24f; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/Melee/FulgurationHalberd.cs b/Items/Weapons/Melee/FulgurationHalberd.cs index 3dcb5c06b6..016a11e406 100644 --- a/Items/Weapons/Melee/FulgurationHalberd.cs +++ b/Items/Weapons/Melee/FulgurationHalberd.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Melee.Spears; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee return base.CanUseItem(player); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Melee/KelvinCatalystMelee.cs b/Items/Weapons/Melee/KelvinCatalystMelee.cs index 98acc894be..4141e27668 100644 --- a/Items/Weapons/Melee/KelvinCatalystMelee.cs +++ b/Items/Weapons/Melee/KelvinCatalystMelee.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -40,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Dedicated; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Melee/MirrorBlade.cs b/Items/Weapons/Melee/MirrorBlade.cs index 9cba7693da..1714a27389 100644 --- a/Items/Weapons/Melee/MirrorBlade.cs +++ b/Items/Weapons/Melee/MirrorBlade.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.PureGreen; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Melee/Mourningstar.cs b/Items/Weapons/Melee/Mourningstar.cs index 5b68f062c5..b225ad82c4 100644 --- a/Items/Weapons/Melee/Mourningstar.cs +++ b/Items/Weapons/Melee/Mourningstar.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -49,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddRecipe(); } - 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) + 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 ai3 = (Main.rand.NextFloat() - 0.75f) * 0.7853982f; //0.5 float ai3X = (Main.rand.NextFloat() - 0.25f) * 0.7853982f; //0.5 diff --git a/Items/Weapons/Melee/Nebulash.cs b/Items/Weapons/Melee/Nebulash.cs index 59e78b632a..8bd1bc30e5 100644 --- a/Items/Weapons/Melee/Nebulash.cs +++ b/Items/Weapons/Melee/Nebulash.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 16; item.height = 16; - item.damage = 54; + item.damage = 60; item.rare = 7; item.noMelee = true; item.noUseGraphic = true; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shoot = ModContent.ProjectileType(); } - 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) + 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 ai3 = (Main.rand.NextFloat() - 0.5f) * 0.7853982f; //0.5 Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, ai3); diff --git a/Items/Weapons/Melee/RedtideSword.cs b/Items/Weapons/Melee/RedtideSword.cs index fbc46fa451..98b7af3eb5 100644 --- a/Items/Weapons/Melee/RedtideSword.cs +++ b/Items/Weapons/Melee/RedtideSword.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 6f; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage / 2, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index 9abe8467c3..c502b927d9 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System; @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 20; item.value = Item.buyPrice(5, 0, 0, 0); item.rare = 10; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 9f; item.Calamity().customRarity = CalamityRarity.Developer; } @@ -93,7 +93,8 @@ namespace CalamityMod.Items.Weapons.Melee num149 *= num80; float x4 = vector2.X; float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[knife].Calamity().forceMelee = true; } return false; } diff --git a/Items/Weapons/Melee/SoulEdge.cs b/Items/Weapons/Melee/SoulEdge.cs index 313f6f4a40..8705a97247 100644 --- a/Items/Weapons/Melee/SoulEdge.cs +++ b/Items/Weapons/Melee/SoulEdge.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.PureGreen; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(2, 4); for (int index = 0; index < num6; ++index) diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index 4851938639..8f81f86c68 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Spears; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -72,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Melee return base.CanUseItem(player); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/Ranged/Arbalest.cs b/Items/Weapons/Ranged/Arbalest.cs index dbb5d98e0b..67cb7532f5 100644 --- a/Items/Weapons/Ranged/Arbalest.cs +++ b/Items/Weapons/Ranged/Arbalest.cs @@ -1,3 +1,4 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.Calamity().customRarity = CalamityRarity.RareVariant; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int i = 0; i < 3; i++) { diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index 3b9a7de80b..8d74533b68 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged this.SetTag("bow"); }*/ - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index a88256fb59..63539ad4f4 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 40; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index e3b38044c0..efe3e790f5 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged return base.CanUseItem(player); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) { diff --git a/Items/Weapons/Ranged/ChickenCannon.cs b/Items/Weapons/Ranged/ChickenCannon.cs index eaf9543241..3f238644d6 100644 --- a/Items/Weapons/Ranged/ChickenCannon.cs +++ b/Items/Weapons/Ranged/ChickenCannon.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged return new Vector2(-10, 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index 37fad3b6a0..a807100e39 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -49,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddRecipe(); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; diff --git a/Items/Weapons/Ranged/CorrodedCaustibow.cs b/Items/Weapons/Ranged/CorrodedCaustibow.cs index 4a3fd3eec9..748e92202f 100644 --- a/Items/Weapons/Ranged/CorrodedCaustibow.cs +++ b/Items/Weapons/Ranged/CorrodedCaustibow.cs @@ -1,5 +1,6 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 40; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/CursedCapper.cs b/Items/Weapons/Ranged/CursedCapper.cs index a5527fb801..d8e224cffa 100644 --- a/Items/Weapons/Ranged/CursedCapper.cs +++ b/Items/Weapons/Ranged/CursedCapper.cs @@ -1,3 +1,4 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 97; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.CursedBullet, damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 66688140de..fda0b30f0f 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Ranged return base.CanUseItem(player); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) { diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 633c0a71c1..8986adf70c 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -38,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index d2d838fdf8..5653451a36 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged return new Vector2(-5, 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int index = 0; index < 3; ++index) { diff --git a/Items/Weapons/Ranged/Helstorm.cs b/Items/Weapons/Ranged/Helstorm.cs index 141b5ea9f3..5dc282e178 100644 --- a/Items/Weapons/Ranged/Helstorm.cs +++ b/Items/Weapons/Ranged/Helstorm.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged return new Vector2(-5, 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int index = 0; index < 2; ++index) { diff --git a/Items/Weapons/Ranged/MineralMortar.cs b/Items/Weapons/Ranged/MineralMortar.cs index 301b2db2d3..be4953ee6a 100644 --- a/Items/Weapons/Ranged/MineralMortar.cs +++ b/Items/Weapons/Ranged/MineralMortar.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged return new Vector2(-10, 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index a6be6ea391..672f5635f7 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 97; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/ProporsePistol.cs b/Items/Weapons/Ranged/ProporsePistol.cs index 7521cfc973..02947b9352 100644 --- a/Items/Weapons/Ranged/ProporsePistol.cs +++ b/Items/Weapons/Ranged/ProporsePistol.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 97; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Ranged/RaidersGlory.cs b/Items/Weapons/Ranged/RaidersGlory.cs index 38fb9c5a4c..0e0b3a749a 100644 --- a/Items/Weapons/Ranged/RaidersGlory.cs +++ b/Items/Weapons/Ranged/RaidersGlory.cs @@ -1,3 +1,4 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 40; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.IchorArrow, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[projectile].extraUpdates++; diff --git a/Items/Weapons/Ranged/Scorpion.cs b/Items/Weapons/Ranged/Scorpion.cs index ac327b6e9d..af08c157ad 100644 --- a/Items/Weapons/Ranged/Scorpion.cs +++ b/Items/Weapons/Ranged/Scorpion.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged return base.CanUseItem(player); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) { diff --git a/Items/Weapons/Ranged/Seabow.cs b/Items/Weapons/Ranged/Seabow.cs index d1c96c3770..83d15e5146 100644 --- a/Items/Weapons/Ranged/Seabow.cs +++ b/Items/Weapons/Ranged/Seabow.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 40; } - 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) + 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 SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; diff --git a/Items/Weapons/Ranged/Shellshooter.cs b/Items/Weapons/Ranged/Shellshooter.cs index 0dd9232071..7858e7c7f2 100644 --- a/Items/Weapons/Ranged/Shellshooter.cs +++ b/Items/Weapons/Ranged/Shellshooter.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 40; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; diff --git a/Items/Weapons/Ranged/SpectralstormCannon.cs b/Items/Weapons/Ranged/SpectralstormCannon.cs index 90727d9e56..60b6c0023b 100644 --- a/Items/Weapons/Ranged/SpectralstormCannon.cs +++ b/Items/Weapons/Ranged/SpectralstormCannon.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Ranged 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int num6 = Main.rand.Next(1, 2); for (int index = 0; index < num6; ++index) diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index 2b5627bb41..755992626d 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -41,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue flat += lifeAmount * 0.2f * player.Calamity().throwingDamage; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); return false; diff --git a/Items/Weapons/Rogue/CraniumSmasher.cs b/Items/Weapons/Rogue/CraniumSmasher.cs index a44cde894d..9b22d9522f 100644 --- a/Items/Weapons/Rogue/CraniumSmasher.cs +++ b/Items/Weapons/Rogue/CraniumSmasher.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (Main.rand.Next(0, 5) == 0) { diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index a5b5051e3c..981ad55e52 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -37,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.Calamity().StealthStrikeAvailable()) { diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index 9755c7b594..1f7e04b2a3 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { counter++; if (counter >= 7) diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index 4077194c6d..f8dad5bc9b 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -40,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.Dedicated; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); return false; diff --git a/Items/Weapons/Rogue/LunarKunai.cs b/Items/Weapons/Rogue/LunarKunai.cs index a3b0f827c8..9419c1db49 100644 --- a/Items/Weapons/Rogue/LunarKunai.cs +++ b/Items/Weapons/Rogue/LunarKunai.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + 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 num72 = item.shootSpeed; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index d7a1285cf9..5f8a435485 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -59,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Rogue return base.CanUseItem(player); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.altFunctionUse == 2) { diff --git a/Items/Weapons/Rogue/Mycoroot.cs b/Items/Weapons/Rogue/Mycoroot.cs index 146f84dafd..3a8af59781 100644 --- a/Items/Weapons/Rogue/Mycoroot.cs +++ b/Items/Weapons/Rogue/Mycoroot.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + 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 SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; diff --git a/Items/Weapons/Rogue/ProfanedTrident.cs b/Items/Weapons/Rogue/ProfanedTrident.cs index e70882ac58..13ca758e8b 100644 --- a/Items/Weapons/Rogue/ProfanedTrident.cs +++ b/Items/Weapons/Rogue/ProfanedTrident.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.DarkBlue; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/Rogue/Quasar.cs b/Items/Weapons/Rogue/Quasar.cs index cf4e42f337..99ef2e8cd1 100644 --- a/Items/Weapons/Rogue/Quasar.cs +++ b/Items/Weapons/Rogue/Quasar.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.RareVariant; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 1f, 0f); return false; diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Rogue/RoyalKnives.cs index 491cb3d31e..2814bc4c33 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Rogue/RoyalKnives.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System; @@ -93,7 +93,7 @@ namespace CalamityMod.Items.Weapons.Rogue num149 *= num80; float x4 = vector2.X; float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs index 07806dd396..9be81be0ae 100644 --- a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs +++ b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.Violet; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); return false; diff --git a/Items/Weapons/Rogue/SylvanSlasher.cs b/Items/Weapons/Rogue/SylvanSlasher.cs index 9a8288fc70..f05db9a4c8 100644 --- a/Items/Weapons/Rogue/SylvanSlasher.cs +++ b/Items/Weapons/Rogue/SylvanSlasher.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue @@ -34,7 +35,7 @@ Does not consume stealth and cannot stealth strike"); item.Calamity().customRarity = CalamityRarity.Turquoise; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Rogue/TimeBolt.cs b/Items/Weapons/Rogue/TimeBolt.cs index 31d938e9c3..616e0932df 100644 --- a/Items/Weapons/Rogue/TimeBolt.cs +++ b/Items/Weapons/Rogue/TimeBolt.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/Summon/AbandonedSlimeStaff.cs b/Items/Weapons/Summon/AbandonedSlimeStaff.cs index 74f8643fc1..3032e41aec 100644 --- a/Items/Weapons/Summon/AbandonedSlimeStaff.cs +++ b/Items/Weapons/Summon/AbandonedSlimeStaff.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Summon return slimeSlots >= 1; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int x = 0; x < Main.projectile.Length; x++) { diff --git a/Items/Weapons/Summon/BensUmbrella.cs b/Items/Weapons/Summon/BensUmbrella.cs index d448b643a0..0132e1a567 100644 --- a/Items/Weapons/Summon/BensUmbrella.cs +++ b/Items/Weapons/Summon/BensUmbrella.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0 && player.maxMinions >= 5; - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; speedX = 0; diff --git a/Items/Weapons/Summon/DreadmineStaff.cs b/Items/Weapons/Summon/DreadmineStaff.cs index 7a90d5cd13..2b873ac060 100644 --- a/Items/Weapons/Summon/DreadmineStaff.cs +++ b/Items/Weapons/Summon/DreadmineStaff.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon item.sentry = 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; speedX = 0; diff --git a/Items/Weapons/Summon/EnergyStaff.cs b/Items/Weapons/Summon/EnergyStaff.cs index f32e7a1133..a4a858dfa5 100644 --- a/Items/Weapons/Summon/EnergyStaff.cs +++ b/Items/Weapons/Summon/EnergyStaff.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon item.Calamity().customRarity = CalamityRarity.Turquoise; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; speedX = 0; diff --git a/Items/Weapons/Summon/GodspawnHelixStaff.cs b/Items/Weapons/Summon/GodspawnHelixStaff.cs index dab100d2ad..d1fd6b2773 100644 --- a/Items/Weapons/Summon/GodspawnHelixStaff.cs +++ b/Items/Weapons/Summon/GodspawnHelixStaff.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon item.summon = 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; speedX = 0; diff --git a/Items/Weapons/Summon/InfectedRemote.cs b/Items/Weapons/Summon/InfectedRemote.cs index 3520ec36a4..6b379cbbb8 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Summon return viruliSlots >= 1 && player.ownedProjectileCounts[item.shoot] <= 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int x = 0; x < Main.projectile.Length; x++) { diff --git a/Items/Weapons/Summon/LanternoftheSoul.cs b/Items/Weapons/Summon/LanternoftheSoul.cs index 6932952940..95673a3af0 100644 --- a/Items/Weapons/Summon/LanternoftheSoul.cs +++ b/Items/Weapons/Summon/LanternoftheSoul.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon item.UseSound = SoundID.Item44; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; speedX = 0; diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index d20160ce12..37e60e7d4b 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Summon return siriusSlots >= 1; } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int x = 0; x < Main.projectile.Length; x++) { diff --git a/Items/Weapons/Summon/SunGodStaff.cs b/Items/Weapons/Summon/SunGodStaff.cs index 3d402eeb60..04f4be5b65 100644 --- a/Items/Weapons/Summon/SunGodStaff.cs +++ b/Items/Weapons/Summon/SunGodStaff.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -44,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Summon recipe.AddRecipe(); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; speedX = 0; diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index 392e0d7c34..a89447ebeb 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -41,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Summon recipe.AddRecipe(); } - 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) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { position = Main.MouseWorld; speedX = 0; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index c8ed906725..a4669d960c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -20,6 +20,7 @@ using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Typeless; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; @@ -71,7 +72,7 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.Config; -using CalamityMod.Items.Weapons.Typeless; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.NPCs { @@ -279,27 +280,27 @@ namespace CalamityMod.NPCs /// public static List AstrumDeusIDs = new List { - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType() + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() }; public static List AquaticScourgeIDs = new List { - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType() + NPCType(), + NPCType(), + NPCType(), + NPCType() }; public static List DesertScourgeIDs = new List { - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType() + NPCType(), + NPCType(), + NPCType() }; public static List EaterofWorldsIDs = new List @@ -318,9 +319,9 @@ namespace CalamityMod.NPCs public static List StormWeaverIDs = new List { - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType() + NPCType(), + NPCType(), + NPCType() }; #endregion @@ -353,42 +354,42 @@ namespace CalamityMod.NPCs } for (int i = 0; i < bobbitWormBottom.Length; i++) - ResetSavedIndex(ref bobbitWormBottom[i], ModContent.NPCType()); + ResetSavedIndex(ref bobbitWormBottom[i], NPCType()); - ResetSavedIndex(ref hiveMind, ModContent.NPCType(), ModContent.NPCType()); - ResetSavedIndex(ref perfHive, ModContent.NPCType()); - ResetSavedIndex(ref slimeGodPurple, ModContent.NPCType(), ModContent.NPCType()); - ResetSavedIndex(ref slimeGodRed, ModContent.NPCType(), ModContent.NPCType()); - ResetSavedIndex(ref slimeGod, ModContent.NPCType()); + ResetSavedIndex(ref hiveMind, NPCType(), NPCType()); + ResetSavedIndex(ref perfHive, NPCType()); + ResetSavedIndex(ref slimeGodPurple, NPCType(), NPCType()); + ResetSavedIndex(ref slimeGodRed, NPCType(), NPCType()); + ResetSavedIndex(ref slimeGod, NPCType()); ResetSavedIndex(ref laserEye, NPCID.Retinazer); ResetSavedIndex(ref fireEye, NPCID.Spazmatism); ResetSavedIndex(ref primeLaser, NPCID.PrimeLaser); ResetSavedIndex(ref primeCannon, NPCID.PrimeCannon); ResetSavedIndex(ref primeVice, NPCID.PrimeVice); ResetSavedIndex(ref primeSaw, NPCID.PrimeSaw); - ResetSavedIndex(ref brimstoneElemental, ModContent.NPCType()); - ResetSavedIndex(ref cataclysm, ModContent.NPCType()); - ResetSavedIndex(ref catastrophe, ModContent.NPCType()); - ResetSavedIndex(ref calamitas, ModContent.NPCType()); - ResetSavedIndex(ref leviathan, ModContent.NPCType()); - ResetSavedIndex(ref siren, ModContent.NPCType()); - ResetSavedIndex(ref scavenger, ModContent.NPCType()); - ResetSavedIndex(ref astrumDeusHeadMain, ModContent.NPCType()); - ResetSavedIndex(ref energyFlame, ModContent.NPCType()); - ResetSavedIndex(ref doughnutBoss, ModContent.NPCType()); - ResetSavedIndex(ref holyBossAttacker, ModContent.NPCType()); - ResetSavedIndex(ref holyBossDefender, ModContent.NPCType()); - ResetSavedIndex(ref holyBossHealer, ModContent.NPCType()); - ResetSavedIndex(ref holyBoss, ModContent.NPCType()); - ResetSavedIndex(ref voidBoss, ModContent.NPCType()); - ResetSavedIndex(ref signus, ModContent.NPCType()); - ResetSavedIndex(ref ghostBossClone, ModContent.NPCType()); - ResetSavedIndex(ref ghostBoss, ModContent.NPCType()); - ResetSavedIndex(ref DoGHead, ModContent.NPCType(), ModContent.NPCType()); - ResetSavedIndex(ref SCalCataclysm, ModContent.NPCType()); - ResetSavedIndex(ref SCalCatastrophe, ModContent.NPCType()); - ResetSavedIndex(ref SCal, ModContent.NPCType()); - ResetSavedIndex(ref SCalWorm, ModContent.NPCType()); + ResetSavedIndex(ref brimstoneElemental, NPCType()); + ResetSavedIndex(ref cataclysm, NPCType()); + ResetSavedIndex(ref catastrophe, NPCType()); + ResetSavedIndex(ref calamitas, NPCType()); + ResetSavedIndex(ref leviathan, NPCType()); + ResetSavedIndex(ref siren, NPCType()); + ResetSavedIndex(ref scavenger, NPCType()); + ResetSavedIndex(ref astrumDeusHeadMain, NPCType()); + ResetSavedIndex(ref energyFlame, NPCType()); + ResetSavedIndex(ref doughnutBoss, NPCType()); + ResetSavedIndex(ref holyBossAttacker, NPCType()); + ResetSavedIndex(ref holyBossDefender, NPCType()); + ResetSavedIndex(ref holyBossHealer, NPCType()); + ResetSavedIndex(ref holyBoss, NPCType()); + ResetSavedIndex(ref voidBoss, NPCType()); + ResetSavedIndex(ref signus, NPCType()); + ResetSavedIndex(ref ghostBossClone, NPCType()); + ResetSavedIndex(ref ghostBoss, NPCType()); + ResetSavedIndex(ref DoGHead, NPCType(), NPCType()); + ResetSavedIndex(ref SCalCataclysm, NPCType()); + ResetSavedIndex(ref SCalCatastrophe, NPCType()); + ResetSavedIndex(ref SCal, NPCType()); + ResetSavedIndex(ref SCalWorm, NPCType()); } #endregion @@ -415,16 +416,16 @@ namespace CalamityMod.NPCs } bool inAbyss = ((npc.position.Y / 16f > (Main.rockLayer - Main.maxTilesY * 0.05)) && ((double)(npc.position.Y / 16f) <= Main.maxTilesY - 250) && abyssPosX) || CalamityWorld.abyssTiles > 200; - bool hurtByAbyss = npc.wet && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && inAbyss && !npc.buffImmune[ModContent.BuffType()]; + bool hurtByAbyss = npc.wet && npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && inAbyss && !npc.buffImmune[BuffType()]; if (hurtByAbyss) { - npc.AddBuff(ModContent.BuffType(), 2); + npc.AddBuff(BuffType(), 2); npc.DeathSound = null; npc.HitSound = null; } if (npc.damage > 0 && !npc.boss && !npc.friendly && !npc.dontTakeDamage && CalamityWorld.sulphurTiles > 30 && - !npc.buffImmune[BuffID.Poisoned] && !npc.buffImmune[ModContent.BuffType()]) + !npc.buffImmune[BuffID.Poisoned] && !npc.buffImmune[BuffType()]) { if (npc.wet) { @@ -433,7 +434,7 @@ namespace CalamityMod.NPCs if (Main.raining) { - npc.AddBuff(ModContent.BuffType(), 2); + npc.AddBuff(BuffType(), 2); } } @@ -448,7 +449,7 @@ namespace CalamityMod.NPCs for (int j = 0; j < Main.maxProjectiles; j++) { if (Main.projectile[j].active && - (Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType() || Main.projectile[j].type == ModContent.ProjectileType()) && + (Main.projectile[j].type == ProjectileType() || Main.projectile[j].type == ProjectileType() || Main.projectile[j].type == ProjectileType() || Main.projectile[j].type == ProjectileType()) && Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI) { projectileCount++; @@ -477,7 +478,7 @@ namespace CalamityMod.NPCs for (int j = 0; j < Main.maxProjectiles; j++) { if (Main.projectile[j].active && - (Main.projectile[j].type == ModContent.ProjectileType() && + (Main.projectile[j].type == ProjectileType() && Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI)) { projectileCount++; @@ -506,7 +507,7 @@ namespace CalamityMod.NPCs for (int j = 0; j < Main.maxProjectiles; j++) { if (Main.projectile[j].active && - (Main.projectile[j].type == ModContent.ProjectileType()) && + (Main.projectile[j].type == ProjectileType()) && Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI && projectileCount < 5) { @@ -534,9 +535,9 @@ namespace CalamityMod.NPCs { if (Main.projectile[j].active && Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI) { - if (Main.projectile[j].type == ModContent.ProjectileType()) + if (Main.projectile[j].type == ProjectileType()) projectileCount += 2; - if (Main.projectile[j].type == ModContent.ProjectileType()) + if (Main.projectile[j].type == ProjectileType()) projectileCount++; } } @@ -674,10 +675,10 @@ namespace CalamityMod.NPCs if (npc.boss && CalamityWorld.revenge) { - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { if (Main.netMode != NetmodeID.Server) { @@ -727,12 +728,12 @@ namespace CalamityMod.NPCs { if (CalamityMod.enemyImmunityList.Contains(npc.type) || npc.boss) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.buffImmune[BuffID.Webbed] = true; npc.buffImmune[BuffID.Slow] = true; } @@ -755,10 +756,10 @@ namespace CalamityMod.NPCs if (npc.buffImmune[BuffID.Venom] == false) { - npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[BuffType()] = false; } - npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[BuffType()] = false; } #endregion @@ -767,17 +768,17 @@ namespace CalamityMod.NPCs { if (!npc.friendly) { - npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[BuffType()] = false; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.buffImmune[BuffID.Webbed] = true; npc.buffImmune[BuffID.Slow] = true; } @@ -1260,80 +1261,80 @@ namespace CalamityMod.NPCs } else if (npc.type == thorium.NPCType("TheGrandThunderBirdv2")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.5); } else if (npc.type == thorium.NPCType("QueenJelly")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.35); } else if (npc.type == thorium.NPCType("Viscount")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.25); } else if (npc.type == thorium.NPCType("GraniteEnergyStorm")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.1); } else if (npc.type == thorium.NPCType("TheBuriedWarrior") || npc.type == thorium.NPCType("TheBuriedWarrior1") || npc.type == thorium.NPCType("TheBuriedWarrior2")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.2); } else if (npc.type == thorium.NPCType("ThePrimeScouter") || npc.type == thorium.NPCType("CryoCore") || npc.type == thorium.NPCType("BioCore") || npc.type == thorium.NPCType("PyroCore")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.3); } else if (npc.type == thorium.NPCType("BoreanStrider") || npc.type == thorium.NPCType("BoreanStriderPopped")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.4); } else if (npc.type == thorium.NPCType("FallenDeathBeholder") || npc.type == thorium.NPCType("FallenDeathBeholder2")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.6); } else if (npc.type == thorium.NPCType("Lich") || npc.type == thorium.NPCType("LichHeadless")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.6); } else if (npc.type == thorium.NPCType("Abyssion") || npc.type == thorium.NPCType("AbyssionCracked") || npc.type == thorium.NPCType("AbyssionReleased")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.5); } else if (npc.type == thorium.NPCType("SlagFury") || npc.type == thorium.NPCType("Omnicide") || npc.type == thorium.NPCType("RealityBreaker") || npc.type == thorium.NPCType("Aquaius") || npc.type == thorium.NPCType("Aquaius2")) { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffType()] = true; + npc.buffImmune[BuffType()] = true; npc.lifeMax = (int)(npc.lifeMax * 1.3); } @@ -1597,7 +1598,7 @@ namespace CalamityMod.NPCs { SetPatreonTownNPCName(npc); - if (npc.type == NPCID.TargetDummy || npc.type == ModContent.NPCType()) + if (npc.type == NPCID.TargetDummy || npc.type == NPCType()) { npc.chaseable = !CalamityPlayer.areThereAnyDamnBosses; npc.dontTakeDamage = CalamityPlayer.areThereAnyDamnBosses; @@ -1605,7 +1606,7 @@ namespace CalamityMod.NPCs if (DestroyerIDs.Contains(npc.type) || EaterofWorldsIDs.Contains(npc.type)) { - npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[BuffType()] = false; } if (npc.type == NPCID.Bee || npc.type == NPCID.BeeSmall || npc.type == NPCID.Hornet || npc.type == NPCID.HornetFatty || npc.type == NPCID.HornetHoney || @@ -1755,11 +1756,11 @@ namespace CalamityMod.NPCs switch (npc.aiStyle) { case 1: - if (npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType()) + if (npc.type == NPCType() || npc.type == NPCType() || + npc.type == NPCType() || npc.type == NPCType() || + npc.type == NPCType() || npc.type == NPCType() || + npc.type == NPCType() || npc.type == NPCType() || + npc.type == NPCType()) { return CalamityGlobalAI.BuffedSlimeAI(npc, mod); } @@ -1793,7 +1794,7 @@ namespace CalamityMod.NPCs } break; case 2: - if (npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType()) + if (npc.type == NPCType() || npc.type == NPCType()) { return CalamityGlobalAI.BuffedDemonEyeAI(npc, mod); } @@ -1819,8 +1820,8 @@ namespace CalamityMod.NPCs } break; case 3: - if (npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType()) + if (npc.type == NPCType() || npc.type == NPCType() || + npc.type == NPCType()) { return CalamityGlobalAI.BuffedFighterAI(npc, mod); } @@ -2096,7 +2097,7 @@ namespace CalamityMod.NPCs } break; case 14: - if (npc.type == ModContent.NPCType()) + if (npc.type == NPCType()) { return CalamityGlobalAI.BuffedBatAI(npc, mod); } @@ -2298,7 +2299,7 @@ namespace CalamityMod.NPCs } break; case 91: - if (npc.type == ModContent.NPCType()) + if (npc.type == NPCType()) { return CalamityGlobalAI.BuffedGraniteElementalAI(npc, mod); } @@ -2557,7 +2558,7 @@ namespace CalamityMod.NPCs break; case 2: - if (npc.type != NPCID.KingSlime && npc.type != NPCID.BlueSlime && npc.type != NPCID.SlimeSpiked && npc.type != ModContent.NPCType() && + if (npc.type != NPCID.KingSlime && npc.type != NPCID.BlueSlime && npc.type != NPCID.SlimeSpiked && npc.type != NPCType() && npc.type != NPCID.YellowSlime && npc.type != NPCID.PurpleSlime && npc.type != NPCID.GreenSlime && npc.type != NPCID.RedSlime && npc.type != NPCID.IceSlime && npc.type != NPCID.UmbrellaSlime && npc.type != NPCID.RainbowSlime && npc.type != NPCID.Pinky) { @@ -2597,8 +2598,8 @@ namespace CalamityMod.NPCs break; case 6: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2616,7 +2617,7 @@ namespace CalamityMod.NPCs break; case 8: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2643,7 +2644,7 @@ namespace CalamityMod.NPCs break; case 11: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && + if (npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCID.Spazmatism && npc.type != NPCID.Retinazer) { npc.active = false; @@ -2664,9 +2665,9 @@ namespace CalamityMod.NPCs break; case 13: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2684,10 +2685,10 @@ namespace CalamityMod.NPCs break; case 15: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2696,11 +2697,11 @@ namespace CalamityMod.NPCs break; case 16: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2709,11 +2710,11 @@ namespace CalamityMod.NPCs break; case 17: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2734,7 +2735,7 @@ namespace CalamityMod.NPCs break; case 19: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2753,8 +2754,8 @@ namespace CalamityMod.NPCs break; case 21: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2763,11 +2764,11 @@ namespace CalamityMod.NPCs break; case 22: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2776,9 +2777,9 @@ namespace CalamityMod.NPCs break; case 23: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2787,7 +2788,7 @@ namespace CalamityMod.NPCs break; case 24: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2796,8 +2797,8 @@ namespace CalamityMod.NPCs break; case 25: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2806,11 +2807,11 @@ namespace CalamityMod.NPCs break; case 26: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2839,8 +2840,8 @@ namespace CalamityMod.NPCs break; case 29: - if (!AstrumDeusIDs.Contains(npc.type) && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (!AstrumDeusIDs.Contains(npc.type) && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2849,8 +2850,8 @@ namespace CalamityMod.NPCs break; case 30: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2859,9 +2860,9 @@ namespace CalamityMod.NPCs break; case 31: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2870,9 +2871,9 @@ namespace CalamityMod.NPCs break; case 32: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2881,9 +2882,9 @@ namespace CalamityMod.NPCs break; case 33: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2892,11 +2893,11 @@ namespace CalamityMod.NPCs break; case 34: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2905,8 +2906,8 @@ namespace CalamityMod.NPCs break; case 35: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2915,11 +2916,11 @@ namespace CalamityMod.NPCs break; case 36: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2928,8 +2929,8 @@ namespace CalamityMod.NPCs break; case 37: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2938,8 +2939,8 @@ namespace CalamityMod.NPCs break; case 38: - if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + if (npc.type != NPCType() && npc.type != NPCType() && + npc.type != NPCType()) { npc.active = false; npc.netUpdate = true; @@ -2956,10 +2957,10 @@ namespace CalamityMod.NPCs if (!CalamityWorld.spawnedHardBoss) { if (npc.type == NPCID.TheDestroyer || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCID.SkeletronPrime || - npc.type == NPCID.Plantera || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || - npc.type == ModContent.NPCType() || npc.type == NPCID.DukeFishron || npc.type == NPCID.CultistBoss || npc.type == NPCID.Golem) + npc.type == NPCID.Plantera || npc.type == NPCType() || npc.type == NPCType() || + npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType() || + npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType() || + npc.type == NPCType() || npc.type == NPCID.DukeFishron || npc.type == NPCID.CultistBoss || npc.type == NPCID.Golem) { CalamityWorld.spawnedHardBoss = true; CalamityMod.UpdateServerBoolean(); @@ -3091,21 +3092,21 @@ namespace CalamityMod.NPCs { if (npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon || npc.type == NPCID.RedDevil) { - target.AddBuff(ModContent.BuffType(), 36000); + target.AddBuff(BuffType(), 36000); } } switch (npc.type) { case NPCID.Golem: - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffType(), 300); break; case NPCID.GolemHead: case NPCID.GolemHeadFree: case NPCID.GolemFistRight: case NPCID.GolemFistLeft: - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); break; case NPCID.Lavabat: @@ -3126,7 +3127,7 @@ namespace CalamityMod.NPCs case NPCID.AngryBonesBig: case NPCID.AngryBonesBigMuscle: case NPCID.AngryBonesBigHelmet: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; default: @@ -3149,7 +3150,7 @@ namespace CalamityMod.NPCs case NPCID.HellArmoredBonesSpikeShield: case NPCID.HellArmoredBonesMace: case NPCID.HellArmoredBonesSword: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; default: @@ -3184,15 +3185,15 @@ namespace CalamityMod.NPCs npc.type == thorium.NPCType("Omnicide") || npc.type == thorium.NPCType("RealityBreaker") || npc.type == thorium.NPCType("Aquaius") || npc.type == thorium.NPCType("Aquaius2")) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); } else if (npc.type == thorium.NPCType("ViscountBaby") || npc.type == thorium.NPCType("EnemyBeholder") || npc.type == thorium.NPCType("AbyssalSpawn") || npc.type == thorium.NPCType("Viscount") || npc.type == thorium.NPCType("FallenDeathBeholder") || npc.type == thorium.NPCType("FallenDeathBeholder2") || npc.type == thorium.NPCType("Lich") || npc.type == thorium.NPCType("LichHeadless") || npc.type == thorium.NPCType("Abyssion") || npc.type == thorium.NPCType("AbyssionCracked") || npc.type == thorium.NPCType("AbyssionReleased")) { - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); + target.AddBuff(BuffType(), 180); } } } @@ -3209,7 +3210,7 @@ namespace CalamityMod.NPCs case NPCID.FaceMonster: case NPCID.BloodCrawler: case NPCID.BloodCrawlerWall: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; case NPCID.DevourerHead: @@ -3239,7 +3240,7 @@ namespace CalamityMod.NPCs case NPCID.CrimsonGoldfish: case NPCID.CrimsonPenguin: case NPCID.Drippler: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case NPCID.EyeofCthulhu: @@ -3267,26 +3268,26 @@ namespace CalamityMod.NPCs case NPCID.Medusa: case NPCID.SandsharkCorrupt: case NPCID.SandsharkCrimson: - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); break; case NPCID.MourningWood: case NPCID.Pumpking: - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(BuffType(), 240); break; case NPCID.WallofFlesh: case NPCID.Krampus: - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffType(), 300); break; case NPCID.DungeonGuardian: - target.AddBuff(ModContent.BuffType(), 1200); + target.AddBuff(BuffType(), 1200); break; case NPCID.Creeper: - target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 60); + target.AddBuff(BuffType(), 120); break; case NPCID.CursedSkull: @@ -3295,48 +3296,48 @@ namespace CalamityMod.NPCs case NPCID.TheHungryII: case NPCID.PumpkingBlade: case NPCID.BloodZombie: - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case NPCID.DarkMummy: - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 180); + target.AddBuff(BuffType(), 120); break; case NPCID.EaterofWorldsHead: case NPCID.GiantCursedSkull: case NPCID.Butcher: case NPCID.Psycho: - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); + target.AddBuff(BuffType(), 180); break; case NPCID.Wraith: case NPCID.VampireBat: case NPCID.Vampire: case NPCID.Reaper: - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 240); + target.AddBuff(BuffType(), 180); break; case NPCID.AncientCultistSquidhead: - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(BuffType(), 240); + target.AddBuff(BuffType(), 240); break; case NPCID.DungeonSpirit: - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 300); + target.AddBuff(BuffType(), 180); break; case NPCID.AncientDoom: - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffType(), 300); + target.AddBuff(BuffType(), 300); break; case NPCID.Snatcher: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; case NPCID.BurningSphere: @@ -3344,7 +3345,7 @@ namespace CalamityMod.NPCs case NPCID.Mummy: case NPCID.EnchantedSword: case NPCID.Werewolf: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case NPCID.Spazmatism: @@ -3358,22 +3359,22 @@ namespace CalamityMod.NPCs case NPCID.Sharkron2: case NPCID.ShadowFlameApparition: case NPCID.MartianDrone: - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); break; case NPCID.Mimic: case NPCID.AngryTrapper: - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(BuffType(), 240); break; case NPCID.DetonatingBubble: - target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(BuffType(), 360); break; case NPCID.PrimeSaw: case NPCID.PrimeVice: target.AddBuff(BuffID.Bleeding, 300); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); break; case NPCID.SkeletronPrime: @@ -3389,7 +3390,7 @@ namespace CalamityMod.NPCs case NPCID.GolemFistRight: case NPCID.GolemFistLeft: target.AddBuff(BuffID.BrokenArmor, 180); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); break; default: @@ -3449,45 +3450,53 @@ namespace CalamityMod.NPCs if (AstrumDeusIDs.Contains(npc.type)) { - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.1); } - else if (projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || ProjectileID.Sets.StardustDragon[projectile.type]) + else if (ProjectileID.Sets.StardustDragon[projectile.type]) { - damage = (int)(damage * 0.2); + damage = (int)(damage * 0.15); } - else if (projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.3); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ProjectileID.Wasp || projectile.type == player.beeType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileID.Wasp || projectile.type == player.beeType() || projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.4); + } + else if (projectile.type == ProjectileType() || projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.8); + } if (projectile.penetrate == -1 && !projectile.minion) { damage = (int)(damage * 0.2); } - else if (projectile.penetrate > 1 && projectile.type != ModContent.ProjectileType()) + else if (projectile.penetrate > 1 && projectile.type != ProjectileType()) { damage /= projectile.penetrate; } } else if (StormWeaverIDs.Contains(npc.type)) { - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.9); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { if (projectile.penetrate == -1) projectile.penetrate = projectile.Calamity().stealthStrike ? 6 : 9; damage = (int)(damage * 0.75); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } @@ -3507,29 +3516,29 @@ namespace CalamityMod.NPCs } else if (DestroyerIDs.Contains(npc.type)) { - if (((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion) || projectile.type == ModContent.ProjectileType()) + if (((projectile.penetrate == -1 || projectile.penetrate > 1) && !projectile.minion)) { damage = (int)(damage * 0.5); } - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.75); } - else if (projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } - else if (projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.38); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { if (projectile.penetrate == -1) projectile.penetrate = 3; damage = (int)(damage * 0.3); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.25); } @@ -3540,19 +3549,19 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.5); } - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.7); + } + if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { if (projectile.penetrate == -1) projectile.penetrate = 3; - damage = (int)(damage * 0.3); - } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) - { - damage = (int)(damage * 0.25); + damage = (int)(damage * 0.1); } } else if (EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper) @@ -3561,58 +3570,62 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.6); } - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.7); } } else if (DesertScourgeIDs.Contains(npc.type)) { - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.7); } } - else if (npc.type == ModContent.NPCType()) + else if (npc.type == NPCType()) { - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.2); } - else if (projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.6); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.75); } - else if (projectile.type == ModContent.ProjectileType() || projectile.type == ProjectileID.LunarFlare) + else if (projectile.type == ProjectileID.LunarFlare) { damage = (int)(damage * 0.8); } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.9); + } } else if (npc.type == NPCID.CultistBoss) { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.75); } } else if (npc.type == NPCID.DukeFishron) { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 1.35); } } - else if (npc.type == ModContent.NPCType()) + else if (npc.type == NPCType()) { - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType()) { damage = (int)(damage * 1.5); } @@ -3653,23 +3666,13 @@ namespace CalamityMod.NPCs { if (isSummon && npc.damage > 0) { - switch (Main.rand.Next(3)) - { - case 0: - player.AddBuff(ModContent.BuffType(), 120); - break; - - case 1: - player.AddBuff(ModContent.BuffType(), 120); - break; - - case 2: - player.AddBuff(ModContent.BuffType(), 120); - break; - - default: - break; - } + int buffType = Utils.SelectRandom(Main.rand, new int[] + { + BuffType(), + BuffType(), + BuffType() + }); + player.AddBuff(buffType, 120); } } @@ -3677,23 +3680,13 @@ namespace CalamityMod.NPCs { if (isSummon && npc.damage > 0) { - switch (Main.rand.Next(3)) - { - case 0: - player.AddBuff(ModContent.BuffType(), 120); - break; - - case 1: - player.AddBuff(ModContent.BuffType(), 120); - break; - - case 2: - player.AddBuff(ModContent.BuffType(), 120); - break; - - default: - break; - } + int buffType = Utils.SelectRandom(Main.rand, new int[] + { + BuffType(), + BuffType(), + BuffType() + }); + player.AddBuff(buffType, 120); } } @@ -3719,10 +3712,10 @@ namespace CalamityMod.NPCs public override bool CheckDead(NPC npc) { if (npc.lifeMax > 1000 && npc.type != 288 && - npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType() && + npc.type != NPCType() && + npc.type != NPCType() && + npc.type != NPCType() && + npc.type != NPCType() && npc.value > 0f && npc.HasPlayerTarget && NPC.downedMoonlord && Main.player[npc.target].ZoneDungeon) @@ -3735,19 +3728,19 @@ namespace CalamityMod.NPCs switch (randomType) { case 0: - randomType = ModContent.NPCType(); + randomType = NPCType(); break; case 1: - randomType = ModContent.NPCType(); + randomType = NPCType(); break; case 2: - randomType = ModContent.NPCType(); + randomType = NPCType(); break; case 3: - randomType = ModContent.NPCType(); + randomType = NPCType(); break; default: @@ -3843,7 +3836,7 @@ namespace CalamityMod.NPCs break; } - if (npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType()) + if (npc.type == NPCType() || npc.type == NPCType()) { if (npc.life <= npc.lifeMax * 0.25) { @@ -4024,9 +4017,9 @@ namespace CalamityMod.NPCs { PossibleEnemies = AcidRainEvent.PossibleEnemiesAS; PossibleMinibosses = AcidRainEvent.PossibleMinibossesAS; - if (!PossibleEnemies.ContainsKey(ModContent.NPCType())) + if (!PossibleEnemies.ContainsKey(NPCType())) { - PossibleEnemies.Add(ModContent.NPCType(), new AcidRainSpawnData(1, 0f, AcidRainSpawnRequirement.Anywhere)); + PossibleEnemies.Add(NPCType(), new AcidRainSpawnData(1, 0f, AcidRainSpawnRequirement.Anywhere)); } } if (CalamityWorld.downedPolterghast) @@ -4080,7 +4073,7 @@ namespace CalamityMod.NPCs } if (CalamityWorld.downedPolterghast) { - pool.Add(ModContent.NPCType(), AcidRainEvent.BloodwormSpawnRate); + pool.Add(NPCType(), AcidRainEvent.BloodwormSpawnRate); } } } @@ -4149,7 +4142,7 @@ namespace CalamityMod.NPCs { if (Main.rand.Next(5) < 4) { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, ModContent.DustType(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3.5f); + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, DustType(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; @@ -4166,7 +4159,7 @@ namespace CalamityMod.NPCs { if (Main.rand.Next(5) < 4) { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, ModContent.DustType(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3.5f); + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, DustType(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.25f; @@ -4199,7 +4192,7 @@ namespace CalamityMod.NPCs { if (Main.rand.Next(5) < 4) { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, ModContent.DustType(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3.5f); + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, DustType(), npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.8f; Main.dust[dust].velocity.Y -= 0.5f; @@ -4250,7 +4243,7 @@ namespace CalamityMod.NPCs { if (Main.rand.Next(5) < 3) { - int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); + int dustType = Main.rand.NextBool(2) ? DustType() : DustType(); int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, dustType, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 0.6f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; @@ -4440,67 +4433,67 @@ namespace CalamityMod.NPCs // Damage over time debuffs if (aFlames > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/AbyssalFlames")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/AbyssalFlames")); if (astralInfection > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/AstralInfectionDebuff")); if (bFlames > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/BrimstoneFlames")); if (bBlood > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/BurningBlood")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/BurningBlood")); if (cDepth > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/CrushDepth")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/CrushDepth")); if (dFlames > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/DemonFlames")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/DemonFlames")); if (gsInferno > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/GodSlayerInferno")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/GodSlayerInferno")); if (hFlames > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/HolyFlames")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/HolyFlames")); if (nightwither > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/Nightwither")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Nightwither")); if (pFlames > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/Plague")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Plague")); if (shellfishVore > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/ShellfishEating")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/ShellfishEating")); if (pShred > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/Shred")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Shred")); if (clamDebuff > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff")); if (sulphurPoison > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning")); if (vaporfied > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/DamageOverTime/Vaporfied")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Vaporfied")); // Stat debuffs if (aCrunch > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/ArmorCrunch")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ArmorCrunch")); if (enraged > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/Enraged")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Enraged")); if (eutrophication > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/Eutrophication")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Eutrophication")); if (eFreeze > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/ExoFreeze")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ExoFreeze")); if (gState > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/GlacialState")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/GlacialState")); if (irradiated > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/Irradiated")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/Irradiated")); if (marked > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/MarkedforDeath")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/MarkedforDeath")); if (pearlAura > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/PearlAura")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/PearlAura")); if (relicOfResilienceWeakness > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/ProfanedWeakness")); if (silvaStun > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/SilvaStun")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/SilvaStun")); if (tSad > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/TemporalSadness")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TemporalSadness")); if (tesla > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/TeslaFreeze")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TeslaFreeze")); if (timeSlow > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/TimeSlow")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/TimeSlow")); if (wCleave > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/WarCleave")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/WarCleave")); if (wDeath > 0) - buffTextureList.Add(ModContent.GetTexture("CalamityMod/Buffs/StatDebuffs/WhisperingDeath")); + buffTextureList.Add(GetTexture("CalamityMod/Buffs/StatDebuffs/WhisperingDeath")); // Vanilla damage over time debuffs if (electrified > 0) @@ -4599,19 +4592,19 @@ namespace CalamityMod.NPCs if (CalamityMod.CalamityConfig.TownNPCNewShopInventoryAlertDisplay && npc.townNPC) { - if (npc.type == ModContent.NPCType() && Main.LocalPlayer.Calamity().newPermafrostInventory) + if (npc.type == NPCType() && Main.LocalPlayer.Calamity().newPermafrostInventory) { DrawNewInventoryAlert(npc); } - else if (npc.type == ModContent.NPCType() && Main.LocalPlayer.Calamity().newCirrusInventory) + else if (npc.type == NPCType() && Main.LocalPlayer.Calamity().newCirrusInventory) { DrawNewInventoryAlert(npc); } - else if (npc.type == ModContent.NPCType() && Main.LocalPlayer.Calamity().newAmidiasInventory) + else if (npc.type == NPCType() && Main.LocalPlayer.Calamity().newAmidiasInventory) { DrawNewInventoryAlert(npc); } - else if (npc.type == ModContent.NPCType() && Main.LocalPlayer.Calamity().newBanditInventory) + else if (npc.type == NPCType() && Main.LocalPlayer.Calamity().newBanditInventory) { DrawNewInventoryAlert(npc); } @@ -4712,7 +4705,7 @@ namespace CalamityMod.NPCs float drawPosY = npcHeight + npc.gfxOffY + 36f; // Texture animation variables - Texture2D texture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/NPCAlertDisplay"); + Texture2D texture = GetTexture("CalamityMod/ExtraTextures/UI/NPCAlertDisplay"); shopAlertAnimTimer++; if (shopAlertAnimTimer >= 6) { @@ -4954,10 +4947,10 @@ namespace CalamityMod.NPCs public override void GetChat(NPC npc, ref string chat) { - int fapsol = NPC.FindFirstNPC(ModContent.NPCType()); - int permadong = NPC.FindFirstNPC(ModContent.NPCType()); - int seahorse = NPC.FindFirstNPC(ModContent.NPCType()); - int thief = NPC.FindFirstNPC(ModContent.NPCType()); + int fapsol = NPC.FindFirstNPC(NPCType()); + int permadong = NPC.FindFirstNPC(NPCType()); + int seahorse = NPC.FindFirstNPC(NPCType()); + int thief = NPC.FindFirstNPC(NPCType()); int angelstatue = NPC.FindFirstNPC(NPCID.Merchant); switch (npc.type) @@ -5001,7 +4994,7 @@ namespace CalamityMod.NPCs chat = "I don't feel very safe; I think there's pigs following me around and it frightens me."; } - if (NPC.AnyNPCs(ModContent.NPCType())) + if (NPC.AnyNPCs(NPCType())) { chat = "Sometimes, " + Main.npc[fapsol].GivenName + " just looks at me funny and I'm not sure how I feel about that."; } @@ -5009,7 +5002,7 @@ namespace CalamityMod.NPCs break; case NPCID.Angler: - if (Main.rand.NextBool(5) && NPC.AnyNPCs(ModContent.NPCType())) + if (Main.rand.NextBool(5) && NPC.AnyNPCs(NPCType())) { chat = "Someone tell " + Main.npc[seahorse].GivenName + " to quit trying to throw me out of town, it's not going to work."; } @@ -5017,7 +5010,7 @@ namespace CalamityMod.NPCs break; case NPCID.TravellingMerchant: - if (Main.rand.NextBool(5) && NPC.AnyNPCs(ModContent.NPCType()) && NPC.AnyNPCs(NPCID.Merchant)) + if (Main.rand.NextBool(5) && NPC.AnyNPCs(NPCType()) && NPC.AnyNPCs(NPCID.Merchant)) { chat = "Tell " + Main.npc[fapsol].GivenName + " I'll take up her offer and meet with her at the back of " + Main.npc[angelstatue].GivenName + "'s house."; } @@ -5083,7 +5076,7 @@ namespace CalamityMod.NPCs } if (Main.rand.NextBool(4) && Main.LocalPlayer.ZoneSnow) { - if (NPC.AnyNPCs(ModContent.NPCType()) && Main.rand.NextBool(2)) + if (NPC.AnyNPCs(NPCType()) && Main.rand.NextBool(2)) { chat = "Think " + Main.npc[permadong].GivenName + " would let me paint him like one of his French girls?!"; } @@ -5159,7 +5152,7 @@ namespace CalamityMod.NPCs chat = "That starborne illness sits upon this land like a blister. Do even more vile forces of corruption exist in worlds beyond?"; } - if (Main.rand.NextBool(5) && NPC.AnyNPCs(ModContent.NPCType()) && Main.LocalPlayer.ZoneGlowshroom) + if (Main.rand.NextBool(5) && NPC.AnyNPCs(NPCType()) && Main.LocalPlayer.ZoneGlowshroom) { chat = Main.npc[fapsol].GivenName + " put me up to this."; } @@ -5304,12 +5297,12 @@ namespace CalamityMod.NPCs chat = "I have to thank ye again for takin' care of that sea serpent. Or was that another one..."; } - if (Main.rand.NextBool(5) && NPC.AnyNPCs(ModContent.NPCType())) + if (Main.rand.NextBool(5) && NPC.AnyNPCs(NPCType())) { chat = "I remember legends about that " + Main.npc[seahorse].GivenName + ". He ain't quite how the stories make him out to be though."; } - if (Main.rand.NextBool(5) && NPC.AnyNPCs(ModContent.NPCType())) + if (Main.rand.NextBool(5) && NPC.AnyNPCs(NPCType())) { chat = "Twenty-nine bottles of beer on the wall..."; } @@ -5470,7 +5463,7 @@ namespace CalamityMod.NPCs chat = "Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by!"; } - if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ModContent.ItemType())) + if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ItemType())) { chat = "Goodness! That cane has swagger!"; } @@ -5496,25 +5489,25 @@ namespace CalamityMod.NPCs { if (type == NPCID.Merchant) { - SetShopItem(ref shop, ref nextSlot, ItemID.Flare, (Main.LocalPlayer.HasItem(ModContent.ItemType()) || Main.LocalPlayer.HasItem(ModContent.ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); - SetShopItem(ref shop, ref nextSlot, ItemID.BlueFlare, (Main.LocalPlayer.HasItem(ModContent.ItemType()) || Main.LocalPlayer.HasItem(ModContent.ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); + SetShopItem(ref shop, ref nextSlot, ItemID.Flare, (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); + SetShopItem(ref shop, ref nextSlot, ItemID.BlueFlare, (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); SetShopItem(ref shop, ref nextSlot, ItemID.ApprenticeBait, NPC.downedBoss1); SetShopItem(ref shop, ref nextSlot, ItemID.JourneymanBait, NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.Vilethorn : ItemID.CrimsonRod, WorldGen.shadowOrbSmashed || NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.BallOHurt : ItemID.TheRottedFork, WorldGen.shadowOrbSmashed || NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, ItemID.MasterBait, NPC.downedBoss3); - SetShopItem(ref shop, ref nextSlot, ItemID.AngelStatue, NPC.FindFirstNPC(ModContent.NPCType()) != -1, Item.buyPrice(0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemID.AngelStatue, NPC.FindFirstNPC(NPCType()) != -1, Item.buyPrice(0, 5)); } // Because of the defiled condition, the dye trader does not receive an alert icon when hardmode starts. if (type == NPCID.DyeTrader) { - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), Main.hardMode && CalamityWorld.defiled, Item.buyPrice(0, 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), Main.hardMode && CalamityWorld.defiled, Item.buyPrice(0, 10)); } if (type == NPCID.ArmsDealer) { - SetShopItem(ref shop, ref nextSlot, ItemID.Stake, Main.LocalPlayer.HasItem(ModContent.ItemType())); + SetShopItem(ref shop, ref nextSlot, ItemID.Stake, Main.LocalPlayer.HasItem(ItemType())); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.Musket : ItemID.TheUndertaker, WorldGen.shadowOrbSmashed || NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, ItemID.Boomstick, NPC.downedQueenBee, price: Item.buyPrice(0, 20, 0, 0)); SetShopItem(ref shop, ref nextSlot, ItemID.TacticalShotgun, NPC.downedGolemBoss, Item.buyPrice(0, 25)); @@ -5523,16 +5516,16 @@ namespace CalamityMod.NPCs if (type == NPCID.Stylist) { - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), Main.LocalPlayer.wingTimeMax > 0); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage); + SetShopItem(ref shop, ref nextSlot, ItemType(), Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor); + SetShopItem(ref shop, ref nextSlot, ItemType(), Main.LocalPlayer.wingTimeMax > 0); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.revenge && CalamityMod.CalamityConfig.AdrenalineAndRage); } if (type == NPCID.Cyborg) { SetShopItem(ref shop, ref nextSlot, ItemID.RocketLauncher, NPC.downedGolemBoss, Item.buyPrice(0, 25)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedPolterghast); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedPolterghast); } if (type == NPCID.Pirate) @@ -5546,41 +5539,41 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, ItemID.NaturesGift, price: Item.buyPrice(0, 10)); SetShopItem(ref shop, ref nextSlot, ItemID.SlimeCrown, NPC.downedSlimeKing && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 2)); SetShopItem(ref shop, ref nextSlot, ItemID.SuspiciousLookingEye, NPC.downedBoss1 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 3)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedCrabulon, Item.buyPrice(0, 4)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedCrabulon, Item.buyPrice(0, 4)); SetShopItem(ref shop, ref nextSlot, ItemID.BloodySpine, NPC.downedBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 6)); SetShopItem(ref shop, ref nextSlot, ItemID.WormFood, NPC.downedBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 6)); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.BandofStarpower : ItemID.PanicNecklace, WorldGen.shadowOrbSmashed || NPC.downedBoss2); SetShopItem(ref shop, ref nextSlot, WorldGen.crimson ? ItemID.WormScarf : ItemID.BrainOfConfusion, Main.expertMode && NPC.downedBoss2); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedPerforator, Item.buyPrice(0, 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedPerforator && Main.expertMode); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedHiveMind, Item.buyPrice(0, 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedHiveMind && Main.expertMode); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedSlimeGod, Item.buyPrice(0, 15)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType()); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedPerforator, Item.buyPrice(0, 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedPerforator && Main.expertMode); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedHiveMind, Item.buyPrice(0, 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedHiveMind && Main.expertMode); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedSlimeGod, Item.buyPrice(0, 15)); + SetShopItem(ref shop, ref nextSlot, ItemType()); } if (type == NPCID.GoblinTinkerer) { - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(0, 5)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(0, 5)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(0, 5)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(0, 5)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(0, 5)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(1)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(1)); SetShopItem(ref shop, ref nextSlot, ItemID.GoblinBattleStandard, price: Item.buyPrice(0, 1)); } if (type == NPCID.Clothier) { - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); SetShopItem(ref shop, ref nextSlot, ItemID.GoldenKey, Main.hardMode, Item.buyPrice(0, 5)); SetShopItem(ref shop, ref nextSlot, ItemID.PumpkinMoonMedallion, NPC.downedHalloweenKing, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.NaughtyPresent, NPC.downedChristmasIceQueen, Item.buyPrice(0, 25)); @@ -5596,35 +5589,35 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalWorm, NPC.downedMechBoss1 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalEye, NPC.downedMechBoss2 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); SetShopItem(ref shop, ref nextSlot, ItemID.MechanicalSkull, NPC.downedMechBoss3 && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), price: Item.buyPrice(0, 0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(0, 0, 5)); } if (type == NPCID.Wizard) { - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedBrimstoneElemental, Item.buyPrice(0, 20)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedAstrageldon, Item.buyPrice(0, 25)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedBrimstoneElemental, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedAstrageldon, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.MagicMissile, price: Item.buyPrice(0, 5)); SetShopItem(ref shop, ref nextSlot, ItemID.SpectreStaff, NPC.downedGolemBoss, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.InfernoFork, NPC.downedGolemBoss, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.ShadowbeamStaff, NPC.downedGolemBoss, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.CelestialSigil, NPC.downedMoonlord && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(3)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedGuardians, Item.buyPrice(5)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedGuardians, Item.buyPrice(5)); } if (type == NPCID.WitchDoctor) { - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType()); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType()); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), Main.hardMode); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), Main.hardMode); + SetShopItem(ref shop, ref nextSlot, ItemType()); + SetShopItem(ref shop, ref nextSlot, ItemType()); + SetShopItem(ref shop, ref nextSlot, ItemType(), Main.hardMode); + SetShopItem(ref shop, ref nextSlot, ItemType(), Main.hardMode); SetShopItem(ref shop, ref nextSlot, ItemID.Abeemination, CalamityMod.CalamityConfig.SellBossSummons, price: Item.buyPrice(0, 8)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), NPC.downedPlantBoss && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); + SetShopItem(ref shop, ref nextSlot, ItemType(), NPC.downedPlantBoss && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 20)); SetShopItem(ref shop, ref nextSlot, ItemID.SolarTablet, NPC.downedGolemBoss, Item.buyPrice(0, 25)); SetShopItem(ref shop, ref nextSlot, ItemID.LihzahrdPowerCell, NPC.downedGolemBoss && CalamityMod.CalamityConfig.SellBossSummons, Item.buyPrice(0, 30)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), NPC.downedGolemBoss, Item.buyPrice(0, 10)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedScavenger, Item.buyPrice(0, 50)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedPlaguebringer, Item.buyPrice(0, 50)); - SetShopItem(ref shop, ref nextSlot, ModContent.ItemType(), CalamityWorld.downedBumble, Item.buyPrice(5)); + SetShopItem(ref shop, ref nextSlot, ItemType(), NPC.downedGolemBoss, Item.buyPrice(0, 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedScavenger, Item.buyPrice(0, 50)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedPlaguebringer, Item.buyPrice(0, 50)); + SetShopItem(ref shop, ref nextSlot, ItemType(), CalamityWorld.downedBumble, Item.buyPrice(5)); } if (type == NPCID.SkeletonMerchant) @@ -5637,7 +5630,7 @@ namespace CalamityMod.NPCs { if (Main.moonPhase == 0) { - shop[nextSlot] = ModContent.ItemType(); + shop[nextSlot] = ItemType(); nextSlot++; } } @@ -5664,19 +5657,19 @@ namespace CalamityMod.NPCs { for (int i = 0; i < types.Length; i++) { - if (types[i] == ModContent.NPCType()) + if (types[i] == NPCType()) { Main.LocalPlayer.Calamity().newPermafrostInventory = true; } - else if (types[i] == ModContent.NPCType()) + else if (types[i] == NPCType()) { Main.LocalPlayer.Calamity().newCirrusInventory = true; } - else if (types[i] == ModContent.NPCType()) + else if (types[i] == NPCType()) { Main.LocalPlayer.Calamity().newAmidiasInventory = true; } - else if (types[i] == ModContent.NPCType()) + else if (types[i] == NPCType()) { Main.LocalPlayer.Calamity().newBanditInventory = true; } @@ -5756,8 +5749,8 @@ namespace CalamityMod.NPCs for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && Main.npc[i].type != NPCID.MartianSaucerCore && - (Main.npc[i].boss || Main.npc[i].type == NPCID.EaterofWorldsHead || Main.npc[i].type == NPCID.EaterofWorldsTail || Main.npc[i].type == ModContent.NPCType() || - Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType())) + (Main.npc[i].boss || Main.npc[i].type == NPCID.EaterofWorldsHead || Main.npc[i].type == NPCID.EaterofWorldsTail || Main.npc[i].type == NPCType() || + Main.npc[i].type == NPCType() || Main.npc[i].type == NPCType() || Main.npc[i].type == NPCType())) { return true; } @@ -5786,8 +5779,8 @@ namespace CalamityMod.NPCs if (target.damage > 0 && !target.boss && !target.friendly && !target.dontTakeDamage && target.type != NPCID.TheDestroyerBody && target.type != NPCID.TheDestroyerTail && target.type != NPCID.MourningWood && target.type != NPCID.Everscream && target.type != NPCID.SantaNK1 && - target.type != ModContent.NPCType() && target.type != ModContent.NPCType() && target.type != ModContent.NPCType() && - target.type != ModContent.NPCType() && target.type != ModContent.NPCType() && target.type != NPCID.DD2Betsy && !CalamityMod.enemyImmunityList.Contains(target.type) && !AcidRainEvent.AllMinibosses.Contains(target.type)) + target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && + target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !CalamityMod.enemyImmunityList.Contains(target.type) && !AcidRainEvent.AllMinibosses.Contains(target.type)) { return true; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 4081ae93bf..089664b141 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -19,6 +19,7 @@ using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles { @@ -60,7 +61,6 @@ namespace CalamityMod.Projectiles // Counters and Timers private int counter = 0; - private int counter2 = 0; public int lineColor = 0; //Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben public bool extorterBoost = false; @@ -691,8 +691,8 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileID.Mushroom] < 30) { //Note: these don't count as true melee anymore but its useful code to keep around - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || - projectile.type == ModContent.ProjectileType() || projectile.type == ProjectileID.SolarWhipSword) + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || + projectile.type == ProjectileType() || projectile.type == ProjectileID.SolarWhipSword) { Vector2 vector24 = Main.OffsetsPlayerOnhand[Main.player[projectile.owner].bodyFrame.Y / 56] * 2f; if (Main.player[projectile.owner].direction != 1) @@ -717,25 +717,25 @@ namespace CalamityMod.Projectiles } } - if (modPlayer.nanotech && rogue && projectile.type != ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType()) + if (modPlayer.nanotech && rogue && projectile.type != ProjectileType() && projectile.type != ProjectileType()) { if (counter % 30 == 0) { - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 25) + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ProjectileType()] < 25) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), (int)(projectile.damage * 0.1), 0f, projectile.owner, 0f, 0f); } } } - if (modPlayer.dragonScales && rogue && projectile.type != ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType()) + if (modPlayer.dragonScales && rogue && projectile.type != ProjectileType() && projectile.type != ProjectileType()) { if (counter % 50 == 0) { - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 15) + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ProjectileType()] < 15) { //spawn a dust that does 1/5th of the original damage - int projectileID = Projectile.NewProjectile(projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi), ModContent.ProjectileType(), + int projectileID = Projectile.NewProjectile(projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi), ProjectileType(), (int)(projectile.damage * 0.2), 0f, projectile.owner, 0f, 0f); } } @@ -743,10 +743,8 @@ namespace CalamityMod.Projectiles if (modPlayer.daedalusSplit && rogue) { - counter2++; - if (counter2 >= 30) + if (counter % 30 == 0) { - counter2 = 0; if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[90] < 30) { for (int num252 = 0; num252 < 2; num252++) @@ -904,9 +902,9 @@ namespace CalamityMod.Projectiles if (modPlayer.moonCrown && !modPlayer.nanotech) { //Summon moon sigils infrequently - if (Main.rand.NextBool(300) && projectile.type != ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType()) + if (Main.rand.NextBool(300) && projectile.type != ProjectileType() && projectile.type != ProjectileType()) { - Projectile.NewProjectile(projectile.position, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), 0, projectile.owner); + Projectile.NewProjectile(projectile.position, Vector2.Zero, ProjectileType(), (int)(projectile.damage * 0.2), 0, projectile.owner); } } } @@ -976,7 +974,7 @@ namespace CalamityMod.Projectiles if (!projectile.melee && player.meleeEnchant == 7) Projectile.NewProjectile(target.Center.X, target.Center.Y, target.velocity.X, target.velocity.Y, ProjectileID.ConfettiMelee, 0, 0f, projectile.owner, 0f, 0f); - if (rogue && stealthStrike && modPlayer.dragonScales && CalamityUtils.CountProjectiles(ModContent.ProjectileType()) < 2) + if (rogue && stealthStrike && modPlayer.dragonScales && CalamityUtils.CountProjectiles(ProjectileType()) < 2) { int projTileX = (int)(projectile.Center.X / 16f); int projTileY = (int)(projectile.Center.Y / 16f); @@ -1006,7 +1004,7 @@ namespace CalamityMod.Projectiles break; } } - int projectileIndex = Projectile.NewProjectile(projTileX * 16 + 8, projTileY * 16 - 24, 0f, 0f, ModContent.ProjectileType(), 420, 15f, Main.myPlayer, 16f, 16f); + int projectileIndex = Projectile.NewProjectile(projTileX * 16 + 8, projTileY * 16 - 24, 0f, 0f, ProjectileType(), 420, 15f, Main.myPlayer, 16f, 16f); Main.projectile[projectileIndex].Calamity().forceRogue = true; Main.projectile[projectileIndex].netUpdate = true; Main.projectile[projectileIndex].localNPCHitCooldown = 1; @@ -1039,7 +1037,7 @@ namespace CalamityMod.Projectiles } } - if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != ModContent.NPCType()) + if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != NPCType()) { // Increases the degree to which Spectre Healing set contributes to the lifesteal cap if (player.ghostHeal) @@ -1085,7 +1083,7 @@ namespace CalamityMod.Projectiles if (!CanSpawnLifeStealProjectile(projectile, healMult, heal)) goto OTHEREFFECTS; - SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType(), 1200f, 1.5f); + SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 1.5f); } else if (modPlayer.silvaSet) { @@ -1096,7 +1094,7 @@ namespace CalamityMod.Projectiles if (!CanSpawnLifeStealProjectile(projectile, healMult, heal)) goto OTHEREFFECTS; - SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType(), 1200f, 1.5f); + SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 1.5f); } else if (projectile.magic) { @@ -1109,7 +1107,7 @@ namespace CalamityMod.Projectiles if (!CanSpawnLifeStealProjectile(projectile, healMult, heal)) goto OTHEREFFECTS; - SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType(), 1200f, 1.5f); + SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 1.5f); } else if (modPlayer.tarraMage) { @@ -1142,7 +1140,7 @@ namespace CalamityMod.Projectiles if (!CanSpawnLifeStealProjectile(projectile, healMult, heal)) goto OTHEREFFECTS; - SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType(), 1200f, 1.5f); + SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 1.5f); } else if (modPlayer.manaOverloader) { @@ -1153,7 +1151,7 @@ namespace CalamityMod.Projectiles if (!CanSpawnLifeStealProjectile(projectile, healMult, heal)) goto OTHEREFFECTS; - SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType(), 1200f, 1.5f); + SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 1.5f); } } } @@ -1162,25 +1160,15 @@ namespace CalamityMod.Projectiles if (modPlayer.alchFlask && (projectile.magic || rogue || projectile.melee || projectile.minion || projectile.ranged || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type]) && - player.ownedProjectileCounts[ModContent.ProjectileType()] < 6) + player.ownedProjectileCounts[ProjectileType()] < 6) { - int newDamage = (int)(projectile.damage * 0.25); - if (newDamage > 30) - { - newDamage = (int)((projectile.damage * 0.25 - 30) * 0.1) + 30; - } - int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); + int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30), 0f, projectile.owner, 0f, 0f); Main.projectile[plague].Calamity().forceTypeless = false; } if (modPlayer.reaverBlast && projectile.melee) { - int newDamage = (int)(projectile.damage * 0.2); - if (newDamage > 30) - { - newDamage = (int)((projectile.damage * 0.2 - 30) * 0.1) + 30; - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 30), 0f, projectile.owner, 0f, 0f); } if (projectile.magic) @@ -1223,50 +1211,40 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= Main.rand.Next(70, 101) * 0.1f; - int newDamage = (int)(projectile.damage * 0.15); - if (newDamage > 15) - { - newDamage = (int)((projectile.damage * 0.15 - 15) * 0.1) + 15; - } - int proj = Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), value15.X, value15.Y, 569 + Main.rand.Next(3), newDamage, 0f, projectile.owner, 0f, 0f); + int proj = Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), value15.X, value15.Y, 569 + Main.rand.Next(3), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 15), 0f, projectile.owner, 0f, 0f); Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 30; } } else if (modPlayer.ataxiaMage && modPlayer.ataxiaDmg <= 0) { - SpawnOrb(projectile, 1.25f, ModContent.ProjectileType(), 800f, 20f); + SpawnOrb(projectile, 1.25f, ProjectileType(), 800f, 20f); int num = (int)(projectile.damage * 0.5f); modPlayer.ataxiaDmg += num; } else if (modPlayer.godSlayerMage && modPlayer.godSlayerDmg <= 0) { - SpawnOrb(projectile, modPlayer.auricSet ? 2f : 1.5f, ModContent.ProjectileType(), 800f, 20f); + SpawnOrb(projectile, modPlayer.auricSet ? 2f : 1.5f, ProjectileType(), 800f, 20f); int num = (int)(projectile.damage * 0.5f); modPlayer.godSlayerDmg += num; } } else if (projectile.melee) { - if (modPlayer.ataxiaGeyser && player.ownedProjectileCounts[ModContent.ProjectileType()] < 3) + if (modPlayer.ataxiaGeyser && player.ownedProjectileCounts[ProjectileType()] < 3) { - int newDamage = (int)(projectile.damage * 0.15); - if (newDamage > 35) - { - newDamage = (int)((projectile.damage * 0.15 - 35) * 0.1) + 35; - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 35), 0f, projectile.owner, 0f, 0f); } } else if (rogue) { - if (modPlayer.xerocSet && modPlayer.xerocDmg <= 0 && player.ownedProjectileCounts[ModContent.ProjectileType()] < 3 && player.ownedProjectileCounts[ModContent.ProjectileType()] < 3) + if (modPlayer.xerocSet && modPlayer.xerocDmg <= 0 && player.ownedProjectileCounts[ProjectileType()] < 3 && player.ownedProjectileCounts[ProjectileType()] < 3) { switch (Main.rand.Next(5)) { case 0: - SpawnOrb(projectile, 1.6f, ModContent.ProjectileType(), 800f, Main.rand.Next(15, 30)); + SpawnOrb(projectile, 1.6f, ProjectileType(), 800f, Main.rand.Next(15, 30)); int num = (int)(projectile.damage * 0.5f); modPlayer.xerocDmg += num; @@ -1274,7 +1252,7 @@ namespace CalamityMod.Projectiles case 1: - SpawnOrb(projectile, 1.25f, ModContent.ProjectileType(), 800f, 30f); + SpawnOrb(projectile, 1.25f, ProjectileType(), 800f, 30f); int num2 = (int)(projectile.damage * 0.5f); modPlayer.xerocDmg += num2; @@ -1287,36 +1265,26 @@ namespace CalamityMod.Projectiles if (!CanSpawnLifeStealProjectile(projectile, healMult, heal)) goto SKIPXEROC; - SpawnLifeStealProjectile(projectile, player, heal, ModContent.ProjectileType(), 1200f, 1.5f); + SpawnLifeStealProjectile(projectile, player, heal, ProjectileType(), 1200f, 1.5f); } break; case 2: - int newDamage = (int)(projectile.damage * 0.15); - if (newDamage > 40) - { - newDamage = (int)((projectile.damage * 0.15 - 40) * 0.1) + 40; - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 40), 0f, projectile.owner, 0f, 0f); break; case 3: - int newDamage2 = (int)(projectile.damage * 0.2); - if (newDamage2 > 40) - { - newDamage = (int)((projectile.damage * 0.2 - 40) * 0.1) + 40; - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage2, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.2, 40), 0f, projectile.owner, 0f, 0f); break; case 4: - SpawnOrb(projectile, 1.2f, ModContent.ProjectileType(), 800f, 15f); + SpawnOrb(projectile, 1.2f, ProjectileType(), 800f, 15f); int num3 = (int)(projectile.damage * 0.5f); modPlayer.xerocDmg += num3; @@ -1337,7 +1305,7 @@ namespace CalamityMod.Projectiles float speedX = (target.Center.X - pos.X) / 30f; float speedY = (target.Center.Y - pos.Y) * 8; int dmg = (int)(15 + (projectile.damage * 0.05f)); - int feather = Projectile.NewProjectile(pos.X, pos.Y, speedX, speedY, ModContent.ProjectileType(), dmg, 3, projectile.owner, 0f, Main.rand.Next(15)); + int feather = Projectile.NewProjectile(pos.X, pos.Y, speedX, speedY, ProjectileType(), dmg, 3, projectile.owner, 0f, Main.rand.Next(15)); Main.projectile[feather].Calamity().forceRogue = true; modPlayer.featherCrownCooldown = 15; } @@ -1364,7 +1332,7 @@ namespace CalamityMod.Projectiles Vector2 pos = new Vector2(target.Center.X + target.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); Vector2 velocity = (target.Center - pos) / 40f; int dmg = (int)(1000 + (projectile.damage * 0.05f)); - int flare = Projectile.NewProjectile(pos, velocity, ModContent.ProjectileType(),dmg, 3f, projectile.owner, 0f, 0f); + int flare = Projectile.NewProjectile(pos, velocity, ProjectileType(),dmg, 3f, projectile.owner, 0f, 0f); Main.projectile[flare].Calamity().rogue = true; modPlayer.nanoFlareCooldown = 15; } @@ -1379,12 +1347,12 @@ namespace CalamityMod.Projectiles xVector *= 10f; yVector *= 10f; int dmg = (int)(75 + (projectile.damage * 0.05f)); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ModContent.ProjectileType(), dmg, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ProjectileType(), dmg, projectile.knockBack, projectile.owner, 0f, 0f); modPlayer.forbiddenCooldown = 15; } } - if (modPlayer.corrosiveSpine && projectile.type != ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType() && projectile.type != ModContent.ProjectileType()) + if (modPlayer.corrosiveSpine && projectile.type != ProjectileType() && projectile.type != ProjectileType() && projectile.type != ProjectileType()) { for (int i = 0; i < 3; i++) { @@ -1394,13 +1362,13 @@ namespace CalamityMod.Projectiles switch (Main.rand.Next(15)) { case 0: - type = ModContent.ProjectileType(); + type = ProjectileType(); break; case 1: - type = ModContent.ProjectileType(); + type = ProjectileType(); break; case 2: - type = ModContent.ProjectileType(); + type = ProjectileType(); break; } // Should never happen, but just in case- @@ -1419,12 +1387,12 @@ namespace CalamityMod.Projectiles { if (modPlayer.profanedCrystalBuffs || (modPlayer.pArtifact && !modPlayer.profanedCrystal)) { - target.AddBuff(ModContent.BuffType(), modPlayer.profanedCrystalBuffs ? 600 : 300); + target.AddBuff(BuffType(), modPlayer.profanedCrystalBuffs ? 600 : 300); } if (modPlayer.tearMinions) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); } if (modPlayer.shadowMinions) @@ -1444,8 +1412,8 @@ namespace CalamityMod.Projectiles if (modPlayer.starTaintedGenerator) { - target.AddBuff(ModContent.BuffType(), 180); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); + target.AddBuff(BuffType(), 180); } // Fearmonger set's colossal life regeneration @@ -1458,7 +1426,7 @@ namespace CalamityMod.Projectiles if (modPlayer.godSlayerSummon && modPlayer.godSlayerDmg <= 0) { - SpawnOrb(projectile, 2f, ModContent.ProjectileType(), 800f, 15f, true); + SpawnOrb(projectile, 2f, ProjectileType(), 800f, 15f, true); int num = (int)(projectile.damage * 0.5f); modPlayer.godSlayerDmg += num; } @@ -1466,11 +1434,11 @@ namespace CalamityMod.Projectiles //Priorities: Nucleogenesis => Starbuster Core => Nuclear Rod => Jelly-Charged Battery List summonExceptionList = new List() { - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType() + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType(), + ProjectileType() }; if (summonExceptionList.TrueForAll(x => projectile.type != x)) @@ -1481,12 +1449,7 @@ namespace CalamityMod.Projectiles { if (Main.rand.NextBool(4)) { - int newDamage = (int)(projectile.damage * 0.25); - if (newDamage > 100) - { - newDamage = (int)((projectile.damage * 0.25 - 100) * 0.1) + 100; - } - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), newDamage, projectile.knockBack * 0.25f, projectile.owner); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 100), projectile.knockBack * 0.25f, projectile.owner); modPlayer.jellyDmg = 20f; } } @@ -1495,13 +1458,8 @@ namespace CalamityMod.Projectiles if (Main.rand.NextBool(3)) { int cap = modPlayer.starTaintedGenerator ? 75 : 60; - int newDamage = (int)(projectile.damage * 0.5); - if (newDamage > cap) - { - newDamage = (int)((projectile.damage * 0.5 - cap) * 0.1) + cap; - } - int boom = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), - newDamage, 3f, projectile.owner); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), + CalamityUtils.DamageSoftCap(projectile.damage * 0.5, cap), 3f, projectile.owner); modPlayer.jellyDmg = 20f; } } @@ -1509,19 +1467,14 @@ namespace CalamityMod.Projectiles { if (Main.rand.NextBool(3)) { - int newDamage = (int)(projectile.damage * 0.25); - if (newDamage > 40) - { - newDamage = (int)((projectile.damage * 0.25 - 40) * 0.1) + 40; - } - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), - newDamage, 0f, projectile.owner); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), + CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 40), 0f, projectile.owner); modPlayer.jellyDmg = 20f; } } else if (modPlayer.jellyChargedBattery) { - SpawnOrb(projectile, 1.05f, ModContent.ProjectileType(), 800f, 15f); + SpawnOrb(projectile, 1.05f, ProjectileType(), 800f, 15f); int num = (int)(projectile.damage * 0.5f); modPlayer.jellyDmg += num; } @@ -1535,7 +1488,7 @@ namespace CalamityMod.Projectiles Vector2 spawnPosition = target.Center - new Vector2(0f, 920f).RotatedByRandom(0.3f); float speed = Main.rand.NextFloat(17f, 23f); Projectile.NewProjectile(spawnPosition, Vector2.Normalize(target.Center - spawnPosition) * speed, - ModContent.ProjectileType(), projectile.damage / 3, 3f, projectile.owner); + ProjectileType(), projectile.damage / 3, 3f, projectile.owner); } } } @@ -1543,7 +1496,7 @@ namespace CalamityMod.Projectiles if (projectile.ranged) { - if (modPlayer.tarraRanged && Main.rand.Next(0, 100) >= 88 && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 20 && (projectile.timeLeft <= 2 || projectile.penetrate <= 1)) + if (modPlayer.tarraRanged && Main.rand.Next(0, 100) >= 88 && player.ownedProjectileCounts[ProjectileType()] <= 20 && (projectile.timeLeft <= 2 || projectile.penetrate <= 1)) { int num251 = Main.rand.Next(2, 4); for (int num252 = 0; num252 < num251; num252++) @@ -1555,12 +1508,7 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= Main.rand.Next(70, 101) * 0.1f; - int newDamage = (int)(projectile.damage * 0.33); - if (newDamage > 65) - { - newDamage = (int)((projectile.damage * 0.33 - 65) * 0.1) + 65; - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.33, 65), 0f, projectile.owner, 0f, 0f); } } } @@ -1739,8 +1687,7 @@ namespace CalamityMod.Projectiles } value15.Normalize(); value15 *= Main.rand.Next(70, 101) * 0.1f; - int newDamage = (int)(projectile.damage * 0.33); - int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileID.LostSoulFriendly, newDamage, 0f, projectile.owner, 0f, 0f); + int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ProjectileID.LostSoulFriendly, (int)(projectile.damage * 0.33), 0f, projectile.owner, 0f, 0f); Main.projectile[soul].Calamity().forceRogue = true; Main.projectile[soul].timeLeft = 300; Main.projectile[soul].tileCollide = false; @@ -1749,25 +1696,25 @@ namespace CalamityMod.Projectiles if (modPlayer.scuttlersJewel && CalamityMod.javelinProjList.Contains(projectile.type) && Main.rand.NextBool(3)) { float dmgMult = 1f; - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType()) dmgMult = 0.5f; - int spike = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f * dmgMult), projectile.knockBack, projectile.owner); + int spike = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), (int)(projectile.damage * 0.5f * dmgMult), projectile.knockBack, projectile.owner); Main.projectile[spike].frame = 4; } } if (projectile.type == ProjectileID.UnholyWater) { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, projectile.owner, 1f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), 0, 0f, projectile.owner, 1f); } if (projectile.type == ProjectileID.BloodWater) { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, projectile.owner, 2f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), 0, 0f, projectile.owner, 2f); } if (projectile.type == ProjectileID.HolyWater) { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, projectile.owner, 3f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), 0, 0f, projectile.owner, 3f); } } } @@ -1946,7 +1893,7 @@ namespace CalamityMod.Projectiles Vector2 value = projectile.Center + projectile.velocity * 4f; Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - value) * homingVelocity; - if (projectile.type == ModContent.ProjectileType()) + if (projectile.type == ProjectileType()) { velocity.Y += Main.rand.Next(-30, 31) * 0.05f; velocity.X += Main.rand.Next(-30, 31) * 0.05f; @@ -1956,22 +1903,68 @@ namespace CalamityMod.Projectiles { int projectile2 = Projectile.NewProjectile(value.X, value.Y, velocity.X, velocity.Y, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f); - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || - projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || (projectile.type == ModContent.ProjectileType() && projectile.melee)) + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || + projectile.type == ProjectileType() || projectile.type == ProjectileType() || (projectile.type == ProjectileType() && projectile.melee)) Main.projectile[projectile2].Calamity().forceMelee = true; - if (projectile.type == ModContent.ProjectileType() && projectile.Calamity().rogue) + if (projectile.type == ProjectileType() && projectile.Calamity().rogue) Main.projectile[projectile2].Calamity().forceRogue = true; } } } } + public static void HealingProjectile(Projectile projectile, int healing, int playerToHeal, float homingVelocity, float N, bool autoHomes = true, int timeCheck = 120) + { + int target = playerToHeal; + Player player = Main.player[target]; + float homingSpeed = homingVelocity; + if (player.lifeMagnet) + homingSpeed *= 1.5f; + + Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); + float xDist = player.Center.X - projPos.X; + float yDist = player.Center.Y - projPos.Y; + Vector2 playerVector = new Vector2(xDist, yDist); + float playerDist = playerVector.Length(); + if (playerDist < 50f && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y) + { + if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) + { + int healAmt = healing; + player.HealEffect(healAmt, false); + player.statLife += healAmt; + if (player.statLife > player.statLifeMax2) + { + player.statLife = player.statLifeMax2; + } + NetMessage.SendData(66, -1, -1, null, target, healAmt, 0f, 0f, 0, 0, 0); + } + projectile.Kill(); + } + if (autoHomes) + { + playerDist = homingSpeed / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; + projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f); + projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f); + } + else if (player.lifeMagnet && projectile.timeLeft < timeCheck) + { + playerDist = homingVelocity / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; + projectile.velocity.X = (projectile.velocity.X * N + playerVector.X) / (N + 1f); + projectile.velocity.Y = (projectile.velocity.Y * N + playerVector.Y) / (N + 1f); + } + } + public static void FloatingPetAI(Projectile projectile, bool faceRight, float tiltFloat, bool lightPet = false) { Player player = Main.player[projectile.owner]; - //anti sticking movement as a backup + //anti sticking movement as a failsafe float SAImovement = 0.05f; for (int index = 0; index < Main.projectile.Length; index++) { @@ -1998,21 +1991,22 @@ namespace CalamityMod.Projectiles } } - float num16 = 0.5f; + float passiveMvtFloat = 0.5f; projectile.tileCollide = false; float range = 100f; - Vector2 vector3 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); - float xDist = player.position.X + (player.width / 2) - vector3.X; - float yDist = player.position.Y + (player.height / 2) - vector3.Y; - yDist += Main.rand.Next(-10, 21); - xDist += Main.rand.Next(-10, 21); - //light pets lead the player, normal pets trail the player - xDist += 60 * (lightPet ? player.direction : -player.direction); + Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); + float xDist = player.Center.X - projPos.X; + float yDist = player.Center.Y - projPos.Y; + yDist += Main.rand.NextFloat(-10, 20); + xDist += Main.rand.NextFloat(-10, 20); + //Light pets lead the player, normal pets trail the player + xDist += 60f * (lightPet ? (float)player.direction : -(float)player.direction); yDist -= 60f; - float playerDist = (float)Math.Sqrt(xDist * xDist + yDist * yDist); - float num21 = 18f; + Vector2 playerVector = new Vector2(xDist, yDist); + float playerDist = playerVector.Length(); + float returnSpeed = 18f; - //if player is close enough, resume normal + //If player is close enough, resume normal if (playerDist < range && player.velocity.Y == 0f && projectile.position.Y + projectile.height <= player.position.Y + player.height && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) @@ -2023,11 +2017,11 @@ namespace CalamityMod.Projectiles } } - //teleport to player if too far + //Teleport to player if too far if (playerDist > 2000f) { - projectile.position.X = player.Center.X - (projectile.width / 2); - projectile.position.Y = player.Center.Y - (projectile.height / 2); + projectile.position.X = player.Center.X - projectile.width / 2; + projectile.position.Y = player.Center.Y - projectile.height / 2; projectile.netUpdate = true; } @@ -2037,52 +2031,52 @@ namespace CalamityMod.Projectiles { projectile.velocity *= 0.99f; } - num16 = 0.01f; + passiveMvtFloat = 0.01f; } else { if (playerDist < 100f) { - num16 = 0.1f; + passiveMvtFloat = 0.1f; } if (playerDist > 300f) { - num16 = 1f; + passiveMvtFloat = 1f; } - playerDist = num21 / playerDist; - xDist *= playerDist; - yDist *= playerDist; + playerDist = returnSpeed / playerDist; + playerVector.X *= playerDist; + playerVector.Y *= playerDist; } - if (projectile.velocity.X < xDist) + if (projectile.velocity.X < playerVector.X) { - projectile.velocity.X = projectile.velocity.X + num16; - if (num16 > 0.05f && projectile.velocity.X < 0f) + projectile.velocity.X += passiveMvtFloat; + if (passiveMvtFloat > 0.05f && projectile.velocity.X < 0f) { - projectile.velocity.X = projectile.velocity.X + num16; + projectile.velocity.X += passiveMvtFloat; } } - if (projectile.velocity.X > xDist) + if (projectile.velocity.X > playerVector.X) { - projectile.velocity.X = projectile.velocity.X - num16; - if (num16 > 0.05f && projectile.velocity.X > 0f) + projectile.velocity.X -= passiveMvtFloat; + if (passiveMvtFloat > 0.05f && projectile.velocity.X > 0f) { - projectile.velocity.X = projectile.velocity.X - num16; + projectile.velocity.X -= passiveMvtFloat; } } - if (projectile.velocity.Y < yDist) + if (projectile.velocity.Y < playerVector.Y) { - projectile.velocity.Y = projectile.velocity.Y + num16; - if (num16 > 0.05f && projectile.velocity.Y < 0f) + projectile.velocity.Y += passiveMvtFloat; + if (passiveMvtFloat > 0.05f && projectile.velocity.Y < 0f) { - projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + projectile.velocity.Y += passiveMvtFloat * 2f; } } - if (projectile.velocity.Y > yDist) + if (projectile.velocity.Y > playerVector.Y) { - projectile.velocity.Y = projectile.velocity.Y - num16; - if (num16 > 0.05f && projectile.velocity.Y > 0f) + projectile.velocity.Y -= passiveMvtFloat; + if (passiveMvtFloat > 0.05f && projectile.velocity.Y > 0f) { - projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + projectile.velocity.Y -= passiveMvtFloat * 2f; } } if (projectile.velocity.X >= 0.25f) diff --git a/Projectiles/Healing/AtaxiaHealOrb.cs b/Projectiles/Healing/AtaxiaHealOrb.cs index cd2312f5d7..98aa375101 100644 --- a/Projectiles/Healing/AtaxiaHealOrb.cs +++ b/Projectiles/Healing/AtaxiaHealOrb.cs @@ -24,43 +24,12 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = (int)projectile.ai[0]; - float num488 = 5.5f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - float num498 = projectile.velocity.X * 0.2f; - float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); - Main.dust[num500].noGravity = true; - Dust expr_154F9_cp_0 = Main.dust[num500]; - expr_154F9_cp_0.position.X -= num498; - Dust expr_15518_cp_0 = Main.dust[num500]; - expr_15518_cp_0.position.Y -= num499; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); + int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); + Dust dust = Main.dust[dusty]; + dust.noGravity = true; + dust.position.X -= projectile.velocity.X * 0.2f; + dust.position.Y += projectile.velocity.Y * 0.2f; } } } diff --git a/Projectiles/Healing/AuricOrb.cs b/Projectiles/Healing/AuricOrb.cs index 7fa77e8d85..74adb60d7d 100644 --- a/Projectiles/Healing/AuricOrb.cs +++ b/Projectiles/Healing/AuricOrb.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Healing if (projectile.localAI[0] == 0f) { projectile.scale += 0.05f; - if ((double)projectile.scale > 1.2) + if (projectile.scale > 1.2f) { projectile.localAI[0] = 1f; } @@ -36,41 +36,13 @@ namespace CalamityMod.Projectiles.Healing else { projectile.scale -= 0.05f; - if ((double)projectile.scale < 0.8) + if (projectile.scale < 0.8f) { projectile.localAI[0] = 0f; } } - int num487 = (int)projectile.ai[0]; - float num488 = 6f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f); return; } diff --git a/Projectiles/Healing/BurntSiennaProj.cs b/Projectiles/Healing/BurntSiennaProj.cs index 6c379fd841..6c2ed80366 100644 --- a/Projectiles/Healing/BurntSiennaProj.cs +++ b/Projectiles/Healing/BurntSiennaProj.cs @@ -27,42 +27,12 @@ namespace CalamityMod.Projectiles.Healing projectile.velocity.X *= 0.95f; projectile.velocity.Y *= 0.95f; - int num487 = (int)projectile.ai[0]; - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = 3; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120) - { - float num488 = 6f; - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - } - float num498 = projectile.velocity.X * 0.2f; - float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[num500]; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f, false); + int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); + Dust dust = Main.dust[dusty]; dust.noGravity = true; - dust.position.X -= num498; - dust.position.Y -= num499; + dust.position.X -= projectile.velocity.X * 0.2f; + dust.position.Y += projectile.velocity.Y * 0.2f; } } } diff --git a/Projectiles/Healing/CactusHealOrb.cs b/Projectiles/Healing/CactusHealOrb.cs index 03a13de375..4d919c5b6a 100644 --- a/Projectiles/Healing/CactusHealOrb.cs +++ b/Projectiles/Healing/CactusHealOrb.cs @@ -26,42 +26,12 @@ namespace CalamityMod.Projectiles.Healing { projectile.velocity.Y *= 0.98f; - int num487 = projectile.owner; - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = 25; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120) - { - float num488 = 12f; - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - } - float num498 = projectile.velocity.X * 0.2f; - float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 200, 0), 1.5f); - Dust dust = Main.dust[num500]; - dust.noGravity = true; - dust.position.X -= num498; - dust.position.Y -= num499; + CalamityGlobalProjectile.HealingProjectile(projectile, 25, projectile.owner, 12f, 15f); + int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 200, 0), 1.5f); + Dust dust = Main.dust[dusty]; + dust.noGravity = true; + dust.position.X -= projectile.velocity.X * 0.2f; + dust.position.Y += projectile.velocity.Y * 0.2f; } } } diff --git a/Projectiles/Healing/EarthHealOrb.cs b/Projectiles/Healing/EarthHealOrb.cs index cf5182f33f..1b0f469446 100644 --- a/Projectiles/Healing/EarthHealOrb.cs +++ b/Projectiles/Healing/EarthHealOrb.cs @@ -24,42 +24,12 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = (int)projectile.ai[0]; - float num488 = 8f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - float num498 = projectile.velocity.X * 0.2f; - float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[num500]; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f); + int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f); + Dust dust = Main.dust[dusty]; dust.noGravity = true; - dust.position.X -= num498; - dust.position.Y -= num499; + dust.position.X -= projectile.velocity.X * 0.2f; + dust.position.Y += projectile.velocity.Y * 0.2f; } } } diff --git a/Projectiles/Healing/EssenceFlame.cs b/Projectiles/Healing/EssenceFlame.cs index 24f49646a4..4b628fbf2a 100644 --- a/Projectiles/Healing/EssenceFlame.cs +++ b/Projectiles/Healing/EssenceFlame.cs @@ -38,35 +38,7 @@ namespace CalamityMod.Projectiles.Healing projectile.frame = 0; } - int num487 = (int)projectile.ai[0]; - float num488 = 3.5f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = 8; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 3.5f, 15f); return; } diff --git a/Projectiles/Healing/Exoheal.cs b/Projectiles/Healing/Exoheal.cs index 9709142587..f2e6e2b59d 100644 --- a/Projectiles/Healing/Exoheal.cs +++ b/Projectiles/Healing/Exoheal.cs @@ -24,42 +24,12 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = (int)projectile.ai[0]; - float num488 = 8f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - float num498 = projectile.velocity.X * 0.2f; - float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1f); - Dust dust = Main.dust[num500]; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f); + int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1f); + Dust dust = Main.dust[dusty]; dust.noGravity = true; - dust.position.X -= num498; - dust.position.Y -= num499; + dust.position.X -= projectile.velocity.X * 0.2f; + dust.position.Y += projectile.velocity.Y * 0.2f; } } } diff --git a/Projectiles/Healing/FungalHeal.cs b/Projectiles/Healing/FungalHeal.cs index 8921a2bbc1..885829ac9e 100644 --- a/Projectiles/Healing/FungalHeal.cs +++ b/Projectiles/Healing/FungalHeal.cs @@ -40,35 +40,7 @@ namespace CalamityMod.Projectiles.Healing projectile.localAI[0] += 1f; } - int num487 = (int)projectile.ai[0]; - float num488 = 5f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 9f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 9f + num490) / 16f; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5f, 15f); float num494 = projectile.velocity.X * 0.334f; float num495 = -(projectile.velocity.Y * 0.334f); int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 56, 0f, 0f, 100, default, 0.5f); diff --git a/Projectiles/Healing/GodSlayerHealOrb.cs b/Projectiles/Healing/GodSlayerHealOrb.cs index aa21e884f8..76ab25d25d 100644 --- a/Projectiles/Healing/GodSlayerHealOrb.cs +++ b/Projectiles/Healing/GodSlayerHealOrb.cs @@ -24,42 +24,12 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = (int)projectile.ai[0]; - float num488 = 6.5f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - float num498 = projectile.velocity.X * 0.2f; - float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[num500]; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6.5f, 15f); + int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); + Dust dust = Main.dust[dusty]; dust.noGravity = true; - dust.position.X -= num498; - dust.position.Y -= num499; + dust.position.X -= projectile.velocity.X * 0.2f; + dust.position.Y += projectile.velocity.Y * 0.2f; } } } diff --git a/Projectiles/Healing/ManaOverloaderHealOrb.cs b/Projectiles/Healing/ManaOverloaderHealOrb.cs index beceb093f6..4a6a1773a8 100644 --- a/Projectiles/Healing/ManaOverloaderHealOrb.cs +++ b/Projectiles/Healing/ManaOverloaderHealOrb.cs @@ -24,43 +24,12 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = (int)projectile.ai[0]; - float num488 = 3f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt(num489 * num489 + num490 * num490); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + Main.player[num487].width && projectile.position.X + projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + Main.player[num487].height && projectile.position.Y + projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - float num498 = projectile.velocity.X * 0.2f; - float num499 = -(projectile.velocity.Y * 0.2f); - int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1.3f); - Main.dust[num500].noGravity = true; - Dust expr_154F9_cp_0 = Main.dust[num500]; - expr_154F9_cp_0.position.X -= num498; - Dust expr_15518_cp_0 = Main.dust[num500]; - expr_15518_cp_0.position.Y -= num499; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 3f, 15f); + int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1.3f); + Dust dust = Main.dust[dusty]; + dust.noGravity = true; + dust.position.X -= projectile.velocity.X * 0.2f; + dust.position.Y += projectile.velocity.Y * 0.2f; } } } diff --git a/Projectiles/Healing/PhoenixHeal.cs b/Projectiles/Healing/PhoenixHeal.cs index 2c36dc2da9..d876795420 100644 --- a/Projectiles/Healing/PhoenixHeal.cs +++ b/Projectiles/Healing/PhoenixHeal.cs @@ -25,35 +25,7 @@ namespace CalamityMod.Projectiles.Healing { projectile.velocity.X *= 0.95f; projectile.velocity.Y *= 0.95f; - int num487 = (int)projectile.ai[0]; - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = 10; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - if (Main.player[num487].lifeMagnet && projectile.timeLeft < 360) - { - float num488 = 6f; - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - } + CalamityGlobalProjectile.HealingProjectile(projectile, 10, (int)projectile.ai[0], 6f, 15f, false, 360); float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Healing/RainHeal.cs b/Projectiles/Healing/RainHeal.cs index 35fb70becc..492030d13b 100644 --- a/Projectiles/Healing/RainHeal.cs +++ b/Projectiles/Healing/RainHeal.cs @@ -26,35 +26,8 @@ namespace CalamityMod.Projectiles.Healing { projectile.velocity.X *= 0.985f; projectile.velocity.Y *= 0.985f; - int num487 = projectile.owner; - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = 8; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - if (Main.player[num487].lifeMagnet && projectile.timeLeft < 120) - { - float num488 = 12f; - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - } + CalamityGlobalProjectile.HealingProjectile(projectile, 8, projectile.owner, 12f, 15f, false); + float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); diff --git a/Projectiles/Healing/RoyalHeal.cs b/Projectiles/Healing/RoyalHeal.cs index 5872a3d6f5..a5f7a0fea3 100644 --- a/Projectiles/Healing/RoyalHeal.cs +++ b/Projectiles/Healing/RoyalHeal.cs @@ -22,35 +22,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = (int)projectile.ai[0]; - float num488 = 5.5f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); for (int num493 = 0; num493 < 3; num493++) { float num494 = projectile.velocity.X * 0.334f * (float)num493; diff --git a/Projectiles/Healing/ShinobiHealOrb.cs b/Projectiles/Healing/ShinobiHealOrb.cs index d79d4fba0d..0361dfd5df 100644 --- a/Projectiles/Healing/ShinobiHealOrb.cs +++ b/Projectiles/Healing/ShinobiHealOrb.cs @@ -26,36 +26,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = projectile.owner; - - float num488 = 6f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], projectile.owner, 6f, 15f); for (int num468 = 0; num468 < 3; num468++) { diff --git a/Projectiles/Healing/SilvaOrb.cs b/Projectiles/Healing/SilvaOrb.cs index 30b293bc9f..4da5cec31c 100644 --- a/Projectiles/Healing/SilvaOrb.cs +++ b/Projectiles/Healing/SilvaOrb.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Healing if (projectile.localAI[0] == 0f) { projectile.scale += 0.05f; - if ((double)projectile.scale > 1.2) + if (projectile.scale > 1.2f) { projectile.localAI[0] = 1f; } @@ -36,41 +36,13 @@ namespace CalamityMod.Projectiles.Healing else { projectile.scale -= 0.05f; - if ((double)projectile.scale < 0.8) + if (projectile.scale < 0.8f) { projectile.localAI[0] = 0f; } } - int num487 = (int)projectile.ai[0]; - float num488 = 6f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f); return; } diff --git a/Projectiles/Healing/TerracottaProj.cs b/Projectiles/Healing/TerracottaProj.cs index bae4b5b362..14ae4bc480 100644 --- a/Projectiles/Healing/TerracottaProj.cs +++ b/Projectiles/Healing/TerracottaProj.cs @@ -27,35 +27,7 @@ namespace CalamityMod.Projectiles.Healing projectile.velocity.X *= 0.95f; projectile.velocity.Y *= 0.95f; - int num487 = (int)projectile.ai[0]; - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = 9; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - if (Main.player[num487].lifeMagnet && projectile.timeLeft < 300) - { - float num488 = 8f; - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; - } + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f, false, 300); float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); diff --git a/Projectiles/Healing/TransfusionTrail.cs b/Projectiles/Healing/TransfusionTrail.cs index b8f10e80a9..741959f1e7 100644 --- a/Projectiles/Healing/TransfusionTrail.cs +++ b/Projectiles/Healing/TransfusionTrail.cs @@ -22,35 +22,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = (int)projectile.ai[0]; - float num488 = 6.5f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 9f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 9f + num490) / 16f; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6.5f, 15f); float num494 = projectile.velocity.X * 0.334f; float num495 = -(projectile.velocity.Y * 0.334f); int num496 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 183, 0f, 0f, 100, default, 0.7f); diff --git a/Projectiles/Healing/XerocHealOrb.cs b/Projectiles/Healing/XerocHealOrb.cs index cd41a696c3..5ab79c1a15 100644 --- a/Projectiles/Healing/XerocHealOrb.cs +++ b/Projectiles/Healing/XerocHealOrb.cs @@ -24,35 +24,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - int num487 = (int)projectile.ai[0]; - float num488 = 5.5f; - if (Main.player[num487].lifeMagnet) - num488 *= 1.5f; - - Vector2 vector36 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num489 = Main.player[num487].Center.X - vector36.X; - float num490 = Main.player[num487].Center.Y - vector36.Y; - float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); - if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) - { - if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) - { - int num492 = (int)projectile.ai[1]; - Main.player[num487].HealEffect(num492, false); - Main.player[num487].statLife += num492; - if (Main.player[num487].statLife > Main.player[num487].statLifeMax2) - { - Main.player[num487].statLife = Main.player[num487].statLifeMax2; - } - NetMessage.SendData(66, -1, -1, null, num487, (float)num492, 0f, 0f, 0, 0, 0); - } - projectile.Kill(); - } - num491 = num488 / num491; - num489 *= num491; - num490 *= num491; - projectile.velocity.X = (projectile.velocity.X * 15f + num489) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num490) / 16f; + CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 5.5f, 15f); float num498 = projectile.velocity.X * 0.2f; float num499 = -(projectile.velocity.Y * 0.2f); int num500 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Hybrid/CorpusAvertorClone.cs b/Projectiles/Hybrid/CorpusAvertorClone.cs index 1bd9edd5c9..1210f3270e 100644 --- a/Projectiles/Hybrid/CorpusAvertorClone.cs +++ b/Projectiles/Hybrid/CorpusAvertorClone.cs @@ -85,9 +85,7 @@ namespace CalamityMod.Projectiles.Hybrid if (Main.player[Main.myPlayer].lifeSteal <= 0f) return; - Main.player[Main.myPlayer].lifeSteal -= heal * 1.5f; - int owner = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ProjectileID.VampireHeal, 0, 0f, projectile.owner, (float)owner, heal); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); } public override void OnHitPvp(Player target, int damage, bool crit) @@ -98,9 +96,7 @@ namespace CalamityMod.Projectiles.Hybrid if (Main.player[Main.myPlayer].lifeSteal <= 0f) return; - Main.player[Main.myPlayer].lifeSteal -= heal * 1.5f; - int owner = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ProjectileID.VampireHeal, 0, 0f, projectile.owner, (float)owner, heal); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); } } } diff --git a/Projectiles/Hybrid/CorpusAvertorProj.cs b/Projectiles/Hybrid/CorpusAvertorProj.cs index 0d6d1935cb..4e41dfb165 100644 --- a/Projectiles/Hybrid/CorpusAvertorProj.cs +++ b/Projectiles/Hybrid/CorpusAvertorProj.cs @@ -90,9 +90,7 @@ namespace CalamityMod.Projectiles.Hybrid if (Main.player[Main.myPlayer].lifeSteal <= 0f) return; - Main.player[Main.myPlayer].lifeSteal -= heal * 1.5f; - int owner = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ProjectileID.VampireHeal, 0, 0f, projectile.owner, (float)owner, heal); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); } public override void OnHitPvp(Player target, int damage, bool crit) @@ -103,9 +101,7 @@ namespace CalamityMod.Projectiles.Hybrid if (Main.player[Main.myPlayer].lifeSteal <= 0f) return; - Main.player[Main.myPlayer].lifeSteal -= heal * 1.5f; - int owner = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ProjectileID.VampireHeal, 0, 0f, projectile.owner, (float)owner, heal); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f); } } } diff --git a/Projectiles/Hybrid/EmpyreanKnife.cs b/Projectiles/Hybrid/EmpyreanKnife.cs index 0ccd843fb8..17908efb24 100644 --- a/Projectiles/Hybrid/EmpyreanKnife.cs +++ b/Projectiles/Hybrid/EmpyreanKnife.cs @@ -40,8 +40,8 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.ai[0] >= 75f) { projectile.alpha += 10; - projectile.damage = (int)((double)projectile.damage * 0.95); - projectile.knockBack = (float)(int)((double)projectile.knockBack * 0.95); + projectile.damage = (int)(projectile.damage * 0.95); + projectile.knockBack = projectile.knockBack * 0.95f; if (projectile.alpha >= 255) { projectile.active = false; @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Hybrid } if (projectile.ai[0] < 75f) { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; } else { @@ -100,8 +100,8 @@ namespace CalamityMod.Projectiles.Hybrid { return; } - float num = (float)damage * 0.005f; - if ((int)num == 0) + float healAmt = (float)damage * 0.005f; + if ((int)healAmt == 0) { return; } @@ -109,15 +109,13 @@ namespace CalamityMod.Projectiles.Hybrid { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, 305, 0, 0f, projectile.owner, (float)num2, num); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 1.5f); } public override void OnHitPvp(Player target, int damage, bool crit) { - float num = (float)damage * 0.005f; - if ((int)num == 0) + float healAmt = (float)damage * 0.005f; + if ((int)healAmt == 0) { return; } @@ -125,9 +123,7 @@ namespace CalamityMod.Projectiles.Hybrid { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, 305, 0, 0f, projectile.owner, (float)num2, num); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 1.5f); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/IllustriousKnife.cs b/Projectiles/Hybrid/IllustriousKnife.cs similarity index 81% rename from Projectiles/Rogue/IllustriousKnife.cs rename to Projectiles/Hybrid/IllustriousKnife.cs index 4d27eeea5e..843ec6fe90 100644 --- a/Projectiles/Rogue/IllustriousKnife.cs +++ b/Projectiles/Hybrid/IllustriousKnife.cs @@ -6,7 +6,7 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue +namespace CalamityMod.Projectiles.Hybrid { public class IllustriousKnife : ModProjectile { @@ -69,8 +69,8 @@ namespace CalamityMod.Projectiles.Rogue { return; } - float num = (float)damage * 0.015f; - if ((int)num == 0) + float healAmt = (float)damage * 0.015f; + if ((int)healAmt == 0) { return; } @@ -78,16 +78,14 @@ namespace CalamityMod.Projectiles.Rogue { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1.5f); } public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 600); - float num = (float)damage * 0.015f; - if ((int)num == 0) + float healAmt = (float)damage * 0.015f; + if ((int)healAmt == 0) { return; } @@ -95,9 +93,7 @@ namespace CalamityMod.Projectiles.Rogue { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1.5f); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/IllustriousKnife.png b/Projectiles/Hybrid/IllustriousKnife.png similarity index 100% rename from Projectiles/Rogue/IllustriousKnife.png rename to Projectiles/Hybrid/IllustriousKnife.png diff --git a/Projectiles/Melee/AstralScytheProjectile.cs b/Projectiles/Melee/AstralScytheProjectile.cs index 334ec4205f..01f07ca2dc 100644 --- a/Projectiles/Melee/AstralScytheProjectile.cs +++ b/Projectiles/Melee/AstralScytheProjectile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = 300; projectile.penetrate = 8; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 5; + projectile.localNPCHitCooldown = 7; projectile.tileCollide = false; } diff --git a/Projectiles/Melee/Earth4.cs b/Projectiles/Melee/Earth4.cs index 4be8960038..75586af9c4 100644 --- a/Projectiles/Melee/Earth4.cs +++ b/Projectiles/Melee/Earth4.cs @@ -95,8 +95,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 4); - float num = (float)damage * 0.075f; - if ((int)num == 0) + float healAmt = (float)damage * 0.075f; + if ((int)healAmt == 0) { return; } @@ -104,9 +104,7 @@ namespace CalamityMod.Projectiles.Melee { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1.5f); } } } diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index 3a0999fd64..d863436f56 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, ModContent.ProjectileType(), 0, 0, projectile.owner, 0f, 0f); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], 8, ModContent.ProjectileType(), 1200f, 0f); } } } diff --git a/Projectiles/Melee/Exocomet.cs b/Projectiles/Melee/Exocomet.cs index 77f949596a..6cbfc7d942 100644 --- a/Projectiles/Melee/Exocomet.cs +++ b/Projectiles/Melee/Exocomet.cs @@ -103,8 +103,8 @@ namespace CalamityMod.Projectiles.Melee { return; } - float num = (float)damage * 0.01f; - if ((int)num == 0) + float healAmt = (float)damage * 0.01f; + if ((int)healAmt == 0) { return; } @@ -112,9 +112,7 @@ namespace CalamityMod.Projectiles.Melee { return; } - Main.player[Main.myPlayer].lifeSteal -= num; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1f); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/NebulashFlail.cs b/Projectiles/Melee/NebulashFlail.cs index 47cba7fb60..4e889530fc 100644 --- a/Projectiles/Melee/NebulashFlail.cs +++ b/Projectiles/Melee/NebulashFlail.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; + projectile.localNPCHitCooldown = 3; } public override Color SpecialDrawColor => new Color(255, 200, 0); public override int ExudeDustType => ModContent.DustType(); @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(ModContent.BuffType(), 120); if (projectile.localAI[1] <= 0f && projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, knockback, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage / 2, knockback, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } projectile.localAI[1] = 4f; } diff --git a/Projectiles/Melee/RoyalKnifeMelee.cs b/Projectiles/Melee/RoyalKnifeMelee.cs deleted file mode 100644 index 6b0648ec3b..0000000000 --- a/Projectiles/Melee/RoyalKnifeMelee.cs +++ /dev/null @@ -1,95 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Projectiles.Healing; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class RoyalKnifeMelee : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Knife"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 18; - projectile.height = 18; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.melee = true; - } - - public override void AI() - { - projectile.ai[0] += 1f; - if (projectile.ai[0] >= 240f) - { - projectile.alpha += 4; - projectile.damage = (int)((double)projectile.damage * 0.95); - projectile.knockBack = (float)(int)((double)projectile.knockBack * 0.95); - } - - if (projectile.ai[0] < 240f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - } - else - { - projectile.rotation += 0.5f; - } - - CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 35f, 20f); - - if (Main.rand.NextBool(6)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - - public override void Kill(int timeLeft) - { - for (int num303 = 0; num303 < 3; num303++) - { - int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 0.8f); - Main.dust[num304].noGravity = true; - Main.dust[num304].velocity *= 1.2f; - Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f; - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600); - if (target.type == NPCID.TargetDummy) - { - return; - } - float num = (float)damage * 0.015f; - if ((int)num == 0) - { - return; - } - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } -} diff --git a/Projectiles/Melee/RoyalKnifeMelee.png b/Projectiles/Melee/RoyalKnifeMelee.png deleted file mode 100644 index d8793dd624..0000000000 Binary files a/Projectiles/Melee/RoyalKnifeMelee.png and /dev/null differ diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index af488c6eb4..fd7f0cefa0 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -90,8 +90,8 @@ namespace CalamityMod.Projectiles.Ranged { return; } - float num = (float)damage * 0.05f; - if ((int)num == 0) + float healAmt = (float)damage * 0.05f; + if ((int)healAmt == 0) { return; } @@ -99,9 +99,7 @@ namespace CalamityMod.Projectiles.Ranged { return; } - Main.player[Main.myPlayer].lifeSteal -= num * 1.5f; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1.5f); } } } diff --git a/Projectiles/Rogue/ShinobiBladeProjectile.cs b/Projectiles/Rogue/ShinobiBladeProjectile.cs index 19d008caaa..af1ab201fa 100644 --- a/Projectiles/Rogue/ShinobiBladeProjectile.cs +++ b/Projectiles/Rogue/ShinobiBladeProjectile.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue { if (target.life <= 0) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0, Main.myPlayer, 0, 10); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], 10, ModContent.ProjectileType(), 1200f, 0f); } } @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Rogue { if (target.statLife <= 0) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0, Main.myPlayer, 0, 10); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], 10, ModContent.ProjectileType(), 1200f, 0f); } } diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index bfe0d78b96..5eeb251297 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -90,8 +90,8 @@ namespace CalamityMod.Projectiles.Summon { return; } - float num = (float)damage * 0.25f; - if ((int)num == 0) + float healAmt = (float)damage * 0.25f; + if ((int)healAmt == 0) { return; } @@ -99,9 +99,7 @@ namespace CalamityMod.Projectiles.Summon { return; } - Main.player[Main.myPlayer].lifeSteal -= num; - int num2 = projectile.owner; - Projectile.NewProjectile(target.position.X, target.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num2, num); + CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1f); } } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 7ec060b2b4..4204c4d2f5 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -642,6 +642,16 @@ namespace CalamityMod } } } + + public static int DamageSoftCap(double dmgInput, int cap) + { + int newDamage = (int)(dmgInput); + if (newDamage > cap) + { + newDamage = (int)((dmgInput - cap) * 0.1) + cap; + } + return newDamage; + } #endregion #region Tile Utilities