diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 7ac0fbad50..3bc380a5b5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7896,7 +7896,7 @@ namespace CalamityMod.CalPlayer } if (BossRushEvent.BossRushActive && CalamityConfig.Instance.BossRushImmunityFrameCurse) { - bossRushImmunityFrameCurseTimer = 300 + player.immuneTime; + bossRushImmunityFrameCurseTimer = 180 + player.immuneTime; } if (damage > 25) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c1574da9f3..9f3f598f6f 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -131,7 +131,24 @@ namespace CalamityMod.CalPlayer float shorterSpearCocoonDistance = CalamityWorld.death ? 1000f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; float shorterDistance = aiState == 2f ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; - float maxDistance = (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance; + bool guardianAlive = false; + if (CalamityGlobalNPC.holyBossAttacker != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active) + guardianAlive = true; + } + if (CalamityGlobalNPC.holyBossDefender != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossDefender].active) + guardianAlive = true; + } + if (CalamityGlobalNPC.holyBossHealer != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossHealer].active) + guardianAlive = true; + } + + float maxDistance = guardianAlive ? baseDistance : (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance; float drawDarknessDistance = maxDistance - 400f; float intensityScalar = MathHelper.Lerp(0f, 0.9f, MathHelper.Clamp((x - drawDarknessDistance) / 400f, 0f, 1f)); diff --git a/CalamityConfig.cs b/CalamityConfig.cs index f0b38ccf3d..86eda6b763 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -258,7 +258,7 @@ namespace CalamityMod [Label("Immunity Frame Curse")] [BackgroundColor(192, 54, 64, 192)] [DefaultValue(false)] - [Tooltip("During the Boss Rush, being hit twice within five seconds will cause instant death.\nThis effect ignores revives.")] + [Tooltip("During the Boss Rush, being hit twice within three seconds will cause instant death.\nThis effect ignores revives.")] public bool BossRushImmunityFrameCurse { get; set; } [Label("Xeroc Curse")] diff --git a/CalamityMod.cs b/CalamityMod.cs index cbb470ed1b..464591ab3f 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1342,7 +1342,24 @@ namespace CalamityMod float shorterSpearCocoonDistance = CalamityWorld.death ? 1000f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f; float shorterDistance = aiState == 2f ? shorterFlameCocoonDistance : shorterSpearCocoonDistance; - float maxDistance = (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance; + bool guardianAlive = false; + if (CalamityGlobalNPC.holyBossAttacker != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active) + guardianAlive = true; + } + if (CalamityGlobalNPC.holyBossDefender != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossDefender].active) + guardianAlive = true; + } + if (CalamityGlobalNPC.holyBossHealer != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossHealer].active) + guardianAlive = true; + } + + float maxDistance = guardianAlive ? baseDistance : (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance; float drawDarknessDistance = maxDistance - 400f; float intensityScalar = MathHelper.Lerp(0f, 0.9f, MathHelper.Clamp((x - drawDarknessDistance) / 400f, 0f, 1f)); scale -= intensityScalar; diff --git a/Items/Accessories/ElementalQuiver.cs b/Items/Accessories/ElementalQuiver.cs index 436a162c75..be8033ab9b 100644 --- a/Items/Accessories/ElementalQuiver.cs +++ b/Items/Accessories/ElementalQuiver.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Elemental Quiver"); Tooltip.SetDefault("Ranged projectiles have a chance to split\n" + - "10% increased ranged damage, 5% increased ranged critical strike chance, and 20% reduced ammo usage\n" + + "15% increased ranged damage, 5% increased ranged critical strike chance, and 20% reduced ammo usage\n" + "5 increased defense, 2 increased life regen, and 15% increased pick speed\n" + "Greatly increases arrow speed and grants a 20% chance to not consume arrows"); } @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.eQuiver = true; - player.rangedDamage += 0.1f; + player.rangedDamage += 0.15f; player.rangedCrit += 5; player.ammoCost80 = true; player.lifeRegen += 2; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index de7826354c..4ee8b61c1f 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -261,16 +261,16 @@ namespace CalamityMod.Items if (player.whoAmI == Main.myPlayer) { if (item.melee) - Projectile.NewProjectile(position, velocity * 0.5f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.4, 60), 0f, player.whoAmI); + Projectile.NewProjectile(position, velocity * 0.5f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.6, 60), 0f, player.whoAmI); else if (rogue) - Projectile.NewProjectile(position, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.35, 50), 0f, player.whoAmI); + Projectile.NewProjectile(position, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.5, 50), 0f, player.whoAmI); else if (item.ranged) - Projectile.NewProjectile(position, velocity * 1.5f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.275, 40), 0f, player.whoAmI); + Projectile.NewProjectile(position, velocity * 1.5f, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.4, 40), 0f, player.whoAmI); else if (item.magic) - Projectile.NewProjectile(position, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.525, 80), 0f, player.whoAmI); + Projectile.NewProjectile(position, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(newDamage * 0.8, 80), 0f, player.whoAmI); else if (item.summon && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI); diff --git a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs index a551b39db6..00c8889fbe 100644 --- a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs +++ b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = item.Calamity(); - item.damage = 67; + item.damage = 80; modItem.rogue = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs index 961fc9a277..a55146abb1 100644 --- a/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs +++ b/Items/Weapons/DraedonsArsenal/GalvanizingGlaive.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 56; item.height = 52; - item.damage = 84; + item.damage = 100; item.noMelee = true; item.noUseGraphic = true; item.channel = true; @@ -56,6 +56,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, swingOffset); return false; } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs index f25b19912e..780a838702 100644 --- a/Items/Weapons/DraedonsArsenal/GaussDagger.cs +++ b/Items/Weapons/DraedonsArsenal/GaussDagger.cs @@ -24,10 +24,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.melee = true; item.width = 26; item.height = 26; + item.scale = 1.5f; item.useTime = 24; item.useAnimation = 24; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTurn = false; + item.useTurn = true; item.knockBack = 7f; item.value = CalamityGlobalItem.Rarity3BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs index a953976c33..ff9b51e329 100644 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ b/Items/Weapons/DraedonsArsenal/GaussPistol.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.height = 22; item.magic = true; item.mana = 6; - item.damage = 130; + item.damage = 110; item.knockBack = 11f; item.useTime = item.useAnimation = 20; item.autoReuse = true; diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index 1b7b3b1ecc..3a40a34e13 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 22; item.height = 28; - item.damage = 8572; + item.damage = 9572; item.noMelee = true; item.noUseGraphic = true; item.consumable = true; diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index 1fbe18dac1..a988bf5811 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class PulseRifle : ModItem { - private int BaseDamage = 6560; + private int BaseDamage = 8560; public override void SetStaticDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index f4bdd3859a..1cb501276d 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal CalamityGlobalItem modItem = item.Calamity(); item.shootSpeed = 10f; - item.damage = 40; + item.damage = 55; item.mana = 12; item.width = 38; item.height = 24; diff --git a/Items/Weapons/DraedonsArsenal/Taser.cs b/Items/Weapons/DraedonsArsenal/Taser.cs index fe5560b622..19f7a9c04a 100644 --- a/Items/Weapons/DraedonsArsenal/Taser.cs +++ b/Items/Weapons/DraedonsArsenal/Taser.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 50; item.height = 26; item.ranged = true; - item.damage = 28; + item.damage = 22; item.knockBack = 0f; item.useTime = item.useAnimation = 28; item.autoReuse = true; diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 47125edc7a..4943771a4a 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class TeslaCannon : ModItem { - private int BaseDamage = 10000; + private int BaseDamage = 15000; public override void SetStaticDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/WavePounder.cs b/Items/Weapons/DraedonsArsenal/WavePounder.cs index d1084e1500..17a57f20e0 100644 --- a/Items/Weapons/DraedonsArsenal/WavePounder.cs +++ b/Items/Weapons/DraedonsArsenal/WavePounder.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = item.Calamity(); - item.damage = 34; + item.damage = 102; modItem.rogue = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Magic/ShadowdropStaff.cs b/Items/Weapons/Magic/ShadowdropStaff.cs index 296c86aa69..d229784ee4 100644 --- a/Items/Weapons/Magic/ShadowdropStaff.cs +++ b/Items/Weapons/Magic/ShadowdropStaff.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Magic num80 = num72 / num80; } - int num107 = 10; + int num107 = 3; for (int num108 = 0; num108 < num107; num108++) { vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); @@ -95,8 +95,8 @@ namespace CalamityMod.Items.Weapons.Magic num80 = num72 / num80; num78 *= num80; num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-120, 121) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-120, 121) * 0.02f; + float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); } return false; diff --git a/Items/Weapons/Melee/AncientCrusher.cs b/Items/Weapons/Melee/AncientCrusher.cs index 041305787e..6c95b91503 100644 --- a/Items/Weapons/Melee/AncientCrusher.cs +++ b/Items/Weapons/Melee/AncientCrusher.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 62; item.height = 62; - item.scale = 1.5f; + item.scale = 2f; item.damage = 55; item.melee = true; item.useAnimation = 30; diff --git a/Items/Weapons/Melee/AstralBlade.cs b/Items/Weapons/Melee/AstralBlade.cs index f2da69941f..8eb06354a1 100644 --- a/Items/Weapons/Melee/AstralBlade.cs +++ b/Items/Weapons/Melee/AstralBlade.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 95; + item.damage = 110; item.crit += 25; item.melee = true; item.width = 80; diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index b3f400c4b6..50af12bac7 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -26,12 +26,14 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 19; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 56; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; } - } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/DiseasedPike.cs b/Items/Weapons/Melee/DiseasedPike.cs index 2bf14a10a8..12fa1f55a6 100644 --- a/Items/Weapons/Melee/DiseasedPike.cs +++ b/Items/Weapons/Melee/DiseasedPike.cs @@ -34,16 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 10f; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/EarthenPike.cs b/Items/Weapons/Melee/EarthenPike.cs index c805164c20..b8063b16c9 100644 --- a/Items/Weapons/Melee/EarthenPike.cs +++ b/Items/Weapons/Melee/EarthenPike.cs @@ -27,12 +27,14 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 25; item.knockBack = 7f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 60; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 6f; + item.shootSpeed = 8f; } - } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/ExsanguinationLance.cs b/Items/Weapons/Melee/ExsanguinationLance.cs index e0bd75f771..1384db9587 100644 --- a/Items/Weapons/Melee/ExsanguinationLance.cs +++ b/Items/Weapons/Melee/ExsanguinationLance.cs @@ -35,19 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 8f; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); diff --git a/Items/Weapons/Melee/FulgurationHalberd.cs b/Items/Weapons/Melee/FulgurationHalberd.cs index dec29f09b8..f17f2c2418 100644 --- a/Items/Weapons/Melee/FulgurationHalberd.cs +++ b/Items/Weapons/Melee/FulgurationHalberd.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 60; item.height = 64; + item.scale = 1.5f; item.damage = 53; item.melee = true; item.useAnimation = 22; @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; - item.shootSpeed = 6f; + item.shootSpeed = 8f; } public override bool AltFunctionUse(Player player) @@ -46,21 +47,20 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; item.useStyle = ItemUseStyleID.HoldingOut; - item.autoReuse = false; item.shoot = ModContent.ProjectileType(); - } + return player.ownedProjectileCounts[item.shoot] <= 0; + } else { item.noMelee = false; item.noUseGraphic = false; item.useStyle = ItemUseStyleID.SwingThrow; - item.autoReuse = true; item.shoot = ProjectileID.None; - } - return base.CanUseItem(player); + return base.CanUseItem(player); + } } - public override bool Shoot(Player player, ref 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/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index 4e275e09ff..1dceada2b2 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -36,16 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.maxProjectiles; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/GoldplumeSpear.cs b/Items/Weapons/Melee/GoldplumeSpear.cs index 9a521df477..216ca2b0bc 100644 --- a/Items/Weapons/Melee/GoldplumeSpear.cs +++ b/Items/Weapons/Melee/GoldplumeSpear.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 23; item.knockBack = 5.75f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 54; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; @@ -35,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 5f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); diff --git a/Items/Weapons/Melee/HellionFlowerSpear.cs b/Items/Weapons/Melee/HellionFlowerSpear.cs index bafef201d8..07f52348d2 100644 --- a/Items/Weapons/Melee/HellionFlowerSpear.cs +++ b/Items/Weapons/Melee/HellionFlowerSpear.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 20; item.knockBack = 7.5f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 64; item.value = Item.buyPrice(0, 60, 0, 0); item.rare = 7; @@ -36,7 +36,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 8f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); diff --git a/Items/Weapons/Melee/InsidiousImpaler.cs b/Items/Weapons/Melee/InsidiousImpaler.cs index 1c6669f6f7..c9e30784dd 100644 --- a/Items/Weapons/Melee/InsidiousImpaler.cs +++ b/Items/Weapons/Melee/InsidiousImpaler.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 66; - item.damage = 390; + item.damage = 350; item.melee = true; item.noMelee = true; item.useTurn = true; @@ -35,16 +35,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 5f; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.maxProjectiles; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } } diff --git a/Items/Weapons/Melee/MajesticGuard.cs b/Items/Weapons/Melee/MajesticGuard.cs index 71889588be..097db304c8 100644 --- a/Items/Weapons/Melee/MajesticGuard.cs +++ b/Items/Weapons/Melee/MajesticGuard.cs @@ -16,7 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 98; - item.damage = 60; + item.height = 98; + item.scale = 1.5f; + item.damage = 60; item.melee = true; item.useAnimation = 22; item.useStyle = ItemUseStyleID.SwingThrow; @@ -25,7 +27,6 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 7.5f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 98; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; } diff --git a/Items/Weapons/Melee/MarniteSpear.cs b/Items/Weapons/Melee/MarniteSpear.cs index 830da229cf..a239132583 100644 --- a/Items/Weapons/Melee/MarniteSpear.cs +++ b/Items/Weapons/Melee/MarniteSpear.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 21; item.knockBack = 5.25f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 50; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; @@ -33,7 +33,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 5f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddRecipeGroup("AnyGoldBar", 5); diff --git a/Items/Weapons/Melee/Nadir.cs b/Items/Weapons/Melee/Nadir.cs index dda2c9cee2..70e9c9d161 100644 --- a/Items/Weapons/Melee/Nadir.cs +++ b/Items/Weapons/Melee/Nadir.cs @@ -43,15 +43,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = ShootSpeed; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.projectile.Length; ++i) - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - return false; - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index 03528cd944..3887697449 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 20; item.knockBack = 6.25f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 42; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; @@ -35,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 6f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); diff --git a/Items/Weapons/Melee/SpatialLance.cs b/Items/Weapons/Melee/SpatialLance.cs index ac33398c35..3af7fa4015 100644 --- a/Items/Weapons/Melee/SpatialLance.cs +++ b/Items/Weapons/Melee/SpatialLance.cs @@ -37,19 +37,9 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); diff --git a/Items/Weapons/Melee/StarnightLance.cs b/Items/Weapons/Melee/StarnightLance.cs index 0d710c75aa..52b654659f 100644 --- a/Items/Weapons/Melee/StarnightLance.cs +++ b/Items/Weapons/Melee/StarnightLance.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 23; item.knockBack = 6; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 72; item.value = Item.buyPrice(0, 36, 0, 0); item.rare = 5; @@ -35,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 6f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); diff --git a/Items/Weapons/Melee/StreamGouge.cs b/Items/Weapons/Melee/StreamGouge.cs index 4ab2194d10..e35d312743 100644 --- a/Items/Weapons/Melee/StreamGouge.cs +++ b/Items/Weapons/Melee/StreamGouge.cs @@ -45,19 +45,9 @@ namespace CalamityMod.Items.Weapons.Melee spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/StreamGougeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 14); diff --git a/Items/Weapons/Melee/TerraLance.cs b/Items/Weapons/Melee/TerraLance.cs index 7355f241e1..0966f84546 100644 --- a/Items/Weapons/Melee/TerraLance.cs +++ b/Items/Weapons/Melee/TerraLance.cs @@ -35,19 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 11f; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; - public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.ChlorophytePartisan); diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs index ed8d836c01..d96261fcb8 100644 --- a/Items/Weapons/Melee/UltimusCleaver.cs +++ b/Items/Weapons/Melee/UltimusCleaver.cs @@ -12,16 +12,18 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Ultimus Cleaver"); - Tooltip.SetDefault("Launches damaging homing sparks"); + Tooltip.SetDefault("Launches damaging homing sparks and explodes on enemy hits"); } public override void SetDefaults() { item.damage = 130; item.melee = true; + item.useTurn = true; item.rare = 8; item.width = 72; item.height = 62; + item.scale = 1.5f; item.useTime = 20; item.useAnimation = 20; item.useStyle = ItemUseStyleID.SwingThrow; @@ -31,7 +33,50 @@ namespace CalamityMod.Items.Weapons.Melee item.UseSound = SoundID.Item1; } - public override void MeleeEffects(Player player, Rectangle hitbox) + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 600); + player.ApplyDamageToNPC(target, (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), 0f, 0, false); + float num50 = 1.7f; + float num51 = 0.8f; + float num52 = 2f; + Vector2 value3 = (target.rotation - 1.57079637f).ToRotationVector2(); + Vector2 value4 = value3 * target.velocity.Length(); + Main.PlaySound(SoundID.Item14, target.position); + int num3; + for (int num53 = 0; num53 < 40; num53 = num3 + 1) + { + int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 200, default, num50); + Dust dust = Main.dust[num54]; + dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; + dust.noGravity = true; + dust.velocity.Y -= 6f; + dust.velocity *= 3f; + dust.velocity += value4 * Main.rand.NextFloat(); + num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 100, default, num51); + dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; + dust.velocity.Y -= 6f; + dust.velocity *= 2f; + dust.noGravity = true; + dust.fadeIn = 1f; + dust.color = Color.Crimson * 0.5f; + dust.velocity += value4 * Main.rand.NextFloat(); + num3 = num53; + } + for (int num55 = 0; num55 < 20; num55 = num3 + 1) + { + int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 0, default, num52); + Dust dust = Main.dust[num56]; + dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; + dust.noGravity = true; + dust.velocity.Y -= 6f; + dust.velocity *= 0.5f; + dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat()); + num3 = num55; + } + } + + public override void MeleeEffects(Player player, Rectangle hitbox) { if (player.whoAmI == Main.myPlayer) { @@ -97,7 +142,7 @@ namespace CalamityMod.Items.Weapons.Melee num342 *= (float)player.direction; num341 *= player.gravDir; Projectile.NewProjectile((float)(hitbox.X + hitbox.Width / 2) + num342, (float)(hitbox.Y + hitbox.Height / 2) + num341, - (float)player.direction * num340, num339 * player.gravDir, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.1f), 0f, player.whoAmI, 0f, 0f); + (float)player.direction * num340, num339 * player.gravDir, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage() * 0.1), 0f, player.whoAmI, 0f, 0f); } } } diff --git a/Items/Weapons/Melee/UrchinSpear.cs b/Items/Weapons/Melee/UrchinSpear.cs index e251016645..091644aa9c 100644 --- a/Items/Weapons/Melee/UrchinSpear.cs +++ b/Items/Weapons/Melee/UrchinSpear.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee item.useTime = 25; item.knockBack = 5f; item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.autoReuse = true; item.height = 56; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = 2; @@ -35,7 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 4f; } - public override void AddRecipes() + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 4); diff --git a/Items/Weapons/Melee/YateveoBloom.cs b/Items/Weapons/Melee/YateveoBloom.cs index 5488338b04..0180c1efa4 100644 --- a/Items/Weapons/Melee/YateveoBloom.cs +++ b/Items/Weapons/Melee/YateveoBloom.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.melee = true; item.noMelee = true; item.channel = true; - item.autoReuse = false; + item.autoReuse = true; item.useTurn = true; item.useStyle = ItemUseStyleID.HoldingOut; @@ -58,19 +58,22 @@ namespace CalamityMod.Items.Weapons.Melee { item.damage = 20; item.channel = false; + item.autoReuse = true; item.useAnimation = 33; item.useTime = 33; item.shootSpeed = 4.5f; - } + return player.ownedProjectileCounts[item.shoot] <= 0; + } else { item.damage = BaseDamage; item.channel = true; + item.autoReuse = false; item.useAnimation = 22; item.useTime = 22; item.shootSpeed = ShootSpeed; - } - return base.CanUseItem(player); + return base.CanUseItem(player); + } } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Ranged/ArterialAssault.cs b/Items/Weapons/Ranged/ArterialAssault.cs index 9187796a49..48ecdba3e5 100644 --- a/Items/Weapons/Ranged/ArterialAssault.cs +++ b/Items/Weapons/Ranged/ArterialAssault.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 232; + item.damage = 200; item.ranged = true; item.width = 44; item.height = 100; diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index 0b693d6a52..90e3c091de 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -52,8 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged float shardKB = 2f * knockBack; float shardVelocityX = (speedX + (float)Main.rand.Next(-25, 26) * 0.05f) * 0.9f; float shardVelocityY = (speedY + (float)Main.rand.Next(-25, 26) * 0.05f) * 0.9f; - int onyx = Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); - Main.projectile[onyx].timeLeft -= 20; + Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); // Fire three symmetric pairs of bullets alongside it Vector2 baseVelocity = new Vector2(speedX, speedY); diff --git a/Items/Weapons/Ranged/TheEmpyrean.cs b/Items/Weapons/Ranged/TheEmpyrean.cs index 9581ff3ffa..a6a6fcf338 100644 --- a/Items/Weapons/Ranged/TheEmpyrean.cs +++ b/Items/Weapons/Ranged/TheEmpyrean.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.rare = 9; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 7.5f; + item.shootSpeed = 9f; item.useAmmo = AmmoID.Gel; } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index a13c5ff2a4..e1f4ab3883 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -4669,11 +4669,11 @@ namespace CalamityMod.NPCs if (BossRushEvent.BossRushActive) { - idlePhaseTimer = 35; - idlePhaseAcceleration *= 1.1f; - idlePhaseVelocity *= 1.15f; + idlePhaseTimer = 45; + idlePhaseAcceleration *= 1.06f; + idlePhaseVelocity *= 1.12f; chargeTime -= 3; - chargeVelocity *= 1.25f; + chargeVelocity *= 1.15f; } if (calamityGlobalNPC.newAI[1] == 1f) diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index dd1d483335..d4f1ac75d2 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -4610,7 +4610,7 @@ namespace CalamityMod.NPCs if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { // Laser speed - float projectileSpeed = npc.ai[2] == 0f ? 2f : 4f; + float projectileSpeed = npc.ai[2] == 0f ? 4f : 2f; projectileSpeed += enrageScale; if (phase2) projectileSpeed += 0.25f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index bf77740471..ed37f1e70a 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -338,6 +338,13 @@ namespace CalamityMod.NPCs NPCID.TheDestroyerTail }; + public static List DarkEnergyIDs = new List + { + NPCType(), + NPCType(), + NPCType() + }; + public static List StormWeaverIDs = new List { NPCType(), @@ -838,7 +845,7 @@ namespace CalamityMod.NPCs npc.buffImmune[BuffID.Slow] = true; } - if (DestroyerIDs.Contains(npc.type) || (EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC || npc.type == NPCID.SpikeBall || npc.type == NPCID.BlazingWheel) + if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.SkeletronHead || (EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC || npc.type == NPCID.SpikeBall || npc.type == NPCID.BlazingWheel) { for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -3051,21 +3058,6 @@ namespace CalamityMod.NPCs GrenadeResist(projectile, ref damage); PierceResistGlobal(projectile, ref damage); - // Old resists - /*if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.1); - } - else if (projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.2); - } - else if (projectile.type == player.beeType() || projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.4); - }*/ - - // New resists if (ProjectileID.Sets.StardustDragon[projectile.type] || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.25); @@ -3083,7 +3075,7 @@ namespace CalamityMod.NPCs damage = (int)(damage * 0.75); } } - else if (CosmicGuardianIDs.Contains(npc.type)) + else if (CosmicGuardianIDs.Contains(npc.type) || DarkEnergyIDs.Contains(npc.type)) { GrenadeResist(projectile, ref damage); PierceResistGlobal(projectile, ref damage); @@ -3111,6 +3103,10 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.5); } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.4); + } else if (ProjectileID.Sets.StardustDragon[projectile.type]) { damage = (int)(damage * 0.1); @@ -3129,6 +3125,10 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.5); } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.45); + } else if (projectile.type == ProjectileType()) { damage = (int)(damage * 0.38); @@ -3147,6 +3147,10 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.9); } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.75); + } if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { damage = (int)(damage * 0.5); @@ -4337,7 +4341,7 @@ namespace CalamityMod.NPCs } else if (DestroyerIDs.Contains(npc.type)) { - if (drawColor != Color.Black && ((newAI[3] >= 900f && npc.life / (float)npc.lifeMax < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f))) + if (drawColor != Color.Black && npc.ai[2] == 0f && ((newAI[3] >= 900f && npc.life / (float)npc.lifeMax < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f))) { Vector2 halfSize = npc.frame.Size() / 2; SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index a59d898176..4311df7117 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -300,15 +300,6 @@ namespace CalamityMod.NPCs.CeaselessVoid return CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active; } - public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) - { - if (CalamityWorld.DoGSecondStageCountdown <= 0 || !CalamityWorld.downedSentinel1) - { - if (projectile.type == ModContent.ProjectileType()) - damage = (int)(damage * 0.9); - } - } - public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.VortexDebuff, 20, true); diff --git a/NPCs/CeaselessVoid/DarkEnergy2.cs b/NPCs/CeaselessVoid/DarkEnergy2.cs index bb92fd8049..7a719c6f4f 100644 --- a/NPCs/CeaselessVoid/DarkEnergy2.cs +++ b/NPCs/CeaselessVoid/DarkEnergy2.cs @@ -260,15 +260,6 @@ namespace CalamityMod.NPCs.CeaselessVoid return CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active; } - public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) - { - if (CalamityWorld.DoGSecondStageCountdown <= 0 || !CalamityWorld.downedSentinel1) - { - if (projectile.type == ModContent.ProjectileType()) - damage = (int)(damage * 0.9); - } - } - public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.VortexDebuff, 20, true); diff --git a/NPCs/CeaselessVoid/DarkEnergy3.cs b/NPCs/CeaselessVoid/DarkEnergy3.cs index 3bfe0ba731..ef028c4376 100644 --- a/NPCs/CeaselessVoid/DarkEnergy3.cs +++ b/NPCs/CeaselessVoid/DarkEnergy3.cs @@ -288,15 +288,6 @@ namespace CalamityMod.NPCs.CeaselessVoid return CalamityGlobalNPC.voidBoss < 0 || !Main.npc[CalamityGlobalNPC.voidBoss].active; } - public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) - { - if (CalamityWorld.DoGSecondStageCountdown <= 0 || !CalamityWorld.downedSentinel1) - { - if (projectile.type == ModContent.ProjectileType()) - damage = (int)(damage * 0.9); - } - } - public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.VortexDebuff, 20, true); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 53c2008df0..102e2903a3 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -694,7 +694,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (bulletHellCounter2 % 30 == 0) //projectiles that move in wave pattern { - int random = Main.rand.Next(-1000, 1001); + int random = Main.rand.Next(-500, 501); Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, ModContent.ProjectileType(), waveDamage, 0f, Main.myPlayer, 0f, 0f); } diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 865fbb0d8a..71b91bf72a 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { npc.ai[1] += 1f; } - if (npc.ai[1] >= 30f) + if (npc.ai[1] >= 45f) { npc.ai[1] = 0f; Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneHellblastSound"), npc.Center); diff --git a/Projectiles/Boss/DestroyerCursedLaser.cs b/Projectiles/Boss/DestroyerCursedLaser.cs index e83a33b84f..415062837d 100644 --- a/Projectiles/Boss/DestroyerCursedLaser.cs +++ b/Projectiles/Boss/DestroyerCursedLaser.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[1] = 1f; } - if (projectile.velocity.Length() < 14f) + if (projectile.velocity.Length() < 12f) { projectile.velocity *= 1.0025f; } diff --git a/Projectiles/Boss/DestroyerElectricLaser.cs b/Projectiles/Boss/DestroyerElectricLaser.cs index 9957185797..6949be76df 100644 --- a/Projectiles/Boss/DestroyerElectricLaser.cs +++ b/Projectiles/Boss/DestroyerElectricLaser.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); projectile.localAI[1] = 1f; } - if (projectile.velocity.Length() < 14f) + if (projectile.velocity.Length() < 12f) { projectile.velocity *= 1.0025f; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 48454e7014..d7e2d0aeb0 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -219,7 +219,7 @@ namespace CalamityMod.Projectiles projectile.localAI[1] = 1f; } - if (projectile.velocity.Length() < 14f) + if (projectile.velocity.Length() < 12f) projectile.velocity *= 1.0025f; return false; diff --git a/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs b/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs index 75d07d8d35..7c5807d6af 100644 --- a/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs +++ b/Projectiles/DraedonsArsenal/FrequencyManipulatorProjectile.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal set => projectile.ai[0] = value; } public const int TotalSpins = 2; - public const float SpinTime = 60f; + public const float SpinTime = 30f; public override void SetStaticDefaults() { DisplayName.SetDefault("Frequency Manipulator"); diff --git a/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs b/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs index a3b25915a7..ba7f9217d7 100644 --- a/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs +++ b/Projectiles/DraedonsArsenal/GalvanizingGlaiveProjectile.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.ownerHitCheck = true; projectile.hide = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; + projectile.localNPCHitCooldown = 6; projectile.alpha = 255; } diff --git a/Projectiles/DraedonsArsenal/GaussPistolShot.cs b/Projectiles/DraedonsArsenal/GaussPistolShot.cs index 06ddbb9a08..6b40c900fc 100644 --- a/Projectiles/DraedonsArsenal/GaussPistolShot.cs +++ b/Projectiles/DraedonsArsenal/GaussPistolShot.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public const float MinEnergyParticleSpeed = 0.25f; public const float MaxEnergyParticleSpeed = 4f; public const float EnergyChargeRadiusRatio = 1.45f; - public const float ChargeTime = 60f; + public const float ChargeTime = 30f; public override void SetStaticDefaults() { DisplayName.SetDefault("Gauss Shot"); diff --git a/Projectiles/DraedonsArsenal/GaussRifleBlast.cs b/Projectiles/DraedonsArsenal/GaussRifleBlast.cs index 063519ea10..1854311c52 100644 --- a/Projectiles/DraedonsArsenal/GaussRifleBlast.cs +++ b/Projectiles/DraedonsArsenal/GaussRifleBlast.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Dust dust = Dust.NewDustPerfect(projectile.Center, 263); dust.velocity = angle.ToRotationVector2().RotatedByRandom(0.25f) * Main.rand.NextFloat(6f, 8f); dust.noGravity = true; - dust.scale = 2.1f; + dust.scale = 1.6f; } } // Ring dust. @@ -54,10 +54,11 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Dust dust = Dust.NewDustPerfect(projectile.Center + angle.ToRotationVector2() * radius, 226); dust.velocity = Vector2.Zero; dust.noGravity = true; - dust.scale = 2f; + dust.scale = 1.5f; } } } + public override void Kill(int timeLeft) { if (Main.myPlayer == projectile.owner) diff --git a/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs b/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs index fa749b237d..6e5a7acee8 100644 --- a/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs +++ b/Projectiles/DraedonsArsenal/GaussRifleExplosion.cs @@ -22,8 +22,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.width = projectile.height = 500; projectile.friendly = true; projectile.ranged = true; - projectile.penetrate = 1; - projectile.timeLeft = 60; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 40; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; } @@ -41,7 +42,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal dust.velocity = dust.velocity.RotatedByRandom(0.4f); dust.velocity = dust.velocity.RotatedBy(Time / 60f * MathHelper.ToRadians(720f)); dust.velocity *= Main.rand.NextFloat(20f, 50f); - dust.scale = Main.rand.NextFloat(1.7f, 2.1f); + dust.scale = Main.rand.NextFloat(1.2f, 1.6f); dust.noGravity = true; } } diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index b19e22b415..7e3f51eeb4 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -29,6 +29,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.melee = true; projectile.scale = 1.1f; } + public override void AI() { projectile.timeLeft = 60; @@ -112,6 +113,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.position -= projectile.velocity.ToRotation().ToRotationVector2() * 8f; projectile.velocity.X *= Main.rand.NextFloat(0.97f, 1.03f); } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt"), target.Center); @@ -139,6 +141,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public bool TryToSuperchargeNPC(NPC npc) { // Prevent supercharging an enemy twice. @@ -154,7 +157,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.NewProjectileDirect(npc.Center, Vector2.Zero, ModContent.ProjectileType(), - (int)(projectile.damage * 0.35), + (int)(projectile.damage * 0.8), 0f, projectile.owner, 0f, diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index ebdccbf200..0654a43412 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -12,8 +12,10 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => projectile.ai[0]; set => projectile.ai[0] = value; } + public const float FallAcceleration = 0.15f; public const float MaxFallSpeed = 12f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Plasma Grenade"); @@ -54,7 +56,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void Kill(int timeLeft) { - if (projectile.Calamity().stealthStrike) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaGrenadeExplosion"), (int)projectile.position.X, (int)projectile.position.Y); + if (projectile.Calamity().stealthStrike) { if (Main.myPlayer == projectile.owner) { diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index 68d31b2395..b9800f1a88 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.minion = true; projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 24; + projectile.localNPCHitCooldown = 12; } public override void AI() @@ -70,6 +70,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } Time++; } + public void Initialize(Player player) { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); @@ -82,6 +83,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal dust.noGravity = true; } } + // While this projectile cannot attack, the projectiles it shoots derive from the damage. public void AdjustDamage(Player player) { @@ -93,6 +95,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.damage = trueDamage; } } + public void GrantBuffs(Player player) { bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); @@ -109,6 +112,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public void PlayerMovement(Player player) { Vector2 destination = player.Center + Vector2.UnitY.RotatedBy(Time / 16f + AngularOffset + (!North).ToInt() * MathHelper.Pi) * 180f; @@ -116,6 +120,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * 10f; projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } + public void NPCMovement(NPC npc) { for (int i = 0; i < Main.projectile.Length; i++) @@ -150,6 +155,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.rotation = projectile.AngleTo(npc.Center) + MathHelper.PiOver2; } } + public void RepelMovement() { // This does not incorporate attraction on purpose. Doing so causes the minions to very easily become distracted. @@ -173,6 +179,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, 1, 2); diff --git a/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs b/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs index d8209e7b8f..3e153fb70a 100644 --- a/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs +++ b/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs @@ -56,6 +56,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 4; projectile.tileCollide = true; + projectile.extraUpdates = 1; projectile.Calamity().hasInorganicEnemyHitBoost = true; projectile.Calamity().inorganicEnemyHitBoost = 0.003f; } diff --git a/Projectiles/DraedonsArsenal/PulseRifleShot.cs b/Projectiles/DraedonsArsenal/PulseRifleShot.cs index f070fcf5ee..2a797e3627 100644 --- a/Projectiles/DraedonsArsenal/PulseRifleShot.cs +++ b/Projectiles/DraedonsArsenal/PulseRifleShot.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (alreadyTargetedNPCType != Main.npc[i].whoAmI && projectile.Center.ManhattanDistance(Main.npc[i].Center) < 600f) { - Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(Main.npc[i].Center) * 2f, projectile.type, projectile.damage / 2, 0f, projectile.owner, target.whoAmI, projectile.ai[1] + 1f); + Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(Main.npc[i].Center) * 5f, projectile.type, projectile.damage / 2, 0f, projectile.owner, Main.npc[i].whoAmI, projectile.ai[1] + 1f); break; } } @@ -110,9 +110,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (!target.boss) { if (target.Inorganic()) - { damage += target.lifeMax / 250; - } } } diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index 2606621cc6..b65237fe32 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -13,13 +13,16 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public bool SufferingFromSeparationAnxiety = false; public Vector2 OldCenter; public Vector2 Destination; + public float Time { get => projectile.ai[0]; set => projectile.ai[0] = value; } + public float EyeOutwardness = 1f; public float EyeRotation = 0f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Snake Eyes"); @@ -89,7 +92,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } NPCMovement(potentialTarget); } - if (!SufferingFromSeparationAnxiety && projectile.Distance(player.Center) > (potentialTarget is null ? 360f : 1500f)) + if (!SufferingFromSeparationAnxiety && projectile.Distance(player.Center) > (potentialTarget is null ? 360f : 1800f)) { SufferingFromSeparationAnxiety = true; projectile.netUpdate = true; @@ -105,6 +108,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } Time++; } + public void Initialize(Player player) { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); @@ -118,6 +122,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal dust.noGravity = true; } } + // While this projectile cannot attack, the projectiles it shoots derive from the damage. public void AdjustDamage(Player player) { @@ -129,6 +134,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.damage = trueDamage; } } + public void GrantBuffs(Player player) { bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); @@ -145,6 +151,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public void PlayerMovement(Player player) { projectile.velocity = Vector2.Zero; @@ -170,6 +177,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 0f, 0.15f); } + public void NPCMovement(NPC npc) { projectile.velocity = Vector2.Zero; @@ -210,6 +218,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + projectile.Size * 0.5f) * offsetMultiplier, Time % 20f / 20f); } } + public void GenerateAfterimageDust() { for (int i = 1; i < projectile.oldPos.Length; i++) @@ -238,7 +247,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + public override bool CanDamage() => false; + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, Color.White, 0, ProjectileID.Sets.TrailCacheLength[projectile.type]); diff --git a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs index 76e76f03c7..73b122ed85 100644 --- a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs +++ b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs @@ -16,11 +16,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public float AcidShootTimer = 0f; public float AcidShootCooldown = 0f; public float FallThroughYPoint = 0f; + public bool ReleasingAcid { get => projectile.ai[0] != 0f; set => projectile.ai[0] = value.ToInt(); } + public override void SetStaticDefaults() { DisplayName.SetDefault("Pet Froge"); @@ -49,6 +51,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal writer.Write(AcidShootTimer); writer.Write(AcidShootCooldown); } + public override void ReceiveExtraAI(BinaryReader reader) { HopCooldown = reader.ReadSingle(); @@ -156,8 +159,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal player.MinionDamage()); projectile.damage = newDamage; } - } + public void HandleHop(Vector2 targetPosition) { if (HopCooldown <= 0f && projectile.oldPosition.Y == projectile.position.Y) @@ -179,6 +182,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal HopCooldown--; } } + public void PlayerSeparationAnxietyAI(Player player, ref int minimumFrame, ref int maximumFrame) { // If the player is extremely far away, don't bother homing. Just go to the player's location. @@ -226,6 +230,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal HandleHop(player.Center); } } + public void NPCTargetingAI(NPC potentialTarget) { HandleHop(potentialTarget.Center); @@ -270,6 +275,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal AcidShootCooldown--; projectile.velocity.X *= 0.8f; } + public void ManipulateFrames(int minimumFrame, int maximumFrame) { if (projectile.frame < minimumFrame) @@ -303,12 +309,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal 0f); return false; } + public override bool OnTileCollide(Vector2 oldVelocity) => false; + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) { fallThrough = projectile.Bottom.Y < FallThroughYPoint - 120f; return base.TileCollideStyle(ref width, ref height, ref fallThrough); } + public override bool CanDamage() => false; } } diff --git a/Projectiles/DraedonsArsenal/TaserHook.cs b/Projectiles/DraedonsArsenal/TaserHook.cs index 10a380270f..59940763fd 100644 --- a/Projectiles/DraedonsArsenal/TaserHook.cs +++ b/Projectiles/DraedonsArsenal/TaserHook.cs @@ -16,22 +16,27 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Electrocuting, ReelingBack } + public TaserAIState AIState { get => (TaserAIState)(int)projectile.ai[0]; set => projectile.ai[0] = (int)value; } + public float Time { get => projectile.ai[1]; set => projectile.ai[1] = value; } + public int ElectrocutionTarget { get => (int)projectile.localAI[0]; set => projectile.localAI[0] = value; } - public const float ReelbackSpeed = 7f; + + public const float ReelbackSpeed = 15f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Taser"); diff --git a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs index 8a2f39e008..63b99d023b 100644 --- a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs +++ b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (projectile.Center.ManhattanDistance(Main.npc[i].Center) < num474) { - Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(Main.npc[i].Center) * 2f, projectile.type, projectile.damage / 2, projectile.knockBack * 0.5f, projectile.owner, 0f, -1f); + Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(Main.npc[i].Center) * 2f, projectile.type, (int)(projectile.damage * 0.6), projectile.knockBack * 0.6f, projectile.owner, 0f, -1f); projectile.ai[1] = 60f; diff --git a/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs b/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs index a831cd502c..9cc00ac852 100644 --- a/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs +++ b/Projectiles/DraedonsArsenal/TrackingDiskProjectile.cs @@ -18,16 +18,19 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => projectile.ai[0] == 1f; set => projectile.ai[0] = value.ToInt(); } + public float Time { get => projectile.ai[1]; set => projectile.ai[1] = value; } + public const int LaserFireRate = 20; public const int MaxLaserCountPerShot = 4; // This only applies to stealth strikes. public const float MaxTargetSearchDistance = 480f; public const float ReturnAcceleration = 0.15f; public const float ReturnMaxSpeed = 12f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Tracking Disk"); @@ -74,7 +77,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.velocity.Y += Math.Sign(idealVelocity.Y - projectile.velocity.Y) * ReturnAcceleration; if (Time % LaserFireRate == 0f) - AttemptToFireLasers((int)(projectile.damage * 0.4)); + AttemptToFireLasers((int)(projectile.damage * 0.25)); if (Main.myPlayer == projectile.owner) { diff --git a/Projectiles/DraedonsArsenal/UnstableMatter.cs b/Projectiles/DraedonsArsenal/UnstableMatter.cs index cd00de0eaa..3196c455cb 100644 --- a/Projectiles/DraedonsArsenal/UnstableMatter.cs +++ b/Projectiles/DraedonsArsenal/UnstableMatter.cs @@ -12,11 +12,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => projectile.ai[0] == 1f; set => projectile.ai[0] = value.ToInt(); } + public float Time { get => projectile.ai[1]; set => projectile.ai[1] = value; } + public override void SetStaticDefaults() { DisplayName.SetDefault("Unstable Matter"); @@ -68,6 +70,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { + if (!HasCollidedWithATile) + damage /= 3; + damage += target.defense / 3; } @@ -81,7 +86,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // And bounce off the tile. Or towards a nearby enemy, if there is one. NPC potentialTarget = projectile.Center.ClosestNPCAt(700f, false); if (potentialTarget != null) - projectile.velocity = projectile.DirectionTo(potentialTarget.Center); + projectile.velocity = projectile.DirectionTo(potentialTarget.Center); else { if (projectile.velocity.X != oldVelocity.X) @@ -97,7 +102,5 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } return true; } - - public override bool CanDamage() => HasCollidedWithATile; } } diff --git a/Projectiles/DraedonsArsenal/VoltageStream.cs b/Projectiles/DraedonsArsenal/VoltageStream.cs index 76cab78f27..6cc43f4438 100644 --- a/Projectiles/DraedonsArsenal/VoltageStream.cs +++ b/Projectiles/DraedonsArsenal/VoltageStream.cs @@ -14,11 +14,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal get => projectile.ai[0]; set => projectile.ai[0] = value; } + public NPC Target { get => Main.npc[(int)projectile.ai[1]]; set => projectile.ai[1] = value.whoAmI; } + public override void SetStaticDefaults() { DisplayName.SetDefault("Voltage Stream"); @@ -111,9 +113,5 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { projectile.damage = (int)(projectile.damage * 0.75); } - - public override void Kill(int timeLeft) - { - } } } diff --git a/Projectiles/DraedonsArsenal/WavePounderBoom.cs b/Projectiles/DraedonsArsenal/WavePounderBoom.cs index c022f174e2..27eeca7a85 100644 --- a/Projectiles/DraedonsArsenal/WavePounderBoom.cs +++ b/Projectiles/DraedonsArsenal/WavePounderBoom.cs @@ -21,24 +21,29 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Position = position; } } + public class WavePounderBoom : ModProjectile { public ScreenShakeSpot CurrentSpot; + public float Radius { get => projectile.ai[0]; set => projectile.ai[0] = value; } + public float MaxRadius { get => projectile.ai[1]; set => projectile.ai[1] = value; } + public float InterpolationStep { get => projectile.localAI[1]; set => projectile.localAI[1] = value; } + public const int Lifetime = 60; public override void SetStaticDefaults() @@ -94,11 +99,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.scale = MathHelper.Lerp(1.2f, 5f, Utils.InverseLerp(Lifetime, 0f, projectile.timeLeft, true)); CalamityGlobalProjectile.ExpandHitboxBy(projectile, (int)(Radius * projectile.scale), (int)(Radius * projectile.scale)); } + public override void Kill(int timeLeft) { if (projectile.Calamity().stealthStrike) CalamityWorld.ScreenShakeSpots.Remove(Projectile.GetByUUID(projectile.owner, projectile.whoAmI)); // Remove the explosion associated with this projectile's UUID. } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { spriteBatch.End(); diff --git a/Projectiles/Melee/IceBombFriendly.cs b/Projectiles/Melee/IceBombFriendly.cs index 47e0d51738..8853e91e7e 100644 --- a/Projectiles/Melee/IceBombFriendly.cs +++ b/Projectiles/Melee/IceBombFriendly.cs @@ -27,8 +27,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - projectile.velocity.X *= 0.985f; - projectile.velocity.Y *= 0.985f; + projectile.velocity *= 0.985f; if (Main.rand.NextBool(5)) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 67, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); @@ -48,9 +47,9 @@ namespace CalamityMod.Projectiles.Melee for (i = 0; i < 2; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, 30, 2f, projectile.owner, 0f, 0f); + int projectile1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); Main.projectile[projectile1].Calamity().forceMelee = true; - int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, 30, 2f, projectile.owner, 0f, 0f); + int projectile2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ProjectileID.FrostShard, (int)(projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); Main.projectile[projectile2].Calamity().forceMelee = true; } } diff --git a/Projectiles/Melee/MourningstarFlail.cs b/Projectiles/Melee/MourningstarFlail.cs index e108572efd..58d3a0702e 100644 --- a/Projectiles/Melee/MourningstarFlail.cs +++ b/Projectiles/Melee/MourningstarFlail.cs @@ -22,7 +22,8 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + projectile.localNPCHitCooldown = 4; + projectile.extraUpdates = 1; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) @@ -32,8 +33,10 @@ namespace CalamityMod.Projectiles.Melee // If it is to be rebalanced, consider replacing it with the FuckYou projectile (which does not mess with I-frames) if (projectile.localAI[1] <= 0f && projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, projectile.damage, knockback, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - } + int proj = Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, projectile.damage, knockback, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].usesLocalNPCImmunity = true; + Main.projectile[proj].localNPCHitCooldown = 4; + } projectile.localAI[1] = 4f; } } diff --git a/Projectiles/Melee/Spears/AstralPikeProj.cs b/Projectiles/Melee/Spears/AstralPikeProj.cs index 3dcb01869d..a1c85d6fa0 100644 --- a/Projectiles/Melee/Spears/AstralPikeProj.cs +++ b/Projectiles/Melee/Spears/AstralPikeProj.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee.Spears speedY = MathHelper.Clamp(speedY, -15f, 15f); if (projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(spawnPosition.X, spawnPosition.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), 1f, projectile.owner); + int proj = Projectile.NewProjectile(spawnPosition.X, spawnPosition.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.4), 1f, projectile.owner, 3f, 0f); Main.projectile[proj].Calamity().forceMelee = true; } } diff --git a/Projectiles/Melee/Spears/EarthenPikeSpear.cs b/Projectiles/Melee/Spears/EarthenPikeSpear.cs index 940739a1db..a5889059b3 100644 --- a/Projectiles/Melee/Spears/EarthenPikeSpear.cs +++ b/Projectiles/Melee/Spears/EarthenPikeSpear.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.melee = true; //Dictates whether projectile is a melee-class weapon. projectile.timeLeft = 90; projectile.height = 40; //The height of the .png file in pixels divided by 2. + projectile.scale = 1.5f; projectile.friendly = true; projectile.hostile = false; projectile.tileCollide = false; diff --git a/Projectiles/Melee/Spears/FulgurationHalberdProj.cs b/Projectiles/Melee/Spears/FulgurationHalberdProj.cs index 839d0b0979..91551c48ee 100644 --- a/Projectiles/Melee/Spears/FulgurationHalberdProj.cs +++ b/Projectiles/Melee/Spears/FulgurationHalberdProj.cs @@ -14,11 +14,12 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void SetDefaults() { - projectile.width = 35; //The width of the .png file in pixels divided by 2. + projectile.width = 40; //The width of the .png file in pixels divided by 2. projectile.aiStyle = 19; projectile.melee = true; //Dictates whether projectile is a melee-class weapon. projectile.timeLeft = 90; - projectile.height = 33; //The height of the .png file in pixels divided by 2. + projectile.height = 40; //The height of the .png file in pixels divided by 2. + projectile.scale = 1.5f; projectile.friendly = true; projectile.hostile = false; projectile.tileCollide = false; diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 1e94a744d9..b6490afd75 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -48,8 +48,11 @@ namespace CalamityMod.Projectiles.Melee.Spears return; Player player = Main.player[projectile.owner]; - player.statLife += 1; - player.HealEffect(1); + if (Main.rand.NextBool(2)) + { + player.statLife += 1; + player.HealEffect(1); + } } } } diff --git a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs index 1df1536735..49bd3f8949 100644 --- a/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs +++ b/Projectiles/Melee/Spears/GoldplumeSpearProjectile.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Melee.Spears if (Main.myPlayer == projectile.owner) { Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y, - projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), 0f, projectile.owner, 0f, 0f); + projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.4), 0f, projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs index 63ecb07dfc..33437ed157 100644 --- a/Projectiles/Melee/Spears/InsidiousImpalerProj.cs +++ b/Projectiles/Melee/Spears/InsidiousImpalerProj.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override Action EffectBeforeReelback => (proj) => { Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y, - projectile.velocity.X * 3.5f, projectile.velocity.Y * 3.5f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); + projectile.velocity.X * 3.5f, projectile.velocity.Y * 3.5f, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); }; public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/TrueCausticEdgeProjectile.cs b/Projectiles/Melee/TrueCausticEdgeProjectile.cs index 2267713830..6df6fc0f28 100644 --- a/Projectiles/Melee/TrueCausticEdgeProjectile.cs +++ b/Projectiles/Melee/TrueCausticEdgeProjectile.cs @@ -49,7 +49,6 @@ namespace CalamityMod.Projectiles.Melee public override bool OnTileCollide(Vector2 oldVelocity) { - projectile.damage = (int)(projectile.damage * 1.25); projectile.penetrate--; if (projectile.penetrate <= 0) { diff --git a/Projectiles/Ranged/CorossiveFlames.cs b/Projectiles/Ranged/CorossiveFlames.cs index 7537988e86..2ee30e1520 100644 --- a/Projectiles/Ranged/CorossiveFlames.cs +++ b/Projectiles/Ranged/CorossiveFlames.cs @@ -26,10 +26,6 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f); - if (projectile.timeLeft > 90) - { - projectile.timeLeft = 90; - } if (projectile.ai[0] > 7f) { float num296 = 1f; diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index a55ec15ef8..763c0c4803 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = -1; projectile.extraUpdates = 3; - projectile.timeLeft = 90; + projectile.timeLeft = 100; } public override void AI() @@ -31,10 +31,6 @@ namespace CalamityMod.Projectiles.Ranged projectile.scale *= 1.01f; } Lighting.AddLight(projectile.Center, 0.25f, 0f, 0.1f); - if (projectile.timeLeft > 90) - { - projectile.timeLeft = 90; - } if (projectile.ai[0] > 7f) { float scalar = 1f; diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index 525c749cd1..82e8b0695d 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -32,6 +32,9 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + if (projectile.ai[0] == 3f) + CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 12f, 20); + if (projectile.ai[0] == 2f) { projectile.Calamity().rogue = true; diff --git a/Projectiles/Typeless/UnstableSpark.cs b/Projectiles/Typeless/UnstableSpark.cs index 96ccb95791..529d00478b 100644 --- a/Projectiles/Typeless/UnstableSpark.cs +++ b/Projectiles/Typeless/UnstableSpark.cs @@ -81,10 +81,6 @@ namespace CalamityMod.Projectiles.Typeless public override bool OnTileCollide(Vector2 oldVelocity) { - if (projectile.penetrate == 0) - { - projectile.Kill(); - } return false; } } diff --git a/Sounds/Item/PlasmaGrenadeExplosion.cs b/Sounds/Item/PlasmaGrenadeExplosion.cs new file mode 100644 index 0000000000..8d2a7939b7 --- /dev/null +++ b/Sounds/Item/PlasmaGrenadeExplosion.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Item +{ + public class PlasmaGrenadeExplosion : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/PlasmaGrenadeExplosion.ogg b/Sounds/Item/PlasmaGrenadeExplosion.ogg new file mode 100644 index 0000000000..782b24b685 Binary files /dev/null and b/Sounds/Item/PlasmaGrenadeExplosion.ogg differ diff --git a/build.txt b/build.txt index 67d3720ef7..aadb9fff40 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 1.4.5.005 +version = 1.4.5.006 displayName = Calamity Mod (No Calamity Music) homepage = https://forums.terraria.org/index.php?threads/calamity-mod.44065/ buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes