From c1be3254d9b6abb078eff4268b8d4996c7e63bc6 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 11:25:41 -0400 Subject: [PATCH 01/52] added stuff to boss checklist support --- ModSupport/WeakReferenceSupport.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 08933814c5..a1f28dbcee 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -357,7 +357,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("AstrumAureus", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemType(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.HallowedKey, ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] at Night in the Astral Biome"; string despawn = CalamityUtils.ColorMessage("Astrum Aureus’ program has been executed. Initiate recall.", new Color(0xFF, 0xD7, 0x00)); @@ -370,7 +370,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("PlaguebringerGoliath", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemID.Stinger, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] in the Jungle Biome"; string despawn = CalamityUtils.ColorMessage("HOSTILE SPECIMENS TERMINATED. INITIATE RECALL TO HOME BASE.", new Color(0x00, 0xFF, 0x00)); @@ -551,7 +551,7 @@ namespace CalamityMod InvasionDifficulty.TryGetValue("Acid Rain Initial", out float order); List enemies = AcidRainEvent.PossibleEnemiesPreHM.Select(enemy => enemy.Key).ToList(); int summon = ItemType(); - List loot = new List() { ItemType() }; + List loot = new List() { ItemType(), ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{summon}] or wait for the invasion to occur naturally after the Eye of Cthulhu is defeated."; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the ocean.", new Color(146, 183, 116)); @@ -566,7 +566,7 @@ namespace CalamityMod enemies.Add(ModContent.NPCType()); enemies.AddRange(AcidRainEvent.PossibleMinibossesAS.Select(miniboss => miniboss.Key)); List summons = new List() { ItemType(), ItemType() }; - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{ItemType()}] or [i:{ItemType()}] or wait for the invasion to occur naturally after the Aquatic Scourge is defeated"; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the deep ocean.", new Color(146, 183, 116)); @@ -580,7 +580,7 @@ namespace CalamityMod List enemies = AcidRainEvent.PossibleEnemiesPolter.Select(enemy => enemy.Key).ToList(); enemies.AddRange(AcidRainEvent.PossibleMinibossesPolter.Select(miniboss => miniboss.Key)); List summons = new List() { ItemType(), ItemType() }; - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ModContent.ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ModContent.ItemType() }; List collection = new List() { ItemType() }; string instructions = $"Use a [i:{ItemType()}] or [i:{ItemType()}] or wait for the invasion to occur naturally after the Polterghast is defeated"; string despawn = CalamityUtils.ColorMessage("The mysterious creatures of the sulphuric sea descended back into the deep ocean.", new Color(146, 183, 116)); @@ -618,7 +618,7 @@ namespace CalamityMod // Queen Bee AddLoot(bossChecklist, "QueenBee", - new List() { ItemType() }, + new List() { ItemType(), ItemID.Stinger }, new List() { ItemType() } ); From 4839bdaaf4a09264dcd022345c1dcbc5cb07c25d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 11:26:13 -0400 Subject: [PATCH 02/52] fixed andromeda typo --- Items/Weapons/Summon/PrototypeAndromechaRing.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Summon/PrototypeAndromechaRing.cs b/Items/Weapons/Summon/PrototypeAndromechaRing.cs index b1b38912a1..54ee78dbdc 100644 --- a/Items/Weapons/Summon/PrototypeAndromechaRing.cs +++ b/Items/Weapons/Summon/PrototypeAndromechaRing.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Prototype Andromecha Ring"); - Tooltip.SetDefault("Summons an colossal controllable mech\n" + + Tooltip.SetDefault("Summons a colossal controllable mech\n" + "Right click to display the mech's control panel\n" + "The panel has 3 possible configurations, that you can choose using the brackets on the UI\n" + "Each bracket powers 2 out of 3 functions, represented by icons on the UI.\n" + From 073488512da5ee2c8122985904dc21287839fd29 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 11:26:43 -0400 Subject: [PATCH 03/52] fixed shadow potion recipe --- Items/Potions/ShadowPotion.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Items/Potions/ShadowPotion.cs b/Items/Potions/ShadowPotion.cs index 7171a5d8f5..aec0a954a0 100644 --- a/Items/Potions/ShadowPotion.cs +++ b/Items/Potions/ShadowPotion.cs @@ -40,8 +40,7 @@ namespace CalamityMod.Items.Potions ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.InvisibilityPotion); - recipe.AddIngredient(ItemID.AlchemyTable); - recipe.AddTile(TileID.Bottles); + recipe.AddTile(TileID.AlchemyTable); recipe.SetResult(this, 2); recipe.AddRecipe(); recipe = new ModRecipe(mod); From 775fbfd1a4dd87b06f2a14561540c96c9d061960 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 11:27:45 -0400 Subject: [PATCH 04/52] nerfed desert prowler --- CalPlayer/CalamityPlayer.cs | 4 ++-- Items/Armor/DesertProwlerHat.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1c967fe618..a36fbe4294 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4011,9 +4011,9 @@ namespace CalamityMod.CalPlayer acidRoundMultiplier = 1D; } //Prismatic Breaker is a weird hybrid melee-ranged weapon so include it too. Why are you using desert prowler post-Yharon? don't ask me - if (desertProwler && (item.ranged/* || item.type == ModContent.ItemType()*/)) + if (desertProwler && (item.ranged || item.type == ModContent.ItemType())) { - flat += 2f; + flat += 1f; } } diff --git a/Items/Armor/DesertProwlerHat.cs b/Items/Armor/DesertProwlerHat.cs index 69a9033f3f..4436351718 100644 --- a/Items/Armor/DesertProwlerHat.cs +++ b/Items/Armor/DesertProwlerHat.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { - player.setBonus = "Ranged attacks deal an extra 2 flat damage\n" + + player.setBonus = "Ranged attacks deal an extra 1 flat damage\n" + "Ranged crits can rarely whip up a sandstorm"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.desertProwler = true; From 9524f4dea97daf431f7a34451ab5b019945398ac Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 11:37:59 -0400 Subject: [PATCH 05/52] the great balancing act --- Items/Weapons/Magic/AlulaAustralis.cs | 4 ++-- Items/Weapons/Melee/PrismaticBreaker.cs | 7 +++---- Items/Weapons/Melee/TenebreusTides.cs | 4 ++-- Items/Weapons/Ranged/AuroraBlazer.cs | 2 +- Items/Weapons/Ranged/MarksmanBow.cs | 2 +- Items/Weapons/Ranged/RubicoPrime.cs | 2 +- Items/Weapons/Ranged/TyrannysEnd.cs | 4 ++-- Projectiles/Magic/WaterLeechProj.cs | 2 +- Projectiles/Rogue/AuroradicalSplitter.cs | 2 +- Projectiles/Rogue/LeonidStar.cs | 9 +++++++-- 10 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Items/Weapons/Magic/AlulaAustralis.cs b/Items/Weapons/Magic/AlulaAustralis.cs index fe5f528c33..d64989186d 100644 --- a/Items/Weapons/Magic/AlulaAustralis.cs +++ b/Items/Weapons/Magic/AlulaAustralis.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 60; + item.damage = 90; item.magic = true; - item.mana = 12; + item.mana = 8; item.width = 52; item.height = 52; item.useTime = 17; diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index 63586c1f30..b1310f75fd 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -53,11 +53,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 400; + item.damage = 600; item.crit += 8; - item.useAnimation = 15; item.useStyle = 1; - item.useTime = 15; + item.useTime = item.useAnimation = 15; item.useTurn = true; item.melee = true; item.knockBack = 7f; @@ -91,7 +90,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (player.altFunctionUse == 2) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage * 2, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 1.75), knockBack, player.whoAmI, 0f, 0f); } else { diff --git a/Items/Weapons/Melee/TenebreusTides.cs b/Items/Weapons/Melee/TenebreusTides.cs index 4aa3fc0331..d4b147c54b 100644 --- a/Items/Weapons/Melee/TenebreusTides.cs +++ b/Items/Weapons/Melee/TenebreusTides.cs @@ -20,10 +20,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 75; + item.damage = 80; item.knockBack = 4.5f; item.melee = true; - item.useAnimation = item.useTime = 15; + item.useAnimation = item.useTime = 14; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Items/Weapons/Ranged/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs index 3364382d01..e97f1353e6 100644 --- a/Items/Weapons/Ranged/AuroraBlazer.cs +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 101; + item.damage = 50; item.ranged = true; item.useTime = 15; item.useAnimation = 15; diff --git a/Items/Weapons/Ranged/MarksmanBow.cs b/Items/Weapons/Ranged/MarksmanBow.cs index 15b6356c1a..673a3e4fe1 100644 --- a/Items/Weapons/Ranged/MarksmanBow.cs +++ b/Items/Weapons/Ranged/MarksmanBow.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 32; + item.damage = 27; item.ranged = true; item.crit += 20; item.width = 36; diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index e444d39168..718d37c965 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 5600; + item.damage = 4000; item.ranged = true; item.crit += 40; item.knockBack = 10f; diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 501414bdd9..fa56707ae3 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 4000; + item.damage = 4200; item.crit += 35; item.knockBack = 9.5f; item.ranged = true; @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Ranged 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, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); return false; } } diff --git a/Projectiles/Magic/WaterLeechProj.cs b/Projectiles/Magic/WaterLeechProj.cs index c092e1101d..ce6818f4bd 100644 --- a/Projectiles/Magic/WaterLeechProj.cs +++ b/Projectiles/Magic/WaterLeechProj.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 4, false); + CalamityUtils.ModifyHitNPCSticky(projectile, 3, false); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/AuroradicalSplitter.cs b/Projectiles/Rogue/AuroradicalSplitter.cs index 7ee1c48c78..badefae78c 100644 --- a/Projectiles/Rogue/AuroradicalSplitter.cs +++ b/Projectiles/Rogue/AuroradicalSplitter.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Rogue for (float i = 0; i < 5; i++) { float angle = MathHelper.TwoPi / 5f * i; - int star = Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 5f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + int star = Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 5f, ModContent.ProjectileType(), (int)(projectile.damage * 0.87), projectile.knockBack, projectile.owner, 0f, 0f); Main.projectile[star].Calamity().stealthStrike = projectile.Calamity().stealthStrike; } projectile.position = projectile.Center; diff --git a/Projectiles/Rogue/LeonidStar.cs b/Projectiles/Rogue/LeonidStar.cs index a601774acf..bf86eb0194 100644 --- a/Projectiles/Rogue/LeonidStar.cs +++ b/Projectiles/Rogue/LeonidStar.cs @@ -40,8 +40,13 @@ namespace CalamityMod.Projectiles.Rogue projectile.ai[0]++; if (projectile.ai[0] > 120f) { - projectile.alpha -= 15; - if (projectile.alpha <= 0) + projectile.scale *= 0.98f; + projectile.position = projectile.Center; + projectile.width = (int)(projectile.width * projectile.scale); + projectile.height = (int)(projectile.height * projectile.scale); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + if (projectile.scale <= 0.05f) projectile.Kill(); } projectile.rotation += projectile.direction * 0.05f; From bfbd4efc470b953effeb86bc0f2ca09f8a42d3a3 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 12:04:20 -0400 Subject: [PATCH 06/52] crates now always drop stuff, reflecting on vanilla --- Items/Fishing/AstralCatches/AstralCrate.cs | 7 ++--- .../BrimstoneCragCatches/BrimstoneCrate.cs | 5 +--- Items/Fishing/SulphurCatches/AbyssalCrate.cs | 29 +++++++++++++++---- Items/Fishing/SunkenSeaCatches/SunkenCrate.cs | 7 ++--- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Items/Fishing/AstralCatches/AstralCrate.cs b/Items/Fishing/AstralCatches/AstralCrate.cs index 4688312ba9..53c08f1100 100644 --- a/Items/Fishing/AstralCatches/AstralCrate.cs +++ b/Items/Fishing/AstralCatches/AstralCrate.cs @@ -41,10 +41,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches item.useStyle = 1; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void RightClick(Player player) { @@ -65,7 +62,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches } // Weapons - DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAstrageldon, 0.2f, + DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAstrageldon, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs index 44cf91737b..d98e589ed8 100644 --- a/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs +++ b/Items/Fishing/BrimstoneCragCatches/BrimstoneCrate.cs @@ -31,10 +31,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches item.useStyle = 1; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void RightClick(Player player) { diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index ee7d0da02a..ba48db363c 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -4,6 +4,11 @@ using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables; using CalamityMod.Items.SummonItems.Invasion; using CalamityMod.Items.Potions; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Tiles.Abyss; using CalamityMod.World; using Terraria; @@ -36,10 +41,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches item.useStyle = 1; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void RightClick(Player player) { @@ -76,8 +78,25 @@ namespace CalamityMod.Items.Fishing.SulphurCatches DropHelper.DropItemChance(player, ModContent.ItemType(), 0.25f, 5, 10); } + // Weapons + DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType()); + + DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAquaticScourgeAcidRain, + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType()); + // Equipment - DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 0.25f, + DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 1f, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs index 027f00b0db..62f806f072 100644 --- a/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/SunkenCrate.cs @@ -40,10 +40,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches item.useStyle = 1; } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() => true; public override void RightClick(Player player) { @@ -61,7 +58,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches } // Weapons - DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAM && Main.hardMode, 0.2f, + DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedCLAM && Main.hardMode, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), From c34a42f5b015f1bb07d795a969fbdcd997ad074b Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 12:05:17 -0400 Subject: [PATCH 07/52] fixes --- Items/Fishing/SulphurCatches/AbyssalCrate.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Fishing/SulphurCatches/AbyssalCrate.cs b/Items/Fishing/SulphurCatches/AbyssalCrate.cs index ba48db363c..1dc1c6e2cf 100644 --- a/Items/Fishing/SulphurCatches/AbyssalCrate.cs +++ b/Items/Fishing/SulphurCatches/AbyssalCrate.cs @@ -89,14 +89,14 @@ namespace CalamityMod.Items.Fishing.SulphurCatches DropHelper.DropItemFromSetCondition(player, CalamityWorld.downedAquaticScourgeAcidRain, ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()); // Equipment - DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, 1f, + DropHelper.DropItemFromSetCondition(player, NPC.downedBoss3, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), From 35fd96a5177d008b60197310916216dbbe128866 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 12:20:29 -0400 Subject: [PATCH 08/52] overriding 1.4 snow biome req boost --- CalPlayer/CalamityPlayer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a36fbe4294..266a1a462e 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2349,6 +2349,10 @@ namespace CalamityMod.CalPlayer ZoneSulphur = (CalamityWorld.sulphurTiles > 30 || (player.ZoneOverworldHeight && sulphurPosX)) && !ZoneAbyss; + //Overriding 1.4's ass req boosts + if (Main.snowTiles > 300) + player.ZoneSnow = true; + Mod fargos = ModLoader.GetMod("Fargowiltas"); if (fargos != null) { From 7aaa4df6f43bda9057bc330d7fff11c497f10a54 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 14:26:23 -0400 Subject: [PATCH 09/52] fallen star added to deus boss checklist --- ModSupport/WeakReferenceSupport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index a1f28dbcee..5b15410227 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -396,7 +396,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("AstrumDeus", out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Defeat 3 empowered astral titans or use a [i:{summon}] at Night"; string despawn = CalamityUtils.ColorMessage("The infected deity retreats to the heavens.", new Color(0xFF, 0xD7, 0x00)); From a55986cc665d8018d03c49db64b985dbc3006b96 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 19:29:48 -0400 Subject: [PATCH 10/52] bumped up aurora fire npc hit cooldown --- Projectiles/Ranged/AuroraFire.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index aae7dae614..3301c4612c 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 3; projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; + projectile.localNPCHitCooldown = 15; } public override void AI() From 81b9e65477caef9bcc91f85b1f5656de362cb1a5 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 21:44:52 -0400 Subject: [PATCH 11/52] added beep for future use but didn't get it to work yet --- Sounds/Custom/MicrowaveBeep.cs | 18 ++++++++++++++++++ Sounds/Custom/MicrowaveBeep.ogg | Bin 0 -> 11776 bytes 2 files changed, 18 insertions(+) create mode 100644 Sounds/Custom/MicrowaveBeep.cs create mode 100644 Sounds/Custom/MicrowaveBeep.ogg diff --git a/Sounds/Custom/MicrowaveBeep.cs b/Sounds/Custom/MicrowaveBeep.cs new file mode 100644 index 0000000000..4e13043f45 --- /dev/null +++ b/Sounds/Custom/MicrowaveBeep.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class MicrowaveBeep : 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/Custom/MicrowaveBeep.ogg b/Sounds/Custom/MicrowaveBeep.ogg new file mode 100644 index 0000000000000000000000000000000000000000..30e601810272cc90d195ee971f1d5062dc88f0e2 GIT binary patch literal 11776 zcmeHtc~n!^-u6Brfe;WANFuXg4iJ<`Kt#|31Y}eK35FmF0hCc0lxnN?h=5@%A|fJS z2!bJkCCcE?Axw%|6=V=?t61l;SgY06EAI~2-hTJH>%HGv@B03G4<~2sv-duGpZ)x% zXa5eXHf)FhIPmcp#m^Q#eej15Vvgi&$`U7MtE+I_){k8>XFH!lR;i!->rg+5z`J{+ z)vxtyrvK&Gt1&y2BkUne&PZCYDr*BHEm<5nGXW!zvB;Ud$a#^o3xl~TePeP)R$_MI z#?AKXw;{t{dR)q;taak7xQz*3331s;bXXU$Y5nF;;<6IGLgI4PyDnbf>b8LG%$}?6 zoxBnD&PmM5PTsW9%h?!K#cxW_h})bjPD`8}CEF`Gdy`vw28WFhX5Y--$2SrIMA(-d z!Wh7Y$^|o1$6DL#?OPvc-&EPa+*Vx~pe_wK7gkpm4j9Ilu+RN@VQ>;?0N??})Glj$ z5SVgh$p%BavMlM6oktI!+zefft5!&DB|OsM%#P00x%{R_vt)Dyf&0rk97U zSN+1`8MqF+_(kwT1@PDsvpOg7dd`;XIXj}N^P^Agh&q)YJ&_;tTYj8j!N>FMj@!Sf z&zYq&5FoW$Qgzo}W@#+@X^BiDub>qN64a0|v@0y_D;fiv*QXp$KGcM=MzmDbO0#C@_eT0`AloSaO?9~EUg)Y2LY5R8qONX z;;hK#oX_@z=ZekT3zZ?4e+`-Yrx4U)2LNT84rH2MfM|p}jbyp5&i1;V9eN!?p+@At zKX%RN3tWgr-TJB&jObDxHvhc#><`s&Wk1UpC??lEeHYF=GlqE~ZY+Cn`v(o@Jk zWOury`p}F7)2s9VFg#b6%h*w-DW+O9TkJF6{Ds~=DSOcVhuCD`x@wB~W{jkuI_skSQD_x^7u=NfRf^g0-_ENqO?mn@@El&` z6yf3};0spgq(>dt@_l!H%*2-4*LU2$Ub=2x!M`fjUzP))(d5n8WTm)-eZF@0N+0c6 z0sm<^nbh-pO)u=V4nAQWdX07Y7tX3zoM8h$9w#({7BfuSGD1&`aElpnO&k#i^RCKhu=%}RVp`?siSe0B@qc|-~yLkNRng4kHWjQOdtl8EkHM>TyVF>7Ezj=Qb0063T-QXEN!V7mA3wIq0cM|Zu{(Fmotz(?f5e@`) zKLAEBa2#nK{Zvn1T)w2xJBb+BZ#uBX<8f`{nvy-`R{nv{Eh4@n<2$Q|0`sY(KZ#Pz zviZfOZ3zM1PF?51E$+*;pxYyY1|y(%9x)BoFb&p#mZv@fM?feQxon`0P4G|+b5H{> z)WC1{_J4MT6LENWczzrPPBhF%hB+VSg0rYx{7?>zB>(f{-^|5xMOOW7E|e3B@(zQ|OFL9_O7UJA~0Brmy_ z6Q}t1FNXnuAzABL5XP>rp|C>2q6#;M=VgkwY3Vsa8}0GR+LGpLuYad`LK ztD2H!gPE-05$@hZNP-G2Ij~5nf4Hq#`|2yWZf21z83)4)gq@&<-7P7Ir5Bbo7z7yB zKy}Bx>i#wvvk3Ah#l=k4rB_@YH8esHbKtJ9>S3XbS<|dIvj9$XbtXhXa+g%|S2ZV; z3cWDu%raP$-V;z@8(VP}uW2L6%h0+@gSy1fA(Pwk2ksL|vzV(FLdOB#61b zKM_lY&z(8W(%{eD8%Y(4Cufd3UILIn-PoTPr8%j-JHY~AQiTA9is*4ceu8KcdTI(# zjZatt3Dkv>xFB|uZoIw^sUa@JC%_^hJlw&)iR9y8vp?KBpy^2Xq9CWHs&InE{)(U$ z#*y%Fdji1B+~H41%r9uggI^%qi?0-ax8$L&l9tAev9f5~j`mDp66JkAzKZIx;FsW7DrL(P}tSDJrt> z`UwgM*1@HS*63I?Rf>w8x(pAcSwN|!!n$~upiWo^my*f~It}ZT1BR)ke#}GB>ekdY zSNr?f!OAgFd~2s|V@ZX&uC;UAvNC+pIcfwf)#N#!`^_-EmHkk(PrvuAd4v<}oCQ)`%7ufmTQ zWBZF*))yLKEYHo;h>hk8k#CA!)Kl) z&QN5y6;(4;eW<&Y;qbY9IL9n^hJcXZ95W3;aLY>d(VlIntbqNRJ~qIK;P@XK;6!kk z*(YE@O~Lo8`>G2w*A{gN-p*cU8=BxmuyVFaJrTV9INr=emEjJvx6u7+sJ)++gH!)X zm*bwe71Tu`=#0(69U56n*)c9UR+4owFtE+n-}r&_$V8x)MW--0k>PzYFsLqYr}&Zz?a>A(8Yz>Oib>k&G!DZt#6)OZ(v&>k6*%5jo+v&!9~+;u ztb0UQJb*O`4vqEGhnODG+MlleG4FNrAH9J;^co(Q=3R=}VlaN_g^pdOPW-7{{RNv6 zct@EhS2Bx-4nO*>FhAcf1r6`6B$5rBo&&K`EA~m~-o1MGKJ|jVZ|ge zh*EjcK#I~Zp1^ZGXG{Z9JZ4NOiDhAOQnh7@gY-4+MQ5knxL?ec44k!^*DB&DWMd3f z{L^`p&sulY?x;N2wb#l(wBTWvg8IzU6mvD)Eku`o589#$iVucC%m!0`?wZ^N++<~? zE;wR!c=?9q%W35Hb49c^`JliD0jcj6#yZGkvfOH6cT+5oF^Y;TzIgu-kL71ZbQlES zo@Rb(495L(5?DgO9h+$V?I1y18c7r2b-&qTwyfT`yEJe9(p7ujTfb@VJ0EekYwuM2 z!^h=^`w9JND>VR_Y|sr83-6481m?O{ur_Ld*tNpn5xu;)I0Mz`2<_r_2wDos&8@jE zZo)WHNhs$5KH&2C{4j*l0^1sLNn+7+8W$m}_bN|Qg8Mtxi(KZ6o)PFcMzWlAN7~n) zY)Urc`5mR<{ro765?3iRR}zca#4>Fvt+Yu6xrKP~G2?h%sXMQH-hHo;*NE;e{er6! zgJoJ&1}N1%vMPXl_(%Ttdkn-;Bsc|_N}-YC*|G^^KTu-`f|x{PYcH!W{3ir6n<5qj zeNUBm#ZTsGZO2KFHvn6TV1y(tZL>%>b}Sr#;8c2SHBPZoJ&?epEgGgFmEt+@#=P2W zjo$OcUu-?=dida)JE~`sSxMh+>;Jy(-FNp$w{upjbnngLwK(i(Gami!D!?FOVs@qp zw9bXKYjFmrF|#Jg3|^8tN%Dry&d$CL#h6&wKYornlG5o%Ksox{5+oH5jzJdy46SI8 z*3JQBr3RV2S(ZdIb1?Q3q@}iETXb5DrLl&Rb94k~-~mC7-(z*L0ZfQ=W$Z47QzB|-8Y4yQn_t4>E@6Qn`LVv)4j12PPur_<( z?!Fyh@|M*&phfRS0C|d?>j9jVBWA)9=8O+>exA;9d-Fyt4DH92-?WxX7?F4?0l`!8 zC4yuATs+yE28DU^N&yoqs-C)GF{LCLKs>mC^GYLC< z;kKoYbmFo&>1rGRBufU1xsoVH=9A=;(tQNWqxH_Wj(02R#+JX|Xm!A0x$+>5vXF-i z#1k9-k|KJ#AJgi=KnW z{Ws56L~Ak$Xdc&(cn7GoW%43_&Lb|t?lCg4^^H^UE>nD-4L(V3K@rJ#=gZr6j;00?ZPN z8wd}5IvyG=5_LLr1K91x3N zmgWkD$q(a}SOuV1;AceX2Zb(p`|jr^S46I9q9c(Jnvuw+>58~Lh(uqHAV#?yQJN8G zh%zzR0Vlb`EGBE36wk z2L_WIdoW6>t|XTN_+cQv-&hC2MMvFms9&2B2c*sR1vKTx7^n0w1K+gdv1`{jENbV1 z0vetpClwXZcp-n7-pK52)m_>&u@n zHM!AN$d$bE+>Y<3{YHL$SD@_-2#8!#N!^;qu)=dnv3T73sVf1&CffkuIv0(vNBD5{ zw#(_+Ie)ynbNirMtO;92!veA{imY!~v@P0QY{)2JbWsWAb=y}HS|9Z@0DzJ2(XsJd zt?t5ohu=So)B0V}IoXr`(>=T8i@WwazV5MwhUlI}hIpAumIJKjQyY*010e#O=UY{F zBA99zXG^yVhYkd^imlw}pLO@?6R7~_O26*ywXa{vwaAyl-K9XUr1022#C z&{79bB$6kKguil+Qzp^{8#6ev@MrLw`)K6?tt%gyM|=Ndv!v8+E*Ky8f}HvDA? zd6|}+{V2P_y(gTW>$%KA3Q&Wjqq^>%wdP-`tbKI2-3Gni@XB;eHJ-qfHfqsJ!_T+I zQ1a9W$k3JE#Wb(F05>r4sDlTA0zwUw3Z0HJmQutpu%Lclac@vR6i_>PfNVQF@VOil zs+9=>H2z83A@hwU>uNn9G5G!XmXW^nyTuXbdsd2bGIc=giBpu(mIxf#>H`40qiX@` zp!VX<3w6K7KOj6)<=HF%fRS?Z#?9{wg#?ob8bjun%k&T1jl*!5h)^O|z~IKy!O}EA zO1u&#RQuQW6_s{TeM6Ng!5X7A$;JhOG>(cK984YI4v?RU72HwFxORXrO6{1XzUqa< zJ4pt_Z88VNUfS0scM~<1Qd={Vh`dha$*mnHwa8{{KnZg)#&GhZnl+dPh69c)3-nYT zcJPSP2*psA5P63gNaJBN+o+rP~Lk}N535Vr~`-Uy!xZV=Ia z3C{`;BbDMGIcXgWA_Z+i(M^5jdW-QkMVzRUAKWTZrf-&E{^ZwRYHq6x3nNRkUl9-E z6yoT{Cm>#0Sg}DiOdI2R}W#+Lf@*ZCy^A*}|@a#V414U$Kd?NGGaATVwpi ztmoDNDvSHGlv1pW$EnrkA0VfrT{|O#VXFokBT6F)JhqrOk^;#!t#|^GDYZc%R08mZ zuZ7AP*ubqwgrb5z$QFQtrrbEi&7>mZYGLQb0UQ`550NG!`*E>8L=^EiUY(mk1c=VL zqI3Q{^6n&xH%}$WmL=JFl{E3oY4=a)HbDc8#l3#iNHaiNb1_%+&2Rf+PwO&a2)=0f zwafA0z12(iyObN5!H|(hzDPI_8y1jZI=$a>etxe8D(DlE`AEs55`9c}@UpEZc+VY- z8(eaG-f7&r45Jsghj(3sh8QhXfx~n#ria>J)$cKT@yS@<7umIg2L_$CP2AbJ+Uvdh z`NHjmKm4M3FoEkIT2X#z1p4cKi9{Z;iiTk``m_+J_D--7P(80;EpDm)C$_eQwGb}n zahZRsQrMHCRG#Fy&Kcpba45GJpV}^D<8TZtHUn}1G*b_$!2WJQ+m$gya)eKP98w8Aw>VOQ!pM=sFRBuJtnWVjCaL`yTA$3$? z2o~M6mMC~7M5%)egMrMyRe%7>C<&B;Fy%S8;de~YNu|q#O1@6CaX~{>Rf;r!7+EN{J5b1N%xjxs(HA4w)fBR%eoTbLaRT zt6%IcJ$8QF!r1cR5A!mol67-24hc}n75ApL;kgLW--AA&PkK?O?diR5h;sVn4VJAT z+{Kvhyms_LR6$_cMY|AVe%(G{ng&o5_?tAo*6>Bz#f>c>V@Oi#-TJ7*8xQIan5BJI zH$CvOWZ=Ssl@<$^PQ3A$F1~A2yzg>dZ|S2I>*uzsNhQ}q0kZ}U7_0NNc}wcJu1;q=hs8f86twy|DsUr(J*!Y66YYPSn}=ZC40)3!#IPso z30u4LPUi0^41MXOKBf04K)p@xK2603|Dk<=*N1);Ss2*Pg4#f>B+CUk(G)+>k9G2a z`jLaAYufuiB1=P46a6#W@Le0aje(Ku1f2RzjYWq_YcGz2ybr z*6}Z%83Qyl+L(lTX`%g^G%`$js{g$NPg@Ju3lDW#MEyyR`MlAL3KJs6)8;S{!kl)1 ze=gIMX)UOZ$M-~@FFx8$|8Qg4TJPkI*F#UXzWjB(cljT1qdekv=oA5&pdwnSn;N1I;$^paIC{{?eO@6c7OU|mF?8a zIy<pd!xfrfSYeDpcXq(+$=UHdgYHizw;IgfcBA2&)KK@#&$P-Gzsw}JyUCy* zB^xXbi?##qj z)!&;O#^VZ*QA0H`IYGe~;u3@goK^mPHBRX#+WU)WPb1l5{kVwMn@JM!F$Y;h$s<6s zyZSX?5>PIGQj2S?JP` z9efu9h+ktMMWZp@T97p zL+L{Y^eyRTE^uG%VBc@&Nrzv4Fd;X-O>=j#tzKdIyW6|E!E39odwrhP`B#^ZeDjV| zK|BSTr~tJmAFDdR)nMR2@8Qo8!8Bf~8NwGxf*GiGo>vdF5G_kH zxcb%<*L3PJQM!{`0fEt2haXT#NQzt$^g3Zy;x@`CB&C3Z3*)xJ5DZBTAJ&_Uu2){r zOdSu2NK4)=RBgqY6G1ks;&FJi2Sr1LI0FLSr6Oij@Tj7priBJU1`Z0O#ON1e($PA>-J z9*H5ZW9qfhBmkDTiy!WA8j?tI{Ty-D?{-f;MY0IB7x=DJ*VaZkT79trAvA*>OR!mTa|ke&Z8Vz{-+4T-puuYl;0v7QH~#nEpxk>U^4S zz}T~5Q~xj~G4XU|;=8;sfUoRByT1JJnCLnwXQ*a#bmatZ&Nve%Rj5-UVT5=0PD5$&w)hlZWU#oykG6HcfhLbNh9 z_6Om}lMtyC_!Yrd0V#Sp^hWx^*f;~mgGt75_-T!$c;nU_r!*MpkbF&pnM;&gLi46^ z2`K6v7ViKlx|;@wc=n7;K=B0VD8de#Sk;M)DS!C30M$V&*J#Eb##bju zA0Y~`{?iH_y$g8Is(~t-nh+q-M4h3hXhZM_xV7iU!7Rl>FT;X6*foKC?%BQf`RhJ) z*6l-@jt%A4MNZUdg2})^9%Xxvr#~%F>)!X0s%#b3FL zv&e5R|J-owl3Sb8uI|?C^V&>ME^3I_BM?x@X`s69!&^}x7WKgK0XqN0)Y-Sbfme=5 zpTCJ<;|H!8<1Bxn3U>s8wMTylSmN@n>eooK@EeP@+9Ea{sXe$Z_S0i}Ezb_^UR$!W zq%F7?ZM}y)ttTfRzWn*{>FCL47{BMkrQc)r-Pra1 z!c;bvf#7Bnl@LgwFiEN$|7fz<9i4DL%s`PK|I3xIwo!!H=DWT(EId2PlrLL zkeYTv5!o6owQM$YyV<)QGD2GG&Db$=uw$fCNDtFvi#%zwgOC;7y>r6(kC3-7@F%`4 z+o5k1NBc%Ew&Ig{_fz1GSQtiY!!22N|K5cS^G;l_*<1M4f_m4d^y&f}7);k3{NNFl zFS@bX>eaS42M-Pw=Um?f*3C1IyVbiiyKCc)>+@cpEgo~;lp#)iXgtV&zeSby n?R09(H^tde0ov6H&ABz~XyfExq$pxPQ$zi)sG_n Date: Fri, 22 May 2020 21:48:28 -0400 Subject: [PATCH 12/52] merchant sells ultrabrights in death mode --- NPCs/CalamityGlobalNPC.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3f5e146fa3..694cd86ab7 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5310,6 +5310,11 @@ namespace CalamityMod.NPCs chat = "I happen to have several Angel Statues at the moment, a truely rare commodity. Want one?"; } + if (Main.rand.NextBool(7) && CalamityWorld.death) + { + chat = "The caverns have become increasingly dark as of late, so I stocked up on some special torches if you have the funds."; + } + break; case NPCID.Mechanic: @@ -5559,6 +5564,7 @@ namespace CalamityMod.NPCs 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(NPCType()) != -1, Item.buyPrice(0, 5)); + SetShopItem(ref shop, ref nextSlot, ItemID.UltrabrightTorch, CalamityWorld.death); } // Because of the defiled condition, the dye trader does not receive an alert icon when hardmode starts. From b8c81583cabd31b005d26bcc0e86e1efad3d7662 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 21:50:26 -0400 Subject: [PATCH 13/52] prov drops more divine geodes --- Items/TreasureBags/ProvidenceBag.cs | 2 +- NPCs/Providence/Providence.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/TreasureBags/ProvidenceBag.cs b/Items/TreasureBags/ProvidenceBag.cs index 06f05113fb..3f71dc6333 100644 --- a/Items/TreasureBags/ProvidenceBag.cs +++ b/Items/TreasureBags/ProvidenceBag.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.TreasureBags // Materials DropHelper.DropItem(player, ModContent.ItemType(), 25, 35); - DropHelper.DropItem(player, ModContent.ItemType(), 15, 25); + DropHelper.DropItem(player, ModContent.ItemType(), 20, 30); // Weapons DropHelper.DropItemChance(player, ModContent.ItemType(), 3); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 99de93d7cc..4a7e994c95 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1196,7 +1196,7 @@ namespace CalamityMod.NPCs.Providence { // Materials DropHelper.DropItemSpray(npc, ModContent.ItemType(), 20, 30); - DropHelper.DropItemSpray(npc, ModContent.ItemType(), 10, 15); + DropHelper.DropItemSpray(npc, ModContent.ItemType(), 15, 20); // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); From c152d137cc7bc7998afc0eceecb8d9c6edebfae5 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 22:12:08 -0400 Subject: [PATCH 14/52] added areThereAnyDamnEvents. RoD and friends now only boost chaos state while a boss or event is active --- CalPlayer/CalamityPlayer.cs | 30 +++++++++++++++----------- CalPlayer/CalamityPlayerMiscEffects.cs | 3 +++ Items/CalamityGlobalItem.cs | 10 +++++---- NPCs/CalamityGlobalNPC.cs | 17 +++++++++++++++ 4 files changed, 44 insertions(+), 16 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 266a1a462e..0926eb5ba5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -85,6 +85,7 @@ namespace CalamityMod.CalPlayer #region No Category public static bool areThereAnyDamnBosses = false; + public static bool areThereAnyDamnEvents = false; public bool drawBossHPBar = true; public bool shouldDrawSmallText = true; private const int saveVersion = 0; @@ -96,7 +97,8 @@ namespace CalamityMod.CalPlayer public int actualMaxLife = 0; public int deathModeUnderworldTime = 0; public int deathModeBlizzardTime = 0; - public static int chaosStateDuration = 600; + public static int chaosStateDuration = 360; + public static int chaosStateDurationBoss = 600; public bool killSpikyBalls = false; public Projectile lastProjectileHit; public double acidRoundMultiplier = 1D; @@ -2516,12 +2518,14 @@ namespace CalamityMod.CalPlayer player.Teleport(teleportLocation, 4, 0); NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0); + int duration = chaosStateDuration; + if (areThereAnyDamnBosses || areThereAnyDamnEvents) + duration = chaosStateDurationBoss; if (eScarfCooldown) - player.AddBuff(BuffID.ChaosState, (int)(chaosStateDuration * 1.5), true); - else if (scarfCooldown) - player.AddBuff(BuffID.ChaosState, chaosStateDuration * 2, true); - else - player.AddBuff(BuffID.ChaosState, chaosStateDuration, true); + duration = (int)(chaosStateDuration * 1.5); + else if (scarfCooldown) + duration = chaosStateDuration * 2; + player.AddBuff(BuffID.ChaosState, duration, true); } } } @@ -2569,12 +2573,14 @@ namespace CalamityMod.CalPlayer player.Teleport(teleportLocation, 1, 0); NetMessage.SendData(65, -1, -1, null, 0, (float)player.whoAmI, teleportLocation.X, teleportLocation.Y, 1, 0, 0); - if (eScarfCooldown) - player.AddBuff(BuffID.ChaosState, (int)(chaosStateDuration * 1.5), true); - else if (scarfCooldown) - player.AddBuff(BuffID.ChaosState, chaosStateDuration * 2, true); - else - player.AddBuff(BuffID.ChaosState, chaosStateDuration, true); + int duration = chaosStateDuration; + if (areThereAnyDamnBosses || areThereAnyDamnEvents) + duration = chaosStateDurationBoss; + if (eScarfCooldown) + duration = (int)(chaosStateDuration * 1.5); + else if (scarfCooldown) + duration = chaosStateDuration * 2; + player.AddBuff(BuffID.ChaosState, duration, true); int numDust = 40; Vector2 step = playerToTeleport / numDust; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index a14cc532c1..bda8e0183b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -56,6 +56,9 @@ namespace CalamityMod.CalPlayer // Bool for any existing bosses, true if any boss NPC is active CalamityPlayer.areThereAnyDamnBosses = CalamityGlobalNPC.AnyBossNPCS(); + // Bool for any existing events, true if any event is active + CalamityPlayer.areThereAnyDamnEvents = CalamityGlobalNPC.AnyEvents(); + // If any boss NPC is active, apply Zen to the player to reduce spawn rate if (CalamityPlayer.areThereAnyDamnBosses) { diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 02269482a1..016dcc89d8 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -949,12 +949,14 @@ namespace CalamityMod.Items { if (!Collision.SolidCollision(teleportLocation, player.width, player.height)) { + int duration = CalamityPlayer.chaosStateDuration; + if (CalamityPlayer.areThereAnyDamnBosses || CalamityPlayer.areThereAnyDamnEvents) + duration = CalamityPlayer.chaosStateDurationBoss; if (modPlayer.eScarfCooldown) - player.AddBuff(BuffID.ChaosState, (int)(CalamityPlayer.chaosStateDuration * 1.5), true); + duration = (int)(CalamityPlayer.chaosStateDuration * 1.5); else if (modPlayer.scarfCooldown) - player.AddBuff(BuffID.ChaosState, CalamityPlayer.chaosStateDuration * 2, true); - else - player.AddBuff(BuffID.ChaosState, CalamityPlayer.chaosStateDuration, true); + duration = CalamityPlayer.chaosStateDuration * 2; + player.AddBuff(BuffID.ChaosState, duration, true); } } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 694cd86ab7..85fc6ad97d 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5828,6 +5828,23 @@ namespace CalamityMod.NPCs } #endregion + #region Any Events + public static bool AnyEvents() + { + if (Main.invasionType > 0) + return true; + if (player.PillarZone()) + return true; + if (DD2Event.Ongoing) + return true; + if ((player.ZoneOverworldHeight || player.ZoneSkyHeight) && (Main.eclipse || Main.bloodMoon || Main.pumpkinMoon || Main.snowMoon)) + return true; + if (CalamityWorld.rainingAcid && player.InSulphur()) + return true; + return false; + } + #endregion + #region Get Downed Boss Variable public static bool GetDownedBossVariable(int type) { From 579010ef552f826bbaf222d02c37e16d897e3f0f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 22:13:18 -0400 Subject: [PATCH 15/52] fix I think --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index bda8e0183b..deed98e90a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -57,7 +57,7 @@ namespace CalamityMod.CalPlayer CalamityPlayer.areThereAnyDamnBosses = CalamityGlobalNPC.AnyBossNPCS(); // Bool for any existing events, true if any event is active - CalamityPlayer.areThereAnyDamnEvents = CalamityGlobalNPC.AnyEvents(); + CalamityPlayer.areThereAnyDamnEvents = CalamityGlobalNPC.AnyEvents(player); // If any boss NPC is active, apply Zen to the player to reduce spawn rate if (CalamityPlayer.areThereAnyDamnBosses) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 85fc6ad97d..b63f829812 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5829,7 +5829,7 @@ namespace CalamityMod.NPCs #endregion #region Any Events - public static bool AnyEvents() + public static bool AnyEvents(Player player) { if (Main.invasionType > 0) return true; From 9d6b175f9c03a4ff9c3ebc71dd6d4a1a243123c9 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 22:16:13 -0400 Subject: [PATCH 16/52] recall now crafted with blood orbs --- Utilities/CalamityRecipes.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 65b1349c2e..d8285b60a6 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -220,7 +220,8 @@ namespace CalamityMod ItemID.SonarPotion, ItemID.GenderChangePotion, ItemID.LovePotion, - ItemID.StinkPotion + ItemID.StinkPotion, + ItemID.RecallPotion }; ModRecipe r; From 490ba5c8fa246a9cbe026df08e9cd75b6666bb04 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 22 May 2020 22:51:41 -0400 Subject: [PATCH 17/52] spiky balls should no longer consume stealth on right click --- Items/Weapons/Melee/ElementalExcalibur.cs | 5 +-- Items/Weapons/Rogue/GodsParanoia.cs | 35 ++++++++------------- Items/Weapons/Rogue/HellsSun.cs | 37 ++++++++--------------- Items/Weapons/Rogue/Nychthemeron.cs | 22 +++++++++++--- Items/Weapons/Rogue/PoisonPack.cs | 36 ++++++++-------------- Items/Weapons/Rogue/SkyStabber.cs | 36 ++++++++-------------- NPCs/CalamityGlobalNPC.cs | 1 + 7 files changed, 68 insertions(+), 104 deletions(-) diff --git a/Items/Weapons/Melee/ElementalExcalibur.cs b/Items/Weapons/Melee/ElementalExcalibur.cs index 3ef670429d..7ee1892844 100644 --- a/Items/Weapons/Melee/ElementalExcalibur.cs +++ b/Items/Weapons/Melee/ElementalExcalibur.cs @@ -63,10 +63,7 @@ namespace CalamityMod.Items.Weapons.Melee return false; } - public override bool AltFunctionUse(Player player) - { - return true; - } + public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) { diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index 8e3b212583..83056c299e 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -48,33 +48,22 @@ Right click to delete all existing spiky balls"); } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - if (player.ownedProjectileCounts[item.shoot] > 0) - { - return true; - } - else - { - return false; - } - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } else { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 5f; int UseMax = item.stack; - - if (player.ownedProjectileCounts[item.shoot] >= UseMax) - { - return false; - } - else - { - return true; - } + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; } - } + } 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/Rogue/HellsSun.cs b/Items/Weapons/Rogue/HellsSun.cs index d6e73f5fea..d4bcc89035 100644 --- a/Items/Weapons/Rogue/HellsSun.cs +++ b/Items/Weapons/Rogue/HellsSun.cs @@ -46,36 +46,25 @@ namespace CalamityMod.Items.Weapons.Rogue item.shootSpeed = 5f; item.shoot = ModContent.ProjectileType(); - } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - if (player.ownedProjectileCounts[item.shoot] > 0) - { - return true; - } - else - { - return false; - } - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } else { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 5f; int UseMax = item.stack; - - if (player.ownedProjectileCounts[item.shoot] >= UseMax) - { - return false; - } - else - { - return true; - } + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; } - } + } + 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/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index 2f7048ba92..f2d29b7758 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable()) { - for (int j = 0; j < item.stack - player.ownedProjectileCounts[item.shoot]; j++) + for (int j = 0; j < item.stack - player.ownedProjectileCounts[ModContent.ProjectileType()]; j++) { float spread = 2; int pIndex = Projectile.NewProjectile(position.X, position.Y, speedX + Main.rand.NextFloat(-spread, spread), speedY + Main.rand.NextFloat(-spread, spread), type, damage, knockBack, player.whoAmI, 0f, 1f); @@ -79,10 +79,22 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } - public override bool CanUseItem(Player player) - { - return player.ownedProjectileCounts[item.shoot] < item.stack && player.altFunctionUse != 2; - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } + else + { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 6f; + int UseMax = item.stack; + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; + } + } public override void AddRecipes() { diff --git a/Items/Weapons/Rogue/PoisonPack.cs b/Items/Weapons/Rogue/PoisonPack.cs index 07e2541d12..c0b680eb27 100644 --- a/Items/Weapons/Rogue/PoisonPack.cs +++ b/Items/Weapons/Rogue/PoisonPack.cs @@ -42,36 +42,24 @@ namespace CalamityMod.Items.Weapons.Rogue item.shootSpeed = 7f; item.shoot = ModContent.ProjectileType(); - } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - if (player.ownedProjectileCounts[item.shoot] > 0) - { - return true; - } - else - { - return false; - } - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } else { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 7f; int UseMax = item.stack; - - if (player.ownedProjectileCounts[item.shoot] >= UseMax) - { - return false; - } - else - { - return true; - } + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; } - } + } 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/Rogue/SkyStabber.cs b/Items/Weapons/Rogue/SkyStabber.cs index 1c58dc7cd6..b539866fdc 100644 --- a/Items/Weapons/Rogue/SkyStabber.cs +++ b/Items/Weapons/Rogue/SkyStabber.cs @@ -42,36 +42,24 @@ namespace CalamityMod.Items.Weapons.Rogue item.shootSpeed = 2f; item.shoot = ModContent.ProjectileType(); - } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - if (player.ownedProjectileCounts[item.shoot] > 0) - { - return true; - } - else - { - return false; - } - } + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.shoot = 0; + item.shootSpeed = 0f; + return player.ownedProjectileCounts[ModContent.ProjectileType()] > 0; + } else { + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 2f; int UseMax = item.stack; - - if (player.ownedProjectileCounts[item.shoot] >= UseMax) - { - return false; - } - else - { - return true; - } + return player.ownedProjectileCounts[ModContent.ProjectileType()] < UseMax; } - } + } 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/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index b63f829812..9d42e77571 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -68,6 +68,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using Terraria; +using Terraria.GameContent.Events; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; From 67bd239106c48588622382794a810fa1af587ee6 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 23 May 2020 08:21:56 -0400 Subject: [PATCH 18/52] fixed howl machinegun --- Items/Accessories/HowlsHeart.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Accessories/HowlsHeart.cs b/Items/Accessories/HowlsHeart.cs index 62234a3e5b..ef5c92d3de 100644 --- a/Items/Accessories/HowlsHeart.cs +++ b/Items/Accessories/HowlsHeart.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ProjectileType(), (int)(HowlDamage * player.MinionDamage()), 1f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ProjectileType(), (int)(HowlDamage * player.MinionDamage()), 1f, player.whoAmI, 0f, 1f); } if (player.ownedProjectileCounts[ProjectileType()] < 1) { From 11c67b16f8561b2d0b0938ee4f0e8375a0d1eff9 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 23 May 2020 08:31:13 -0400 Subject: [PATCH 19/52] nerfed prismatic laser attack a shit ton --- CalPlayer/CalamityPlayerMiscEffects.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index deed98e90a..af103032cd 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3552,7 +3552,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.prismaticLasers > 1800 && player.whoAmI == Main.myPlayer) { float shootSpeed = 18f; - int dmg = (int)(150 * player.MagicDamage()); + int dmg = (int)(50 * player.MagicDamage()); Vector2 startPos = player.RotatedRelativePoint(player.MountedCenter, true); Vector2 velocity = Main.MouseWorld - startPos; if (player.gravDir == -1f) @@ -3571,7 +3571,7 @@ namespace CalamityMod.CalPlayer travelDist = shootSpeed / travelDist; } - int laserAmt = 2; + int laserAmt = Main.rand.Next(2); for (int index = 0; index < laserAmt; index++) { startPos = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); @@ -3593,7 +3593,8 @@ namespace CalamityMod.CalPlayer velocity.Y *= travelDist; velocity.X += (float)Main.rand.Next(-50, 51) * 0.02f; velocity.Y += (float)Main.rand.Next(-50, 51) * 0.02f; - Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, (float)Main.rand.Next(10)); + int laser = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), dmg, 4f, player.whoAmI, 0f, Main.rand.Next(10)); + Main.projectile[laser].localNPCHitCooldown = 5; } Main.PlaySound(SoundID.Item12, player.position); } From c5871429311b1b444326cd8a3270768b23e80ef6 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sat, 23 May 2020 20:23:37 -0500 Subject: [PATCH 20/52] Nerfed Bumbledoge mount horizontal speed --- Items/Mounts/BUMBLEDOGE.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Items/Mounts/BUMBLEDOGE.cs b/Items/Mounts/BUMBLEDOGE.cs index 9cdc2a3399..e720b01f24 100644 --- a/Items/Mounts/BUMBLEDOGE.cs +++ b/Items/Mounts/BUMBLEDOGE.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Items.Mounts mountData.fatigueMax = 0; mountData.fallDamage = 0f; mountData.runSpeed = 12f; - mountData.dashSpeed = 12f; mountData.heightBoost = 44; mountData.acceleration = 0.2f; mountData.jumpHeight = 10; @@ -56,7 +55,7 @@ namespace CalamityMod.Items.Mounts mountData.swimFrameDelay = mountData.inAirFrameDelay; mountData.swimFrameStart = mountData.inAirFrameStart; - mountData.dashSpeed = 25f; + mountData.dashSpeed = 18.5f; mountData.dashingFrameCount = mountData.flyingFrameCount; mountData.dashingFrameDelay = 5; mountData.dashingFrameStart = mountData.flyingFrameStart; From d70c4c33a092d37caeb41729123cf629f829115c Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sat, 23 May 2020 21:34:37 -0500 Subject: [PATCH 21/52] Made water leeches and skyfins less aggressive --- CalPlayer/CalamityPlayer.cs | 6 ++++-- NPCs/AcidRain/Skyfin.cs | 11 ++++++++++- NPCs/AcidRain/WaterLeech.cs | 32 +++++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0926eb5ba5..3b8871c3aa 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -102,6 +102,7 @@ namespace CalamityMod.CalPlayer public bool killSpikyBalls = false; public Projectile lastProjectileHit; public double acidRoundMultiplier = 1D; + public int waterLeechTarget = -1; #endregion #region External variables -- Only set by Mod.Call @@ -8807,8 +8808,8 @@ namespace CalamityMod.CalPlayer } public override void PreUpdate() - { - tailFrameUp++; + { + tailFrameUp++; if (tailFrameUp == 8) { tailFrame++; @@ -11103,6 +11104,7 @@ namespace CalamityMod.CalPlayer int frame = HandlePSCAnimationFrames(animType); player.legFrame.Y = player.legFrame.Height * frame; } + waterLeechTarget = -1; } #endregion diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index 946524a1b0..2b0665d63e 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -86,7 +86,16 @@ namespace CalamityMod.NPCs.AcidRain { if (npc.ai[0] % 55f == 54f) { - npc.velocity = Vector2.UnitX * (player.Center.X - npc.Center.X > 0).ToDirectionInt() * 27f; + float horizontalSchoolingSpeed = 9f; + if (CalamityWorld.downedAquaticScourge) + { + horizontalSchoolingSpeed = 15f; + } + if (CalamityWorld.downedPolterghast) + { + horizontalSchoolingSpeed = 24f; + } + npc.velocity = Vector2.UnitX * (player.Center.X - npc.Center.X > 0).ToDirectionInt() * horizontalSchoolingSpeed; } if ((Math.Abs(player.Center.Y - npc.Center.Y) > 50f && player.wet) || (!player.wet && npc.ai[1] <= 0f)) { diff --git a/NPCs/AcidRain/WaterLeech.cs b/NPCs/AcidRain/WaterLeech.cs index db02795914..d11b3cd218 100644 --- a/NPCs/AcidRain/WaterLeech.cs +++ b/NPCs/AcidRain/WaterLeech.cs @@ -71,7 +71,33 @@ namespace CalamityMod.NPCs.AcidRain npc.TargetClosest(false); npc.localAI[0] = 1f; } + + // Anti-sticky movement and player targeting detection (only one leech and attack the player at once) Player player = Main.player[npc.target]; + bool playerAlreadyTargeted = false; + float antiStickyAcceleration = 0.25f; + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].type == npc.type && + Main.npc[i].whoAmI != npc.whoAmI && + Main.npc[i].active) + { + if (Main.npc[i].target == npc.target && !playerAlreadyTargeted) + { + playerAlreadyTargeted = true; + } + if (Main.npc[i].Hitbox.Intersects(npc.Hitbox)) + { + npc.velocity += npc.DirectionFrom(Main.npc[i].Center) * antiStickyAcceleration; + } + } + } + + if (!playerAlreadyTargeted || player.Calamity().waterLeechTarget == -1) + { + player.Calamity().waterLeechTarget = npc.whoAmI; + } + // Latch onto player if (npc.ai[0] == 1f) { @@ -114,14 +140,14 @@ namespace CalamityMod.NPCs.AcidRain npc.netUpdate = true; } } - else if (player.wet) + else if (player.wet && player.Calamity().waterLeechTarget == npc.whoAmI) { - float speed = player.wet ? 23f : 15f; + float speed = player.wet ? 23f : 17f; float swimIntertia = 24f; if (CalamityWorld.downedPolterghast) { speed *= 1.6f; - swimIntertia = 13f; + swimIntertia = 17f; } npc.velocity = (npc.velocity * (swimIntertia - 1f) + npc.DirectionTo(player.Center) * speed) / swimIntertia; } From 5bf7e81b6f056db8df36282ae71d735b2be721ce Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sat, 23 May 2020 21:34:54 -0500 Subject: [PATCH 22/52] Reduced sulph skater spawnrate --- Events/AcidRainEvent.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 287a2f66f5..f5c9c90528 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Events { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, - { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Anywhere) } + { ModContent.NPCType(), new AcidRainSpawnData(1, 0.4f, AcidRainSpawnRequirement.Anywhere) } }; public static Dictionary PossibleEnemiesPolter = new Dictionary() @@ -71,7 +71,7 @@ namespace CalamityMod.Events { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Water) }, - { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Anywhere) }, + { ModContent.NPCType(), new AcidRainSpawnData(1, 0.4f, AcidRainSpawnRequirement.Anywhere) }, { ModContent.NPCType(), new AcidRainSpawnData(1, 1f, AcidRainSpawnRequirement.Anywhere) } }; From 8791a5d8d498ca47a7bb11d85182c4a315f2037c Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 23 May 2020 23:14:58 -0400 Subject: [PATCH 23/52] preventing sandstorm now has a check for hardmode --- World/CalamityWorld.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index b2adc93dff..0390a0a5f6 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1827,7 +1827,7 @@ namespace CalamityMod.World } } - if (!downedDesertScourge && Main.netMode != NetmodeID.MultiplayerClient) + if (!downedDesertScourge && Main.netMode != NetmodeID.MultiplayerClient && !Main.hardMode) CalamityUtils.StopSandstorm(); if (Main.netMode != NetmodeID.MultiplayerClient) From 2ec4893bd65a8ca1add089ff443d27b9095890a6 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 24 May 2020 11:10:21 -0400 Subject: [PATCH 24/52] applied homing fixes for nuclear fury, planetary annihilation, entropy's vigil, deepsea staff, and plantation staff --- CalPlayer/CalamityPlayer.cs | 1 - Projectiles/Magic/NuclearFuryProjectile.cs | 91 +++++++++++++++++++ .../Ranged/PlanetaryAnnihilationProj.cs | 34 +------ Projectiles/Summon/AquaticStarMinion.cs | 7 +- Projectiles/Summon/Calamitamini.cs | 15 +-- Projectiles/Summon/Cataclymini.cs | 13 ++- Projectiles/Summon/Catastromini.cs | 15 +-- Projectiles/Summon/PlantSummon.cs | 34 ++++--- 8 files changed, 143 insertions(+), 67 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3b8871c3aa..9f59fd3573 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -54,7 +54,6 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.IO; using Terraria.ModLoader.Config; -using System.Linq; namespace CalamityMod.CalPlayer { diff --git a/Projectiles/Magic/NuclearFuryProjectile.cs b/Projectiles/Magic/NuclearFuryProjectile.cs index 9f58a84dfc..fb7158c660 100644 --- a/Projectiles/Magic/NuclearFuryProjectile.cs +++ b/Projectiles/Magic/NuclearFuryProjectile.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -31,6 +32,96 @@ namespace CalamityMod.Projectiles.Magic projectile.ignoreWater = true; } + public override void AI() + { + projectile.localAI[1] += 1f; + if (projectile.localAI[1] > 10f && Main.rand.NextBool(3)) + { + int num = 6; + for (int index1 = 0; index1 < num; ++index1) + { + Vector2 vector2_1 = (Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width, (float)projectile.height) / 2f).RotatedBy((double)(index1 - (num / 2 - 1)) * Math.PI / (double)num, new Vector2()) + projectile.Center; + Vector2 vector2_2 = ((Main.rand.NextFloat() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int index2 = Dust.NewDust(vector2_1 + vector2_2, 0, 0, 217, vector2_2.X * 2f, vector2_2.Y * 2f, 100, new Color(), 1.4f); + Dust dust = Main.dust[index2]; + dust.noGravity = true; + dust.noLight = true; + dust.velocity /= 4f; + dust.velocity -= projectile.velocity; + } + projectile.alpha -= 5; + if (projectile.alpha < 50) + projectile.alpha = 50; + projectile.rotation += projectile.velocity.X * 0.1f; + projectile.frame = (int)(projectile.localAI[1] / 3f) % 3; + Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, 0.1f, 0.4f, 0.6f); + } + int num1 = -1; + Vector2 vector2 = projectile.Center; + float num2 = 500f; + Vector2 value = new Vector2(0.5f); + if (projectile.localAI[0] > 0f) + { + projectile.localAI[0] -= 1f; + } + if (projectile.ai[0] == 0f && projectile.localAI[0] == 0f) + { + for (int index = 0; index < Main.maxNPCs; ++index) + { + NPC npc = Main.npc[index]; + if (npc.CanBeChasedBy(projectile, false) && (projectile.ai[0] == 0f || projectile.ai[0] == (index + 1f))) + { + Vector2 center = npc.position + npc.Size * value; + float num3 = Vector2.Distance(center, vector2); + if (num3 < num2 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + { + num2 = num3; + vector2 = center; + num1 = index; + } + } + } + if (num1 >= 0) + { + projectile.ai[0] = num1 + 1f; + projectile.netUpdate = true; + } + } + if (projectile.localAI[0] == 0f && projectile.ai[0] == 0f) + projectile.localAI[0] = 30f; + bool flag = false; + if (projectile.ai[0] != 0f) + { + int index = (int)(projectile.ai[0] - 1); + if (Main.npc[index].active && !Main.npc[index].dontTakeDamage && Main.npc[index].immune[projectile.owner] == 0) + { + if ((Math.Abs(projectile.Center.X - Main.npc[index].Center.X) + Math.Abs(projectile.Center.Y - Main.npc[index].Center.Y)) < 1000f) + { + flag = true; + vector2 = Main.npc[index].Center; + } + } + else + { + projectile.ai[0] = 0f; + flag = false; + projectile.netUpdate = true; + } + } + if (flag) + { + double num3 = (double)(vector2 - projectile.Center).ToRotation() - (double)projectile.velocity.ToRotation(); + if (num3 > Math.PI) + num3 -= 2.0 * Math.PI; + if (num3 < -1.0 * Math.PI) + num3 += 2.0 * Math.PI; + projectile.velocity = projectile.velocity.RotatedBy(num3 * 0.1, new Vector2()); + } + float num4 = projectile.velocity.Length(); + projectile.velocity.Normalize(); + projectile.velocity = projectile.velocity * (num4 + 1f / 400f); + } + public override void Kill(int timeLeft) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); diff --git a/Projectiles/Ranged/PlanetaryAnnihilationProj.cs b/Projectiles/Ranged/PlanetaryAnnihilationProj.cs index d5d419f1e6..b91cefe529 100644 --- a/Projectiles/Ranged/PlanetaryAnnihilationProj.cs +++ b/Projectiles/Ranged/PlanetaryAnnihilationProj.cs @@ -58,39 +58,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 400f; - bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - if (flag17) - { - float num483 = 18f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - } + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 18f, 20f); } public override void Kill(int timeLeft) diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index 012c839454..cf238cfad5 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -116,16 +116,18 @@ namespace CalamityMod.Projectiles.Summon } Vector2 vector46 = projectile.position; bool flag25 = false; + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } @@ -137,11 +139,12 @@ namespace CalamityMod.Projectiles.Summon NPC npc = Main.npc[num645]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index 8ee9315bf7..85b12794b5 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -117,15 +117,17 @@ namespace CalamityMod.Projectiles.Summon { projectile.tileCollide = false; } + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } @@ -134,14 +136,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index b8372875eb..a4f7b2adbc 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -116,11 +116,13 @@ namespace CalamityMod.Projectiles.Summon { projectile.tileCollide = false; } + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { @@ -133,14 +135,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index 86a4b27f9e..dfbdb77e71 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -144,16 +144,18 @@ namespace CalamityMod.Projectiles.Summon { projectile.tileCollide = false; } + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } @@ -162,14 +164,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); + if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index e54d51b734..2217137588 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -152,16 +152,18 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[0] = 0f; Vector2 vector46 = projectile.position; bool flag25 = false; + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if (!flag25 && num646 < num633) { num633 = num646; - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } @@ -170,14 +172,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); if (!flag25 && num646 < num633) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } @@ -273,14 +276,14 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[0] == 0f) { float scaleFactor3 = 6f; - int num658 = (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()); + int projType = (Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()); int projDmg = (int)(projectile.damage * 0.7f); float speedMult = 1f; if (Main.rand.NextBool(4)) { - num658 = ModContent.ProjectileType(); + projType = ModContent.ProjectileType(); } - if (num658 == ModContent.ProjectileType()) + if (projType == ModContent.ProjectileType()) { speedMult = 2f; projDmg = (int)(projectile.damage * 1.2f); @@ -294,7 +297,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 value19 = vector46 - projectile.Center; value19.Normalize(); value19 *= scaleFactor3; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X * speedMult, value19.Y * speedMult, num658, projDmg, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X * speedMult, value19.Y * speedMult, projType, projDmg, 0f, projectile.owner, 0f, 0f); projectile.netUpdate = true; } } @@ -326,16 +329,18 @@ namespace CalamityMod.Projectiles.Summon } Vector2 vector46 = projectile.position; bool flag25 = false; + Vector2 value = new Vector2(0.5f); if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { + Vector2 vector2 = npc.position + npc.Size * value; float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) { num633 = num646; - vector46 = npc.Center; + vector46 = vector2; flag25 = true; } } @@ -344,14 +349,15 @@ namespace CalamityMod.Projectiles.Summon { for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); + Vector2 vector2 = npc.position + npc.Size * value; + float num646 = Vector2.Distance(npc.Center, projectile.Center); if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) { num633 = num646; - vector46 = nPC2.Center; + vector46 = vector2; flag25 = true; } } From 399010e4891325ba59eff33d3dc00d1a72f5f141 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 24 May 2020 14:53:25 -0400 Subject: [PATCH 25/52] removed aistyle --- Projectiles/Magic/NuclearFuryProjectile.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Projectiles/Magic/NuclearFuryProjectile.cs b/Projectiles/Magic/NuclearFuryProjectile.cs index fb7158c660..ced7da82de 100644 --- a/Projectiles/Magic/NuclearFuryProjectile.cs +++ b/Projectiles/Magic/NuclearFuryProjectile.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Magic projectile.height = 60; projectile.alpha = 255; projectile.friendly = true; - projectile.aiStyle = 71; projectile.magic = true; projectile.penetrate = -1; projectile.timeLeft = 600; From 2b9b670927465ee7a41346c931bd139a51ee70a9 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 24 May 2020 21:15:51 -0400 Subject: [PATCH 26/52] sealed singularity texture fix --- Projectiles/Rogue/SealedSingularityGore.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Projectiles/Rogue/SealedSingularityGore.cs b/Projectiles/Rogue/SealedSingularityGore.cs index 1dad8cd775..5b1f906bc4 100644 --- a/Projectiles/Rogue/SealedSingularityGore.cs +++ b/Projectiles/Rogue/SealedSingularityGore.cs @@ -14,21 +14,20 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { projectile.friendly = true; - projectile.width = 25; - projectile.height = 25; + projectile.width = projectile.height = 25; projectile.Calamity().rogue = true; + projectile.timeLeft = 300; } public override void AI() { //Rotation and gravity projectile.rotation += 0.6f * projectile.direction; - projectile.velocity.Y = projectile.velocity.Y + 0.27f; + projectile.velocity.Y += 0.27f; if (projectile.velocity.Y > 16f) { projectile.velocity.Y = 16f; } - } public override void Kill(int timeLeft) @@ -48,10 +47,9 @@ namespace CalamityMod.Projectiles.Rogue Texture2D texture; switch (projectile.ai[0]) { - - case 2f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/SealedSingularityGore2"); + case 1f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/SealedSingularityGore2"); break; - case 3f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/SealedSingularityGore3"); + case 2f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/SealedSingularityGore3"); break; default: texture = Main.projectileTexture[projectile.type]; break; From f6ab8869b6b5878bb1641c292c67436102043972 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 24 May 2020 21:18:55 -0400 Subject: [PATCH 27/52] buffs to sealed singularity and apoctolith --- Items/Weapons/Rogue/Apoctolith.cs | 2 +- Items/Weapons/Rogue/SealedSingularity.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index 776dfbb294..11507f71d8 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 100; + item.damage = 108; item.shootSpeed = 15f; item.shoot = ModContent.ProjectileType(); item.width = 66; diff --git a/Items/Weapons/Rogue/SealedSingularity.cs b/Items/Weapons/Rogue/SealedSingularity.cs index 3574841393..d56a78eca5 100644 --- a/Items/Weapons/Rogue/SealedSingularity.cs +++ b/Items/Weapons/Rogue/SealedSingularity.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 47; + item.damage = 169; item.knockBack = 5f; item.useAnimation = item.useTime = 25; item.useStyle = 1; From e2750db52e39df010b4163856b328b2ef454e877 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 24 May 2020 21:38:29 -0400 Subject: [PATCH 28/52] hybrid weapons now can call universal SS effects also fixed some type bugs with true paladin's hammer and flame scythe (melee) --- Items/Weapons/Melee/AccretionDiskMelee.cs | 8 -------- Items/Weapons/Melee/EradicatorMelee.cs | 7 ------- Items/Weapons/Melee/FlameScytheMelee.cs | 8 -------- Items/Weapons/Melee/MangroveChakramMelee.cs | 8 -------- Items/Weapons/Melee/PwnagehammerMelee.cs | 8 -------- Items/Weapons/Melee/SeashellBoomerangMelee.cs | 8 -------- .../TriactisTruePaladinianMageHammerofMightMelee.cs | 8 -------- Items/Weapons/Melee/TruePaladinsHammerMelee.cs | 8 -------- Items/Weapons/Rogue/AccretionDisk.cs | 9 +++++++++ Items/Weapons/Rogue/CorpusAvertor.cs | 3 ++- Items/Weapons/Rogue/EmpyreanKnivesThrown.cs | 3 ++- Items/Weapons/Rogue/Eradicator.cs | 8 ++++++++ Items/Weapons/Rogue/FlameScythe.cs | 9 +++++++++ Items/Weapons/Rogue/GalaxySmasherRogue.cs | 1 + Items/Weapons/Rogue/KelvinCatalyst.cs | 3 ++- Items/Weapons/Rogue/MangroveChakram.cs | 9 +++++++++ Items/Weapons/Rogue/NanoblackReaperRogue.cs | 1 + Items/Weapons/Rogue/Pwnagehammer.cs | 9 +++++++++ Items/Weapons/Rogue/RoyalKnives.cs | 3 ++- Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs | 3 ++- Items/Weapons/Rogue/SeashellBoomerang.cs | 9 +++++++++ Items/Weapons/Rogue/StellarContemptRogue.cs | 1 + Items/Weapons/Rogue/TerraDisk.cs | 1 + .../Rogue/TriactisTruePaladinianMageHammerofMight.cs | 9 +++++++++ Items/Weapons/Rogue/TruePaladinsHammer.cs | 9 +++++++++ Projectiles/Hybrid/AccretionDiskProj.cs | 2 +- Projectiles/Hybrid/EradicatorProjectile.cs | 2 +- Projectiles/Hybrid/FlameScytheProjectile.cs | 12 +++++++++--- Projectiles/Hybrid/GalaxySmasherHammer.cs | 1 - Projectiles/Hybrid/MangroveChakramProjectile.cs | 2 +- Projectiles/Hybrid/OPHammer.cs | 12 +++++++++--- Projectiles/Hybrid/PwnagehammerProj.cs | 2 +- Projectiles/Hybrid/SeashellBoomerangProjectile.cs | 2 +- Projectiles/Hybrid/TriactisOPHammer.cs | 2 +- 34 files changed, 109 insertions(+), 81 deletions(-) diff --git a/Items/Weapons/Melee/AccretionDiskMelee.cs b/Items/Weapons/Melee/AccretionDiskMelee.cs index 1eadd4f954..2b4c772c7c 100644 --- a/Items/Weapons/Melee/AccretionDiskMelee.cs +++ b/Items/Weapons/Melee/AccretionDiskMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,13 +35,6 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Turquoise; } - 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/EradicatorMelee.cs b/Items/Weapons/Melee/EradicatorMelee.cs index 31f6afb425..7f827c609a 100644 --- a/Items/Weapons/Melee/EradicatorMelee.cs +++ b/Items/Weapons/Melee/EradicatorMelee.cs @@ -36,13 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.PureGreen; } - 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Vector2 origin = new Vector2(31f, 29f); diff --git a/Items/Weapons/Melee/FlameScytheMelee.cs b/Items/Weapons/Melee/FlameScytheMelee.cs index 5ded2dbf1f..feca9aa52a 100644 --- a/Items/Weapons/Melee/FlameScytheMelee.cs +++ b/Items/Weapons/Melee/FlameScytheMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,13 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 16f; } - 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/MangroveChakramMelee.cs b/Items/Weapons/Melee/MangroveChakramMelee.cs index b2c51b0be1..765e0701bc 100644 --- a/Items/Weapons/Melee/MangroveChakramMelee.cs +++ b/Items/Weapons/Melee/MangroveChakramMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,13 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 16f; } - 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/PwnagehammerMelee.cs b/Items/Weapons/Melee/PwnagehammerMelee.cs index 60f28b067f..9315eac593 100644 --- a/Items/Weapons/Melee/PwnagehammerMelee.cs +++ b/Items/Weapons/Melee/PwnagehammerMelee.cs @@ -1,5 +1,4 @@ using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,13 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 12f; } - 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/SeashellBoomerangMelee.cs b/Items/Weapons/Melee/SeashellBoomerangMelee.cs index 79febc672a..841ad4267e 100644 --- a/Items/Weapons/Melee/SeashellBoomerangMelee.cs +++ b/Items/Weapons/Melee/SeashellBoomerangMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,13 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 11.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) - { - int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs index ba5e4479cd..849065bc52 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs @@ -1,7 +1,6 @@ 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; @@ -37,13 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee item.Calamity().customRarity = CalamityRarity.Developer; } - 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs index 63838e1415..f5865df418 100644 --- a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs +++ b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,13 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 14f; } - 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - Main.projectile[proj].Calamity().forceMelee = true; - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/AccretionDisk.cs b/Items/Weapons/Rogue/AccretionDisk.cs index 32da2c5c22..39fbd1f72d 100644 --- a/Items/Weapons/Rogue/AccretionDisk.cs +++ b/Items/Weapons/Rogue/AccretionDisk.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -35,6 +36,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.Turquoise; } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index 74e7573bc9..3475a96cd1 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -46,7 +46,8 @@ namespace CalamityMod.Items.Weapons.Rogue 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); + int dagger = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[dagger].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } } diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs index f114c903d6..878d9b34c2 100644 --- a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs +++ b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs @@ -94,7 +94,8 @@ namespace CalamityMod.Items.Weapons.Rogue num149 *= num80; float x4 = vector2.X; float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); + int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); } return false; } diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 21d7a99cbc..0951af189d 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -36,6 +36,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.PureGreen; } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Vector2 origin = new Vector2(31f, 29f); diff --git a/Items/Weapons/Rogue/FlameScythe.cs b/Items/Weapons/Rogue/FlameScythe.cs index 55d7aa87c8..4120edfc13 100644 --- a/Items/Weapons/Rogue/FlameScythe.cs +++ b/Items/Weapons/Rogue/FlameScythe.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,6 +35,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/GalaxySmasherRogue.cs b/Items/Weapons/Rogue/GalaxySmasherRogue.cs index f5bbadb4c6..a59b0e4d53 100644 --- a/Items/Weapons/Rogue/GalaxySmasherRogue.cs +++ b/Items/Weapons/Rogue/GalaxySmasherRogue.cs @@ -47,6 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index f8dad5bc9b..7f4b6e90a1 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -43,7 +43,8 @@ namespace CalamityMod.Items.Weapons.Rogue 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); + int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/MangroveChakram.cs b/Items/Weapons/Rogue/MangroveChakram.cs index 5a0d797ec6..96d7874b26 100644 --- a/Items/Weapons/Rogue/MangroveChakram.cs +++ b/Items/Weapons/Rogue/MangroveChakram.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,6 +34,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/NanoblackReaperRogue.cs b/Items/Weapons/Rogue/NanoblackReaperRogue.cs index c2ea74d77f..7f0d949771 100644 --- a/Items/Weapons/Rogue/NanoblackReaperRogue.cs +++ b/Items/Weapons/Rogue/NanoblackReaperRogue.cs @@ -49,6 +49,7 @@ namespace CalamityMod.Items.Weapons.Rogue { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/Pwnagehammer.cs b/Items/Weapons/Rogue/Pwnagehammer.cs index 22c306977d..efc33c2c13 100644 --- a/Items/Weapons/Rogue/Pwnagehammer.cs +++ b/Items/Weapons/Rogue/Pwnagehammer.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,6 +34,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Rogue/RoyalKnives.cs index 2814bc4c33..4d5499fe89 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Rogue/RoyalKnives.cs @@ -93,7 +93,8 @@ namespace CalamityMod.Items.Weapons.Rogue num149 *= num80; float x4 = vector2.X; float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, type, 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().stealthStrike = player.Calamity().StealthStrikeAvailable(); } return false; } diff --git a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs index 9be81be0ae..93641079e8 100644 --- a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs +++ b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs @@ -39,7 +39,8 @@ namespace CalamityMod.Items.Weapons.Rogue 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); + int javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f); + Main.projectile[javelin].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/SeashellBoomerang.cs b/Items/Weapons/Rogue/SeashellBoomerang.cs index cd9eb3a0c4..9424e5d6ea 100644 --- a/Items/Weapons/Rogue/SeashellBoomerang.cs +++ b/Items/Weapons/Rogue/SeashellBoomerang.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,6 +33,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/StellarContemptRogue.cs b/Items/Weapons/Rogue/StellarContemptRogue.cs index 307f59266f..f3b4207cc6 100644 --- a/Items/Weapons/Rogue/StellarContemptRogue.cs +++ b/Items/Weapons/Rogue/StellarContemptRogue.cs @@ -45,6 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/TerraDisk.cs b/Items/Weapons/Rogue/TerraDisk.cs index 84124fafee..80ab448d5c 100644 --- a/Items/Weapons/Rogue/TerraDisk.cs +++ b/Items/Weapons/Rogue/TerraDisk.cs @@ -58,6 +58,7 @@ A max of three disks can be active at a time"); { int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } diff --git a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs index cc7d1d8545..b6f1371380 100644 --- a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.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,6 +37,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.Developer; } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/TruePaladinsHammer.cs b/Items/Weapons/Rogue/TruePaladinsHammer.cs index eeaee61fc5..e982861df0 100644 --- a/Items/Weapons/Rogue/TruePaladinsHammer.cs +++ b/Items/Weapons/Rogue/TruePaladinsHammer.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,6 +35,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; } + 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, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[proj].Calamity().forceRogue = true; + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Projectiles/Hybrid/AccretionDiskProj.cs b/Projectiles/Hybrid/AccretionDiskProj.cs index 0cc68e105f..5c91e8fadb 100644 --- a/Projectiles/Hybrid/AccretionDiskProj.cs +++ b/Projectiles/Hybrid/AccretionDiskProj.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.aiStyle = 3; projectile.timeLeft = 400; aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() diff --git a/Projectiles/Hybrid/EradicatorProjectile.cs b/Projectiles/Hybrid/EradicatorProjectile.cs index 458f86a7a3..c5d6093ea1 100644 --- a/Projectiles/Hybrid/EradicatorProjectile.cs +++ b/Projectiles/Hybrid/EradicatorProjectile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Hybrid aiType = ProjectileID.WoodenBoomerang; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() diff --git a/Projectiles/Hybrid/FlameScytheProjectile.cs b/Projectiles/Hybrid/FlameScytheProjectile.cs index 57e8b9a374..5faaa6cf46 100644 --- a/Projectiles/Hybrid/FlameScytheProjectile.cs +++ b/Projectiles/Hybrid/FlameScytheProjectile.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.timeLeft = 600; projectile.alpha = 55; aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() @@ -57,7 +57,10 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceRogue = true; + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; } } @@ -67,7 +70,10 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceRogue = true; + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; } } } diff --git a/Projectiles/Hybrid/GalaxySmasherHammer.cs b/Projectiles/Hybrid/GalaxySmasherHammer.cs index 16010c3265..39f836e272 100644 --- a/Projectiles/Hybrid/GalaxySmasherHammer.cs +++ b/Projectiles/Hybrid/GalaxySmasherHammer.cs @@ -183,7 +183,6 @@ namespace CalamityMod.Projectiles.Hybrid float laserSpeed = Main.rand.NextFloat(15f, 18f); Vector2 velocity = startDir * (-laserSpeed); - // NebulaShot projectile adjusts its own damage type based on ai[0] if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner); diff --git a/Projectiles/Hybrid/MangroveChakramProjectile.cs b/Projectiles/Hybrid/MangroveChakramProjectile.cs index 0c32453a85..a1e11f2486 100644 --- a/Projectiles/Hybrid/MangroveChakramProjectile.cs +++ b/Projectiles/Hybrid/MangroveChakramProjectile.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.aiStyle = 3; projectile.timeLeft = 600; aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() diff --git a/Projectiles/Hybrid/OPHammer.cs b/Projectiles/Hybrid/OPHammer.cs index 0278d3d2db..8cd41f666b 100644 --- a/Projectiles/Hybrid/OPHammer.cs +++ b/Projectiles/Hybrid/OPHammer.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 2; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() @@ -118,7 +118,10 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceRogue = true; + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; } } @@ -128,7 +131,10 @@ namespace CalamityMod.Projectiles.Hybrid if (projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - Main.projectile[proj].Calamity().forceRogue = true; + if (projectile.melee) + Main.projectile[proj].Calamity().forceMelee = true; + else + Main.projectile[proj].Calamity().forceRogue = true; } } diff --git a/Projectiles/Hybrid/PwnagehammerProj.cs b/Projectiles/Hybrid/PwnagehammerProj.cs index b84082b42c..a973c87a60 100644 --- a/Projectiles/Hybrid/PwnagehammerProj.cs +++ b/Projectiles/Hybrid/PwnagehammerProj.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.timeLeft = 120; projectile.extraUpdates = 3; aiType = ProjectileID.PaladinsHammerFriendly; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() diff --git a/Projectiles/Hybrid/SeashellBoomerangProjectile.cs b/Projectiles/Hybrid/SeashellBoomerangProjectile.cs index d7209de0a7..f6f6a7c8aa 100644 --- a/Projectiles/Hybrid/SeashellBoomerangProjectile.cs +++ b/Projectiles/Hybrid/SeashellBoomerangProjectile.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.aiStyle = 3; projectile.timeLeft = 240; aiType = ProjectileID.WoodenBoomerang; - projectile.Calamity().rogue = true; + projectile.melee = true; } } } diff --git a/Projectiles/Hybrid/TriactisOPHammer.cs b/Projectiles/Hybrid/TriactisOPHammer.cs index 1c4ddffd63..4a59c7ab85 100644 --- a/Projectiles/Hybrid/TriactisOPHammer.cs +++ b/Projectiles/Hybrid/TriactisOPHammer.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 3; - projectile.Calamity().rogue = true; + projectile.melee = true; } public override void AI() From 6db8fbec872aef3fee9f155c46cfe899f6856af1 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 25 May 2020 09:36:51 -0400 Subject: [PATCH 29/52] black hawk, cosmic viper, plantation, and subjugator now use AngleTowards --- Projectiles/Summon/BlackHawkSummon.cs | 4 ++-- Projectiles/Summon/CosmicViperSummon.cs | 2 +- Projectiles/Summon/PhantomGuy.cs | 8 ++++---- Projectiles/Summon/PlantSummon.cs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index 3478ec1a8c..85162b0476 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -216,11 +216,11 @@ namespace CalamityMod.Projectiles.Summon } if (flag25) { - projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(vector46) + MathHelper.Pi, 0.1f); } else { - projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi; } if (projectile.ai[1] > 0f) { diff --git a/Projectiles/Summon/CosmicViperSummon.cs b/Projectiles/Summon/CosmicViperSummon.cs index 54747653c6..c409c0ac5d 100644 --- a/Projectiles/Summon/CosmicViperSummon.cs +++ b/Projectiles/Summon/CosmicViperSummon.cs @@ -222,7 +222,7 @@ namespace CalamityMod.Projectiles.Summon } if (foundTarget) { - projectile.rotation = (targetVec - projectile.Center).ToRotation() + MathHelper.Pi; + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(targetVec) + MathHelper.Pi, 0.1f); } else { diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index 42c0e72143..47bdf7321f 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -187,8 +187,8 @@ namespace CalamityMod.Projectiles.Summon } if (num651 > 2000f) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); projectile.netUpdate = true; } if (num651 > 70f) @@ -205,11 +205,11 @@ namespace CalamityMod.Projectiles.Summon } if (flag25) { - projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(vector46) + MathHelper.Pi, 0.1f); } else { - projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi; } if (projectile.ai[1] > 0f) { diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index 2217137588..55f9d2f5d0 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -258,11 +258,11 @@ namespace CalamityMod.Projectiles.Summon } if (flag25) { - projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f; + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(vector46) + MathHelper.Pi, 0.1f); } else { - projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi; } if (projectile.ai[1] > 0f) { From 6161d1761e5249059645f257c6bad9329c804e76 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 25 May 2020 11:40:41 -0400 Subject: [PATCH 30/52] added a charging minion AI shortcut --- Projectiles/CalamityGlobalProjectile.cs | 225 +++++++++++++++++++++ Projectiles/Summon/AquaticStarMinion.cs | 184 +---------------- Projectiles/Summon/BrittleStarMinion.cs | 181 +---------------- Projectiles/Summon/Catastromini.cs | 205 +------------------ Projectiles/Summon/CloudElementalMinion.cs | 218 ++------------------ Projectiles/Summon/ElementalAxeMinion.cs | 179 +--------------- Projectiles/Summon/HerringMinion.cs | 183 +---------------- Projectiles/Summon/IceClasperMinion.cs | 182 +---------------- Projectiles/Summon/LuxorsGiftSummon.cs | 183 +---------------- Projectiles/Summon/SonOfYharon.cs | 213 ++----------------- Projectiles/Summon/Valkyrie.cs | 206 ++----------------- 11 files changed, 299 insertions(+), 1860 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 7f077815ca..9358df5955 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2028,6 +2028,231 @@ namespace CalamityMod.Projectiles } } + public static void ChargingMinionAI(Projectile projectile, float range, float maxPlayerDist, float extraMaxPlayerDist, float safeDist, int initialUpdates, float chargeDelayTime, float goToSpeed, float goBackSpeed, float chargeCounterMax, float chargeSpeed, bool tileVision, bool ignoreTilesWhenCharging) + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + + //Anti sticky movement to prevent stacking + float antiStickMvt = 0.05f; + for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) + { + Projectile proj = Main.projectile[projIndex]; + bool typeCheck = proj.type == projectile.type; + if (projIndex != projectile.whoAmI && proj.active && proj.owner == projectile.owner && typeCheck && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) + { + if (projectile.position.X < proj.position.X) + { + projectile.velocity.X -= antiStickMvt; + } + else + { + projectile.velocity.X += antiStickMvt; + } + if (projectile.position.Y < proj.position.Y) + { + projectile.velocity.Y -= antiStickMvt; + } + else + { + projectile.velocity.Y += antiStickMvt; + } + } + } + + //Breather time between charges as like a reset + bool chargeDelay = false; + if (projectile.ai[0] == 2f) + { + projectile.ai[1] += 1f; + projectile.extraUpdates = initialUpdates + (projectile.type == ModContent.ProjectileType() ? 2 : 1); + if (projectile.ai[1] > chargeDelayTime) + { + projectile.ai[1] = 1f; + projectile.ai[0] = 0f; + projectile.extraUpdates = initialUpdates; + projectile.numUpdates = 0; + projectile.netUpdate = true; + } + else + { + chargeDelay = true; + } + } + if (chargeDelay) + { + return; + } + + //Find a target + float maxDist = range; + Vector2 targetVec = projectile.position; + bool foundTarget = false; + Vector2 half = new Vector2(0.5f); + //Prioritize the targeted enemy if possible + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + //Check the size of the target to make it easier to hit fat targets like Levi + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + //Some minions will ignore tiles when choosing a target like Ice Claspers, others will not + bool canHit = true; + if (!tileVision) + canHit = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + if (!foundTarget && targetDist < maxDist && canHit) + { + maxDist = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + //If no npc is specifically targetted, check through the entire array + else + { + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) + { + NPC npc = Main.npc[npcIndex]; + if (npc.CanBeChasedBy(projectile, false)) + { + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + bool canHit = true; + if (!tileVision) + canHit = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + if (!foundTarget && targetDist < maxDist && canHit) + { + maxDist = targetDist; + targetVec = sizeCheck; + foundTarget = true; + } + } + } + } + + //If the player is too far, return to the player. Range is increased while attacking something. + float distBeforeForcedReturn = maxPlayerDist; + if (foundTarget) + { + distBeforeForcedReturn = extraMaxPlayerDist; + } + if (Vector2.Distance(player.Center, projectile.Center) > distBeforeForcedReturn) + { + projectile.ai[0] = 1f; + projectile.netUpdate = true; + } + + //Go to the target if you found one + if (foundTarget && projectile.ai[0] == 0f) + { + //Some minions don't ignore tiles while charging like brittle stars + projectile.tileCollide = !ignoreTilesWhenCharging; + Vector2 targetSpot = targetVec - projectile.Center; + float targetDist = targetSpot.Length(); + targetSpot.Normalize(); + //Tries to get the minion in the sweet spot of 200 pixels away but the minion also charges so idk what good it does + if (targetDist > 200f) + { + float speed = goToSpeed; //8 + targetSpot *= speed; + projectile.velocity = (projectile.velocity * 40f + targetSpot) / 41f; + } + else + { + float speed = -goBackSpeed; //-4 + targetSpot *= speed; + projectile.velocity = (projectile.velocity * 40f + targetSpot) / 41f; //41 + } + } + + //Movement for idle or returning to the player + else + { + //Ignore tiles so they don't get stuck everywhere like Optic Staff + projectile.tileCollide = false; + + bool returningToPlayer = false; + if (!returningToPlayer) + { + returningToPlayer = projectile.ai[0] == 1f; + } + + //Player distance calculations + Vector2 playerVec = player.Center - projectile.Center + new Vector2(0f, -60f); + float playerDist = playerVec.Length(); + + //If the minion is actively returning, move faster + float playerHomeSpeed = 6f; + if (returningToPlayer) + { + playerHomeSpeed = 15f; + } + //Move somewhat faster if the player is kinda far~ish + if (playerDist > 200f && playerHomeSpeed < 8f) + { + playerHomeSpeed = 8f; + } + //Return to normal if close enough to the player + if (playerDist < safeDist && returningToPlayer && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + //Teleport to the player if abnormally far + if (playerDist > 2000f) + { + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + //If more than 70 pixels away, move toward the player + if (playerDist > 70f) + { + playerVec.Normalize(); + playerVec *= playerHomeSpeed; + projectile.velocity = (projectile.velocity * 40f + playerVec) / 41f; + } + //Minions never stay still + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + } + + //Increment attack counter randomly + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += (float)Main.rand.Next(1, 4); + } + //If high enough, prepare to attack + if (projectile.ai[1] > chargeCounterMax) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + + //Charge at an enemy if not on cooldown + if (projectile.ai[0] == 0f) + { + if (projectile.ai[1] == 0f && foundTarget && maxDist < 500f) + { + projectile.ai[1] += 1f; + if (Main.myPlayer == projectile.owner) + { + projectile.ai[0] = 2f; + Vector2 targetPos = targetVec - projectile.Center; + targetPos.Normalize(); + projectile.velocity = targetPos * chargeSpeed; //8 + projectile.netUpdate = true; + } + } + } + } + public static void FloatingPetAI(Projectile projectile, bool faceRight, float tiltFloat, bool lightPet = false) { Player player = Main.player[projectile.owner]; diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index cf238cfad5..67f2fb93cc 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -64,188 +64,8 @@ namespace CalamityMod.Projectiles.Summon } } projectile.rotation += projectile.velocity.X * 0.04f; - float num633 = 700f; - float num634 = 800f; - float num635 = 1200f; - float num636 = 150f; - float SAIMovement = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X -= SAIMovement; - } - else - { - projectile.velocity.X += SAIMovement; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y -= SAIMovement; - } - else - { - projectile.velocity.Y += SAIMovement; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - Vector2 value = new Vector2(0.5f); - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - Vector2 vector2 = npc.position + npc.Size * value; - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = vector2; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC npc = Main.npc[num645]; - if (npc.CanBeChasedBy(projectile, false)) - { - Vector2 vector2 = npc.position + npc.Size * value; - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = vector2; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - projectile.tileCollide = true; - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; //4 - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; //41 - } - } - else - { - projectile.tileCollide = false; - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; //8 - projectile.netUpdate = true; - } - } - } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 600f, 800f, 1200f, 150f, 0, 40f, 8f, -4f, 40f, 8f, false, false); } public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Summon/BrittleStarMinion.cs b/Projectiles/Summon/BrittleStarMinion.cs index d59bdd29a8..c8c761d021 100644 --- a/Projectiles/Summon/BrittleStarMinion.cs +++ b/Projectiles/Summon/BrittleStarMinion.cs @@ -64,185 +64,8 @@ namespace CalamityMod.Projectiles.Summon } } projectile.rotation += projectile.velocity.X * 0.04f; - float num633 = 700f; - float num634 = 800f; - float num635 = 1200f; - float num636 = 150f; - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC npc = Main.npc[num645]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633 && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - projectile.tileCollide = true; - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; //4 - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; //41 - } - } - else - { - projectile.tileCollide = false; - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; //8 - projectile.netUpdate = true; - } - } - } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 600f, 800f, 1200f, 150f, 0, 40f, 8f, -4f, 40f, 8f, false, false); } public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index dfbdb77e71..b7036d438e 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -61,10 +61,6 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - float num633 = 700f; - float num634 = 1100f; - float num635 = 2400f; - float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); if (flag64) { @@ -77,181 +73,10 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; - projectile.frameCounter++; - if (projectile.frameCounter > 1) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 2) - { - projectile.frame = 0; - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (projectile.ai[0] != 1f) - { - projectile.tileCollide = false; - } - if (projectile.tileCollide && WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16))) - { - projectile.tileCollide = false; - } - Vector2 value = new Vector2(0.5f); - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - Vector2 vector2 = npc.position + npc.Size * value; - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = vector2; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC npc = Main.npc[num645]; - if (npc.CanBeChasedBy(projectile, false)) - { - Vector2 vector2 = npc.position + npc.Size * value; - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = vector2; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.tileCollide = false; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } + projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f; projectile.frameCounter++; - if (projectile.frameCounter > 3) + if (projectile.frameCounter > (projectile.ai[0] == 2f ? 1 : 3)) { projectile.frame++; projectile.frameCounter = 0; @@ -260,30 +85,8 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 700f, 1100f, 2400f, 150f, 0, 40f, 8f, -4f, 40f, 8f, false, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index 027ceff01d..872b7f681e 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -82,210 +82,26 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } - float num633 = 500f; //700 - float num634 = 800f; - float num635 = 1200f; - float num636 = 400f; //150 - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight(projectile.Center, 0.25f * num, 0.55f * num, 0.75f * num); - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 2; - projectile.frameCounter++; - if (projectile.frameCounter > 16) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 7) - { - projectile.frame = 0; - } - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < 200; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 100f) //200 - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; //6 - if (flag26) - { - num650 = 15f; //15 - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(500f, -60f); //-60 - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) //200 and 8 - { - num650 = 8f; //8 - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - projectile.frameCounter++; - if (projectile.frameCounter > 16) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 7) - { - projectile.frame = 0; - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } + float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; + lightScalar *= Main.essScale; + Lighting.AddLight(projectile.Center, 0.25f * lightScalar, 0.55f * lightScalar, 0.75f * lightScalar); + + projectile.frameCounter++; + if (projectile.frameCounter > 16) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 7) + { + projectile.frame = 0; + } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 500f, 800f, 1200f, 400f, 0, 30f, 8f, -4f, 40f, 8f, false, true); } } } diff --git a/Projectiles/Summon/ElementalAxeMinion.cs b/Projectiles/Summon/ElementalAxeMinion.cs index 3899f354c9..43daf58f0f 100644 --- a/Projectiles/Summon/ElementalAxeMinion.cs +++ b/Projectiles/Summon/ElementalAxeMinion.cs @@ -69,183 +69,8 @@ namespace CalamityMod.Projectiles.Summon } } projectile.rotation += 0.075f; - float num633 = 1600f; //range - float num634 = 1800f; - float num635 = 2500f; - float num636 = 400f; - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 2; - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 1; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 24f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 12f; //4 - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; //41 - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 16f; //8 - projectile.netUpdate = true; - } - } - } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 1600f, 1800f, 2500f, 400f, 1, 30f, 24f, -12f, 30f, 16f, true, true); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Summon/HerringMinion.cs b/Projectiles/Summon/HerringMinion.cs index 6ce24ae4d3..cc014a1faa 100644 --- a/Projectiles/Summon/HerringMinion.cs +++ b/Projectiles/Summon/HerringMinion.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = projectile.direction; } @@ -78,10 +78,7 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - float num633 = 600f; - float num634 = 800f; - float num635 = 1200f; - float num636 = 150f; + bool flag64 = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) @@ -95,180 +92,8 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 7f; //8 - projectile.netUpdate = true; - } - } - } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 600f, 800f, 1200f, 150f, 0, 40f, 8f, -4f, 40f, 7f, false, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs index 3d20d0f0be..50d81e9ade 100644 --- a/Projectiles/Summon/IceClasperMinion.cs +++ b/Projectiles/Summon/IceClasperMinion.cs @@ -75,10 +75,6 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } Lighting.AddLight((int)((projectile.position.X + (float)(projectile.width / 2)) / 16f), (int)((projectile.position.Y + (float)(projectile.height / 2)) / 16f), 0.05f, 0.15f, 0.2f); - float num633 = 700f; - float num634 = 1000f; - float num635 = 2200f; - float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) @@ -92,182 +88,10 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - projectile.rotation = projectile.velocity.ToRotation() - 1.57f; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 9f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 700f, 1000f, 2200f, 150f, 0, 40f, 9f, -4f, 40f, 9f, true, true); + projectile.rotation = projectile.velocity.ToRotation() - 1.57f; - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 9f; //8 - projectile.netUpdate = true; - } - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/LuxorsGiftSummon.cs b/Projectiles/Summon/LuxorsGiftSummon.cs index dbbf55d8b7..b40fc8ced3 100644 --- a/Projectiles/Summon/LuxorsGiftSummon.cs +++ b/Projectiles/Summon/LuxorsGiftSummon.cs @@ -84,10 +84,7 @@ namespace CalamityMod.Projectiles.Summon projectile.localAI[0] = 0f; } } - float num633 = 700f; - float num634 = 1000f; - float num635 = 2200f; - float num636 = 150f; + bool flag64 = projectile.type == ModContent.ProjectileType(); if (flag64) { @@ -96,182 +93,10 @@ namespace CalamityMod.Projectiles.Summon projectile.Kill(); } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && - flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - projectile.rotation = projectile.velocity.ToRotation() + 1.57f; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 9f; //8 - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 700f, 1000f, 2200f, 150f, 0, 40f, 9f, -4f, 40f, 9f, true, true); + projectile.rotation = projectile.velocity.ToRotation() + 1.57f; - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 9f; //8 - projectile.netUpdate = true; - } - } - } } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Summon/SonOfYharon.cs b/Projectiles/Summon/SonOfYharon.cs index 361eac8190..ed48037b59 100644 --- a/Projectiles/Summon/SonOfYharon.cs +++ b/Projectiles/Summon/SonOfYharon.cs @@ -60,20 +60,16 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } - float num633 = 1000f; - float num634 = 2000f; - float num635 = 3000f; - float num636 = 500f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight(projectile.Center, 1.2f * num, 0.8f * num, 0f * num); - bool flag64 = projectile.type == ModContent.ProjectileType(); + float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; + lightScalar *= Main.essScale; + Lighting.AddLight(projectile.Center, 1.2f * lightScalar, 0.8f * lightScalar, 0f * lightScalar); + bool correctMinion = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + if (correctMinion) { if (player.dead) { @@ -84,35 +80,8 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; if (projectile.ai[0] == 2f) { - projectile.ai[1] += 1f; - projectile.extraUpdates = 2; projectile.frameCounter++; if (projectile.frameCounter > 3) { @@ -123,160 +92,22 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if (projectile.ai[1] > 30f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 1; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - projectile.frameCounter++; - if (projectile.frameCounter > 12) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } + } + else + { + projectile.frameCounter++; + if (projectile.frameCounter > 12) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 1000f, 2000f, 3000f, 500f, 1, 30f, 8f, -4f, 40f, 8f, true, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Summon/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs index 746ecdfc04..83cd9fc2d0 100644 --- a/Projectiles/Summon/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - bool flag64 = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); if (!modPlayer.valkyrie) @@ -45,7 +44,8 @@ namespace CalamityMod.Projectiles.Summon projectile.active = false; return; } - if (flag64) + bool correctMinion = projectile.type == ModContent.ProjectileType(); + if (correctMinion) { if (player.dead) { @@ -76,175 +76,21 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = damage2; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + + //Adjust sprite direction so it faces correctly + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } - float num633 = 700f; - float num634 = 800f; - float num635 = 1200f; - float num636 = 150f; - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight(projectile.Center, 0f * num, 0.2f * num, 0.45f * num); - float num637 = 0.05f; - for (int num638 = 0; num638 < Main.maxProjectiles; num638++) - { - bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); - if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) - { - if (projectile.position.X < Main.projectile[num638].position.X) - { - projectile.velocity.X = projectile.velocity.X - num637; - } - else - { - projectile.velocity.X = projectile.velocity.X + num637; - } - if (projectile.position.Y < Main.projectile[num638].position.Y) - { - projectile.velocity.Y = projectile.velocity.Y - num637; - } - else - { - projectile.velocity.Y = projectile.velocity.Y + num637; - } - } - } - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - projectile.ai[1] += 1f; - projectile.extraUpdates = 1; - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - Vector2 vector46 = projectile.position; - bool flag25 = false; - if (projectile.ai[0] != 1f) - { - projectile.tileCollide = false; - } - if (projectile.tileCollide && WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16))) - { - projectile.tileCollide = false; - } - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = num646; - vector46 = npc.Center; - flag25 = true; - } - } - } - else - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if ((!flag25 && num646 < num633) && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; - } - } - } - } - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.tileCollide = false; - projectile.netUpdate = true; - } - if (flag25 && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float num651 = vector48.Length(); - if (num651 > 200f && num650 < 8f) - { - num650 = 8f; - } - if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (num651 > 2000f) - { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (num651 > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } + + CalamityGlobalProjectile.ChargingMinionAI(projectile, 700f, 800f, 1200f, 150f, 0, 40f, 8f, -4f, 40f, 8f, false, true); + + //Give off some light + float lightScalar = (float)Main.rand.Next(90, 111) * 0.01f; + lightScalar *= Main.essScale; + Lighting.AddLight(projectile.Center, 0f * lightScalar, 0.2f * lightScalar, 0.45f * lightScalar); + + //Frames projectile.frameCounter++; if (projectile.frameCounter > 7) { @@ -255,30 +101,6 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } - if (projectile.ai[1] > 0f) - { - projectile.ai[1] += (float)Main.rand.Next(1, 4); - } - if (projectile.ai[1] > 40f) - { - projectile.ai[1] = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (projectile.ai[1] == 0f && flag25 && num633 < 500f) - { - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) From a9f419787b628b6ac9230194fe16321d16f6e0bc Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 25 May 2020 11:44:59 -0400 Subject: [PATCH 31/52] spectralstorm cannon now uses projectile with a sprite --- Items/Weapons/Ranged/SpectralstormCannon.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Ranged/SpectralstormCannon.cs b/Items/Weapons/Ranged/SpectralstormCannon.cs index 60b6c0023b..68117e29b6 100644 --- a/Items/Weapons/Ranged/SpectralstormCannon.cs +++ b/Items/Weapons/Ranged/SpectralstormCannon.cs @@ -1,3 +1,4 @@ +using CalamityMod.Projectiles.Rogue; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,10 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 931; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool ConsumeAmmo(Player player) { @@ -57,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged Main.projectile[projectile].timeLeft = 200; Main.projectile[projectile].Calamity().forceRanged = true; } - int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.LostSoulFriendly, damage, knockBack, player.whoAmI, 0f, 0f); + int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[proj].timeLeft = 600; Main.projectile[proj].Calamity().forceRanged = true; return false; From 037de198ab2d40caa081733d49556fccb2363b43 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 25 May 2020 11:59:21 -0400 Subject: [PATCH 32/52] lost soul adjustments & doubled living shard drop rate --- Items/CalamityGlobalItem.cs | 2 +- NPCs/CalamityGlobalNPCLoot.cs | 2 +- Projectiles/Rogue/LostSoulFriendly.cs | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 016dcc89d8..268376f79a 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2781,7 +2781,7 @@ Provides heat and cold protection in Death Mode"; // Plantera case ItemID.PlanteraBossBag: - DropHelper.DropItem(player, ModContent.ItemType(), 8, 11); + DropHelper.DropItem(player, ModContent.ItemType(), 16, 22); float bFluxChance = DropHelper.LegendaryDropRateFloat; DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge, bFluxChance); DropHelper.DropItemChance(player, ItemID.JungleKey, 5); diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 721657255b..3b773eccd8 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1689,7 +1689,7 @@ namespace CalamityMod.NPCs break; case NPCID.Plantera: - DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 6, 9); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 12, 18); break; case NPCID.SolarSpearman: //Drakanian diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index 069cf54644..883db74d16 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -25,6 +25,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = 1; projectile.timeLeft = 240; projectile.Calamity().rogue = true; + projectile.extraUpdates = 1; + projectile.alpha = 150; } public override void AI() @@ -47,13 +49,14 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 43); for (int j = 0; j <= 10; j++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 175, 0f, 0f, 100, default, 1f); } } + public override Color? GetAlpha(Color lightColor) => new Color(150, 150, 150, 150); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); From d7ffd0d6bc352d3cdf2f72aca370786ff3c98294 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 25 May 2020 12:18:31 -0400 Subject: [PATCH 33/52] lost soul adjustment #2 --- Projectiles/Rogue/LostSoulFriendly.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index 883db74d16..3014bd7ff8 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { projectile.frameCounter++; - if (projectile.frameCounter > 4) + if (projectile.frameCounter > 8) { projectile.frame++; projectile.frameCounter = 0; From 1ec49efba4a134b01c49a45da40f6a24418764a7 Mon Sep 17 00:00:00 2001 From: Amber Sienna Date: Tue, 26 May 2020 14:16:21 +0100 Subject: [PATCH 34/52] Removed holy flame immunity from asgard's valor --- Items/Accessories/AsgardsValor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index c00b5ede3c..3a71ce5fdb 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Asgard's Valor"); Tooltip.SetDefault("Grants immunity to fire blocks and knockback\n" + - "Immune to most debuffs including Brimstone Flames, Holy Flames, and Glacial State\n" + + "Immune to most debuffs including Brimstone Flames, and Glacial State\n" + "10% damage reduction while submerged in liquid\n" + "+20 max life\n" + "Grants a holy dash which can be used to ram enemies\n" + @@ -51,7 +51,6 @@ namespace CalamityMod.Items.Accessories player.buffImmune[BuffID.Cursed] = true; player.buffImmune[BuffID.Darkness] = true; player.buffImmune[ModContent.BuffType()] = true; - player.buffImmune[ModContent.BuffType()] = true; player.buffImmune[ModContent.BuffType()] = true; player.statLifeMax2 += 20; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) From 344d115a660b4dc7dcb4389951a394965277a7f4 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 26 May 2020 14:20:18 -0400 Subject: [PATCH 35/52] buffed evasion scarf boost duration --- CalPlayer/CalamityPlayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 9f59fd3573..c003c5d05c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -8262,7 +8262,7 @@ namespace CalamityMod.CalPlayer { if (evasionScarf) { - player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(6f)); + player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(9f)); player.AddBuff(ModContent.BuffType(), player.chaosState ? CalamityUtils.SecondsToFrames(20f) : CalamityUtils.SecondsToFrames(13f)); } else From 0ef34d6b8f0fdf2a96d04c5f7d48fe8bc138b194 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 27 May 2020 08:37:37 -0500 Subject: [PATCH 36/52] Nuclear Terror no longer enter a state of undeath with Anitaris enabled --- NPCs/AcidRain/NuclearTerror.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 2b1074f059..fa9b875671 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -14,9 +14,10 @@ namespace CalamityMod.NPCs.AcidRain { public class NuclearTerror : ModNPC { - public bool Walking = false; public int AttackIndex = 0; public int DelayTime = 0; + public bool Dying = false; + public bool Walking = false; public float JumpTimer = 0f; public Vector2 ShootPosition; public static readonly int[] PhaseArray = new int[] @@ -61,6 +62,7 @@ namespace CalamityMod.NPCs.AcidRain public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.dontTakeDamage); + writer.Write(Dying); writer.Write(Walking); writer.Write(AttackIndex); writer.Write(DelayTime); @@ -70,6 +72,7 @@ namespace CalamityMod.NPCs.AcidRain public override void ReceiveExtraAI(BinaryReader reader) { npc.dontTakeDamage = reader.ReadBoolean(); + Dying = reader.ReadBoolean(); Walking = reader.ReadBoolean(); AttackIndex = reader.ReadInt32(); DelayTime = reader.ReadInt32(); @@ -78,8 +81,8 @@ namespace CalamityMod.NPCs.AcidRain } public override void AI() { - Lighting.AddLight(npc.Center, (npc.dontTakeDamage ? Color.Lime.ToVector3() : Color.White.ToVector3()) * 2f); - if (npc.dontTakeDamage) + Lighting.AddLight(npc.Center, (Dying ? Color.Lime.ToVector3() : Color.White.ToVector3()) * 2f); + if (Dying) return; bool phase2 = npc.life / (float)npc.lifeMax < 0.5f; if (DelayTime > 0) @@ -103,7 +106,7 @@ namespace CalamityMod.NPCs.AcidRain } Player player = Main.player[npc.target]; npc.defDamage = 170; - npc.damage = npc.dontTakeDamage ? 0 : npc.defDamage; + npc.damage = Dying ? 0 : npc.defDamage; TeleportCheck(player); npc.ai[0]++; Walking = false; @@ -347,7 +350,7 @@ namespace CalamityMod.NPCs.AcidRain public override void FindFrame(int frameHeight) { npc.frameCounter++; - int framesNeeded = npc.dontTakeDamage ? 7 : 6; + int framesNeeded = Dying ? 7 : 6; if (Walking) { framesNeeded = 8 - (int)Math.Ceiling(Math.Abs(npc.velocity.X) / 5f); // Walk faster the faster we're moving @@ -357,7 +360,7 @@ namespace CalamityMod.NPCs.AcidRain npc.frame.Y += frameHeight; npc.frameCounter = 0; } - if (npc.dontTakeDamage) + if (Dying) { if (npc.frame.Y < frameHeight * 8) { @@ -402,16 +405,17 @@ namespace CalamityMod.NPCs.AcidRain } public override bool CheckDead() { - if (!npc.dontTakeDamage) + if (!Dying) { npc.active = true; npc.life = 1; npc.dontTakeDamage = true; + Dying = true; npc.velocity = Vector2.Zero; npc.netUpdate = true; return false; } - return true; + return Dying; } public override void HitEffect(int hitDirection, double damage) { From 451d478312715b47908c9ec1da4ded586ef33a2d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 27 May 2020 16:55:29 -0400 Subject: [PATCH 37/52] fixed burnt sienna and terra-cotta healing --- Projectiles/Healing/BurntSiennaProj.cs | 2 +- Projectiles/Healing/TerracottaProj.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/Healing/BurntSiennaProj.cs b/Projectiles/Healing/BurntSiennaProj.cs index 6c2ed80366..c9a3d5e548 100644 --- a/Projectiles/Healing/BurntSiennaProj.cs +++ b/Projectiles/Healing/BurntSiennaProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Healing projectile.velocity.X *= 0.95f; projectile.velocity.Y *= 0.95f; - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 6f, 15f, false); + CalamityGlobalProjectile.HealingProjectile(projectile, 3, (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; diff --git a/Projectiles/Healing/TerracottaProj.cs b/Projectiles/Healing/TerracottaProj.cs index 14ae4bc480..d6c26b2ae1 100644 --- a/Projectiles/Healing/TerracottaProj.cs +++ b/Projectiles/Healing/TerracottaProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Healing projectile.velocity.X *= 0.95f; projectile.velocity.Y *= 0.95f; - CalamityGlobalProjectile.HealingProjectile(projectile, (int)projectile.ai[1], (int)projectile.ai[0], 8f, 15f, false, 300); + CalamityGlobalProjectile.HealingProjectile(projectile, 9, (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); From 362c2cf18cfede43e09f75e034e80cd7f051a919 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 27 May 2020 17:24:35 -0400 Subject: [PATCH 38/52] fixed howl eating a minion slot --- Projectiles/Summon/HowlsHeartHowl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Summon/HowlsHeartHowl.cs b/Projectiles/Summon/HowlsHeartHowl.cs index 1c063c2e31..b4c7fe8aa2 100644 --- a/Projectiles/Summon/HowlsHeartHowl.cs +++ b/Projectiles/Summon/HowlsHeartHowl.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Summon projectile.height = 54; projectile.netImportant = true; projectile.friendly = true; - projectile.minionSlots = 1f; + projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.penetrate = -1; projectile.timeLeft *= 5; From 727315f6b2d1bcbc9c23a5ba8f76bfd4590f56ca Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 27 May 2020 18:10:09 -0400 Subject: [PATCH 39/52] fixed amalgam issues --- Items/Accessories/TheAmalgam.cs | 4 ++ Projectiles/Summon/FungalClumpMinion.cs | 91 ++++++++++++++----------- 2 files changed, 54 insertions(+), 41 deletions(-) diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 7338190ab6..a30da8596a 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -97,6 +97,10 @@ namespace CalamityMod.Items.Accessories { WaterBonuses = true; } + else if (!player.IsUnderwater()) + { + WaterBonuses = false; + } } } if (WaterBonuses || player.IsUnderwater()) diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index 04f6c10f2b..4a2e39f367 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Summon //If summoned by Amalgam, trail poisonous seawater if (Math.Abs(projectile.velocity.X) > 0.1f || Math.Abs(projectile.velocity.Y) > 0.1f) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && amalgam) { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 1f, 0f); } @@ -139,35 +139,45 @@ namespace CalamityMod.Projectiles.Summon returnToPlayer = true; //Find an npc to target, or if minion targetting is used, choose that npc - Vector2 center = projectile.Center; + Vector2 targetVec = projectile.Center; float range = 900f; bool npcFound = false; + Vector2 half = new Vector2(0.5f); if (!returnToPlayer) { - projectile.tileCollide = true; - NPC target = projectile.OwnerMinionAttackTargetNPC; - if (target != null && target.CanBeChasedBy(projectile, false)) + if (player.HasMinionAttackTargetNPC) { - float extraDistance = (target.width / 2) + (target.height / 2); - - if (Vector2.Distance(target.Center, projectile.Center) < (range + extraDistance) && Collision.CanHit(projectile.position, projectile.width, projectile.height, target.position, target.width, target.height)) + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) { - center = target.Center; - npcFound = true; + //Check the size of the target to make it easier to hit fat targets like Levi + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + //Some minions will ignore tiles when choosing a target like Ice Claspers, others will not + bool canHit = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + if (!npcFound && targetDist < range && canHit) + { + range = targetDist; + targetVec = sizeCheck; + npcFound = true; + } } } - if (!npcFound) + //If no npc is specifically targetted, check through the entire array + else { - for (int index = 0; index < Main.maxNPCs; ++index) + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { - NPC npc = Main.npc[index]; + NPC npc = Main.npc[npcIndex]; if (npc.CanBeChasedBy(projectile, false)) { - float extraDistance = (npc.width / 2) + (npc.height / 2); - - if (Vector2.Distance(npc.Center, projectile.Center) < (range + extraDistance) && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + Vector2 sizeCheck = npc.position + npc.Size * half; + float targetDist = Vector2.Distance(npc.Center, projectile.Center); + bool canHit = Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height); + if (!npcFound && targetDist < range && canHit) { - center = npc.Center; + range = targetDist; + targetVec = sizeCheck; npcFound = true; } } @@ -185,35 +195,33 @@ namespace CalamityMod.Projectiles.Summon float turnSpeed = 20f; if (returnToPlayer) //move faster if returning to the player homingSpeed = amalgam ? 30f : 12f; - Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); - float xDist = player.Center.X - projPos.X; - float yDist = player.Center.Y - projPos.Y - 60f; - Vector2 playerVector = new Vector2(xDist, yDist); + Vector2 playerVector = player.Center - projectile.Center; + playerVector.Y -= 60f; float playerDist = playerVector.Length(); - if (playerDist < 100f && projectile.ai[0] == 1f && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - projectile.ai[0] = 0f; + if (playerDist < 100f && returnToPlayer && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + returnToPlayer = false; if (playerDist > 2000f) { projectile.position.X = player.Center.X - projectile.width / 2; projectile.position.Y = player.Center.Y - projectile.width / 2; } - if (playerDist > 70f) - { - Vector2 homeInVector = projectile.DirectionTo(playerVector); - if (homeInVector.HasNaNs()) - homeInVector = Vector2.UnitY; - - projectile.velocity = (projectile.velocity * turnSpeed + homeInVector * homingSpeed) / (turnSpeed + 1f); - } - else - { + //If more than 70 pixels away, move toward the player + if (playerDist > 70f) + { + playerVector.Normalize(); + playerVector *= homingSpeed; + projectile.velocity = (projectile.velocity * turnSpeed + playerVector) / (turnSpeed + 1f); + } + //Minions never stay still + else + { if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) { projectile.velocity.X = -0.15f; projectile.velocity.Y = -0.05f; } projectile.velocity *= 1.01f; - } + } projectile.friendly = false; projectile.rotation = projectile.velocity.X * 0.05f; if (Math.Abs(projectile.velocity.X) <= 0f) @@ -233,19 +241,18 @@ namespace CalamityMod.Projectiles.Summon projectile.friendly = true; float minionSpeed = amalgam ? 20f : 8f; float turnSpeed = 14f; - Vector2 projPos = new Vector2(projectile.Center.X, projectile.Center.Y); - float xDist = center.X - projPos.X; - float yDist = center.Y - projPos.Y - 60f; - Vector2 targetVector = new Vector2(xDist, yDist); - float targetDist = targetVector.Length(); + Vector2 targetLocation = targetVec - projectile.Center; + float targetDist = targetLocation.Length(); if (targetDist < 100f) minionSpeed = amalgam ? 25f : 10f; - Vector2 homeInVector = projectile.DirectionTo(targetVector); + Vector2 homeInVector = projectile.DirectionTo(targetLocation); if (homeInVector.HasNaNs()) homeInVector = Vector2.UnitY; - projectile.velocity = (projectile.velocity * turnSpeed + homeInVector * minionSpeed) / (turnSpeed + 1f); + targetLocation.Normalize(); + targetLocation *= minionSpeed; + projectile.velocity = (projectile.velocity * turnSpeed + targetLocation) / (turnSpeed + 1f); } else { @@ -277,5 +284,7 @@ namespace CalamityMod.Projectiles.Summon } CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType(), 1200f, 1f); } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } From a47eadc1a697917404828e6253550793a6766c0b Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 27 May 2020 18:49:08 -0400 Subject: [PATCH 40/52] balancing and death --- CalamityMod.cs | 4 +- .../AstralCatches/PolarisParrotfish.cs | 2 +- Items/Weapons/Magic/Effervescence.cs | 2 +- Items/Weapons/Magic/FrostBolt.cs | 4 +- Items/Weapons/Magic/WulfrumStaff.cs | 2 +- Items/Weapons/Melee/CosmicShiv.cs | 2 +- Items/Weapons/Melee/Nadir.cs | 2 +- Items/Weapons/Melee/ScourgeoftheCosmos.cs | 2 +- .../Weapons/Melee/TruePaladinsHammerMelee.cs | 2 +- Items/Weapons/Melee/UltimusCleaver.cs | 2 +- Items/Weapons/Ranged/ClamorRifle.cs | 2 +- Items/Weapons/Ranged/Needler.cs | 4 +- Items/Weapons/Ranged/Onyxia.cs | 11 +- Items/Weapons/Rogue/CraniumSmasher.cs | 2 +- Items/Weapons/Rogue/Crystalline.cs | 2 +- Items/Weapons/Rogue/IronFrancisca.cs | 4 +- Items/Weapons/Rogue/LeadTomahawk.cs | 4 +- Items/Weapons/Rogue/TruePaladinsHammer.cs | 2 +- Items/Weapons/Rogue/WulfrumKnife.cs | 4 +- Projectiles/CalamityGlobalProjectile.cs | 12 ++- Projectiles/Magic/ManaBoltSmall.cs | 2 +- Projectiles/Magic/ManaBoltSmall2.cs | 2 +- Projectiles/Melee/Spears/NadirSpear.cs | 6 +- Projectiles/Melee/VoidEssence.cs | 4 +- Projectiles/Ranged/ButcherGun.cs | 101 +++++++++--------- Projectiles/Ranged/ClamorRifleProj.cs | 2 +- Projectiles/Ranged/NeedlerProj.cs | 10 +- Projectiles/Ranged/RealmRavagerBullet.cs | 4 +- Projectiles/Summon/ApparatusExplosion.cs | 2 +- 29 files changed, 106 insertions(+), 98 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index c1f1ddf3fd..9212cb403a 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1287,7 +1287,9 @@ namespace CalamityMod ItemID.WaspGun, ItemID.Keybrand, ItemID.PulseBow, - ItemID.PaladinsHammer + ItemID.PaladinsHammer, + ItemID.SolarEruption, + ItemID.DayBreak }; thirtyThreeDamageBuffList = new List() diff --git a/Items/Fishing/AstralCatches/PolarisParrotfish.cs b/Items/Fishing/AstralCatches/PolarisParrotfish.cs index 01c7dea67c..e44f282be1 100644 --- a/Items/Fishing/AstralCatches/PolarisParrotfish.cs +++ b/Items/Fishing/AstralCatches/PolarisParrotfish.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches public override void SetDefaults() { - item.damage = 60; + item.damage = 55; item.ranged = true; item.width = 38; item.height = 34; diff --git a/Items/Weapons/Magic/Effervescence.cs b/Items/Weapons/Magic/Effervescence.cs index 147a521634..632d5a9574 100644 --- a/Items/Weapons/Magic/Effervescence.cs +++ b/Items/Weapons/Magic/Effervescence.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 36; + item.damage = 40; item.magic = true; item.mana = 17; item.width = 56; diff --git a/Items/Weapons/Magic/FrostBolt.cs b/Items/Weapons/Magic/FrostBolt.cs index 3d65397d61..d42e2eeb90 100644 --- a/Items/Weapons/Magic/FrostBolt.cs +++ b/Items/Weapons/Magic/FrostBolt.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Magic item.mana = 6; item.width = 28; item.height = 30; - item.useTime = 18; - item.useAnimation = 18; + item.useTime = 20; + item.useAnimation = 20; item.useStyle = 5; item.noMelee = true; item.knockBack = 3.5f; diff --git a/Items/Weapons/Magic/WulfrumStaff.cs b/Items/Weapons/Magic/WulfrumStaff.cs index c81ccd8c55..27bf657e3f 100644 --- a/Items/Weapons/Magic/WulfrumStaff.cs +++ b/Items/Weapons/Magic/WulfrumStaff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 10; + item.damage = 12; item.magic = true; item.mana = 4; item.width = 44; diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index 6ac343fad0..b0691a7130 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 44; item.height = 44; - item.damage = 800; + item.damage = 700; item.melee = true; item.knockBack = 9f; diff --git a/Items/Weapons/Melee/Nadir.cs b/Items/Weapons/Melee/Nadir.cs index 978f6640e9..dda4ce7f5d 100644 --- a/Items/Weapons/Melee/Nadir.cs +++ b/Items/Weapons/Melee/Nadir.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Weapons.Melee { public class Nadir : ModItem { - public static int BaseDamage = 800; + public static int BaseDamage = 700; public static float ShootSpeed = 12f; public override void SetStaticDefaults() diff --git a/Items/Weapons/Melee/ScourgeoftheCosmos.cs b/Items/Weapons/Melee/ScourgeoftheCosmos.cs index c5112d6e8a..03630c5761 100644 --- a/Items/Weapons/Melee/ScourgeoftheCosmos.cs +++ b/Items/Weapons/Melee/ScourgeoftheCosmos.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 18; - item.damage = 1550; + item.damage = 1100; item.melee = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs index f5865df418..56e70e350b 100644 --- a/Items/Weapons/Melee/TruePaladinsHammerMelee.cs +++ b/Items/Weapons/Melee/TruePaladinsHammerMelee.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 14; - item.damage = 81; + item.damage = 87; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs index b7b1700ff7..759dfef726 100644 --- a/Items/Weapons/Melee/UltimusCleaver.cs +++ b/Items/Weapons/Melee/UltimusCleaver.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 300; + item.damage = 130; item.melee = true; item.rare = 8; item.width = 72; diff --git a/Items/Weapons/Ranged/ClamorRifle.cs b/Items/Weapons/Ranged/ClamorRifle.cs index 041ddc9c07..c014be74a2 100644 --- a/Items/Weapons/Ranged/ClamorRifle.cs +++ b/Items/Weapons/Ranged/ClamorRifle.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 32; + item.damage = 27; item.ranged = true; item.width = 64; item.height = 30; diff --git a/Items/Weapons/Ranged/Needler.cs b/Items/Weapons/Ranged/Needler.cs index 385aea044d..1ab60c3910 100644 --- a/Items/Weapons/Ranged/Needler.cs +++ b/Items/Weapons/Ranged/Needler.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 38; + item.damage = 45; item.ranged = true; item.width = 44; item.height = 26; @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 9f; item.shoot = ModContent.ProjectileType(); - item.useAmmo = 97; + item.useAmmo = AmmoID.Bullet; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index 53a30951e9..1d286f5b93 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -20,12 +20,12 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 210; + item.damage = 200; item.ranged = true; item.width = 84; item.height = 34; - item.useTime = 8; - item.useAnimation = 8; + item.useTime = 9; + item.useAnimation = 9; item.useStyle = 5; item.noMelee = true; item.knockBack = 4.5f; @@ -48,11 +48,12 @@ namespace CalamityMod.Items.Weapons.Ranged { // Fire the Onyx Shard that is characteristic of the Onyx Blaster // The shard deals triple damage and double knockback - int shardDamage = 3 * damage; + int shardDamage = (int)(2.5 * damage); 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; - Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); + int onyx = Projectile.NewProjectile(position.X, position.Y, shardVelocityX, shardVelocityY, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); + Main.projectile[onyx].timeLeft -= 20; // Fire three symmetric pairs of bullets alongside it Vector2 baseVelocity = new Vector2(speedX, speedY); diff --git a/Items/Weapons/Rogue/CraniumSmasher.cs b/Items/Weapons/Rogue/CraniumSmasher.cs index fa34c83b75..ddea0f89fc 100644 --- a/Items/Weapons/Rogue/CraniumSmasher.cs +++ b/Items/Weapons/Rogue/CraniumSmasher.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue { item.width = 50; item.height = 50; - item.damage = 140; + item.damage = 120; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/Crystalline.cs b/Items/Weapons/Rogue/Crystalline.cs index ebfb1e7d4c..db54600b47 100644 --- a/Items/Weapons/Rogue/Crystalline.cs +++ b/Items/Weapons/Rogue/Crystalline.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 44; - item.damage = 18; + item.damage = 16; item.crit += 4; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Rogue/IronFrancisca.cs b/Items/Weapons/Rogue/IronFrancisca.cs index 57302003c7..50814bfec6 100644 --- a/Items/Weapons/Rogue/IronFrancisca.cs +++ b/Items/Weapons/Rogue/IronFrancisca.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 40; - item.damage = 8; + item.damage = 7; item.noMelee = true; item.consumable = true; item.noUseGraphic = true; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.autoReuse = false; item.height = 36; item.maxStack = 999; - item.value = 1000; + item.value = Item.buyPrice(0, 0, 1, 0); item.rare = 0; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Items/Weapons/Rogue/LeadTomahawk.cs b/Items/Weapons/Rogue/LeadTomahawk.cs index 414d6034d9..2d4e6fc3e6 100644 --- a/Items/Weapons/Rogue/LeadTomahawk.cs +++ b/Items/Weapons/Rogue/LeadTomahawk.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 40; - item.damage = 8; + item.damage = 7; item.noMelee = true; item.consumable = true; item.noUseGraphic = true; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.autoReuse = false; item.height = 36; item.maxStack = 999; - item.value = 1000; + item.value = Item.buyPrice(0, 0, 1, 0); item.rare = 0; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Items/Weapons/Rogue/TruePaladinsHammer.cs b/Items/Weapons/Rogue/TruePaladinsHammer.cs index e982861df0..bc8087f295 100644 --- a/Items/Weapons/Rogue/TruePaladinsHammer.cs +++ b/Items/Weapons/Rogue/TruePaladinsHammer.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 14; - item.damage = 81; + item.damage = 87; item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; diff --git a/Items/Weapons/Rogue/WulfrumKnife.cs b/Items/Weapons/Rogue/WulfrumKnife.cs index 86ef24f4aa..ada0d3eabd 100644 --- a/Items/Weapons/Rogue/WulfrumKnife.cs +++ b/Items/Weapons/Rogue/WulfrumKnife.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 22; - item.damage = 8; + item.damage = 11; item.noMelee = true; item.consumable = true; item.noUseGraphic = true; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.autoReuse = true; item.height = 38; item.maxStack = 999; - item.value = 100; + item.value = Item.buyPrice(0, 0, 1, 0); item.rare = 1; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 9358df5955..50ee070d42 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -122,9 +122,17 @@ namespace CalamityMod.Projectiles case ProjectileID.ButchersChainsaw: trueMelee = true; break; + case ProjectileID.StarWrath: projectile.penetrate = projectile.maxPenetrate = 1; break; + + case ProjectileID.Spazmamini: + case ProjectileID.Retanimini: + case ProjectileID.MiniRetinaLaser: + projectile.localNPCHitCooldown = 10; + projectile.usesLocalNPCImmunity = true; + break; default: break; } @@ -1519,8 +1527,8 @@ namespace CalamityMod.Projectiles { if (Main.rand.NextBool(4)) { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 100), projectile.knockBack * 0.25f, projectile.owner); - modPlayer.jellyDmg = 20f; + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 90), projectile.knockBack * 0.25f, projectile.owner); + modPlayer.jellyDmg = 25f; } } else if (modPlayer.starbusterCore) diff --git a/Projectiles/Magic/ManaBoltSmall.cs b/Projectiles/Magic/ManaBoltSmall.cs index fa9fb3df1d..1559d3ffb0 100644 --- a/Projectiles/Magic/ManaBoltSmall.cs +++ b/Projectiles/Magic/ManaBoltSmall.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; projectile.velocity.X *= 0.975f; projectile.velocity.Y *= 0.975f; - if (Main.rand.NextBool(2)) + if (projectile.timeLeft % 4 == 0) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Magic/ManaBoltSmall2.cs b/Projectiles/Magic/ManaBoltSmall2.cs index db5781dd73..66162cb947 100644 --- a/Projectiles/Magic/ManaBoltSmall2.cs +++ b/Projectiles/Magic/ManaBoltSmall2.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; projectile.velocity.X *= 0.975f; projectile.velocity.Y *= 0.975f; - if (Main.rand.NextBool(2)) + if (projectile.timeLeft % 4 == 0) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } diff --git a/Projectiles/Melee/Spears/NadirSpear.cs b/Projectiles/Melee/Spears/NadirSpear.cs index 1d16adb747..7b1063d648 100644 --- a/Projectiles/Melee/Spears/NadirSpear.cs +++ b/Projectiles/Melee/Spears/NadirSpear.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee.Spears projectile.ignoreWater = true; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; + projectile.localNPCHitCooldown = 4; projectile.Calamity().trueMelee = true; } public override float InitialSpeed => 5.5f; @@ -34,8 +34,8 @@ namespace CalamityMod.Projectiles.Melee.Spears public override float ForwardSpeed => 1.1f; public override Action EffectBeforeReelback => (proj) => { - int damage = Nadir.BaseDamage / 5; - float kb = 5.5f; + int damage = projectile.damage / 4; + float kb = projectile.knockBack * 0.5f; Vector2 projPos = projectile.Center + projectile.velocity; Vector2 projVel = projectile.velocity * 0.75f; if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Melee/VoidEssence.cs b/Projectiles/Melee/VoidEssence.cs index c8d3d72553..aedeb96684 100644 --- a/Projectiles/Melee/VoidEssence.cs +++ b/Projectiles/Melee/VoidEssence.cs @@ -193,8 +193,8 @@ namespace CalamityMod.Projectiles.Melee private void SpawnTentacle(Vector2 tentacleVelocity) { - int damage = Nadir.BaseDamage; - float kb = 7f; + int damage = projectile.damage; + float kb = projectile.knockBack; // Randomize tentacle behavior variables float ai0 = Main.rand.NextFloat(0.01f, 0.08f); diff --git a/Projectiles/Ranged/ButcherGun.cs b/Projectiles/Ranged/ButcherGun.cs index f5e40a58fb..a52885e739 100644 --- a/Projectiles/Ranged/ButcherGun.cs +++ b/Projectiles/Ranged/ButcherGun.cs @@ -27,120 +27,112 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { Player player = Main.player[projectile.owner]; - float num = 0f; - Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); - if (projectile.spriteDirection == -1) - { - num = 3.14159274f; - } projectile.ai[0] += 1f; - int num39 = 0; + int incrementAmt = 0; float spreadMult = 0.15f; if (projectile.ai[0] >= 90f) { - num39++; + incrementAmt++; spreadMult = 0.13f; } if (projectile.ai[0] >= 180f) { - num39++; + incrementAmt++; spreadMult = 0.11f; } if (projectile.ai[0] >= 270f) { - num39++; + incrementAmt++; spreadMult = 0.09f; } if (projectile.ai[0] >= 360f) { - num39++; + incrementAmt++; spreadMult = 0.07f; } if (projectile.ai[0] >= 450f) { - num39++; spreadMult = 0.05f; } if (projectile.ai[0] >= 540f) { - num39++; + incrementAmt++; spreadMult = 0.04f; } if (projectile.ai[0] >= 630f) { - num39++; spreadMult = 0.03f; } if (projectile.ai[0] >= 720f) //8 { - num39++; + incrementAmt++; spreadMult = 0.02f; } - int num40 = 40; - int num41 = 3; + int shootDelayBase = 40; + int incrementMult = 3; projectile.ai[1] -= 1f; - bool flag15 = false; + bool willShoot = false; if (projectile.ai[1] <= 0f) { - projectile.ai[1] = (float)(num40 - num41 * num39); - flag15 = true; + projectile.ai[1] = (float)(shootDelayBase - incrementMult * incrementAmt); + willShoot = true; } - bool flag16 = player.channel && player.HasAmmo(player.ActiveItem(), true) && !player.noItems && !player.CCed; + bool canShoot = player.channel && player.HasAmmo(player.ActiveItem(), true) && !player.noItems && !player.CCed; if (projectile.localAI[0] > 0f) { projectile.localAI[0] -= 1f; } - if (projectile.soundDelay <= 0 && flag16) + if (projectile.soundDelay <= 0 && canShoot) { - projectile.soundDelay = num40 - num41 * num39; + projectile.soundDelay = shootDelayBase - incrementMult * incrementAmt; if (projectile.ai[0] != 1f) { Main.PlaySound(SoundID.Item38, projectile.position); } projectile.localAI[0] = 12f; } - if (flag15 && Main.myPlayer == projectile.owner) + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + if (willShoot && Main.myPlayer == projectile.owner) { - int num42 = 14; - float scaleFactor11 = 14f; - int weaponDamage2 = player.GetWeaponDamage(player.ActiveItem()); - float weaponKnockback2 = player.ActiveItem().knockBack; - if (flag16) + int projType = ProjectileID.Bullet; + float speedMult = 14f; + int damage = player.GetWeaponDamage(player.ActiveItem()); + float kback = player.ActiveItem().knockBack; + if (canShoot) { - player.PickAmmo(player.ActiveItem(), ref num42, ref scaleFactor11, ref flag16, ref weaponDamage2, ref weaponKnockback2, false); - weaponKnockback2 = player.GetWeaponKnockback(player.ActiveItem(), weaponKnockback2); - float scaleFactor12 = player.ActiveItem().shootSpeed * projectile.scale; - Vector2 vector19 = vector; - Vector2 value18 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - vector19; + player.PickAmmo(player.ActiveItem(), ref projType, ref speedMult, ref canShoot, ref damage, ref kback, false); + kback = player.GetWeaponKnockback(player.ActiveItem(), kback); + float speed = player.ActiveItem().shootSpeed * projectile.scale; + Vector2 targetPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - source; if (player.gravDir == -1f) { - value18.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector19.Y; + targetPos.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - source.Y; } - Vector2 value19 = Vector2.Normalize(value18); - if (float.IsNaN(value19.X) || float.IsNaN(value19.Y)) + Vector2 velMult = Vector2.Normalize(targetPos); + if (float.IsNaN(velMult.X) || float.IsNaN(velMult.Y)) { - value19 = -Vector2.UnitY; + velMult = -Vector2.UnitY; } - value19 *= scaleFactor12; - if (value19.X != projectile.velocity.X || value19.Y != projectile.velocity.Y) + velMult *= speed; + if (velMult.X != projectile.velocity.X || velMult.Y != projectile.velocity.Y) { projectile.netUpdate = true; } - projectile.velocity = value19 * 0.55f; - int randomBulletCount = Main.rand.Next(3, 5); - for (int num43 = 0; num43 < randomBulletCount; num43++) + projectile.velocity = velMult * 0.55f; + int randomBulletCount = Main.rand.Next(3, 5); //3 to 4 bullets + for (int projIndex = 0; projIndex < randomBulletCount; projIndex++) { - Vector2 vector20 = Vector2.Normalize(projectile.velocity) * scaleFactor11 * (0.6f + Main.rand.NextFloat() * spreadMult); - if (float.IsNaN(vector20.X) || float.IsNaN(vector20.Y)) + Vector2 bulletVel = Vector2.Normalize(projectile.velocity) * speedMult * (0.6f + Main.rand.NextFloat() * spreadMult); + if (float.IsNaN(bulletVel.X) || float.IsNaN(bulletVel.Y)) { - vector20 = -Vector2.UnitY; + bulletVel = -Vector2.UnitY; } - Vector2 vector21 = vector19 + Utils.RandomVector2(Main.rand, -5f, 5f); - vector20.X += (float)Main.rand.Next(-15, 16) * spreadMult; - vector20.Y += (float)Main.rand.Next(-15, 16) * spreadMult; - int num44 = Projectile.NewProjectile(vector21.X, vector21.Y, vector20.X, vector20.Y, num42, weaponDamage2, weaponKnockback2, projectile.owner, 0f, 0f); + source += Utils.RandomVector2(Main.rand, -5f, 5f); + bulletVel.X += (float)Main.rand.Next(-15, 16) * spreadMult; + bulletVel.Y += (float)Main.rand.Next(-15, 16) * spreadMult; + int num44 = Projectile.NewProjectile(source, bulletVel, projType, damage, kback, projectile.owner, 0f, 0f); Main.projectile[num44].noDropItem = true; - Main.projectile[num44].extraUpdates += num39 / 2; //0 to 4 + Main.projectile[num44].extraUpdates += incrementAmt / 2; //0 to 4 } } else @@ -149,7 +141,12 @@ namespace CalamityMod.Projectiles.Ranged } } projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f; - projectile.rotation = projectile.velocity.ToRotation() + num; + float rotationAmt = 0f; + if (projectile.spriteDirection == -1) + { + rotationAmt = MathHelper.Pi; + } + projectile.rotation = projectile.velocity.ToRotation() + rotationAmt; projectile.spriteDirection = projectile.direction; projectile.timeLeft = 2; player.ChangeDir(projectile.direction); diff --git a/Projectiles/Ranged/ClamorRifleProj.cs b/Projectiles/Ranged/ClamorRifleProj.cs index aeb75bfddd..e93fc94851 100644 --- a/Projectiles/Ranged/ClamorRifleProj.cs +++ b/Projectiles/Ranged/ClamorRifleProj.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.45), 0f, projectile.owner, 0f, 0f); } } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 118); diff --git a/Projectiles/Ranged/NeedlerProj.cs b/Projectiles/Ranged/NeedlerProj.cs index 6ad53995fa..d9d9fa4779 100644 --- a/Projectiles/Ranged/NeedlerProj.cs +++ b/Projectiles/Ranged/NeedlerProj.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -22,7 +23,9 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.extraUpdates = 2; projectile.aiStyle = 93; - aiType = 514; + aiType = ProjectileID.NailFriendly; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 1; } public override void AI() @@ -44,11 +47,6 @@ namespace CalamityMod.Projectiles.Ranged } } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 1; - } - public override void Kill(int timeLeft) { projectile.position = projectile.Center; diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index 9120c2ec8c..b6ba258d6d 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -20,7 +21,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.friendly = true; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 90; } @@ -49,6 +50,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.damage /= 2; projectile.Damage(); } } diff --git a/Projectiles/Summon/ApparatusExplosion.cs b/Projectiles/Summon/ApparatusExplosion.cs index 1f5ffacb1d..58143b81b8 100644 --- a/Projectiles/Summon/ApparatusExplosion.cs +++ b/Projectiles/Summon/ApparatusExplosion.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; + projectile.localNPCHitCooldown = 20; } public override void AI() From fe4bc5e4e45ed4a71319fb6e200a09dc41374a9e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 27 May 2020 19:59:09 -0400 Subject: [PATCH 41/52] changes to optic staff, fungal clump, and icebreaker --- CalamityMod.cs | 3 ++- Projectiles/Rogue/IcebreakerHammer.cs | 3 ++- Projectiles/Summon/FungalClumpMinion.cs | 4 +++- Projectiles/Typeless/PoisonousSeawater.cs | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 9212cb403a..fe87e541ca 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1368,7 +1368,8 @@ namespace CalamityMod ItemID.DD2BetsyBow, ItemID.InfluxWaver, ItemID.Xenopopper, - ItemID.ElectrosphereLauncher + ItemID.ElectrosphereLauncher, + ItemID.OpticStaff //Note: got local i frames so it should be better }; pumpkinMoonBuffList = new List() diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index 638cd3ffbd..f78d5f5f79 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -93,8 +93,9 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < Main.maxPlayers; i++) { + Player owner = Main.player[projectile.owner]; Player player = Main.player[i]; - if ((Main.player[projectile.owner].team != player.team || player.team == 0) && !player.dead && !player.buffImmune[buffType] && Vector2.Distance(projectile.Center, player.Center) <= radius) + if ((owner.team != player.team || player.team == 0) && player.hostile && owner.hostile && !player.dead && !player.buffImmune[buffType] && Vector2.Distance(projectile.Center, player.Center) <= radius) { if (player.FindBuffIndex(buffType) == -1) player.AddBuff(buffType, 180, false); diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index 4a2e39f367..864318f7b2 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -126,7 +126,9 @@ namespace CalamityMod.Projectiles.Summon { if (projectile.owner == Main.myPlayer && amalgam) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 1f, 0f); + int water = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 1f, 0f); + Main.projectile[water].usesIDStaticNPCImmunity = true; + Main.projectile[water].usesLocalNPCImmunity = false; } } diff --git a/Projectiles/Typeless/PoisonousSeawater.cs b/Projectiles/Typeless/PoisonousSeawater.cs index 619dcb6611..4951f8fa4a 100644 --- a/Projectiles/Typeless/PoisonousSeawater.cs +++ b/Projectiles/Typeless/PoisonousSeawater.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.timeLeft = 6; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.idStaticNPCHitCooldown = 10; } public override void AI() From c52da51b34f199d63afd3e579b94887a99e1e706 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 27 May 2020 23:03:39 -0400 Subject: [PATCH 42/52] nerfed realm ravager, buffed apoctosis array --- Items/Weapons/Magic/ApoctosisArray.cs | 4 ++-- Items/Weapons/Ranged/RealmRavager.cs | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Items/Weapons/Magic/ApoctosisArray.cs b/Items/Weapons/Magic/ApoctosisArray.cs index 12c8980faf..734002411f 100644 --- a/Items/Weapons/Magic/ApoctosisArray.cs +++ b/Items/Weapons/Magic/ApoctosisArray.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { item.width = 98; - item.damage = 45; + item.damage = 55; item.magic = true; - item.mana = 14; + item.mana = 12; item.useAnimation = 7; item.useTime = 7; item.useStyle = 5; diff --git a/Items/Weapons/Ranged/RealmRavager.cs b/Items/Weapons/Ranged/RealmRavager.cs index b2750d1247..31636ef2d9 100644 --- a/Items/Weapons/Ranged/RealmRavager.cs +++ b/Items/Weapons/Ranged/RealmRavager.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.ranged = true; item.width = 76; item.height = 32; - item.useTime = 20; - item.useAnimation = 20; + item.useTime = 22; + item.useAnimation = 22; item.useStyle = 5; item.noMelee = true; item.knockBack = 4f; @@ -31,17 +31,14 @@ namespace CalamityMod.Items.Weapons.Ranged item.autoReuse = true; item.shootSpeed = 30f; item.shoot = ModContent.ProjectileType(); - item.useAmmo = 97; + item.useAmmo = AmmoID.Bullet; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - for (int index = 0; index < 5; ++index) + for (int index = 0; index < Main.rand.Next(3,5); ++index) //3 to 4 bullets { float SpeedX = speedX + (float)Main.rand.Next(-75, 76) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-75, 76) * 0.05f; From 76e42a00595699eb4978730e550499f0c64f7a89 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Wed, 27 May 2020 23:04:28 -0400 Subject: [PATCH 43/52] marginally nerfed evasion scarf dash distance --- CalPlayer/CalamityPlayer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c003c5d05c..814ea6cf9a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7753,7 +7753,7 @@ namespace CalamityMod.CalPlayer float dashDistance; if (dashMod == 1) //Counter and Evasion Scarf { - dashDistance = evasionScarf ? 16.9f : 14.5f; + dashDistance = evasionScarf ? 16.3f : 14.5f; int direction = 0; bool justDashed = false; if (dashTimeMod > 0) From db73d455d52e21f723787305db028665dc978553 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 09:56:26 -0400 Subject: [PATCH 44/52] Balanced, as all things should be --- Items/Weapons/Magic/AlulaAustralis.cs | 2 +- Items/Weapons/Melee/CosmicShiv.cs | 2 +- Items/Weapons/Melee/PrismaticBreaker.cs | 4 ++-- Items/Weapons/Melee/ScourgeoftheCosmos.cs | 2 +- Items/Weapons/Ranged/AuroraBlazer.cs | 6 +++--- Items/Weapons/Ranged/RubicoPrime.cs | 2 +- Items/Weapons/Summon/FrostBlossomStaff.cs | 2 +- Projectiles/Ranged/AuroraFire.cs | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Items/Weapons/Magic/AlulaAustralis.cs b/Items/Weapons/Magic/AlulaAustralis.cs index d64989186d..98216b996f 100644 --- a/Items/Weapons/Magic/AlulaAustralis.cs +++ b/Items/Weapons/Magic/AlulaAustralis.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 90; + item.damage = 99; item.magic = true; item.mana = 8; item.width = 52; diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index b0691a7130..408059b77f 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 44; item.height = 44; - item.damage = 700; + item.damage = 666; item.melee = true; item.knockBack = 9f; diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index b1310f75fd..fb0ec5f0da 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 600; + item.damage = 1200; item.crit += 8; item.useStyle = 1; item.useTime = item.useAnimation = 15; @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (player.altFunctionUse == 2) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 1.75), knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * 1), knockBack, player.whoAmI, 0f, 0f); } else { diff --git a/Items/Weapons/Melee/ScourgeoftheCosmos.cs b/Items/Weapons/Melee/ScourgeoftheCosmos.cs index 03630c5761..c7ac6cd59e 100644 --- a/Items/Weapons/Melee/ScourgeoftheCosmos.cs +++ b/Items/Weapons/Melee/ScourgeoftheCosmos.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 18; - item.damage = 1100; + item.damage = 1300; item.melee = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Ranged/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs index e97f1353e6..6d6583af85 100644 --- a/Items/Weapons/Ranged/AuroraBlazer.cs +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -18,10 +18,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 50; + item.damage = 49; item.ranged = true; - item.useTime = 15; - item.useAnimation = 15; + item.useTime = 18; + item.useAnimation = 18; item.knockBack = 2f; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index 718d37c965..9a41a5dd4e 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 4000; + item.damage = 2601; item.ranged = true; item.crit += 40; item.knockBack = 10f; diff --git a/Items/Weapons/Summon/FrostBlossomStaff.cs b/Items/Weapons/Summon/FrostBlossomStaff.cs index 273e2ac851..638fdc8a8d 100644 --- a/Items/Weapons/Summon/FrostBlossomStaff.cs +++ b/Items/Weapons/Summon/FrostBlossomStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 12; + item.damage = 10; item.mana = 10; item.width = 34; item.height = 24; diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index 3301c4612c..aa189fdafe 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 3; projectile.tileCollide = false; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; + projectile.localNPCHitCooldown = 20; } public override void AI() From e7f4b0fc4cf7dc11b4faf53d8f459b47ae62371f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 10:42:00 -0400 Subject: [PATCH 45/52] fixed spiky balls not properly getting deleted --- Items/Weapons/Rogue/GodsParanoia.cs | 9 +++------ Items/Weapons/Rogue/HellsSun.cs | 10 +++------- Items/Weapons/Rogue/PoisonPack.cs | 9 +++------ Items/Weapons/Rogue/SkyStabber.cs | 9 +++------ 4 files changed, 12 insertions(+), 25 deletions(-) diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index 83056c299e..ff7aa0d399 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -69,12 +69,7 @@ Right click to delete all existing spiky balls"); { CalamityPlayer modPlayer = player.Calamity(); modPlayer.killSpikyBalls = false; - if (player.altFunctionUse == 2) - { - modPlayer.killSpikyBalls = true; - return false; - } - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; @@ -85,6 +80,8 @@ Right click to delete all existing spiky balls"); public override bool AltFunctionUse(Player player) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = true; return true; } diff --git a/Items/Weapons/Rogue/HellsSun.cs b/Items/Weapons/Rogue/HellsSun.cs index d4bcc89035..38c01c5cd8 100644 --- a/Items/Weapons/Rogue/HellsSun.cs +++ b/Items/Weapons/Rogue/HellsSun.cs @@ -65,17 +65,11 @@ namespace CalamityMod.Items.Weapons.Rogue } } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.killSpikyBalls = false; - if (player.altFunctionUse == 2) - { - modPlayer.killSpikyBalls = true; - return false; - } - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * SdamageMult), knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; @@ -88,6 +82,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = true; return true; } diff --git a/Items/Weapons/Rogue/PoisonPack.cs b/Items/Weapons/Rogue/PoisonPack.cs index c0b680eb27..e26e270cd5 100644 --- a/Items/Weapons/Rogue/PoisonPack.cs +++ b/Items/Weapons/Rogue/PoisonPack.cs @@ -65,12 +65,7 @@ namespace CalamityMod.Items.Weapons.Rogue { CalamityPlayer modPlayer = player.Calamity(); modPlayer.killSpikyBalls = false; - if (player.altFunctionUse == 2) - { - modPlayer.killSpikyBalls = true; - return false; - } - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; @@ -81,6 +76,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = true; return true; } diff --git a/Items/Weapons/Rogue/SkyStabber.cs b/Items/Weapons/Rogue/SkyStabber.cs index b539866fdc..bf1ae74ec7 100644 --- a/Items/Weapons/Rogue/SkyStabber.cs +++ b/Items/Weapons/Rogue/SkyStabber.cs @@ -65,12 +65,7 @@ namespace CalamityMod.Items.Weapons.Rogue { CalamityPlayer modPlayer = player.Calamity(); modPlayer.killSpikyBalls = false; - if (player.altFunctionUse == 2) - { - modPlayer.killSpikyBalls = true; - return false; - } - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; @@ -81,6 +76,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.killSpikyBalls = true; return true; } From 719e30379b54f15fb5daffb0a0d474611604d818 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 10:46:05 -0400 Subject: [PATCH 46/52] added a shadow potion cooldown --- CalPlayer/CalamityPlayer.cs | 2 ++ CalPlayer/CalamityPlayerMiscEffects.cs | 2 ++ Projectiles/CalamityGlobalProjectile.cs | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 814ea6cf9a..d3769b514f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -196,6 +196,7 @@ namespace CalamityMod.CalPlayer public int profanedSoulWeaponType = 0; public int hurtSoundTimer = 0; public int danceOfLightCharge = 0; + public int shadowPotCooldown = 0; #endregion #region Sound @@ -1899,6 +1900,7 @@ namespace CalamityMod.CalPlayer planarSpeedBoost = 0; galileoCooldown = 0; soundCooldown = 0; + shadowPotCooldown = 0; rage = 0; adrenaline = 0; raiderStack = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index af103032cd..858dfdd1b3 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -897,6 +897,8 @@ namespace CalamityMod.CalPlayer modPlayer.galileoCooldown--; if (modPlayer.soundCooldown > 0) modPlayer.soundCooldown--; + if (modPlayer.shadowPotCooldown > 0) + modPlayer.shadowPotCooldown--; if (modPlayer.raiderCooldown > 0) modPlayer.raiderCooldown--; if (modPlayer.gSabatonCooldown > 0) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 50ee070d42..30d1db9213 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1391,13 +1391,14 @@ namespace CalamityMod.Projectiles target.AddBuff(BuffID.Venom, 240); } - if (modPlayer.shadow) + if (modPlayer.shadow && modPlayer.shadowPotCooldown <= 0) { if (CalamityMod.javelinProjList.Contains(projectile.type)) { int randrot = Main.rand.Next(-30, 391); Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot)); Projectile.NewProjectile(projectile.Center, SoulSpeed, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.1, 60), 3f, projectile.owner, 0f, 0f); + modPlayer.shadowPotCooldown = 30; } if (CalamityMod.spikyBallProjList.Contains(projectile.type)) { @@ -1405,6 +1406,7 @@ namespace CalamityMod.Projectiles Main.projectile[scythe].usesLocalNPCImmunity = true; Main.projectile[scythe].localNPCHitCooldown = 10; Main.projectile[scythe].penetrate = 2; + modPlayer.shadowPotCooldown = 30; } if (CalamityMod.daggerProjList.Contains(projectile.type)) { @@ -1413,6 +1415,7 @@ namespace CalamityMod.Projectiles shardVelocity *= 5f; int shard = Projectile.NewProjectile(projectile.Center, shardVelocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 60), 0f, projectile.owner); Main.projectile[shard].timeLeft = 150; + modPlayer.shadowPotCooldown = 30; } if (CalamityMod.boomerangProjList.Contains(projectile.type)) { @@ -1453,11 +1456,13 @@ namespace CalamityMod.Projectiles int ghost = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, SpeedX, SpeedY, ProjectileID.SpectreWrath, spiritDamage, 0f, projectile.owner, (float)num3, 0f); Main.projectile[ghost].Calamity().forceRogue = true; Main.projectile[ghost].penetrate = 1; + modPlayer.shadowPotCooldown = 30; } if (CalamityMod.flaskBombProjList.Contains(projectile.type)) { int blackhole = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.05, 60), 3f, projectile.owner, 0f, 0f); Main.projectile[blackhole].Center = projectile.Center; + modPlayer.shadowPotCooldown = 30; } } } From 0666bd3a4694656e611ddba33691bd7d377072e5 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 21:54:33 -0400 Subject: [PATCH 47/52] moon bite disables most/all lifesteal now --- Items/Weapons/Melee/BloodyEdge.cs | 4 ++-- Items/Weapons/Melee/BurntSienna.cs | 4 ++-- Items/Weapons/Melee/DraedonsExoblade.cs | 4 +++- Items/Weapons/Melee/Earth.cs | 10 ++++++---- Items/Weapons/Melee/ElementalExcalibur.cs | 4 +++- Items/Weapons/Melee/GrandGuardian.cs | 6 +++--- Items/Weapons/Melee/LifefruitScythe.cs | 4 +++- Items/Weapons/Melee/MajesticGuard.cs | 2 +- Items/Weapons/Melee/TerraEdge.cs | 4 +++- Items/Weapons/Melee/Terratomere.cs | 4 +++- Items/Weapons/Melee/TrueBloodyEdge.cs | 4 +++- Projectiles/CalamityGlobalProjectile.cs | 4 +++- Projectiles/Magic/MagnusBeam.cs | 2 +- Projectiles/Magic/SanguineFlareProj.cs | 4 ++-- Projectiles/Magic/VisceraBeam.cs | 2 +- Projectiles/Melee/Blood.cs | 2 ++ Projectiles/Melee/Leech.cs | 2 ++ Projectiles/Melee/Spears/GildedProboscisProj.cs | 2 +- Projectiles/Melee/Yoyos/LaceratorYoyo.cs | 2 +- Projectiles/Ranged/BloodBoilerFire.cs | 4 ++-- Projectiles/Ranged/BloodfireArrowProj.cs | 4 ++-- Projectiles/Ranged/BloodfireBullet.cs | 4 ++-- Projectiles/Ranged/CardHeart.cs | 4 ++-- Projectiles/Ranged/ShockblastRound.cs | 2 +- Projectiles/Rogue/BloodsoakedCrashax.cs | 2 +- Projectiles/Rogue/ScarletDevilProjectile.cs | 2 +- Projectiles/Typeless/OmegaBlueTentacle.cs | 6 +++--- 27 files changed, 59 insertions(+), 39 deletions(-) diff --git a/Items/Weapons/Melee/BloodyEdge.cs b/Items/Weapons/Melee/BloodyEdge.cs index 8ad4ccc251..9337375fff 100644 --- a/Items/Weapons/Melee/BloodyEdge.cs +++ b/Items/Weapons/Melee/BloodyEdge.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { int healAmount = Main.rand.Next(3) + 1; - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool(2) && !player.moonLeech) { player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/BurntSienna.cs b/Items/Weapons/Melee/BurntSienna.cs index f861213e2d..fcf21be439 100644 --- a/Items/Weapons/Melee/BurntSienna.cs +++ b/Items/Weapons/Melee/BurntSienna.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.life <= 0) + if (target.life <= 0 && !player.moonLeech) { float randomSpeedX = (float)Main.rand.Next(3); float randomSpeedY = (float)Main.rand.Next(3, 5); @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - if (target.statLife <= 0) + if (target.statLife <= 0 && !player.moonLeech) { float randomSpeedX = (float)Main.rand.Next(3); float randomSpeedY = (float)Main.rand.Next(3, 5); diff --git a/Items/Weapons/Melee/DraedonsExoblade.cs b/Items/Weapons/Melee/DraedonsExoblade.cs index b09f0ceb06..444032cbb8 100644 --- a/Items/Weapons/Melee/DraedonsExoblade.cs +++ b/Items/Weapons/Melee/DraedonsExoblade.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), knockback, player.whoAmI, 0f, ai1); } } - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -134,6 +134,8 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType(), (int)(item.damage * player.MeleeDamage()), item.knockBack, player.whoAmI, 0f, ai1); } } + if (player.moonLeech) + return; int healAmount = Main.rand.Next(5) + 5; player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index 38858f734f..cac0c123a2 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -86,14 +86,14 @@ namespace CalamityMod.Items.Weapons.Melee float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), knockback, player.whoAmI, 0f, (float)Main.rand.Next(10)); } - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) - { - return; - } if (Main.rand.NextBool(2)) { target.defense -= 50; } + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) + { + return; + } int heal = Main.rand.Next(1, 69); player.statLife += heal; player.HealEffect(heal); @@ -145,6 +145,8 @@ namespace CalamityMod.Items.Weapons.Melee float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); } + if (player.moonLeech) + return; int heal = Main.rand.Next(1, 69); player.statLife += heal; player.HealEffect(heal); diff --git a/Items/Weapons/Melee/ElementalExcalibur.cs b/Items/Weapons/Melee/ElementalExcalibur.cs index 7ee1892844..ae217ee9be 100644 --- a/Items/Weapons/Melee/ElementalExcalibur.cs +++ b/Items/Weapons/Melee/ElementalExcalibur.cs @@ -154,7 +154,7 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(BuffID.OnFire, 240); target.AddBuff(BuffID.Ichor, 240); - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -174,6 +174,8 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 240); target.AddBuff(BuffID.OnFire, 240); target.AddBuff(BuffID.Ichor, 240); + if (player.moonLeech) + return; int healAmount = Main.rand.Next(10) + 10; player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/GrandGuardian.cs b/Items/Weapons/Melee/GrandGuardian.cs index 7aef9f9409..d60c5e37b6 100644 --- a/Items/Weapons/Melee/GrandGuardian.cs +++ b/Items/Weapons/Melee/GrandGuardian.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee { target.defense -= 15; } - if (target.defense <= 0 && target.canGhostHeal) + if (target.defense <= 0 && target.canGhostHeal && !player.moonLeech) { player.statLife += 4; player.HealEffect(4); @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(player.Center.X, player.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.75f), knockback, player.whoAmI); Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -randomSpeedY, ModContent.ProjectileType(), (int)((float)item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.75f), knockback, player.whoAmI); } - if (target.life <= 0) + if (target.life <= 0 && !player.moonLeech) { float randomSpeedX = (float)Main.rand.Next(9); float randomSpeedY = (float)Main.rand.Next(6, 15); @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(player.Center.X, player.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.75f), item.knockBack, player.whoAmI); Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -randomSpeedY, ModContent.ProjectileType(), (int)((float)item.damage * (player.allDamage + player.meleeDamage - 1f) * 0.75f), item.knockBack, player.whoAmI); } - if (target.statLife <= 0) + if (target.statLife <= 0 && !player.moonLeech) { float randomSpeedX = (float)Main.rand.Next(9); float randomSpeedY = (float)Main.rand.Next(6, 15); diff --git a/Items/Weapons/Melee/LifefruitScythe.cs b/Items/Weapons/Melee/LifefruitScythe.cs index 4bd35bc74d..d450027649 100644 --- a/Items/Weapons/Melee/LifefruitScythe.cs +++ b/Items/Weapons/Melee/LifefruitScythe.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -64,6 +64,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { + if (player.moonLeech) + return; player.statLife += 5; player.HealEffect(5); } diff --git a/Items/Weapons/Melee/MajesticGuard.cs b/Items/Weapons/Melee/MajesticGuard.cs index 3e25680803..b47f22b9f3 100644 --- a/Items/Weapons/Melee/MajesticGuard.cs +++ b/Items/Weapons/Melee/MajesticGuard.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee target.defense -= 10; // Healing effect does not trigger versus dummies - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || player.moonLeech) return; if (target.defense <= 0 && target.canGhostHeal) diff --git a/Items/Weapons/Melee/TerraEdge.cs b/Items/Weapons/Melee/TerraEdge.cs index b37082e869..30cf8b013d 100644 --- a/Items/Weapons/Melee/TerraEdge.cs +++ b/Items/Weapons/Melee/TerraEdge.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -80,6 +80,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { + if (player.moonLeech) + return; int healAmount = Main.rand.Next(2) + 2; player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index 9fab60c74f..b910782777 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -91,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 600); target.AddBuff(BuffID.OnFire, 600); target.AddBuff(BuffID.Ichor, 300); - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || player.moonLeech) { return; } @@ -110,6 +110,8 @@ namespace CalamityMod.Items.Weapons.Melee target.AddBuff(BuffID.Frostburn, 600); target.AddBuff(BuffID.OnFire, 600); target.AddBuff(BuffID.Ichor, 300); + if (player.moonLeech) + return; int healAmount = Main.rand.Next(3) + 2; player.statLife += healAmount; player.HealEffect(healAmount); diff --git a/Items/Weapons/Melee/TrueBloodyEdge.cs b/Items/Weapons/Melee/TrueBloodyEdge.cs index 8f745cb00a..d11303391d 100644 --- a/Items/Weapons/Melee/TrueBloodyEdge.cs +++ b/Items/Weapons/Melee/TrueBloodyEdge.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || player.moonLeech) { return; } @@ -67,6 +67,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, int damage, bool crit) { + if (player.moonLeech) + return; int healAmount = Main.rand.Next(6) + 1; if (Main.rand.NextBool(2)) { diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 30d1db9213..d212d89ff6 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1045,7 +1045,7 @@ namespace CalamityMod.Projectiles } } - if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != NPCType()) + if (Main.player[Main.myPlayer].lifeSteal > 0f && target.canGhostHeal && target.type != NPCID.TargetDummy && target.type != NPCType() && !player.moonLeech) { // Increases the degree to which Spectre Healing set contributes to the lifesteal cap if (player.ghostHeal) @@ -1823,6 +1823,8 @@ namespace CalamityMod.Projectiles public static void SpawnLifeStealProjectile(Projectile projectile, Player player, float healAmount, int healProjectileType, float distanceRequired, float cooldownMultiplier) { + if (Main.player[Main.myPlayer].moonLeech) + return; Main.player[Main.myPlayer].lifeSteal -= healAmount * cooldownMultiplier; float num13 = 0f; int num14 = projectile.owner; diff --git a/Projectiles/Magic/MagnusBeam.cs b/Projectiles/Magic/MagnusBeam.cs index cfacbdbd4a..718b82efce 100644 --- a/Projectiles/Magic/MagnusBeam.cs +++ b/Projectiles/Magic/MagnusBeam.cs @@ -203,7 +203,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Magic/SanguineFlareProj.cs b/Projectiles/Magic/SanguineFlareProj.cs index 12d74eaff4..3ed0304e57 100644 --- a/Projectiles/Magic/SanguineFlareProj.cs +++ b/Projectiles/Magic/SanguineFlareProj.cs @@ -88,14 +88,14 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + target.AddBuff(ModContent.BuffType(), 120); + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } Player player = Main.player[projectile.owner]; player.statLife += 1; player.HealEffect(1); - target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Magic/VisceraBeam.cs b/Projectiles/Magic/VisceraBeam.cs index 894d789415..e695566dc5 100644 --- a/Projectiles/Magic/VisceraBeam.cs +++ b/Projectiles/Magic/VisceraBeam.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Melee/Blood.cs b/Projectiles/Melee/Blood.cs index b160e1f524..663a68b5f1 100644 --- a/Projectiles/Melee/Blood.cs +++ b/Projectiles/Melee/Blood.cs @@ -40,6 +40,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { Player player = Main.player[projectile.owner]; + if (player.moonLeech) + return; player.statLife += 5; player.HealEffect(5); } diff --git a/Projectiles/Melee/Leech.cs b/Projectiles/Melee/Leech.cs index 805c041da9..325f29c3f6 100644 --- a/Projectiles/Melee/Leech.cs +++ b/Projectiles/Melee/Leech.cs @@ -47,6 +47,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { + if (Main.player[projectile.owner].moonLeech) + return; Player player = Main.player[projectile.owner]; player.statLife += 5; player.HealEffect(5); diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index a9e3c93132..30895a8a21 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) return; Player player = Main.player[projectile.owner]; diff --git a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index c9972ca647..60e5346fbf 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) return; Player player = Main.player[projectile.owner]; if (Main.rand.NextBool(5)) diff --git a/Projectiles/Ranged/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index 5c0f7837e8..37724b66e1 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Ranged if (Main.myPlayer == projectile.owner) if (projectile.Hitbox.Intersects(player.Hitbox)) { - if (Main.rand.NextBool(3)) + if (Main.rand.NextBool(3) && !Main.player[projectile.owner].moonLeech) { player.statLife += 1; player.HealEffect(1); @@ -158,7 +158,7 @@ namespace CalamityMod.Projectiles.Ranged { target.AddBuff(ModContent.BuffType(), 360); target.AddBuff(ModContent.BuffType(), 360); - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index a3066f1645..9792dfcd11 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -80,7 +80,8 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + target.AddBuff(ModContent.BuffType(), 360); + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } @@ -90,7 +91,6 @@ namespace CalamityMod.Projectiles.Ranged player.statLife += 1; player.HealEffect(1); } - target.AddBuff(ModContent.BuffType(), 360); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/BloodfireBullet.cs b/Projectiles/Ranged/BloodfireBullet.cs index bd200a4560..e7c2b5542b 100644 --- a/Projectiles/Ranged/BloodfireBullet.cs +++ b/Projectiles/Ranged/BloodfireBullet.cs @@ -52,7 +52,8 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (target.type == NPCID.TargetDummy || !target.canGhostHeal) + target.AddBuff(ModContent.BuffType(), 360); + if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) { return; } @@ -62,7 +63,6 @@ namespace CalamityMod.Projectiles.Ranged player.statLife += 1; player.HealEffect(1); } - target.AddBuff(ModContent.BuffType(), 360); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/CardHeart.cs b/Projectiles/Ranged/CardHeart.cs index f023af6d53..c6bbcce245 100644 --- a/Projectiles/Ranged/CardHeart.cs +++ b/Projectiles/Ranged/CardHeart.cs @@ -60,11 +60,11 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 360); - if (target.type == NPCID.TargetDummy) + Player player = Main.player[projectile.owner]; + if (target.type == NPCID.TargetDummy || player.moonLeech) { return; } - Player player = Main.player[projectile.owner]; player.statLife += 1; player.HealEffect(1); } diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index fd7f0cefa0..ff994af960 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); } - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 24d20904ab..802f3d0811 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Rogue int stealth = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[stealth].Calamity().forceRogue = true; } - if (!target.canGhostHeal) //canGhostHeal be like lol + if (!target.canGhostHeal || player.moonLeech) //canGhostHeal be like lol { return; } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index 104c5466d0..41a38ffd9a 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.0075), 0f, projectile.owner, 0f, 0f); - if (target.type == NPCID.TargetDummy || !projectile.Calamity().stealthStrike) + if (target.type == NPCID.TargetDummy || !projectile.Calamity().stealthStrike || Main.player[projectile.owner].moonLeech) { return; } diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index 029e62f3b8..c855387dae 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.ai[0] = 10 + Main.rand.Next(10); float maxDistance = hentai ? 900f : 600f; int target = -1; - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(projectile)) @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].lifeSteal > 0f && target.type != NPCID.TargetDummy) + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].lifeSteal > 0f && target.type != NPCID.TargetDummy && !Main.player[projectile.owner].moonLeech) { int healAmount = 10 * damage / projectile.damage; //should always be around max, less if enemy has defense/DR if (healAmount > 0) @@ -213,7 +213,7 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitPvp(Player target, int damage, bool crit) { - if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].lifeSteal > 0f) + if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].lifeSteal > 0f && !Main.player[projectile.owner].moonLeech) { int healAmount = 10 * damage / projectile.damage; //should always be around max, less if enemy has defense/DR if (healAmount > 0) From 6490f8993a8f0761ff7d011f093237643e32429a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 22:07:30 -0400 Subject: [PATCH 48/52] buffed pbg health, phantom lances, and greatbow of turmoil --- Items/Weapons/Ranged/GreatbowofTurmoil.cs | 30 +++++++++---------- Items/Weapons/Rogue/PhantomLance.cs | 2 +- .../PlaguebringerGoliath.cs | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Items/Weapons/Ranged/GreatbowofTurmoil.cs b/Items/Weapons/Ranged/GreatbowofTurmoil.cs index 6ed6729314..ad58129904 100644 --- a/Items/Weapons/Ranged/GreatbowofTurmoil.cs +++ b/Items/Weapons/Ranged/GreatbowofTurmoil.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 27; + item.damage = 31; item.ranged = true; item.width = 18; item.height = 36; @@ -38,26 +38,26 @@ namespace CalamityMod.Items.Weapons.Ranged 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 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num117 = 0.314159274f; - int num118 = 3; - Vector2 vector7 = new Vector2(speedX, speedY); - vector7.Normalize(); - vector7 *= 40f; - bool flag11 = Collision.CanHit(vector2, 0, 0, vector2 + vector7, 0, 0); - for (int num119 = 0; num119 < num118; num119++) + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float piOverTen = MathHelper.Pi * 0.1f; + int arrowAmt = 3; + Vector2 velocity = new Vector2(speedX, speedY); + velocity.Normalize(); + velocity *= 40f; + bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0); + for (int projIndex = 0; projIndex < arrowAmt; projIndex++) { - float num120 = (float)num119 - ((float)num118 - 1f) / 2f; - Vector2 value9 = vector7.RotatedBy((double)(num117 * num120), default); - if (!flag11) + float num120 = (float)projIndex - ((float)arrowAmt - 1f) / 2f; + Vector2 offset = velocity.RotatedBy((double)(piOverTen * num120), default); + if (!canHit) { - value9 -= vector7; + offset -= velocity; } if (type == ProjectileID.WoodenArrowFriendly) { type = ProjectileID.FireArrow; } - int num121 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + int num121 = Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[num121].noDropItem = true; } for (int i = 0; i < 2; i++) @@ -78,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Ranged default: break; } - int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.5f), knockBack, player.whoAmI, 0f, 0f); + int index = Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, (int)(damage * 0.5f), knockBack, player.whoAmI, 0f, 0f); Main.projectile[index].noDropItem = true; Main.projectile[index].usesLocalNPCImmunity = true; Main.projectile[index].localNPCHitCooldown = 10; diff --git a/Items/Weapons/Rogue/PhantomLance.cs b/Items/Weapons/Rogue/PhantomLance.cs index bb4ca73c94..7265574da8 100644 --- a/Items/Weapons/Rogue/PhantomLance.cs +++ b/Items/Weapons/Rogue/PhantomLance.cs @@ -20,7 +20,7 @@ Stealth strikes don't slow down and souls always deal full damage"); public override void SafeSetDefaults() { - item.damage = 60; + item.damage = 70; item.knockBack = 5f; item.width = 62; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 26d9f78b5a..f5558ebedb 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.height = 198; npc.defense = 40; npc.Calamity().RevPlusDR(0.25f); - npc.LifeMaxNERB(58500, 77275, 3700000); + npc.LifeMaxNERB(64350, 85002, 3700000); double HPBoost = (double)CalamityMod.CalamityConfig.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.knockBackResist = 0f; From 6258c25177e6af2d3f0d0f143851774d5ee54148 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 23:26:37 -0400 Subject: [PATCH 49/52] nerfs also reworked toxicant twister --- Items/Weapons/Magic/HyphaeRod.cs | 72 ++++++++--------- Items/Weapons/Rogue/ToxicantTwister.cs | 41 ++++------ NPCs/CalamityGlobalNPC.cs | 4 + .../Rogue/ToxicantTwisterTwoPointZero.cs | 78 +++++++++++++------ 4 files changed, 109 insertions(+), 86 deletions(-) diff --git a/Items/Weapons/Magic/HyphaeRod.cs b/Items/Weapons/Magic/HyphaeRod.cs index c4b2c93fcf..317a2ae5cd 100644 --- a/Items/Weapons/Magic/HyphaeRod.cs +++ b/Items/Weapons/Magic/HyphaeRod.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 20; + item.damage = 15; item.magic = true; item.mana = 7; item.width = 34; @@ -31,64 +31,60 @@ namespace CalamityMod.Items.Weapons.Magic item.rare = 2; item.UseSound = SoundID.Item8; item.autoReuse = true; - item.shoot = 590; + item.shoot = ProjectileID.TruffleSpore; item.shootSpeed = 1f; } - public override Vector2? HoldoutOrigin() - { - return new Vector2(15, 15); - } + public override Vector2? HoldoutOrigin() => new Vector2(15, 15); 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 i = Main.myPlayer; - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); - Vector2 vector3 = Main.MouseWorld + vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X + vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y + vector2.Y; + float speed = item.shootSpeed; + Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + float xDist = (float)Main.mouseX + Main.screenPosition.X + source.X; + float yDist = (float)Main.mouseY + Main.screenPosition.Y + source.Y; + Vector2 spawnVec = new Vector2(xDist, yDist); if (player.gravDir == -1f) { - num79 = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + vector2.Y; + spawnVec.Y = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + source.Y; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + float distance = spawnVec.Length(); + if ((float.IsNaN(spawnVec.X) && float.IsNaN(spawnVec.Y)) || (spawnVec.X == 0f && spawnVec.Y == 0f)) { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; + spawnVec.X = (float)player.direction; + spawnVec.Y = 0f; + distance = speed; } else { - num80 = num72 / num80; + distance = speed / distance; } - int num107 = 3; - for (int num108 = 0; num108 < num107; num108++) + int projAmt = 3; + for (int projIndex = 0; projIndex < projAmt; projIndex++) { - 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); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-100, 101); - vector2.Y -= (float)(50 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) + source = new Vector2(player.Center.X + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y); + source.X = (source.X + player.Center.X) / 2f + (float)Main.rand.Next(-100, 101); + source.Y -= (float)(50 * projIndex); + spawnVec.X = (float)Main.mouseX + Main.screenPosition.X - source.X; + spawnVec.Y = (float)Main.mouseY + Main.screenPosition.Y - source.Y; + if (spawnVec.Y < 0f) { - num79 *= -1f; + spawnVec.Y *= -1f; } - if (num79 < 20f) + if (spawnVec.Y < 20f) { - num79 = 20f; + spawnVec.Y = 20f; } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-180, 181) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; - int proj = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, i, 0f, (float)Main.rand.Next(3)); + distance = spawnVec.Length(); + distance = speed / distance; + spawnVec.X *= distance; + spawnVec.Y *= distance; + spawnVec.X += (float)Main.rand.Next(-180, 181) * 0.02f; + spawnVec.Y += (float)Main.rand.Next(-180, 181) * 0.02f; + int proj = Projectile.NewProjectile(source, spawnVec, type, damage, knockBack, player.whoAmI, 0f, Main.rand.Next(3)); Main.projectile[proj].Calamity().forceMagic = true; + Main.projectile[proj].timeLeft = CalamityUtils.SecondsToFrames(8f); } return false; } diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index 2e7c0109e6..0ddae8e36a 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Toxicant Twister"); - Tooltip.SetDefault("Throws a speedy boomerang\n" + + Tooltip.SetDefault("Throws a speedy, homing boomerang\n" + "Stealth strikes fire two boomerangs that go much faster and release sand rapidly"); } @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue { item.width = 42; item.height = 46; - item.damage = 950; + item.damage = 650; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = item.useTime = 20; @@ -30,45 +30,34 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = Item.buyPrice(1, 40, 0, 0); item.Calamity().postMoonLordRarity = 13; item.rare = 10; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 18f; item.Calamity().rogue = true; } 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 projType = item.shoot; - if (Main.rand.NextBool(2)) - { - projType = ModContent.ProjectileType(); - } - if (player.Calamity().StealthStrikeAvailable()) { float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; + int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + Main.projectile[stealth].velocity *= 1.5f; + Main.projectile[stealth].timeLeft = 420; + Main.projectile[stealth].penetrate = -1; + Main.projectile[stealth].localNPCHitCooldown = 6; + float SpeedX2 = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; float SpeedY2 = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; - int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - Main.projectile[stealth].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - Main.projectile[stealth2].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - if (Main.projectile[stealth].Calamity().stealthStrike) - { - Main.projectile[stealth].velocity *= 1.5f; - Main.projectile[stealth].timeLeft = 420; - Main.projectile[stealth].penetrate = -1; - Main.projectile[stealth].localNPCHitCooldown = 6; - } - if (Main.projectile[stealth2].Calamity().stealthStrike) - { - Main.projectile[stealth2].penetrate += 2; - Main.projectile[stealth2].localNPCHitCooldown = 8; - } + int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, type, (int)(damage * 0.6f), knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth2].Calamity().stealthStrike = true; + Main.projectile[stealth2].penetrate += 2; + Main.projectile[stealth2].localNPCHitCooldown = 8; } else { - Projectile.NewProjectile(position, new Vector2(speedX, speedY), projType, damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); } return false; } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 9d42e77571..176464517d 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3535,6 +3535,10 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.1); } + else if (projectile.type == ProjectileType()) + { + damage = (int)(damage * 0.2); + } else if (projectile.type == ProjectileID.Wasp || projectile.type == player.beeType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileID.DD2BetsyArrow) { damage = (int)(damage * 0.4); diff --git a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs index 1de61c3dd4..9fc6bf12d0 100644 --- a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs +++ b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs @@ -58,52 +58,50 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(SoundID.Item7, projectile.position); } - // Returns after some number of frames in the air - if (projectile.timeLeft < lifeTime - 180) + // Returns after 2.5 seconds in the air + if (projectile.timeLeft < lifeTime - 150) projectile.ai[0] = 1f; if (projectile.ai[0] != 0f) { - float returnSpeed = 18f * 1.6f; + float returnSpeed = 30f; float acceleration = 1.4f; Player owner = Main.player[projectile.owner]; // Delete the projectile if it's excessively far away. - Vector2 playerCenter = owner.Center; - float xDist = playerCenter.X - projectile.Center.X; - float yDist = playerCenter.Y - projectile.Center.Y; - float dist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); + Vector2 projVector = owner.Center - projectile.Center; + float dist = projVector.Length(); if (dist > 3000f) projectile.Kill(); dist = returnSpeed / dist; - xDist *= dist; - yDist *= dist; + projVector.X *= dist; + projVector.Y *= dist; // Home back in on the player. - if (projectile.velocity.X < xDist) + if (projectile.velocity.X < projVector.X) { - projectile.velocity.X = projectile.velocity.X + acceleration; - if (projectile.velocity.X < 0f && xDist > 0f) + projectile.velocity.X += acceleration; + if (projectile.velocity.X < 0f && projVector.X > 0f) projectile.velocity.X += acceleration; } - else if (projectile.velocity.X > xDist) + else if (projectile.velocity.X > projVector.X) { - projectile.velocity.X = projectile.velocity.X - acceleration; - if (projectile.velocity.X > 0f && xDist < 0f) + projectile.velocity.X -= acceleration; + if (projectile.velocity.X > 0f && projVector.X < 0f) projectile.velocity.X -= acceleration; } - if (projectile.velocity.Y < yDist) + if (projectile.velocity.Y < projVector.Y) { - projectile.velocity.Y = projectile.velocity.Y + acceleration; - if (projectile.velocity.Y < 0f && yDist > 0f) + projectile.velocity.Y += acceleration; + if (projectile.velocity.Y < 0f && projVector.Y > 0f) projectile.velocity.Y += acceleration; } - else if (projectile.velocity.Y > yDist) + else if (projectile.velocity.Y > projVector.Y) { - projectile.velocity.Y = projectile.velocity.Y - acceleration; - if (projectile.velocity.Y > 0f && yDist < 0f) + projectile.velocity.Y -= acceleration; + if (projectile.velocity.Y > 0f && projVector.Y < 0f) projectile.velocity.Y -= acceleration; } @@ -114,12 +112,46 @@ namespace CalamityMod.Projectiles.Rogue } else { - CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 20f, 20f); + Vector2 center = projectile.Center; + float maxDistance = 600f; + bool homeIn = false; + + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + float extraDistance = (float)(Main.npc[i].width / 2) + (Main.npc[i].height / 2); + + bool canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); + + if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && canHit) + { + center = Main.npc[i].Center; + homeIn = true; + break; + } + } + } + + if (homeIn && projectile.ai[0] == 0f) + { + Vector2 homeInVector = projectile.DirectionTo(center); + if (homeInVector.HasNaNs()) + homeInVector = Vector2.UnitY; + + projectile.velocity = (projectile.velocity * 20f + homeInVector * 20f) / (21f); + } + else + { + projectile.ai[0] = 1f; + } } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { + if (projectile.penetrate < 3) + projectile.ai[0] = 1f; target.AddBuff(ModContent.BuffType(), 180); Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int k = 0; k < 10; k++) @@ -132,6 +164,8 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPvp(Player target, int damage, bool crit) { + if (projectile.penetrate < 3) + projectile.ai[0] = 1f; target.AddBuff(ModContent.BuffType(), 180); Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int k = 0; k < 10; k++) From 91de37f0dfd4730dcee8a148a00b88cc5d0012ba Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 23:28:35 -0400 Subject: [PATCH 50/52] reduced acid rain kill req's post AS/Polter --- Events/AcidRainEvent.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index f5c9c90528..0b32c27cb6 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -132,9 +132,9 @@ namespace CalamityMod.Events } } if (CalamityWorld.downedPolterghast) - return (int)(180 * Math.Log(playerCount + Math.E - 1)); + return (int)(140 * Math.Log(playerCount + Math.E - 1)); else if (CalamityWorld.downedAquaticScourge) - return (int)(125 * Math.Log(playerCount + Math.E - 1)); + return (int)(115 * Math.Log(playerCount + Math.E - 1)); else return (int)(90 * Math.Log(playerCount + Math.E - 1)); } From 70c6c2b3bff50f3fda1e95f4e8f28a851a878924 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 23:34:08 -0400 Subject: [PATCH 51/52] toxicant twister fix --- .../Rogue/ToxicantTwisterTwoPointZero.cs | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs index 9fc6bf12d0..59bf1b0f2c 100644 --- a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs +++ b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs @@ -112,39 +112,7 @@ namespace CalamityMod.Projectiles.Rogue } else { - Vector2 center = projectile.Center; - float maxDistance = 600f; - bool homeIn = false; - - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false)) - { - float extraDistance = (float)(Main.npc[i].width / 2) + (Main.npc[i].height / 2); - - bool canHit = Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1); - - if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && canHit) - { - center = Main.npc[i].Center; - homeIn = true; - break; - } - } - } - - if (homeIn && projectile.ai[0] == 0f) - { - Vector2 homeInVector = projectile.DirectionTo(center); - if (homeInVector.HasNaNs()) - homeInVector = Vector2.UnitY; - - projectile.velocity = (projectile.velocity * 20f + homeInVector * 20f) / (21f); - } - else - { - projectile.ai[0] = 1f; - } + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 600f, 20f, 20f); } } From 6e7308747f466bf5fba19624db797e7c0dd75ee4 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 28 May 2020 23:54:40 -0400 Subject: [PATCH 52/52] added the stupid ring and my umbrella to boss checklist....,,..,.,.. --- ModSupport/WeakReferenceSupport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 5b15410227..e22d704f19 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -536,7 +536,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00));