From 616f0822c06bcc75655d3d49a948173d856777d5 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 4 Sep 2023 01:14:01 -0400 Subject: [PATCH 1/9] Urchin Flail balance --- Items/Weapons/Melee/UrchinFlail.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Melee/UrchinFlail.cs b/Items/Weapons/Melee/UrchinFlail.cs index a48cf899bd..8cedafc9d1 100644 --- a/Items/Weapons/Melee/UrchinFlail.cs +++ b/Items/Weapons/Melee/UrchinFlail.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { - Item.damage = 33; + Item.damage = 20; Item.DamageType = DamageClass.MeleeNoSpeed; Item.width = 44; Item.height = 36; @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.autoReuse = true; Item.channel = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 12f; + Item.shootSpeed = 16f; } } } From 82fc8d5fb0a467600c31094a6eee031f45d19017 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 4 Sep 2023 01:55:17 -0400 Subject: [PATCH 2/9] Flak Toxicannon as well because why not --- Items/Weapons/Ranged/FlakToxicannon.cs | 6 +++--- .../Mods.CalamityMod.Items.Weapons.Ranged.hjson | 2 +- Projectiles/Ranged/ToxicannonDrop.cs | 2 +- Projectiles/Ranged/ToxicannonShot.cs | 13 +++++-------- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index c7d8a65e26..d98eba6f8e 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -15,11 +15,11 @@ namespace CalamityMod.Items.Weapons.Ranged } public override void SetDefaults() { - Item.damage = 60; + Item.damage = 51; Item.DamageType = DamageClass.Ranged; Item.width = 88; Item.height = 28; - Item.useTime = Item.useAnimation = 8; + Item.useTime = Item.useAnimation = 11; Item.useStyle = ItemUseStyleID.Shoot; Item.useTurn = false; Item.noMelee = true; @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float angle = velocity.ToRotation() + MathHelper.PiOver2; - if (angle <= -MathHelper.PiOver4 || angle >= MathHelper.PiOver4) + if (angle <= -(MathHelper.Pi / 3) || angle >= (MathHelper.Pi / 3)) return false; Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 733f68a8d2..97619fa32d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -471,7 +471,7 @@ FlakToxicannon: { Tooltip: ''' Fires angled shots in the direction of the cursor - Can only be shot in a cone direction above the player + Can only be shot in a wide cone above the player 'High IQ required' ''' } diff --git a/Projectiles/Ranged/ToxicannonDrop.cs b/Projectiles/Ranged/ToxicannonDrop.cs index a03fe4d0d9..c556ecd097 100644 --- a/Projectiles/Ranged/ToxicannonDrop.cs +++ b/Projectiles/Ranged/ToxicannonDrop.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.friendly = true; Projectile.tileCollide = true; Projectile.ignoreWater = false; - Projectile.timeLeft = 420; + Projectile.timeLeft = 300; Projectile.DamageType = DamageClass.Ranged; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 17; diff --git a/Projectiles/Ranged/ToxicannonShot.cs b/Projectiles/Ranged/ToxicannonShot.cs index 8b742e3c3b..a7a171ea4d 100644 --- a/Projectiles/Ranged/ToxicannonShot.cs +++ b/Projectiles/Ranged/ToxicannonShot.cs @@ -71,16 +71,13 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[idx].scale = 3f; Main.dust[idx].noGravity = true; } - if (Main.rand.NextBool(3)) + float count = Main.rand.Next(1, 2 + 1); + for (int i = 0; i < count; i++) { - int count = Main.rand.Next(1, 3 + 1); - for (int i = 0; i < count; i++) - { - float angle = MathHelper.TwoPi * i / count; - angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool(2).ToDirectionInt(); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f), + float angle = MathHelper.TwoPi * i / count; + angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool(2).ToDirectionInt(); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f), ModContent.ProjectileType(), Projectile.damage, 2.5f, Projectile.owner); - } } } From cde16a7b74e4ea28b2cf5ff38f4ae0c6f907a32e Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Mon, 4 Sep 2023 14:25:45 -0600 Subject: [PATCH 3/9] Fixed Seargeant United being banned from the parry buff --- Items/CalamityGlobalItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 5e8f9b9c47..c1131e861a 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -625,7 +625,7 @@ namespace CalamityMod.Items if (player.HasBuff(BuffID.ParryDamageBuff)) { - if (item.type != ItemID.DD2SquireDemonSword) + if (item.type != ItemID.DD2SquireDemonSword && item.type != ItemID.BouncingShield) { player.parryDamageBuff = false; player.ClearBuff(BuffID.ParryDamageBuff); From 8c433aa9597e9ac87146ad4cb87527c37c8ff336 Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Mon, 4 Sep 2023 16:36:44 -0600 Subject: [PATCH 4/9] If someone could make it so that a Plague Nanodroid spawns instead of just doing nothing it would be appreciated, but for now I'm taking the easy way out of patching getting Plague Cannisters pre-boss. --- ILEditing/BalancingILChanges.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index af2cb8924a..0cb4cf6c4c 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -1,6 +1,8 @@ using System; using CalamityMod.Balancing; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Placeables.FurniturePlagued; +using CalamityMod.NPCs.DraedonLabThings; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; @@ -11,7 +13,7 @@ namespace CalamityMod.ILEditing { public partial class ILChanges { - #region Rod of Harmony Changes + #region Shimmer Changes private static bool AdjustShimmerRequirements(On_Item.orig_CanShimmer orig, Item item) { @@ -20,6 +22,12 @@ namespace CalamityMod.ILEditing { return DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs; } + + if (item.type == ModContent.ItemType()) + { + return DownedBossSystem.downedPlaguebringer; + } + return orig(item); } From bf040531290a57b0b55346d7d0412e27e5d69be5 Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Mon, 4 Sep 2023 17:13:02 -0600 Subject: [PATCH 5/9] Downed Golem instead of PBG and fixed partial stacks not giving anything and not being able to stack so that it shimmered when enough bricks were present. --- ILEditing/BalancingILChanges.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 0cb4cf6c4c..b579b5e0ff 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -25,7 +25,7 @@ namespace CalamityMod.ILEditing if (item.type == ModContent.ItemType()) { - return DownedBossSystem.downedPlaguebringer; + return NPC.downedGolemBoss ? orig(item) : false; } return orig(item); From 87a7fc21a9aa73c762a92873ba9cc8d9eb299fab Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Mon, 4 Sep 2023 18:27:06 -0600 Subject: [PATCH 6/9] ... and fire Nerfed Penumbra's dmg to 830 from 1008 In return it gets: Increased Velocity from 8f to 9f (Higher,) Increased Lifetime from 150 to 300 (-much higher) Umbraphile armor setbonus! (Unbounded fire) --- Items/Weapons/Rogue/Penumbra.cs | 6 +++--- .../en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson | 2 +- Projectiles/Rogue/PenumbraBomb.cs | 9 ++++++++- Projectiles/Rogue/PenumbraSoul.cs | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Items/Weapons/Rogue/Penumbra.cs b/Items/Weapons/Rogue/Penumbra.cs index 6a80c3be80..b147956ca4 100644 --- a/Items/Weapons/Rogue/Penumbra.cs +++ b/Items/Weapons/Rogue/Penumbra.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Penumbra : RogueWeapon { - public static float ShootSpeed = 8f; + public static float ShootSpeed = 9f; public override void SetDefaults() { Item.width = 46; @@ -24,12 +24,12 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item103; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.damage = 1008; + Item.damage = 830; Item.useAnimation = 40; Item.useTime = 40; Item.knockBack = 8f; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = ShootSpeed; + Item.shootSpeed = 9f; Item.rare = ModContent.RarityType(); Item.DamageType = RogueDamageClass.Instance; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index fc13deb0cf..c1f17982b3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -839,7 +839,7 @@ Penumbra: { DisplayName: Penumbra Tooltip: ''' - Throws a shadow bomb that explodes into homing souls + Throws a shadow bomb that explodes into homing souls and flames Stealth strikes make the bomb manifest on the cursor and explode into more souls ''' } diff --git a/Projectiles/Rogue/PenumbraBomb.cs b/Projectiles/Rogue/PenumbraBomb.cs index 767b6de5c6..eb3fe21ea3 100644 --- a/Projectiles/Rogue/PenumbraBomb.cs +++ b/Projectiles/Rogue/PenumbraBomb.cs @@ -3,6 +3,8 @@ using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using Terraria.Audio; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Rogue { @@ -23,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.height = 32; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.timeLeft = 150; + Projectile.timeLeft = 300; Projectile.extraUpdates = 2; Projectile.DamageType = RogueDamageClass.Instance; Projectile.ignoreWater = true; @@ -72,6 +74,11 @@ namespace CalamityMod.Projectiles.Rogue } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.Daybreak, 240); + target.AddBuff(ModContent.BuffType(), 240); + } public override void Kill(int timeLeft) { //Dark soul projectiles diff --git a/Projectiles/Rogue/PenumbraSoul.cs b/Projectiles/Rogue/PenumbraSoul.cs index 4174bf0a10..86e6897a8c 100644 --- a/Projectiles/Rogue/PenumbraSoul.cs +++ b/Projectiles/Rogue/PenumbraSoul.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue private void HomingAI() { - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, Penumbra.ShootSpeed * 1.5f, 35f); + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 35f); } public override bool PreDraw(ref Color lightColor) From b5926d1122864ad195e1f2c545112e820d141e1a Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 4 Sep 2023 21:04:46 -0400 Subject: [PATCH 7/9] Cosmic Shiv no longer takes 8 minutes to kill Yharon God I spent over an hour on this one weapon --- Items/Weapons/Melee/CosmicShiv.cs | 2 +- Projectiles/Melee/CosmicShivBall.cs | 14 ++++---------- Projectiles/Melee/CosmicShivBlade.cs | 12 +++--------- Projectiles/Melee/GalaxyStar.cs | 1 + Projectiles/Melee/Shortswords/CosmicShivProj.cs | 2 +- 5 files changed, 10 insertions(+), 21 deletions(-) diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index af799c26d7..3bc4eaa726 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.useTime = 18; Item.width = 44; Item.height = 44; - Item.damage = 218; + Item.damage = 109; Item.knockBack = 9f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index ebd0317d35..be8cae2632 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee public bool initialized = false; public float startingVelocityY = 0f; public float randomAngleDelta = 0f; - public const float explosionDamageMultiplier = 1.8f; + public const float explosionDamageMultiplier = 1.5f; public override void SetDefaults() { Projectile.width = 12; @@ -47,7 +47,6 @@ namespace CalamityMod.Projectiles.Melee Main.dust[dustID].noGravity = true; Main.dust[dustID].velocity *= 0f; } - Projectile.velocity.Y *= 0.965f; } if (Projectile.localAI[0] % 30 == 0) // every 0.5 seconds { @@ -60,21 +59,16 @@ namespace CalamityMod.Projectiles.Melee Vector2 idealVelocity = Projectile.SafeDirectionTo(target.Center, Vector2.UnitX) * homingSpeed; Projectile.velocity = (Projectile.velocity * (inertia - 1f) + idealVelocity) / inertia; } - else - { - Projectile.ai[0]++; - Projectile.velocity.Y = startingVelocityY + (float)(Math.Cos(Projectile.ai[0] / 12D + randomAngleDelta) * 7D); - } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { // for spawning the side beams - for (int i = 0; i < 3; i++) + for (int i = 0; i < 2; i++) { int directionSign = Main.rand.NextBool(2).ToDirectionInt(); Vector2 spawnPos = new Vector2(target.Center.X + directionSign * 650, Projectile.Center.Y + Main.rand.Next(-500, 501)); Vector2 velocity = Vector2.Normalize(target.Center - spawnPos) * 30f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.1f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.8f), Projectile.knockBack * 0.1f, Projectile.owner); } int starMax = Main.rand.Next(6, 11); // 6 to 10 stars for (int i = -starMax / 2; i < starMax / 2; i++) @@ -82,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee int ySpawnAdditive = Main.rand.Next(-40, 41); Vector2 toSpawn = target.Center - new Vector2(0f, 800f + ySpawnAdditive).RotatedBy(MathHelper.ToRadians(i * 11f / starMax)); Vector2 toTarget = Vector2.Normalize(target.Center - toSpawn) * 35f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), toSpawn, toTarget, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), toSpawn, toTarget, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.5f, Projectile.owner); } target.AddBuff(ModContent.BuffType(), 60); } diff --git a/Projectiles/Melee/CosmicShivBlade.cs b/Projectiles/Melee/CosmicShivBlade.cs index f9fcbc6139..7ea7599c5b 100644 --- a/Projectiles/Melee/CosmicShivBlade.cs +++ b/Projectiles/Melee/CosmicShivBlade.cs @@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = penetrateMax; Projectile.tileCollide = false; Projectile.timeLeft = 290; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 5; } public override void AI() { @@ -58,16 +60,8 @@ namespace CalamityMod.Projectiles.Melee } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Projectile.penetrate == penetrateMax) - { - Projectile.damage /= 15; - } - else - { - Projectile.scale += (maxScale - 1) / (float)penetrateMax; - } + Projectile.scale += (maxScale - 1) / (float)penetrateMax; Projectile.ai[1] = 5 + Main.rand.Next(-2, 3); - target.immune[Projectile.owner] = 0; //so that all blades can hit the enemy target.AddBuff(ModContent.BuffType(), 120); } diff --git a/Projectiles/Melee/GalaxyStar.cs b/Projectiles/Melee/GalaxyStar.cs index 7b6c229d55..6fffa74c23 100644 --- a/Projectiles/Melee/GalaxyStar.cs +++ b/Projectiles/Melee/GalaxyStar.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = 1; Projectile.tileCollide = false; Projectile.timeLeft = 160; + Projectile.extraUpdates = 2; } public override void AI() { diff --git a/Projectiles/Melee/Shortswords/CosmicShivProj.cs b/Projectiles/Melee/Shortswords/CosmicShivProj.cs index 239fa21fb0..5a56e3b252 100644 --- a/Projectiles/Melee/Shortswords/CosmicShivProj.cs +++ b/Projectiles/Melee/Shortswords/CosmicShivProj.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords public override Action EffectBeforePullback => (proj) => { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 14f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 14f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); }; public override void SetVisualOffsets() From 741eb28d961d506acdd377b68330ac4432cabef9 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 4 Sep 2023 21:57:17 -0400 Subject: [PATCH 8/9] Slight Scourge of the Cosmos buff Also cleaned up a few of the num variables in the mini projectile file --- Projectiles/Melee/ScourgeoftheCosmosMini.cs | 39 ++++++++++----------- Projectiles/Melee/ScourgeoftheCosmosProj.cs | 2 +- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Projectiles/Melee/ScourgeoftheCosmosMini.cs b/Projectiles/Melee/ScourgeoftheCosmosMini.cs index 4282ffed8c..6836a73f50 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosMini.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosMini.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.alpha = 255; Projectile.penetrate = 1; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; + Projectile.timeLeft = 375; + Projectile.extraUpdates = 4; } public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < 270 && target.CanBeChasedBy(Projectile); @@ -53,12 +53,12 @@ namespace CalamityMod.Projectiles.Melee for (int num369 = 0; num369 < 1; num369++) { int dustType = Main.rand.NextBool(3) ? 56 : 242; - float num370 = Projectile.velocity.X / 3f * num369; - float num371 = Projectile.velocity.Y / 3f * num369; + float dustX = Projectile.velocity.X / 3f * num369; + float dustY = Projectile.velocity.Y / 3f * num369; int num372 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num372]; - dust.position.X = Projectile.Center.X - num370; - dust.position.Y = Projectile.Center.Y - num371; + dust.position.X = Projectile.Center.X - dustX; + dust.position.Y = Projectile.Center.Y - dustY; dust.velocity *= 0f; dust.scale = 0.5f; } @@ -68,41 +68,40 @@ namespace CalamityMod.Projectiles.Melee float num373 = Projectile.position.X; float num374 = Projectile.position.Y; float num375 = 100000f; - bool flag10 = false; + bool isHoming = false; Projectile.ai[0] += 1f; if (Projectile.ai[0] > 30f) { Projectile.ai[0] = 30f; - for (int num376 = 0; num376 < Main.maxNPCs; num376++) + for (int enemy = 0; enemy < Main.maxNPCs; enemy++) { - if (Main.npc[num376].CanBeChasedBy(Projectile, false)) + if (Main.npc[enemy].CanBeChasedBy(Projectile, false)) { - float num377 = Main.npc[num376].position.X + Main.npc[num376].width / 2; - float num378 = Main.npc[num376].position.Y + Main.npc[num376].height / 2; - float num379 = Math.Abs(Projectile.position.X + Projectile.width / 2 - num377) + Math.Abs(Projectile.position.Y + Projectile.height / 2 - num378); - if (num379 < 800f && num379 < num375 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[num376].position, Main.npc[num376].width, Main.npc[num376].height)) + float enemyX = Main.npc[enemy].position.X + Main.npc[enemy].width / 2; + float enemyY = Main.npc[enemy].position.Y + Main.npc[enemy].height / 2; + float enemyDistance = Math.Abs(Projectile.position.X + Projectile.width / 2 - enemyX) + Math.Abs(Projectile.position.Y + Projectile.height / 2 - enemyY); + if (enemyDistance < 800f && enemyDistance < num375 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[enemy].position, Main.npc[enemy].width, Main.npc[enemy].height)) { - num375 = num379; - num373 = num377; - num374 = num378; - flag10 = true; + num375 = enemyDistance; + num373 = enemyX; + num374 = enemyY; + isHoming = true; } } } } - if (!flag10) + if (!isHoming) { num373 = Projectile.position.X + Projectile.width / 2 + Projectile.velocity.X * 100f; num374 = Projectile.position.Y + Projectile.height / 2 + Projectile.velocity.Y * 100f; } - float num380 = 10f; float num381 = 0.16f; Vector2 vector30 = new Vector2(Projectile.position.X + Projectile.width * 0.5f, Projectile.position.Y + Projectile.height * 0.5f); float num382 = num373 - vector30.X; float num383 = num374 - vector30.Y; float num384 = (float)Math.Sqrt(num382 * num382 + num383 * num383); - num384 = num380 / num384; + num384 = 10f / num384; num382 *= num384; num383 *= num384; if (Projectile.velocity.X < num382) diff --git a/Projectiles/Melee/ScourgeoftheCosmosProj.cs b/Projectiles/Melee/ScourgeoftheCosmosProj.cs index 06d3711db8..bbfdd8bb5d 100644 --- a/Projectiles/Melee/ScourgeoftheCosmosProj.cs +++ b/Projectiles/Melee/ScourgeoftheCosmosProj.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee float num629 = Main.rand.Next(-35, 36) * 0.02f; num628 *= 10f; num629 *= 10f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)(Projectile.damage * 0.7), Projectile.knockBack * 0.35f, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, num628, num629, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75), Projectile.knockBack * 0.35f, Main.myPlayer); num3 = num627; } } From 11418ad5482c1593757b577a0d5c1357bf03f5d5 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 5 Sep 2023 12:49:44 -0400 Subject: [PATCH 9/9] Eutrophic Sand and Navystone Walls now shimmer into the unsafe variants instead of crafting them If someone more knowledgeable than me knows how to add the little skull icon in the bottom right, please do so :pray: --- Items/Placeables/EutrophicSand.cs | 5 ----- Items/Placeables/Navystone.cs | 5 ----- Items/Placeables/Walls/EutrophicSandWall.cs | 6 +----- Items/Placeables/Walls/EutrophicSandWallSafe.cs | 1 + Items/Placeables/Walls/NavystoneWall.cs | 6 +----- Items/Placeables/Walls/NavystoneWallSafe.cs | 1 + 6 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Items/Placeables/EutrophicSand.cs b/Items/Placeables/EutrophicSand.cs index da19d9b25c..25b1db4512 100644 --- a/Items/Placeables/EutrophicSand.cs +++ b/Items/Placeables/EutrophicSand.cs @@ -28,11 +28,6 @@ namespace CalamityMod.Items.Placeables AddIngredient(4). AddTile(TileID.WorkBenches). Register(); - - CreateRecipe(). - AddIngredient(4). - AddTile(TileID.WorkBenches). - Register(); } } } diff --git a/Items/Placeables/Navystone.cs b/Items/Placeables/Navystone.cs index 16f1377d7f..154971ba93 100644 --- a/Items/Placeables/Navystone.cs +++ b/Items/Placeables/Navystone.cs @@ -35,11 +35,6 @@ namespace CalamityMod.Items.Placeables AddTile(TileID.WorkBenches). Register(); - CreateRecipe(). - AddIngredient(4). - AddTile(TileID.WorkBenches). - Register(); - CreateRecipe(). AddIngredient(2). AddTile(). diff --git a/Items/Placeables/Walls/EutrophicSandWall.cs b/Items/Placeables/Walls/EutrophicSandWall.cs index 315934659c..02e418d447 100644 --- a/Items/Placeables/Walls/EutrophicSandWall.cs +++ b/Items/Placeables/Walls/EutrophicSandWall.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetStaticDefaults() { Item.ResearchUnlockCount = 400; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -25,10 +26,5 @@ namespace CalamityMod.Items.Placeables.Walls Item.consumable = true; Item.createWall = ModContent.WallType(); } - - public override void AddRecipes() - { - CreateRecipe(4).AddIngredient(ModContent.ItemType()).AddTile(TileID.WorkBenches).Register(); - } } } diff --git a/Items/Placeables/Walls/EutrophicSandWallSafe.cs b/Items/Placeables/Walls/EutrophicSandWallSafe.cs index 3f399439aa..083cb750e7 100644 --- a/Items/Placeables/Walls/EutrophicSandWallSafe.cs +++ b/Items/Placeables/Walls/EutrophicSandWallSafe.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetStaticDefaults() { Item.ResearchUnlockCount = 400; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Placeables/Walls/NavystoneWall.cs b/Items/Placeables/Walls/NavystoneWall.cs index 4e33e4c5ea..855ca72460 100644 --- a/Items/Placeables/Walls/NavystoneWall.cs +++ b/Items/Placeables/Walls/NavystoneWall.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetStaticDefaults() { Item.ResearchUnlockCount = 400; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -24,10 +25,5 @@ namespace CalamityMod.Items.Placeables.Walls Item.consumable = true; Item.createWall = ModContent.WallType(); } - - public override void AddRecipes() - { - CreateRecipe(4).AddIngredient(ModContent.ItemType()).AddTile(TileID.WorkBenches).Register(); - } } } diff --git a/Items/Placeables/Walls/NavystoneWallSafe.cs b/Items/Placeables/Walls/NavystoneWallSafe.cs index 2ab3e44900..71cb6b2195 100644 --- a/Items/Placeables/Walls/NavystoneWallSafe.cs +++ b/Items/Placeables/Walls/NavystoneWallSafe.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetStaticDefaults() { Item.ResearchUnlockCount = 400; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults()