From be6247b058b0b1ecbfa8a119e457d5ac28b4b562 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 15 May 2024 08:49:57 -0400 Subject: [PATCH 001/177] Thorn Ball visibility improvements --- Projectiles/Boss/ThornBallSpike.cs | 4 +++- Projectiles/Boss/ThornBallSpike.png | Bin 263 -> 304 bytes Projectiles/CalamityGlobalProjectile.cs | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Projectiles/Boss/ThornBallSpike.cs b/Projectiles/Boss/ThornBallSpike.cs index f3db9317e9..86d5b8d957 100644 --- a/Projectiles/Boss/ThornBallSpike.cs +++ b/Projectiles/Boss/ThornBallSpike.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss { if (Projectile.velocity.Length() < MaxVelocity) { - Projectile.velocity *= 1.05f; + Projectile.velocity *= 1.045f; if (Projectile.velocity.Length() > MaxVelocity) { Projectile.velocity.Normalize(); @@ -58,6 +58,8 @@ namespace CalamityMod.Projectiles.Boss public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 90); + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); + public override bool PreDraw(ref Color lightColor) { if (Projectile.timeLeft > TimeLeft - 5) diff --git a/Projectiles/Boss/ThornBallSpike.png b/Projectiles/Boss/ThornBallSpike.png index a1be17ccd9c9d03017fb77e27eefe5fe8d18885b..9253275e890662c3b017f078fd4cb34ed6ac5351 100644 GIT binary patch delta 261 zcmV+g0s8)j0fhSmY1W=zd6|Sfv(N9!9(}#kOpxki-G8@&l)+uXQXQqZLoVmc`H#N@*C_C zeZk2l;oW|9sgUi`B3<&0z}p{RTO%q&5(9i~bx|uSnw{q-ru&2n5p6*4Gqz9N30#00000 LNkvXXu0mjfMfq)4 delta 220 zcmV<203-jf0*3-2iBL{Q4GJ0x0000DNk~Le0000C0000K2nGNE0J-qo5s@J^f1F7~ zK~y+TW55McWMuw>Fq8`iOi-F=zzC(`0A{L!FgKY0;O$p1J?F_2uv(IBz^Oq;MG%b9 z0rhOa1<2O`3wKcHfUv2wC>THZ^b3q(fO03nLg)0;*I8VfdK$l WCop}*q~fmt0000sTxR diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 83f8b28779..45f9f892d1 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -4390,15 +4390,15 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileID.ThornBall) { - float startTurningBrownGateValue = 420f; - float timeToReachFullBrown = 180f; - float timeToReachThornExplosion = startTurningBrownGateValue + timeToReachFullBrown; + float startWarningColorGateValue = 420f; + float timeToReachFullIntensity = 180f; + float timeToReachThornExplosion = startWarningColorGateValue + timeToReachFullIntensity; Color initialColor = lightColor; - Color finalColor = new Color(125, 75, 75); + Color finalColor = Color.Lerp(new Color(125, 75, 75), Color.Red, (float)Math.Abs(Math.Sin((projectile.ai[1] - startWarningColorGateValue) * (MathHelper.Pi / 45)))); finalColor.A = (byte)(255 - projectile.alpha); - if (projectile.ai[1] > startTurningBrownGateValue) + if (projectile.ai[1] > startWarningColorGateValue) { - float colorTransitionRatio = (projectile.ai[1] - startTurningBrownGateValue) / timeToReachFullBrown; + float colorTransitionRatio = (projectile.ai[1] - startWarningColorGateValue) / timeToReachFullIntensity; Color dehydratedColor = Color.Lerp(initialColor, finalColor, colorTransitionRatio); return dehydratedColor; } From 74938d3115af2dac474cd1327770cb7ba75f2516 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Wed, 15 May 2024 08:55:24 -0400 Subject: [PATCH 002/177] Fixed Tombstone tooltips being outdated --- Items/CalamityGlobalItemTooltip.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index dcf49bcac9..2e4827495f 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -326,7 +326,7 @@ namespace CalamityMod.Items // There are no item sets for tombstones wtf if (item.type == ItemID.Tombstone || item.type == ItemID.GraveMarker || item.type == ItemID.CrossGraveMarker || item.type == ItemID.Headstone || item.type == ItemID.Gravestone || item.type == ItemID.Obelisk || item.type == ItemID.RichGravestone1 || item.type == ItemID.RichGravestone2 || item.type == ItemID.RichGravestone3 || item.type == ItemID.RichGravestone4 || item.type == ItemID.RichGravestone5) - EditTooltipByName("Material", (line) => line.Text += "\n20 of any tombstone turns the surrounding area into a graveyard" + EditTooltipByName("Material", (line) => line.Text += "\n13 of any tombstone turns the surrounding area into a graveyard" + "\nGraveyards have various new item sales and recipes"); // Eternity Crystal notifies the player that they can accelerate the invasion From 8550d2247b5f3f297adc8852e392dd254d7df027 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 15 May 2024 11:14:45 -0400 Subject: [PATCH 003/177] Fixed Giant Clam having 9999 defense until it enters and exits hiding once --- NPCs/SunkenSea/GiantClam.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index fec26d9caa..6e520e527b 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -150,6 +150,8 @@ namespace CalamityMod.NPCs.SunkenSea // Avoid cheap bullshit NPC.damage = 0; + NPC.defense = Main.hardMode ? 35 : 10; + NPC.ai[0] += 1f; hide = false; } From 28ae7ef9e8908bf23ff51985615325d59fcef740 Mon Sep 17 00:00:00 2001 From: Memes Date: Wed, 15 May 2024 18:37:30 +0200 Subject: [PATCH 004/177] Added some syncing to base holdouts. --- .../BaseGunHoldoutProjectile.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index f231b4f8d2..2a541aedb9 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -246,5 +247,39 @@ namespace CalamityMod.Projectiles.BaseProjectiles } #endregion + + #region Syncying + + public sealed override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Projectile.rotation); + writer.Write(KeepRefreshingLifetime); + writer.Write(OffsetLengthFromArm); + SendExtraAIHoldout(writer); + } + + public sealed override void ReceiveExtraAI(BinaryReader reader) + { + Projectile.rotation = reader.ReadSingle(); + KeepRefreshingLifetime = reader.ReadBoolean(); + OffsetLengthFromArm = reader.ReadSingle(); + ReceiveExtraAIHoldout(reader); + } + + /// + /// The common is sealed to avoid deleting syncing of other properties without noticing.
+ /// Use this method instead, which uses the same . + ///
+ /// + public virtual void SendExtraAIHoldout(BinaryWriter writer) { } + + /// + /// The common is sealed to avoid deleting syncing of other properties without noticing.
+ /// Use this method instead, which uses the same . + ///
+ /// + public virtual void ReceiveExtraAIHoldout(BinaryReader reader) { } + + #endregion } } From ef2b524df18a966b4c2eda8cccae3e1a9f3be452 Mon Sep 17 00:00:00 2001 From: Memes Date: Wed, 15 May 2024 18:38:04 +0200 Subject: [PATCH 005/177] Typo lmao. --- Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index 2a541aedb9..ca12e9cbd7 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -248,7 +248,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles #endregion - #region Syncying + #region Syncing public sealed override void SendExtraAI(BinaryWriter writer) { From 872ad8dd56c10ba231cdb7035204961cb2224f9b Mon Sep 17 00:00:00 2001 From: Memes Date: Wed, 15 May 2024 20:24:17 +0200 Subject: [PATCH 006/177] Genesis syncing and cleanup. --- Items/Weapons/Magic/Genesis.cs | 11 ++-- Projectiles/Magic/GenesisHoldout.cs | 88 ++++++++++++++--------------- 2 files changed, 51 insertions(+), 48 deletions(-) diff --git a/Items/Weapons/Magic/Genesis.cs b/Items/Weapons/Magic/Genesis.cs index 26a83161e8..24ca2275e4 100644 --- a/Items/Weapons/Magic/Genesis.cs +++ b/Items/Weapons/Magic/Genesis.cs @@ -11,6 +11,9 @@ namespace CalamityMod.Items.Weapons.Magic [LegacyName("Genisis")] public class Genesis : ModItem, ILocalizedModType { + public static float FireRate = 15f; + public static float StarterWindup = 60f; + public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() { @@ -34,17 +37,17 @@ namespace CalamityMod.Items.Weapons.Magic Item.shoot = ModContent.ProjectileType(); } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] == 0; // Makes the rotation of the mouse around the player sync in multiplayer. public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, 0); - holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); - + Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } + public override void AddRecipes() { CreateRecipe(). diff --git a/Projectiles/Magic/GenesisHoldout.cs b/Projectiles/Magic/GenesisHoldout.cs index 5f25eaeac0..65385f8a61 100644 --- a/Projectiles/Magic/GenesisHoldout.cs +++ b/Projectiles/Magic/GenesisHoldout.cs @@ -1,12 +1,13 @@ -using CalamityMod.Items.Weapons.Magic; +using System.IO; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; -using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using static CalamityMod.Items.Weapons.Magic.Genesis; namespace CalamityMod.Projectiles.Magic { @@ -19,20 +20,20 @@ namespace CalamityMod.Projectiles.Magic public override float BaseOffsetY => -5f; public override float OffsetYDownwards => 5f; - public Color StaticEffectsColor = Color.MediumSlateBlue; + public ref float ShootingTimer => ref Projectile.ai[0]; + public ref float MaxFirerateShots => ref Projectile.ai[1]; + public bool FireYBeam + { + get => Projectile.ai[2] == 1f; + set => Projectile.ai[2] = value == true ? 1f : 0f; + } - public float FiringTime = 15; - public float Windup = 60; - public bool WindingUp = false; - public int time = 0; - public bool fireYBeam = false; - public int maxFirerateShots = 0; - - private ref float ShootingTimer => ref Projectile.ai[0]; + public float Windup { get; set; } = StarterWindup; + public Color EffectsColor { get; set; } = Color.MediumSlateBlue; public override void KillHoldoutLogic() { - if (HeldItem.type != Owner.ActiveItem().type || Owner is null || !Owner.active || Owner.CCed || Owner.dead || Owner.noItems) + if (HeldItem.type != Owner.ActiveItem().type || Owner.CantUseHoldout()) { Projectile.Kill(); Projectile.netUpdate = true; @@ -41,56 +42,49 @@ namespace CalamityMod.Projectiles.Magic public override void HoldoutAI() { - Item heldItem = Owner.ActiveItem(); - // Fire if the owner stops channeling or otherwise cannot use the weapon. - if (Owner.CantUseHoldout()) - { - Projectile.Kill(); - } - else if (ShootingTimer >= FiringTime) + if (ShootingTimer >= FireRate) { if (Owner.CheckMana(Owner.ActiveItem(), -1, true, false)) { - maxFirerateShots++; - - if (maxFirerateShots == 6) + if (MaxFirerateShots == 6f) { - fireYBeam = true; - Windup = 60; + FireYBeam = true; + Windup = 60f; + Projectile.netUpdate = true; } - if (fireYBeam) - { - Shoot(heldItem, true); - maxFirerateShots = 0; + if (FireYBeam) + { + Shoot(true); + MaxFirerateShots = 0f; } else - Shoot(heldItem, false); + Shoot(false); - ShootingTimer = 0; - - if (Windup > 10) + if (Windup > 10f) { - if (!fireYBeam) - Windup -= 12; + if (!FireYBeam) + Windup -= 12f; } else - { - Windup = 10; - } + Windup = 10f; - fireYBeam = false; + MaxFirerateShots++; + ShootingTimer = 0f; + FireYBeam = false; } else { SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); Projectile.Kill(); + Projectile.netUpdate = true; } - } + ShootingTimer++; } - private void Shoot(Item item, bool yBeam) + + private void Shoot(bool yBeam) { Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); @@ -107,11 +101,11 @@ namespace CalamityMod.Projectiles.Magic Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3, ModContent.ProjectileType(), Projectile.damage * 9, Projectile.knockBack, Projectile.owner, 0, 0); - Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, StaticEffectsColor, new Vector2(1.7f, 0.8f), true); + Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, EffectsColor, new Vector2(1.7f, 0.8f), true); GeneralParticleHandler.SpawnParticle(pulse3); for (int i = 0; i < 8; i++) { - SparkParticle spark2 = new SparkParticle(GunTipPosition + Main.rand.NextVector2Circular(10, 10), firingVelocity3 * Main.rand.NextFloat(0.7f, 1.3f), false, Main.rand.Next(20, 30), Main.rand.NextFloat(0.4f, 0.55f), StaticEffectsColor); + SparkParticle spark2 = new SparkParticle(GunTipPosition + Main.rand.NextVector2Circular(10, 10), firingVelocity3 * Main.rand.NextFloat(0.7f, 1.3f), false, Main.rand.Next(20, 30), Main.rand.NextFloat(0.4f, 0.55f), EffectsColor); GeneralParticleHandler.SpawnParticle(spark2); } } @@ -131,10 +125,12 @@ namespace CalamityMod.Projectiles.Magic Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); } - Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, StaticEffectsColor, new Vector2(1.7f, 0.8f), true); + Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, EffectsColor, new Vector2(1.7f, 0.8f), true); GeneralParticleHandler.SpawnParticle(pulse3); } + Projectile.netUpdate = true; + // Inside here go all the things that dedicated servers shouldn't spend resources on. // Like visuals and sounds. if (Main.dedServ) @@ -147,7 +143,7 @@ namespace CalamityMod.Projectiles.Magic Dust dust2 = Dust.NewDustPerfect(GunTipPosition, Main.rand.NextBool(4) ? 267 : 66, shootVel); dust2.scale = Main.rand.NextFloat(1.15f, 1.45f); dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? Color.Lerp(StaticEffectsColor, Color.White, 0.5f) : StaticEffectsColor; + dust2.color = Main.rand.NextBool() ? Color.Lerp(EffectsColor, Color.White, 0.5f) : EffectsColor; } // By decreasing the offset length of the gun from the arms, we give an effect of recoil. @@ -156,5 +152,9 @@ namespace CalamityMod.Projectiles.Magic else OffsetLengthFromArm -= 5f; } + + public override void SendExtraAIHoldout(BinaryWriter writer) => writer.Write(Windup); + + public override void ReceiveExtraAIHoldout(BinaryReader reader) => Windup = reader.ReadSingle(); } } From 22fb3230084eaaec6a4c08430cc4b0abfa95997d Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 15 May 2024 14:54:31 -0500 Subject: [PATCH 007/177] 1 - Fixed Desert Scourge body and tail not showing up in mp. 2 - Fixed certain worms having despawn issues in mp. --- NPCs/Abyss/EidolonWyrmHead.cs | 37 +++++++----------- NPCs/Abyss/GulperEelHead.cs | 39 +++++++------------ NPCs/Abyss/OarfishHead.cs | 6 ++- NPCs/DesertScourge/DesertNuisanceBody.cs | 29 ++------------ NPCs/DesertScourge/DesertNuisanceBodyYoung.cs | 29 ++------------ NPCs/DesertScourge/DesertScourgeBody.cs | 23 ++--------- NPCs/SunkenSea/SeaSerpent1.cs | 36 +++++++---------- 7 files changed, 58 insertions(+), 141 deletions(-) diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 8b23bec9cf..b7b311396f 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -118,19 +118,18 @@ namespace CalamityMod.NPCs.Abyss } if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead) - { - NPC.TargetClosest(true); - } + NPC.TargetClosest(); + if (NPC.justHit || detectsPlayer || Main.player[NPC.target].chaosState || adultWyrmAlive || (Main.player[NPC.target].Center - NPC.Center).Length() < Main.player[NPC.target].Calamity().GetAbyssAggro(160f)) { detectsPlayer = true; NPC.damage = Main.expertMode ? 340 : 170; } else - { NPC.damage = 0; - } + NPC.chaseable = detectsPlayer; + if (detectsPlayer) { if (NPC.soundDelay <= 0) @@ -142,14 +141,12 @@ namespace CalamityMod.NPCs.Abyss else { if (Main.rand.NextBool(900)) - { SoundEngine.PlaySound(roar, NPC.Center); - } } + if (NPC.ai[2] > 0f) - { NPC.realLife = (int)NPC.ai[2]; - } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && NPC.ai[0] == 0f) @@ -161,18 +158,13 @@ namespace CalamityMod.NPCs.Abyss if (segments >= 0 && segments < minLength) { if (segments % 2 == 0) - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } else - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } } else - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } + Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = (float)NPC.whoAmI; Main.npc[lol].ai[1] = (float)Previous; @@ -180,17 +172,16 @@ namespace CalamityMod.NPCs.Abyss NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } + TailSpawned = true; } } + if (NPC.velocity.X < 0f) - { NPC.spriteDirection = -1; - } else if (NPC.velocity.X > 0f) - { NPC.spriteDirection = 1; - } + if (Main.player[NPC.target].dead) { NPC.TargetClosest(false); @@ -208,14 +199,16 @@ namespace CalamityMod.NPCs.Abyss } } } + NPC.alpha -= 42; if (NPC.alpha < 0) - { NPC.alpha = 0; - } + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 6400f) { - NPC.active = false; + NPC.TargetClosest(false); + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 6400f) + NPC.active = false; } float currentSpeed = speed; diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 1d09fd334f..395fc3d696 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -115,19 +115,16 @@ namespace CalamityMod.NPCs.Abyss } if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead) - { - NPC.TargetClosest(true); - } - if ((Main.player[NPC.target].Center - NPC.Center).Length() < Main.player[NPC.target].Calamity().GetAbyssAggro(160f) || - NPC.justHit) - { + NPC.TargetClosest(); + + if ((Main.player[NPC.target].Center - NPC.Center).Length() < Main.player[NPC.target].Calamity().GetAbyssAggro(160f) || NPC.justHit) detectsPlayer = true; - } + NPC.chaseable = detectsPlayer; + if (NPC.ai[2] > 0f) - { NPC.realLife = (int)NPC.ai[2]; - } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && NPC.ai[0] == 0f) @@ -139,18 +136,13 @@ namespace CalamityMod.NPCs.Abyss if (segments >= 0 && segments < minLength) { if (segments == 0) - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } else - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } } else - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } + Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = (float)NPC.whoAmI; Main.npc[lol].ai[1] = (float)Previous; @@ -158,29 +150,28 @@ namespace CalamityMod.NPCs.Abyss NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } + TailSpawned = true; } } + if (NPC.velocity.X < 0f) - { NPC.spriteDirection = 1; - } else if (NPC.velocity.X > 0f) - { NPC.spriteDirection = -1; - } + if (Main.player[NPC.target].dead) - { NPC.TargetClosest(false); - } + NPC.alpha -= 42; if (NPC.alpha < 0) - { NPC.alpha = 0; - } + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 5600f) { - NPC.active = false; + NPC.TargetClosest(false); + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 5600f) + NPC.active = false; } float currentSpeed = speed; diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 5945215fc8..9459276e5a 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -155,7 +155,11 @@ namespace CalamityMod.NPCs.Abyss NPC.alpha = 0; if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 5600f) - NPC.active = false; + { + NPC.TargetClosest(false); + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 5600f) + NPC.active = false; + } float currentSpeed = speed; float currentTurnSpeed = turnSpeed; diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index e666fc7b04..d61794d229 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -69,23 +69,6 @@ namespace CalamityMod.NPCs.DesertScourge public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; - public override void SendExtraAI(BinaryWriter writer) - { - // Frame syncs - writer.Write(NPC.frame.X); - writer.Write(NPC.frame.Y); - writer.Write(NPC.frame.Width); - writer.Write(NPC.frame.Height); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - // Frame syncs - Rectangle frame = new Rectangle(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32()); - if (frame.Width > 0 && frame.Height > 0) - NPC.frame = frame; - } - public override void AI() { bool bossRush = BossRushEvent.BossRushActive; @@ -104,10 +87,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 1f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture2.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture2.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture2.Width(), BodyTexture2.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture2 is null ? 0 : BodyTexture2.Width(), BodyTexture2 is null ? 0 : BodyTexture2.Height()); NPC.netUpdate = true; @@ -121,10 +102,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 2f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture3.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture3.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture3.Width(), BodyTexture3.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture3 is null ? 0 : BodyTexture3.Width(), BodyTexture3 is null ? 0 : BodyTexture3.Height()); NPC.netUpdate = true; @@ -138,10 +117,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 3f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture4.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture4.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture4.Width(), BodyTexture4.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture4 is null ? 0 : BodyTexture4.Width(), BodyTexture4 is null ? 0 : BodyTexture4.Height()); NPC.netUpdate = true; diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index 86b3514232..c1086817cc 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -69,23 +69,6 @@ namespace CalamityMod.NPCs.DesertScourge public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; - public override void SendExtraAI(BinaryWriter writer) - { - // Frame syncs - writer.Write(NPC.frame.X); - writer.Write(NPC.frame.Y); - writer.Write(NPC.frame.Width); - writer.Write(NPC.frame.Height); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - // Frame syncs - Rectangle frame = new Rectangle(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32()); - if (frame.Width > 0 && frame.Height > 0) - NPC.frame = frame; - } - public override void AI() { bool bossRush = BossRushEvent.BossRushActive; @@ -104,10 +87,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 1f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture2.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture2.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture2.Width(), BodyTexture2.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture2 is null ? 0 : BodyTexture2.Width(), BodyTexture2 is null ? 0 : BodyTexture2.Height()); NPC.netUpdate = true; @@ -121,10 +102,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 2f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture3.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture3.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture3.Width(), BodyTexture3.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture3 is null ? 0 : BodyTexture3.Width(), BodyTexture3 is null ? 0 : BodyTexture3.Height()); NPC.netUpdate = true; @@ -138,10 +117,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 3f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture4.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture4.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture4.Width(), BodyTexture4.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture4 is null ? 0 : BodyTexture4.Width(), BodyTexture4 is null ? 0 : BodyTexture4.Height()); NPC.netUpdate = true; diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index daa0b54eae..1d30f4e6ce 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -80,23 +80,12 @@ namespace CalamityMod.NPCs.DesertScourge { writer.Write(NPC.alpha); writer.Write(NPC.dontTakeDamage); - - // Frame syncs - writer.Write(NPC.frame.X); - writer.Write(NPC.frame.Y); - writer.Write(NPC.frame.Width); - writer.Write(NPC.frame.Height); } public override void ReceiveExtraAI(BinaryReader reader) { NPC.alpha = reader.ReadInt32(); NPC.dontTakeDamage = reader.ReadBoolean(); - - // Frame syncs - Rectangle frame = new Rectangle(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32()); - if (frame.Width > 0 && frame.Height > 0) - NPC.frame = frame; } public override void AI() @@ -117,10 +106,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 1f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture2.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture2.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture2.Width(), BodyTexture2.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture2 is null ? 0 : BodyTexture2.Width(), BodyTexture2 is null ? 0 : BodyTexture2.Height()); NPC.netUpdate = true; @@ -134,10 +121,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 2f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture3.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture3.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture3.Width(), BodyTexture3.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture3 is null ? 0 : BodyTexture3.Width(), BodyTexture3 is null ? 0 : BodyTexture3.Height()); NPC.netUpdate = true; @@ -151,10 +136,8 @@ namespace CalamityMod.NPCs.DesertScourge NPC.ai[3] = 3f; NPC.position = NPC.Center; - //NPC.width = (int)(BodyTexture4.Width() * NPC.scale); - //NPC.height = (int)(BodyTexture4.Height() * NPC.scale); NPC.position -= NPC.Size * 0.5f; - NPC.frame = new Rectangle(0, 0, BodyTexture4.Width(), BodyTexture4.Height()); + NPC.frame = new Rectangle(0, 0, BodyTexture4 is null ? 0 : BodyTexture4.Width(), BodyTexture4 is null ? 0 : BodyTexture4.Height()); NPC.netUpdate = true; diff --git a/NPCs/SunkenSea/SeaSerpent1.cs b/NPCs/SunkenSea/SeaSerpent1.cs index 7a678cddb8..2cb2cdab19 100644 --- a/NPCs/SunkenSea/SeaSerpent1.cs +++ b/NPCs/SunkenSea/SeaSerpent1.cs @@ -84,15 +84,14 @@ namespace CalamityMod.NPCs.SunkenSea } } - Lighting.AddLight(NPC.Center, (255 - NPC.alpha) * 0f / 255f, (255 - NPC.alpha) * 0.30f / 255f, (255 - NPC.alpha) * 0.30f / 255f); + Lighting.AddLight(NPC.Center, 0f, (255 - NPC.alpha) * 0.3f / 255f, (255 - NPC.alpha) * 0.3f / 255f); + if (NPC.ai[2] > 0f) - { NPC.realLife = (int)NPC.ai[2]; - } + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead) - { NPC.TargetClosest(true); - } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (!TailSpawned && NPC.ai[0] == 0f) @@ -102,21 +101,14 @@ namespace CalamityMod.NPCs.SunkenSea { int lol = 0; if (segment == 0 || segment == 1 || segment == 4 || segment == 5) - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } else if (segment == 2 || segment == 3 || segment == 6) - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } else if (segment == 7) - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } else if (segment == 8) - { lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + (NPC.width / 2), (int)NPC.position.Y + (NPC.height / 2), ModContent.NPCType(), NPC.whoAmI); - } + Main.npc[lol].realLife = NPC.whoAmI; Main.npc[lol].ai[2] = (float)NPC.whoAmI; Main.npc[lol].ai[1] = (float)Previous; @@ -124,30 +116,30 @@ namespace CalamityMod.NPCs.SunkenSea NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; } + TailSpawned = true; } } + if (NPC.velocity.X < 0f) - { NPC.spriteDirection = -1; - } else if (NPC.velocity.X > 0f) - { NPC.spriteDirection = 1; - } + if (Main.player[NPC.target].dead) - { NPC.TargetClosest(false); - } + NPC.alpha -= 42; if (NPC.alpha < 0) - { NPC.alpha = 0; - } + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 5600f) { - NPC.active = false; + NPC.TargetClosest(false); + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 5600f) + NPC.active = false; } + float currentSpeed = speed; float currentTurnSpeed = turnSpeed; Vector2 segmentPosition = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)NPC.height * 0.5f); From 6d21d5c2759b9a3ac3a800a9c123b3e05fb62802 Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 15 May 2024 13:07:36 -0700 Subject: [PATCH 008/177] Tried to fix some bugs pulse file sound in multi genesis holdout firing timer omicron holdout firing timer omicron beam infinite split in multi cinder arrow infinite split in multi Polar star bounce removed because its annoying --- Items/Weapons/DraedonsArsenal/PulseRifle.cs | 3 +-- Items/Weapons/Magic/Genesis.cs | 2 +- Projectiles/Magic/GenesisBeam.cs | 5 +++- Projectiles/Magic/OmicronBeam.cs | 15 +++++++++--- Projectiles/Magic/OmicronHoldout.cs | 6 ++--- Projectiles/Magic/VoidVortexProj.cs | 1 + Projectiles/Ranged/CinderArrowProj.cs | 27 +++++++++++++++------ Projectiles/Ranged/PolarStar.cs | 25 +------------------ 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index 21190b3ab9..c17d4093a8 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = null; + Item.UseSound = FireSound; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; @@ -53,7 +53,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - SoundEngine.PlaySound(FireSound); Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); return false; diff --git a/Items/Weapons/Magic/Genesis.cs b/Items/Weapons/Magic/Genesis.cs index 24ca2275e4..3574304c4f 100644 --- a/Items/Weapons/Magic/Genesis.cs +++ b/Items/Weapons/Magic/Genesis.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); return false; } diff --git a/Projectiles/Magic/GenesisBeam.cs b/Projectiles/Magic/GenesisBeam.cs index a1b782a551..9a2a2167fd 100644 --- a/Projectiles/Magic/GenesisBeam.cs +++ b/Projectiles/Magic/GenesisBeam.cs @@ -32,7 +32,10 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { if (isSplit == 0) + { + Projectile.netUpdate = true; splitShot = true; + } if (time == 0) { if (splitShot) @@ -57,7 +60,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnKill(int timeLeft) { int numProj = 2; - float rotation = MathHelper.ToRadians(20); + float rotation = MathHelper.ToRadians(12); if (splitShot) { for (int i = 0; i < numProj; i++) diff --git a/Projectiles/Magic/OmicronBeam.cs b/Projectiles/Magic/OmicronBeam.cs index ab72615ff1..e281affc55 100644 --- a/Projectiles/Magic/OmicronBeam.cs +++ b/Projectiles/Magic/OmicronBeam.cs @@ -15,6 +15,9 @@ namespace CalamityMod.Projectiles.Magic public Color mainColor = Color.MediumVioletRed; public bool HitDirect = false; + + public ref float isSplit => ref Projectile.ai[1]; + public bool splitShot = false; public override void SetDefaults() { Projectile.width = 50; @@ -30,6 +33,12 @@ namespace CalamityMod.Projectiles.Magic } public override void AI() { + if (isSplit == 0) + { + Projectile.netUpdate = true; + splitShot = true; + } + Player Owner = Main.player[Projectile.owner]; float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); if (Projectile.timeLeft % 2 == 0 && time > 2 && targetDist < 1400f) @@ -55,7 +64,7 @@ namespace CalamityMod.Projectiles.Magic { int numProj = 2; float rotation = MathHelper.ToRadians(10); - if (Projectile.ai[1] == 0 && time < 250 && !HitDirect) + if (splitShot && time < 250 && !HitDirect) { for (int i = 0; i < numProj; i++) { @@ -91,7 +100,7 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.ai[1] == 0 && time > 7 && !HitDirect) + if (splitShot && time > 7 && !HitDirect) Projectile.Kill(); Player Owner = Main.player[Projectile.owner]; @@ -101,7 +110,7 @@ namespace CalamityMod.Projectiles.Magic dust.noGravity = true; dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; } - if (time <= 7 && Projectile.ai[1] == 0) // This is the sweet spot + if (time <= 7 && splitShot) // This is the sweet spot { modifiers.SourceDamage *= 5; diff --git a/Projectiles/Magic/OmicronHoldout.cs b/Projectiles/Magic/OmicronHoldout.cs index d1884e6c4b..49c022c8a6 100644 --- a/Projectiles/Magic/OmicronHoldout.cs +++ b/Projectiles/Magic/OmicronHoldout.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Magic if (maxFirerateShots == 5) { Windup = 60; - maxFirerateShots = 0; + maxFirerateShots = 1; } Shoot(heldItem, false); @@ -146,12 +146,12 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 5; i++) { - firingVelocity3 = (shootDirection * 10).RotatedBy((0.04f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); + firingVelocity3 = (shootDirection * 10).RotatedBy((0.035f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); } for (int i = 0; i < 5; i++) { - firingVelocity3 = (shootDirection * 10).RotatedBy((-0.04f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); + firingVelocity3 = (shootDirection * 10).RotatedBy((-0.035f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); } diff --git a/Projectiles/Magic/VoidVortexProj.cs b/Projectiles/Magic/VoidVortexProj.cs index f8c424ab86..d0ba7f2205 100644 --- a/Projectiles/Magic/VoidVortexProj.cs +++ b/Projectiles/Magic/VoidVortexProj.cs @@ -137,6 +137,7 @@ namespace CalamityMod.Projectiles.Magic } public override void OnKill(int timeLeft) { + Projectile.netUpdate = true; if (Projectile.ai[2] == 1) { doDamage = true; diff --git a/Projectiles/Ranged/CinderArrowProj.cs b/Projectiles/Ranged/CinderArrowProj.cs index 3b599fa134..1933630860 100644 --- a/Projectiles/Ranged/CinderArrowProj.cs +++ b/Projectiles/Ranged/CinderArrowProj.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Items/Ammo/CinderArrow"; public ref float Time => ref Projectile.ai[1]; - public bool isShrapnel => Projectile.ai[2] > 0f; + public ref float isSplit => ref Projectile.ai[2]; + public bool splitShot = false; public override void SetStaticDefaults() { @@ -41,13 +42,23 @@ namespace CalamityMod.Projectiles.Ranged { Time++; Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; - if (isShrapnel) + + if (isSplit > 0) { + Projectile.netUpdate = true; + splitShot = true; + } + + if (splitShot) + { + Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * 0.15f); if (Main.rand.NextBool(4)) { Dust dust = Dust.NewDustPerfect(Projectile.Center + Projectile.velocity * 2, 90, -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.55f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.65f, 0.85f); + dust.noLight = true; + dust.noLightEmittence = true; } } else @@ -72,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnKill(int timeLeft) { - if (!isShrapnel) + if (!splitShot) { int Dusts = 9; float radians = MathHelper.TwoPi / Dusts; @@ -90,7 +101,7 @@ namespace CalamityMod.Projectiles.Ranged for (int b = 0; b < 3; b++) { - Vector2 velocity = Vector2.UnitY.RotatedByRandom(0.8f) * Main.rand.NextFloat(-2.75f, -2.25f); + Vector2 velocity = Vector2.UnitY.RotatedByRandom(0.8f) * Main.rand.NextFloat(-3.5f, -3f); Projectile shrapnel = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1f), 0f, Projectile.owner, ai2: 1f); shrapnel.timeLeft = 300; shrapnel.arrow = false; @@ -105,17 +116,17 @@ namespace CalamityMod.Projectiles.Ranged } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (isShrapnel) + if (splitShot) { target.AddBuff(ModContent.BuffType(), 180); } } public override bool PreDraw(ref Color lightColor) { - if (isShrapnel) + if (splitShot) { Texture2D texture = ModContent.Request("CalamityMod/Particles/DrainLine").Value; - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Crimson * 0.35f, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Crimson * 0.3f, 1, texture); return false; } else @@ -127,6 +138,6 @@ namespace CalamityMod.Projectiles.Ranged } } - public override bool? CanDamage() => isShrapnel && Time < 20 ? false : null; + public override bool? CanDamage() => splitShot && Time < 20 ? false : null; } } diff --git a/Projectiles/Ranged/PolarStar.cs b/Projectiles/Ranged/PolarStar.cs index bdc4de08d8..b870ab4aff 100644 --- a/Projectiles/Ranged/PolarStar.cs +++ b/Projectiles/Ranged/PolarStar.cs @@ -46,6 +46,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; + Projectile.tileCollide = true; } public override void AI() @@ -126,30 +127,6 @@ namespace CalamityMod.Projectiles.Ranged DoSlowdown = false; } } - public override bool OnTileCollide(Vector2 oldVelocity) - { - Time = 2; - - if (tileBounces >= 2) - Projectile.Kill(); - else - tileBounces++; - - for (int i = 0; i <= 5; i++) - { - SquishyLightParticle energy = new(Projectile.Center, Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(0.08f, 0.15f), Main.rand.NextFloat(0.4f, 0.7f), EffectsColor, Main.rand.Next(40, 50 + 1), 0.25f, 2f); - GeneralParticleHandler.SpawnParticle(energy); - } - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y; - } - return false; - } public override void OnKill(int timeLeft) { int points = 5; From aa27091e8250c7f4c710d65366d1ed2370e924f2 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 15 May 2024 16:20:39 -0400 Subject: [PATCH 009/177] 1 - Nerf Shadow Armor mobility boosts. 2 - Revert all Calamity Shadow Armor changes. Now gives +5% crit per piece like vanilla with no other effects. --- Balancing/BalancingConstants.cs | 11 ++ ILEditing/BalancingILChanges.cs | 102 +++++++++++++----- ILEditing/ILChangesLoading.cs | 2 +- Items/CalamityGlobalItemTooltip.cs | 4 - .../ShadowArmorSetChange.cs | 18 ++-- 5 files changed, 92 insertions(+), 45 deletions(-) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index dc64bb8899..5087a7a6cf 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -16,6 +16,17 @@ // Altered jump speed boost provided by Shiny Red Balloon via IL edit // This is a const because it replaces a hardcoded value in vanilla internal const float BalloonJumpSpeedBoost = 0.75f; + + // Altered movement stats provided by Shadow Armor via IL edit + // This item is modified to not stack with Magiluminescence if on the ground. If in the air, it still functions. + internal static readonly float ShadowArmorRunAccelerationMultiplier = 1.25f; // Vanilla and Magi = 1.75f + internal static readonly float ShadowArmorMaxRunSpeedMultiplier = 1.05f; // Vanilla and Magi = 1.15f + internal static readonly float ShadowArmorAccRunSpeedMultiplier = 1.05f; // Vanilla and Magi = 1.15f + internal static readonly float ShadowArmorRunSlowdownMultiplier = 1.5f; // Vanilla and Magi = 1.75f + + // Altered run acceleration multiplier provided by Soaring Insignia via IL edit + // This is a const because it replaces a hardcoded value in vanilla + internal const float SoaringInsigniaRunAccelerationMultiplier = 1.1f; // Vanilla = 1.75f #endregion #region Immunity Frames diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 0d4956e672..ef06ec1d55 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -27,7 +27,7 @@ namespace CalamityMod.ILEditing #endregion - #region Soaring Insignia Changes + #region Remove Soaring Insignia Infinite Flight private static void RemoveSoaringInsigniaInfiniteWingTime(ILContext il) { // Prevent the infinite flight effect. @@ -42,34 +42,6 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldc_I4_0); cursor.Emit(OpCodes.And); } - - private static void NerfSoaringInsigniaRunAcceleration(ILContext il) - { - // Nerf the run acceleration boost from 1.75x to 1.1x. - var cursor = new ILCursor(il); - if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("empressBrooch"))) - { - LogFailure("Soaring Insignia Mobility Nerf", "Could not locate the Soaring Insignia bool."); - return; - } - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f))) - { - LogFailure("Soaring Insignia Mobility Nerf", "Could not locate the Soaring Insignia run acceleration multiplier."); - return; - } - cursor.Next.Operand = 1.1f; - - // Prevent the rocket boots infinite flight effect. - if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("empressBrooch"))) - { - LogFailure("Soaring Insignia Mobility Nerf", "Could not locate the Soaring Insignia bool."); - return; - } - - // AND with 0 (false) so that the Soaring Insignia is never considered equipped and thus infinite rocket boots never triggers. - cursor.Emit(OpCodes.Ldc_I4_0); - cursor.Emit(OpCodes.And); - } #endregion #region Jump Height Changes @@ -258,6 +230,78 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldc_R4, iceSkateTopSpeed); } } + + private static void NerfOverpoweredRunAccelerationSources(ILContext il) + { + // First: Soaring Insignia. Find the check for whether it's equipped for run speeds. + var cursor = new ILCursor(il); + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("empressBrooch"))) + { + LogFailure("Run Acceleration Nerfs", "Could not locate the Soaring Insignia bool."); + return; + } + + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f))) + { + LogFailure("Run Acceleration Nerfs", "Could not locate the Soaring Insignia run acceleration multiplier."); + return; + } + cursor.Next.Operand = BalancingConstants.SoaringInsigniaRunAccelerationMultiplier; + + // Second: Magiluminescence. Find the check for whether it's equipped for run speeds. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("hasMagiluminescence"))) + { + LogFailure("Run Acceleration Nerfs", "Could not locate the Magiluminescence bool."); + return; + } + + // + // Don't actually do anything. Magiluminescence is not intended to be nerfed by Calamity. + // + + // Third: Shadow Armor. Find the check for whether it's equipped for run speeds. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("shadowArmor"))) + { + LogFailure("Run Acceleration Nerfs", "Could not locate the Shadow Armor bool."); + return; + } + + // Load the player onto the stack as an argument to the following delegate. + // Emit a delegate which consumes the Shadow Armor bool, performs Calamity effects, then always returns false. + // Returning false ensures vanilla Shadow Armor code never runs. + cursor.Emit(OpCodes.Ldarg_0); + + cursor.EmitDelegate((bool shadowArmor, Player p) => { + // If you don't even have Shadow Armor equipped, do nothing. + if (!shadowArmor) + return 0; + + // Shadow Armor does not stack with Magiluminescence if you are on the ground. + if (p.hasMagiluminescence && p.velocity.Y == 0) + return 0; + + // Shadow Armor grants reduced movement bonuses if in the air, or on the ground WITHOUT Magiluminescence. + p.runAcceleration *= BalancingConstants.ShadowArmorRunAccelerationMultiplier; + p.maxRunSpeed *= BalancingConstants.ShadowArmorMaxRunSpeedMultiplier; + p.accRunSpeed *= BalancingConstants.ShadowArmorAccRunSpeedMultiplier; + p.runSlowdown *= BalancingConstants.ShadowArmorRunSlowdownMultiplier; + + // Vanilla Shadow Armor behavior should still always be skipped. + return 0; + }); + + + // Finally: Back to Soaring Insignia. Prevent the rocket boots infinite flight effect, since it's in the same function. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("empressBrooch"))) + { + LogFailure("Run Acceleration Nerfs", "Could not locate the Soaring Insignia bool."); + return; + } + + // AND with 0 (false) so that the Soaring Insignia is never considered equipped and thus infinite rocket boots never triggers. + cursor.Emit(OpCodes.Ldc_I4_0); + cursor.Emit(OpCodes.And); + } #endregion #region Life Regen Changes diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 2c8fb20700..c2ea95f2b1 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -107,7 +107,7 @@ namespace CalamityMod.ILEditing IL_Player.UpdateJumpHeight += FixJumpHeightBoosts; IL_Player.Update += BaseJumpHeightAdjustment; IL_Player.Update += RunSpeedAdjustments; - IL_Player.Update += NerfSoaringInsigniaRunAcceleration; + IL_Player.Update += NerfOverpoweredRunAccelerationSources; // Soaring Insignia, Magiluminescence, and Shadow Armor IL_Player.WingMovement += RemoveSoaringInsigniaInfiniteWingTime; // Life regen balance diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 2e4827495f..2c32034142 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -841,10 +841,6 @@ namespace CalamityMod.Items if (item.type == ItemID.JunglePants || item.type == ItemID.AncientCobaltLeggings) EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("6%", "3%")); - // Shadow - if (item.type == ItemID.ShadowHelmet || item.type == ItemID.AncientShadowHelmet || item.type == ItemID.ShadowScalemail || item.type == ItemID.AncientShadowScalemail || item.type == ItemID.ShadowGreaves || item.type == ItemID.AncientShadowGreaves) - EditTooltipByNum(0, (line) => line.Text = "5% increased damage and 7% increased jump speed"); - // Crimson if (item.type == ItemID.CrimsonHelmet || item.type == ItemID.CrimsonScalemail || item.type == ItemID.CrimsonGreaves) { diff --git a/Items/VanillaArmorChanges/ShadowArmorSetChange.cs b/Items/VanillaArmorChanges/ShadowArmorSetChange.cs index b046bb9c76..b93bb0d478 100644 --- a/Items/VanillaArmorChanges/ShadowArmorSetChange.cs +++ b/Items/VanillaArmorChanges/ShadowArmorSetChange.cs @@ -1,6 +1,5 @@ using Terraria; using Terraria.ID; -using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { @@ -18,17 +17,14 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Shadow"; - public const float ArmorPieceDamage = 0.05f; - public const float ArmorPieceJumpBoost = 0.07f; - - private void ApplyAnyPieceEffect(Player player) + private static void ApplyAnyPieceEffect(Player player) { - // Remove the vanilla crit chance buff and replace it with damage - player.GetCritChance() -= 5; - player.GetDamage() += ArmorPieceDamage; - - // Give jump boost - player.jumpSpeedBoost += 5f * ArmorPieceJumpBoost; + // 15MAY2024: Ozzatron: Removed all standard changes to Shadow Armor. + // As such, this method intentionally does nothing. + // + // Shadow Armor's movement speed boosting effect is separately nerfed via an IL edit. + // + // Class is being left here so that further changes can be made to Shadow Armor as needed. } public override void ApplyHeadPieceEffect(Player player) => ApplyAnyPieceEffect(player); From 3aac8dbc4ecbd2f18c982d82c2fd27d0be6c2ff1 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 15 May 2024 16:31:52 -0400 Subject: [PATCH 010/177] Buff Crimson Armor from 5% to 6% damage per piece. Increase life regen on chestplate to 2. --- Items/CalamityGlobalItemTooltip.cs | 5 +++-- Items/VanillaArmorChanges/CrimsonArmorSetChange.cs | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 2c32034142..d2fa8e249d 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -846,8 +846,9 @@ namespace CalamityMod.Items { EditTooltipByNum(0, (line) => { - string newTooltip = line.Text.Replace("3%", "5%"); - newTooltip += "\n+0.5 HP/s life regen"; + string newTooltip = line.Text.Replace("3%", "6%"); + // Chest piece has 2 regen instead of 1 + newTooltip += item.type == ItemID.CrimsonScalemail ? "\n+1 HP/s life regen" : "\n+0.5 HP/s life regen"; line.Text = newTooltip; }); } diff --git a/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs b/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs index c8314dbaac..d74e80cff3 100644 --- a/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs +++ b/Items/VanillaArmorChanges/CrimsonArmorSetChange.cs @@ -14,17 +14,17 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Crimson"; - public const float ArmorPieceDamage = 0.05f; + public const float ArmorPieceDamage = 0.06f; public const int ArmorPieceLifeRegen = 1; + public const int ChestPieceBonusLifeRegen = 1; // Set bonus clarification public override void UpdateSetBonusText(ref string setBonusText) { - Player player = Main.LocalPlayer; setBonusText = $"{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; } - private void ApplyAnyPieceEffect(Player player) + private static void ApplyAnyPieceEffect(Player player) { // Remove the vanilla +3% damage and add the new damage value at the same time player.GetDamage() += ArmorPieceDamage - 0.03f; @@ -35,7 +35,11 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void ApplyHeadPieceEffect(Player player) => ApplyAnyPieceEffect(player); - public override void ApplyBodyPieceEffect(Player player) => ApplyAnyPieceEffect(player); + public override void ApplyBodyPieceEffect(Player player) + { + ApplyAnyPieceEffect(player); + player.lifeRegen += ChestPieceBonusLifeRegen; + } public override void ApplyLegPieceEffect(Player player) => ApplyAnyPieceEffect(player); } From 36fa789864245a7af8c889eff7ddaf6d9082b006 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 15 May 2024 18:08:35 -0400 Subject: [PATCH 011/177] Fixed not getting Proximity Rage from slimes that were not currently jumping. --- Utilities/NPCUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index c28f3fdab4..08c4955552 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -147,7 +147,7 @@ namespace CalamityMod // "Non-enemies" (e.g. butterflies or projectile enemies) with near zero max health, // or anything but the strongest enemies with no contact damage (e.g. Celestial Pillars, Providence) // do not generate rage. - if (npc.lifeMax <= BalancingConstants.TinyHealthThreshold || (npc.damage <= BalancingConstants.TinyDamageThreshold && npc.lifeMax <= BalancingConstants.NoContactDamageHealthThreshold)) + if (npc.lifeMax <= BalancingConstants.TinyHealthThreshold || (npc.defDamage <= BalancingConstants.TinyDamageThreshold && npc.lifeMax <= BalancingConstants.NoContactDamageHealthThreshold)) return false; // Also explicitly exclude dummies and anything with a ridiculous health pool (dummies from Fargo's for example). if (npc.type == NPCID.TargetDummy || npc.type == NPCType() || npc.lifeMax > BalancingConstants.UnreasonableHealthThreshold) From 1c6115a24d648ce6f6e41f5e4a0da1372e4678d2 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 15 May 2024 17:17:52 -0500 Subject: [PATCH 012/177] Fixed some other potential texture Width() and Height() function issues. --- NPCs/CalamityGlobalNPC.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index ec513557be..9dc40ae725 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6806,7 +6806,9 @@ namespace CalamityMod.NPCs Vector2 halfSize = npc.frame.Size() / 2; - spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)TextureAssets.Npc[npc.type].Width() * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)TextureAssets.Npc[npc.type].Height() * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, alphaColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); + int width = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Width(); + int height = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Height(); + spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)width * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, alphaColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); } } else @@ -7181,7 +7183,9 @@ namespace CalamityMod.NPCs if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)TextureAssets.Npc[npc.type].Width() * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)TextureAssets.Npc[npc.type].Height() * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); + int width = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Width(); + int height = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Height(); + spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)width * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); } } } @@ -7231,7 +7235,9 @@ namespace CalamityMod.NPCs position.Y -= npc.height / 2; - spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)TextureAssets.Npc[npc.type].Width() * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)TextureAssets.Npc[npc.type].Height() * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); + int width = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Width(); + int height = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Height(); + spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)width * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); } float secondAfterimageSetHealthValue = (int)(Main.npc[NPC.crimsonBoss].lifeMax * 0.8f); @@ -7312,7 +7318,9 @@ namespace CalamityMod.NPCs position.X -= npc.width / 2; position.Y -= npc.height / 2; - spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)TextureAssets.Npc[npc.type].Width() * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)TextureAssets.Npc[npc.type].Height() * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); + int width = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Width(); + int height = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Height(); + spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)width * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); } } } From 259bee9214a95ab544d4ba795d88672223e2e648 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Wed, 15 May 2024 16:17:11 -0700 Subject: [PATCH 013/177] Alpha Virus nerf, Ultra Liquidator tooltip --- Items/Weapons/Rogue/AlphaVirus.cs | 2 ++ Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson | 1 - Projectiles/Rogue/AlphaSeeker.cs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/AlphaVirus.cs b/Items/Weapons/Rogue/AlphaVirus.cs index 2cedc925c2..136298988c 100644 --- a/Items/Weapons/Rogue/AlphaVirus.cs +++ b/Items/Weapons/Rogue/AlphaVirus.cs @@ -32,6 +32,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } + public override float StealthDamageMultiplier => 0.70f; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 900842eba5..32f2aa6047 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -864,7 +864,6 @@ UltraLiquidator: { Tooltip: ''' Summons liquidation blades that summon more blades on enemy hits - The blades inflict ichor, cursed inferno and brimstone flames ''' } diff --git a/Projectiles/Rogue/AlphaSeeker.cs b/Projectiles/Rogue/AlphaSeeker.cs index e15fc1e560..7d91a5bc1f 100644 --- a/Projectiles/Rogue/AlphaSeeker.cs +++ b/Projectiles/Rogue/AlphaSeeker.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = 1; Projectile.timeLeft = lifetime; Projectile.DamageType = RogueDamageClass.Instance; + Projectile.Calamity().CannotProc = true; Projectile.extraUpdates = 1; } From 52da62024ae1fec763045b10757f09000411c9b0 Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 15 May 2024 16:38:01 -0700 Subject: [PATCH 014/177] More small fixes --- Items/Weapons/DraedonsArsenal/PulseRifle.cs | 2 +- Items/Weapons/DraedonsArsenal/PulseRifle.png | Bin 1218 -> 1312 bytes .../DraedonsArsenal/PulseRifleGlow.png | Bin 3071 -> 897 bytes Items/Weapons/Ranged/NitroExpressRifle.cs | 6 ++++-- Projectiles/Magic/WingmanHoldout.cs | 2 +- Projectiles/Ranged/MarksmanShot.cs | 2 ++ Projectiles/Ranged/MineralMortarHoldout.cs | 2 +- 7 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index c17d4093a8..9a68a38931 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = Item.Calamity(); - Item.width = 98; + Item.width = 100; Item.height = 32; Item.DamageType = DamageClass.Ranged; Item.damage = BaseDamage; diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.png b/Items/Weapons/DraedonsArsenal/PulseRifle.png index 4075f9d5944f91f7c901e907b3c6a1439f1d4712..bcb3e668d97ef4d8518b2da701b7f9136e0e90c4 100644 GIT binary patch delta 1264 zcmVeaN~x_Xn3VGtTEd=YP(UfgR~FeuuxeUSsBsUSz}9GHq#-%<`_6+G%`*W?5PQpeb?Ph7F5^lGPX=i z1sM*JrA9sP9Kt%@1QC9yqFIZSj%3^+exFa9nf{~2V)NSa(vs96xOOoXf72EhV%pz$ zvyyFxp?~~-Ked2AK>Jp*;Sk;-NI7);ZOw!*+Lh(2WRIWQMi!3QU0X}`)$2E8t3p*| z;h?tmR=Bz^uyJ2{( zgCf>e*R;9$Iai194kR32e^>@mf$cu%5T0`25CF%3{$CHso@#F=3*abFx6i&0$AF2b z{W;u0fWKd+U_qMXfaa!S##Vx!-cMu`;aNZ#OobqVP+WNm;2y@`<`IvS%Lgxjr)E%4h+;?;e}agVDI;FAbW!*P zP72|}SRUbs97GsEB=YxoqM3>$IwFbpI^Sw9@}Rb=m~2C1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)ONf0??UW6=?8$S){FohxP`PTW05#VSOTKS25Jode=>cclkdVv z>+ln3b;}^MwW|%+*wS$Ubz5a3=MqF jY2MFuN+KRd-GuG`CU=go0-x^}zaH%}*=QKvlllZEdMY=_ diff --git a/Items/Weapons/DraedonsArsenal/PulseRifleGlow.png b/Items/Weapons/DraedonsArsenal/PulseRifleGlow.png index 8a109d4ccfabc0577da5266c551b5d4fb3771c1f..49124dc1d0996e96833f7bdd424b0e772630dfe9 100644 GIT binary patch literal 897 zcmV-{1AhF8P)Px#1ZP1_K>z@;j|==^1poj85lKWrRA@u(n$J%YK@`WQpt~(Xl!_(|O_e5yX!N8P z@sHqU^p7xJ^ytl#7vmqH@kTs)xld1Q<4VPX6IN-j>l+{N*6TFdYb4p=MWfKjm|4L@f;hXgsx6cSa4%-|T|x6a=q z%R3)vJ1O8ZozYR!*#AX*|2L`C>+DW9;E<`(G;KG1pEM7B^5=iy(XAk~kK;JBxQb4!Fp=&hYghqi@b=4rL4l}Ck8Y))62$Y$`xnn>eeqFQ zi$cVlb!S8EknFwf*rNEbW7qrD=d|8!tmO6%*U7|%qV(k`Fp@+LK&8Nm97?0^u{#!| zG_gSI#-4X#CoE_`fJPS|q4{c+eBRn(J#)#7LcZ5(tYtRFDFg}Hzaul1 ztK_WflKr|D_{Tm|cVVXnl_aloBal9X`~ySyN<5kJH3f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz}{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_46#!l9 z0Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%LdZt9g$j;($`3&Zthxi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Weapons/Ranged/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index 8964b33364..eab45c79d1 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.UseSound = FireSound; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 12f; Item.useAmmo = AmmoID.Bullet; Item.rare = ItemRarityID.LightRed; @@ -66,7 +66,9 @@ 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) { player.velocity += -velocity * 0.3f; - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f); + if (type == ProjectileID.Bullet) + type = ModContent.ProjectileType(); + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f); return false; } diff --git a/Projectiles/Magic/WingmanHoldout.cs b/Projectiles/Magic/WingmanHoldout.cs index 052e406b2a..bca2231d0b 100644 --- a/Projectiles/Magic/WingmanHoldout.cs +++ b/Projectiles/Magic/WingmanHoldout.cs @@ -286,7 +286,7 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - if (time <= 0) + if (time <= 0 && !Main.dedServ) return false; Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/Wingman").Value; diff --git a/Projectiles/Ranged/MarksmanShot.cs b/Projectiles/Ranged/MarksmanShot.cs index 5afea94f6a..e7f74735cf 100644 --- a/Projectiles/Ranged/MarksmanShot.cs +++ b/Projectiles/Ranged/MarksmanShot.cs @@ -45,6 +45,8 @@ namespace CalamityMod.Projectiles.Ranged Projectile.DamageType = DamageClass.Ranged; Projectile.friendly = true; Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; Projectile.timeLeft = Lifetime; Projectile.MaxUpdates = UpdateCount; Projectile.alpha = 255; diff --git a/Projectiles/Ranged/MineralMortarHoldout.cs b/Projectiles/Ranged/MineralMortarHoldout.cs index 72ced92643..aa1f8f32b6 100644 --- a/Projectiles/Ranged/MineralMortarHoldout.cs +++ b/Projectiles/Ranged/MineralMortarHoldout.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged { Owner.PickAmmo(Owner.ActiveItem(), out _, out float speed, out int damage, out float knockback, out int usedItemAmmoId); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX) * speed, ModContent.ProjectileType(), damage, knockback, Projectile.owner, usedItemAmmoId); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitX) * speed * 1.5f, ModContent.ProjectileType(), damage, knockback, Projectile.owner, usedItemAmmoId); // Doesn't sync this to the server, it's just effects. if (!Main.dedServ) From c90bedb1d533f219ceb87314b0507238fab34e55 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 15 May 2024 19:03:42 -0500 Subject: [PATCH 015/177] Destroyer mp bug fixes. --- NPCs/CalamityGlobalNPC.cs | 4 +- .../Bosses/DestroyerAI.cs | 611 +++++++++--------- 2 files changed, 294 insertions(+), 321 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 9dc40ae725..40838282ad 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6950,13 +6950,13 @@ namespace CalamityMod.NPCs if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - if (npc.type == NPCID.TheDestroyerBody) + /*if (npc.type == NPCID.TheDestroyerBody) { if (npc.ai[2] == 0f) npc.frame.Y = 0; else npc.frame.Y = frameHeight; - } + }*/ Color segmentDrawColor = npc.GetAlpha(drawColor); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 7582745b63..3a00c07cb0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -343,85 +343,85 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (Main.netMode != NetmodeID.MultiplayerClient) + if (npc.type == NPCID.TheDestroyer) { - if (npc.type == NPCID.TheDestroyer) + // Spawn segments from head + if (npc.ai[0] == 0f) { - // Spawn segments from head - if (npc.ai[0] == 0f) + npc.ai[3] = npc.whoAmI; + npc.realLife = npc.whoAmI; + int index = npc.whoAmI; + for (int j = 0; j <= totalSegments; j++) { - npc.ai[3] = npc.whoAmI; - npc.realLife = npc.whoAmI; - int index = npc.whoAmI; - for (int j = 0; j <= totalSegments; j++) - { - int type = NPCID.TheDestroyerBody; - if (j == totalSegments) - type = NPCID.TheDestroyerTail; + int type = NPCID.TheDestroyerBody; + if (j == totalSegments) + type = NPCID.TheDestroyerTail; - int segment = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X), (int)(npc.position.Y + npc.height), type, npc.whoAmI); - Main.npc[segment].ai[3] = npc.whoAmI; - Main.npc[segment].realLife = npc.whoAmI; - Main.npc[segment].ai[1] = index; - Main.npc[index].ai[0] = segment; - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segment); - index = segment; - } + int segment = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X), (int)(npc.position.Y + npc.height), type, npc.whoAmI); + Main.npc[segment].ai[3] = npc.whoAmI; + Main.npc[segment].realLife = npc.whoAmI; + Main.npc[segment].ai[1] = index; + Main.npc[index].ai[0] = segment; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segment); + index = segment; + } + } + + // Laser breath in Death Mode + if (spitLaserSpreads) + { + // Set laser color and type + if (calamityGlobalNPC.destroyerLaserColor == -1) + { + calamityGlobalNPC.destroyerLaserColor = phase3 ? 3 : phase2 ? 2 : 1; + npc.SyncDestroyerLaserColor(); } - // Laser breath in Death Mode - if (spitLaserSpreads) + float laserBreathGateValue = DeathModeLaserBreathGateValue; + if (calamityGlobalNPC.newAI[0] < laserBreathGateValue) + calamityGlobalNPC.newAI[0] += 1f; + + // Sync newAI every 20 frames for the new telegraph + if (calamityGlobalNPC.newAI[0] % 20f == 0f) + npc.SyncExtraAI(); + + if ((player.Center - npc.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(npc.velocity.ToRotation(), MathHelper.PiOver4) == npc.velocity.ToRotation() && + calamityGlobalNPC.newAI[0] >= laserBreathGateValue && Vector2.Distance(npc.Center, player.Center) > 480f && + Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - // Set laser color and type - if (calamityGlobalNPC.destroyerLaserColor == -1) + if (calamityGlobalNPC.newAI[0] % 30f == 0f) { - calamityGlobalNPC.destroyerLaserColor = phase3 ? 3 : phase2 ? 2 : 1; - npc.SyncDestroyerLaserColor(); - } - - float laserBreathGateValue = DeathModeLaserBreathGateValue; - if (calamityGlobalNPC.newAI[0] < laserBreathGateValue) - calamityGlobalNPC.newAI[0] += 1f; - - // Sync newAI every 20 frames for the new telegraph - if (calamityGlobalNPC.newAI[0] % 20f == 0f) - npc.SyncExtraAI(); - - if ((player.Center - npc.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(npc.velocity.ToRotation(), MathHelper.PiOver4) == npc.velocity.ToRotation() && - calamityGlobalNPC.newAI[0] >= laserBreathGateValue && Vector2.Distance(npc.Center, player.Center) > 480f && - Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - if (calamityGlobalNPC.newAI[0] % 30f == 0f) + float velocity = bossRush ? 6f : death ? 5.333f : 5f; + int type = ProjectileID.DeathLaser; + switch (calamityGlobalNPC.destroyerLaserColor) { - float velocity = bossRush ? 6f : death ? 5.333f : 5f; - int type = ProjectileID.DeathLaser; - switch (calamityGlobalNPC.destroyerLaserColor) - { - default: - case 0: - break; + default: + case 0: + break; - case 1: - type = ModContent.ProjectileType(); - break; + case 1: + type = ModContent.ProjectileType(); + break; - case 2: - type = ModContent.ProjectileType(); - break; - } - int damage = npc.GetProjectileDamage(type); + case 2: + type = ModContent.ProjectileType(); + break; + } + int damage = npc.GetProjectileDamage(type); - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } + // Reduce mech boss projectile damage depending on the new ore progression changes + if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) + { + double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; + double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; + if (!NPC.downedMechBossAny) + damage = (int)(damage * firstMechMultiplier); + else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) + damage = (int)(damage * secondMechMultiplier); + } + if (Main.netMode != NetmodeID.MultiplayerClient) + { Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; int numProj = calamityGlobalNPC.newAI[0] % 60f == 0f ? (masterMode ? 9 : 7) : (masterMode ? 6 : 4); int spread = masterMode ? 38 : 26; @@ -433,111 +433,129 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.projectile[proj].timeLeft = 1200; } } + } - calamityGlobalNPC.newAI[0] += 1f; - if (calamityGlobalNPC.newAI[0] > laserBreathGateValue + 60f) - { - calamityGlobalNPC.newAI[0] = 0f; - calamityGlobalNPC.destroyerLaserColor = -1; - npc.SyncDestroyerLaserColor(); - npc.SyncExtraAI(); - } + calamityGlobalNPC.newAI[0] += 1f; + if (calamityGlobalNPC.newAI[0] > laserBreathGateValue + 60f) + { + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.destroyerLaserColor = -1; + npc.SyncDestroyerLaserColor(); + npc.SyncExtraAI(); } } } + } - // Fire lasers - if (npc.type == NPCID.TheDestroyerBody) + // Fire lasers + if (npc.type == NPCID.TheDestroyerBody) + { + bool ableToFireLaser = calamityGlobalNPC.destroyerLaserColor != -1; + + // Set laser color and type + if (calamityGlobalNPC.destroyerLaserColor == -1 && !probeLaunched) { - bool ableToFireLaser = calamityGlobalNPC.destroyerLaserColor != -1; - - // Set laser color and type - if (calamityGlobalNPC.destroyerLaserColor == -1 && !probeLaunched) + if (Main.rand.NextBool(masterMode ? OneInXChanceToFireLaser / (phase5 ? 4 : phase4 ? 3 : 2) : OneInXChanceToFireLaser)) { - if (Main.rand.NextBool(masterMode ? OneInXChanceToFireLaser / (phase5 ? 4 : phase4 ? 3 : 2) : OneInXChanceToFireLaser)) + int random = phase3 ? 4 : phase2 ? 3 : 2; + switch (Main.rand.Next(random)) { - int random = phase3 ? 4 : phase2 ? 3 : 2; - switch (Main.rand.Next(random)) - { - case 0: - case 1: - calamityGlobalNPC.destroyerLaserColor = 0; - break; - case 2: - calamityGlobalNPC.destroyerLaserColor = 1; - break; - case 3: - calamityGlobalNPC.destroyerLaserColor = 2; - break; - } - - if (calamityGlobalNPC.newAI[2] > 0f || bossRush) + case 0: + case 1: + calamityGlobalNPC.destroyerLaserColor = 0; + break; + case 2: + calamityGlobalNPC.destroyerLaserColor = 1; + break; + case 3: calamityGlobalNPC.destroyerLaserColor = 2; - - npc.SyncDestroyerLaserColor(); + break; } - } - if (probeLaunched && ableToFireLaser) - { - calamityGlobalNPC.destroyerLaserColor = -1; + if (calamityGlobalNPC.newAI[2] > 0f || bossRush) + calamityGlobalNPC.destroyerLaserColor = 2; + npc.SyncDestroyerLaserColor(); } + } - // Laser rate of fire - float shootProjectileTime = death ? (masterMode ? (phase5 ? 120f : phase4 ? 150f : 180f) : 270f) : (masterMode ? (phase5 ? 150f : phase4 ? 210f : 270f) : 450f); - float bodySegmentTime = npc.ai[0] * (masterMode ? 20f : 30f); - float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; - float laserTimerIncrement = (calamityGlobalNPC.newAI[0] > shootProjectileGateValue - LaserTelegraphTime) ? 1f : 2f; - if (ableToFireLaser) - calamityGlobalNPC.newAI[0] += laserTimerIncrement; + if (probeLaunched && ableToFireLaser) + { + calamityGlobalNPC.destroyerLaserColor = -1; + npc.SyncDestroyerLaserColor(); + } - // Sync newAI every 20 frames for the new telegraph - if (calamityGlobalNPC.newAI[0] % 20f == 0f && ableToFireLaser) + // Laser rate of fire + float shootProjectileTime = death ? (masterMode ? (phase5 ? 120f : phase4 ? 150f : 180f) : 270f) : (masterMode ? (phase5 ? 150f : phase4 ? 210f : 270f) : 450f); + float bodySegmentTime = npc.ai[0] * (masterMode ? 20f : 30f); + float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; + float laserTimerIncrement = (calamityGlobalNPC.newAI[0] > shootProjectileGateValue - LaserTelegraphTime) ? 1f : 2f; + if (ableToFireLaser) + calamityGlobalNPC.newAI[0] += laserTimerIncrement; + + // Sync newAI every 20 frames for the new telegraph + if (calamityGlobalNPC.newAI[0] % 20f == 0f && ableToFireLaser) + npc.SyncExtraAI(); + + Color telegraphColor = Color.Transparent; + switch (calamityGlobalNPC.destroyerLaserColor) + { + case 0: + telegraphColor = Color.Red; + break; + case 1: + telegraphColor = Color.Green; + break; + case 2: + telegraphColor = Color.Cyan; + break; + } + + if (calamityGlobalNPC.newAI[0] == shootProjectileGateValue - LaserTelegraphTime) + { + Particle telegraph = new DestroyerReticleTelegraph( + npc, + telegraphColor, + 1.5f, + 0.15f, + (int)LaserTelegraphTime); + GeneralParticleHandler.SpawnParticle(telegraph); + } + + if (calamityGlobalNPC.newAI[0] == shootProjectileGateValue - SparkTelegraphTime) + { + Particle spark = new DestroyerSparkTelegraph( + npc, + telegraphColor * 2f, + Color.White, + 3f, + 30, + Main.rand.NextFloat(MathHelper.ToRadians(3f)) * Main.rand.NextBool().ToDirectionInt()); + GeneralParticleHandler.SpawnParticle(spark); + } + + // Shoot lasers + // Shoot nothing if probe has been launched + if (calamityGlobalNPC.newAI[0] >= shootProjectileGateValue && ableToFireLaser) + { + if (!masterMode) + { + int numProbeSegments = 0; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active && Main.npc[i].type == npc.type && Main.npc[i].ai[2] == 0f) + numProbeSegments++; + } + float lerpAmount = MathHelper.Clamp(numProbeSegments / (float)totalSegments, 0f, 1f); + float laserShootTimeBonus = (int)MathHelper.Lerp(0f, (shootProjectileTime + bodySegmentTime * lerpAmount) - LaserTelegraphTime, 1f - lerpAmount); + calamityGlobalNPC.newAI[0] = laserShootTimeBonus; npc.SyncExtraAI(); - - Color telegraphColor = Color.Transparent; - switch (calamityGlobalNPC.destroyerLaserColor) - { - case 0: - telegraphColor = Color.Red; - break; - case 1: - telegraphColor = Color.Green; - break; - case 2: - telegraphColor = Color.Cyan; - break; + npc.TargetClosest(); } - if (calamityGlobalNPC.newAI[0] == shootProjectileGateValue - LaserTelegraphTime) + if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - Particle telegraph = new DestroyerReticleTelegraph( - npc, - telegraphColor, - 1.5f, - 0.15f, - (int)LaserTelegraphTime); - GeneralParticleHandler.SpawnParticle(telegraph); - } - - if (calamityGlobalNPC.newAI[0] == shootProjectileGateValue - SparkTelegraphTime) - { - Particle spark = new DestroyerSparkTelegraph( - npc, - telegraphColor * 2f, - Color.White, - 3f, - 30, - Main.rand.NextFloat(MathHelper.ToRadians(3f)) * Main.rand.NextBool().ToDirectionInt()); - GeneralParticleHandler.SpawnParticle(spark); - } - - // Shoot lasers - // Shoot nothing if probe has been launched - if (calamityGlobalNPC.newAI[0] >= shootProjectileGateValue && ableToFireLaser) - { - if (!masterMode) + if (masterMode) { int numProbeSegments = 0; for (int i = 0; i < Main.maxNPCs; i++) @@ -552,80 +570,65 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.TargetClosest(); } - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) + // Laser speed + float projectileSpeed = (masterMode ? 4.5f : 3.5f) + Main.rand.NextFloat() * 1.5f; + projectileSpeed += enrageScale; + + // Set projectile damage and type + int projectileType = ProjectileID.DeathLaser; + switch (calamityGlobalNPC.destroyerLaserColor) { - if (masterMode) - { - int numProbeSegments = 0; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == npc.type && Main.npc[i].ai[2] == 0f) - numProbeSegments++; - } - float lerpAmount = MathHelper.Clamp(numProbeSegments / (float)totalSegments, 0f, 1f); - float laserShootTimeBonus = (int)MathHelper.Lerp(0f, (shootProjectileTime + bodySegmentTime * lerpAmount) - LaserTelegraphTime, 1f - lerpAmount); - calamityGlobalNPC.newAI[0] = laserShootTimeBonus; - npc.SyncExtraAI(); - npc.TargetClosest(); - } + default: + case 0: + break; - // Laser speed - float projectileSpeed = (masterMode ? 4.5f : 3.5f) + Main.rand.NextFloat() * 1.5f; - projectileSpeed += enrageScale; + case 1: + projectileType = ModContent.ProjectileType(); + break; - // Set projectile damage and type - int projectileType = ProjectileID.DeathLaser; - switch (calamityGlobalNPC.destroyerLaserColor) - { - default: - case 0: - break; - - case 1: - projectileType = ModContent.ProjectileType(); - break; - - case 2: - projectileType = ModContent.ProjectileType(); - break; - } - - // Get target vector - Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; - Vector2 projectileSpawn = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 100f; - - // Shoot projectile - int damage = npc.GetProjectileDamage(projectileType); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); - Main.projectile[proj].timeLeft = 1200; - - npc.netUpdate = true; - - if (masterMode) - { - calamityGlobalNPC.destroyerLaserColor = -1; - npc.SyncDestroyerLaserColor(); - } + case 2: + projectileType = ModContent.ProjectileType(); + break; } - if (!masterMode) + // Get target vector + Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; + Vector2 projectileSpawn = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 100f; + + // Shoot projectile + int damage = npc.GetProjectileDamage(projectileType); + + // Reduce mech boss projectile damage depending on the new ore progression changes + if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) + { + double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; + double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; + if (!NPC.downedMechBossAny) + damage = (int)(damage * firstMechMultiplier); + else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) + damage = (int)(damage * secondMechMultiplier); + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); + Main.projectile[proj].timeLeft = 1200; + } + + npc.netUpdate = true; + + if (masterMode) { calamityGlobalNPC.destroyerLaserColor = -1; npc.SyncDestroyerLaserColor(); } } + + if (!masterMode) + { + calamityGlobalNPC.destroyerLaserColor = -1; + npc.SyncDestroyerLaserColor(); + } } } @@ -714,82 +717,67 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.type != NPCID.TheDestroyerBody || !probeLaunched) { Vector3 lightColor = Color.Red.ToVector3(); - int x = (int)((npc.position.X - 8f) / 16f); - int x2 = (int)((npc.position.X + npc.width + 8f) / 16f); - int y = (int)((npc.position.Y - 8f) / 16f); - int y2 = (int)((npc.position.Y + npc.height + 8f) / 16f); - for (int l = x; l <= x2; l++) + + // Light colors + Vector3 groundColor = new Vector3(0.3f, 0.1f, 0.05f); + Vector3 flightColor = new Vector3(0.05f, 0.1f, 0.3f); + Vector3 segmentColor = Vector3.Lerp(groundColor, flightColor, phaseTransitionColorAmount); + Vector3 telegraphColor = groundColor; + + // Telegraph for the laser breath and body lasers + float telegraphProgress = 0f; + if (calamityGlobalNPC.destroyerLaserColor != -1) { - for (int m = y; m <= y2; m++) + if (npc.type == NPCID.TheDestroyer && spitLaserSpreads) { - if (Lighting.Brightness(l, m) == 0f) - lightColor = Color.Black.ToVector3(); + float telegraphGateValue = DeathModeLaserBreathGateValue - LaserTelegraphTime; + if (calamityGlobalNPC.newAI[0] > telegraphGateValue) + { + switch (calamityGlobalNPC.destroyerLaserColor) + { + default: + case 0: + break; + + case 1: + telegraphColor = new Vector3(0.1f, 0.3f, 0.05f); + break; + + case 2: + telegraphColor = new Vector3(0.05f, 0.2f, 0.2f); + break; + } + telegraphProgress = MathHelper.Clamp((calamityGlobalNPC.newAI[0] - telegraphGateValue) / LaserTelegraphTime, 0f, 1f); + } + } + else if (npc.type == NPCID.TheDestroyerBody) + { + float shootProjectileTime = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 270f : 450f; + float bodySegmentTime = npc.ai[0] * 30f; + float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; + float telegraphGateValue = shootProjectileGateValue - LaserTelegraphTime; + if (calamityGlobalNPC.newAI[0] > telegraphGateValue) + { + switch (calamityGlobalNPC.destroyerLaserColor) + { + default: + case 0: + break; + + case 1: + telegraphColor = new Vector3(0.1f, 0.3f, 0.05f); + break; + + case 2: + telegraphColor = new Vector3(0.05f, 0.2f, 0.2f); + break; + } + telegraphProgress = MathHelper.Clamp((calamityGlobalNPC.newAI[0] - telegraphGateValue) / LaserTelegraphTime, 0f, 1f); + } } } - if (lightColor != Color.Black.ToVector3()) - { - // Light colors - Vector3 groundColor = new Vector3(0.3f, 0.1f, 0.05f); - Vector3 flightColor = new Vector3(0.05f, 0.1f, 0.3f); - Vector3 segmentColor = Vector3.Lerp(groundColor, flightColor, phaseTransitionColorAmount); - Vector3 telegraphColor = groundColor; - - // Telegraph for the laser breath and body lasers - float telegraphProgress = 0f; - if (calamityGlobalNPC.destroyerLaserColor != -1) - { - if (npc.type == NPCID.TheDestroyer && spitLaserSpreads) - { - float telegraphGateValue = DeathModeLaserBreathGateValue - LaserTelegraphTime; - if (calamityGlobalNPC.newAI[0] > telegraphGateValue) - { - switch (calamityGlobalNPC.destroyerLaserColor) - { - default: - case 0: - break; - - case 1: - telegraphColor = new Vector3(0.1f, 0.3f, 0.05f); - break; - - case 2: - telegraphColor = new Vector3(0.05f, 0.2f, 0.2f); - break; - } - telegraphProgress = MathHelper.Clamp((calamityGlobalNPC.newAI[0] - telegraphGateValue) / LaserTelegraphTime, 0f, 1f); - } - } - else if (npc.type == NPCID.TheDestroyerBody) - { - float shootProjectileTime = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 270f : 450f; - float bodySegmentTime = npc.ai[0] * 30f; - float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; - float telegraphGateValue = shootProjectileGateValue - LaserTelegraphTime; - if (calamityGlobalNPC.newAI[0] > telegraphGateValue) - { - switch (calamityGlobalNPC.destroyerLaserColor) - { - default: - case 0: - break; - - case 1: - telegraphColor = new Vector3(0.1f, 0.3f, 0.05f); - break; - - case 2: - telegraphColor = new Vector3(0.05f, 0.2f, 0.2f); - break; - } - telegraphProgress = MathHelper.Clamp((calamityGlobalNPC.newAI[0] - telegraphGateValue) / LaserTelegraphTime, 0f, 1f); - } - } - } - - Lighting.AddLight(npc.Center, Vector3.Lerp(segmentColor, telegraphColor * 2f, telegraphProgress)); - } + Lighting.AddLight(npc.Center, Vector3.Lerp(segmentColor, telegraphColor * 2f, telegraphProgress)); } // Despawn @@ -1403,43 +1391,28 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.type != NPCID.TheDestroyerBody || npc.ai[2] != 1f) { Vector3 lightColor = Color.Red.ToVector3(); - int x = (int)((npc.position.X - 8f) / 16f); - int x2 = (int)((npc.position.X + npc.width + 8f) / 16f); - int y = (int)((npc.position.Y - 8f) / 16f); - int y2 = (int)((npc.position.Y + npc.height + 8f) / 16f); - for (int l = x; l <= x2; l++) + + // Light colors + Vector3 groundColor = new Vector3(0.3f, 0.1f, 0.05f); + Vector3 segmentColor = groundColor; + Vector3 telegraphColor = groundColor; + + // Telegraph for the laser breath and body lasers + float telegraphProgress = 0f; + if (npc.Calamity().destroyerLaserColor != -1) { - for (int m = y; m <= y2; m++) + if (npc.type == NPCID.TheDestroyerBody) { - if (Lighting.Brightness(l, m) == 0f) - lightColor = Color.Black.ToVector3(); + float shootProjectileTime = Main.masterMode ? 500f : Main.expertMode ? 700f : 900f; + float bodySegmentTime = npc.ai[0] * 30f; + float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; + float telegraphGateValue = shootProjectileGateValue - LaserTelegraphTime; + if (npc.localAI[0] > telegraphGateValue) + telegraphProgress = MathHelper.Clamp((npc.localAI[0] - telegraphGateValue) / LaserTelegraphTime, 0f, 1f); } } - if (lightColor != Color.Black.ToVector3()) - { - // Light colors - Vector3 groundColor = new Vector3(0.3f, 0.1f, 0.05f); - Vector3 segmentColor = groundColor; - Vector3 telegraphColor = groundColor; - - // Telegraph for the laser breath and body lasers - float telegraphProgress = 0f; - if (npc.Calamity().destroyerLaserColor != -1) - { - if (npc.type == NPCID.TheDestroyerBody) - { - float shootProjectileTime = Main.masterMode ? 500f : Main.expertMode ? 700f : 900f; - float bodySegmentTime = npc.ai[0] * 30f; - float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; - float telegraphGateValue = shootProjectileGateValue - LaserTelegraphTime; - if (npc.localAI[0] > telegraphGateValue) - telegraphProgress = MathHelper.Clamp((npc.localAI[0] - telegraphGateValue) / LaserTelegraphTime, 0f, 1f); - } - } - - Lighting.AddLight(npc.Center, Vector3.Lerp(segmentColor, telegraphColor * 2f, telegraphProgress)); - } + Lighting.AddLight(npc.Center, Vector3.Lerp(segmentColor, telegraphColor * 2f, telegraphProgress)); } npc.localAI[1] = 1f; From 7dc2584cbf4cf7d9291af35bcc04efb1e9149afb Mon Sep 17 00:00:00 2001 From: Storm2103 Date: Wed, 15 May 2024 20:35:09 -0600 Subject: [PATCH 016/177] Added a failsave to SG paladins not despawning if the core despawns before them + some localization change to UltraLiquidator tmod did automatically --- ...Mods.CalamityMod.Items.Weapons.Magic.hjson | 5 +---- NPCs/SlimeGod/CrimulanPaladin.cs | 19 +++++++++++++++---- NPCs/SlimeGod/EbonianPaladin.cs | 13 +++++++++---- NPCs/SlimeGod/SplitCrimulanPaladin.cs | 12 ++++++++---- NPCs/SlimeGod/SplitEbonianPaladin.cs | 12 ++++++++---- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 32f2aa6047..4f9a2d7f91 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -861,10 +861,7 @@ Tradewinds: { UltraLiquidator: { DisplayName: Ultra Liquidator - Tooltip: - ''' - Summons liquidation blades that summon more blades on enemy hits - ''' + Tooltip: Summons liquidation blades that summon more blades on enemy hits } UndinesRetribution: { diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index 2efc4de6b7..b936b172c6 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -119,8 +119,12 @@ namespace CalamityMod.NPCs.SlimeGod NPC.netUpdate = true; } } - else if (NPC.timeLeft < 1800) - NPC.timeLeft = 1800; + //Hey there's someone alive, please dont go + //else if (NPC.timeLeft < 300 && (!player.dead || player.active) && NPC.ai[0] == 3f) + //{ + //NPC.timeLeft = 300; + //NPC.ai[0] = 0f; + //} if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { @@ -564,14 +568,21 @@ namespace CalamityMod.NPCs.SlimeGod } else if (NPC.ai[0] == 3f) { + //This seems to be where it despawns - Shade // Avoid cheap bullshit NPC.damage = 0; NPC.noTileCollide = true; NPC.Opacity -= 0.03f; - if (NPC.timeLeft > 10) - NPC.timeLeft = 10; + //the game loves to set by default to 937, even if you set it to be otherwise on SetDefaults + if (NPC.timeLeft > 300) + NPC.timeLeft = 300; + NPC.timeLeft--; //it doesnt decrease automatically on NPCs + + //you should despawn NOW! + if (NPC.timeLeft <= 0) + NPC.active = false; if (NPC.Opacity < 0f) NPC.Opacity = 0f; diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index f8c225f0cb..eef32d7327 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -116,8 +116,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.netUpdate = true; } } - else if (NPC.timeLeft < 1800) - NPC.timeLeft = 1800; if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { @@ -608,14 +606,21 @@ namespace CalamityMod.NPCs.SlimeGod } else if (NPC.ai[0] == 4f) { + //This seems to be where it despawns - Shade // Avoid cheap bullshit NPC.damage = 0; NPC.noTileCollide = true; NPC.Opacity -= 0.03f; - if (NPC.timeLeft > 10) - NPC.timeLeft = 10; + //the game loves to set by default to 937, even if you set it to be otherwise on SetDefaults + if (NPC.timeLeft > 300) + NPC.timeLeft = 300; + NPC.timeLeft--; //it doesnt decrease automatically on NPCs + + //you should despawn NOW! + if (NPC.timeLeft <= 0) + NPC.active = false; if (NPC.Opacity < 0f) NPC.Opacity = 0f; diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index d00c921ae9..28898bab1d 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -133,8 +133,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.netUpdate = true; } } - else if (NPC.timeLeft < 1800) - NPC.timeLeft = 1800; bool enraged = true; if (CalamityGlobalNPC.slimeGodPurple != -1) @@ -552,8 +550,14 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noTileCollide = true; NPC.Opacity -= 0.03f; - if (NPC.timeLeft > 10) - NPC.timeLeft = 10; + //the game loves to set by default to 937, even if you set it to be otherwise on SetDefaults + if (NPC.timeLeft > 300) + NPC.timeLeft = 300; + NPC.timeLeft--; //it doesnt decrease automatically on NPCs + + //you should despawn NOW! + if (NPC.timeLeft <= 0) + NPC.active = false; if (NPC.Opacity < 0f) NPC.Opacity = 0f; diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 91036c6d16..4f0256cf06 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -133,8 +133,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.netUpdate = true; } } - else if (NPC.timeLeft < 1800) - NPC.timeLeft = 1800; bool enraged = true; bool hyperMode = NPC.localAI[1] == 1f; @@ -599,8 +597,14 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noTileCollide = true; NPC.Opacity -= 0.03f; - if (NPC.timeLeft > 10) - NPC.timeLeft = 10; + //the game loves to set by default to 937, even if you set it to be otherwise on SetDefaults + if (NPC.timeLeft > 300) + NPC.timeLeft = 300; + NPC.timeLeft--; //it doesnt decrease automatically on NPCs + + //you should despawn NOW! + if (NPC.timeLeft <= 0) + NPC.active = false; if (NPC.Opacity < 0f) NPC.Opacity = 0f; From cf58114dc898bddfd201c37f5193644bdc2ffd50 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Wed, 15 May 2024 19:38:42 -0700 Subject: [PATCH 017/177] fixed deus alt segment sprites in MP --- NPCs/AstrumDeus/AstrumDeusBody.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index df1beaab43..dfc682dcb0 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -82,6 +82,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SendExtraAI(BinaryWriter writer) { + writer.Write(NPC.localAI[3]); writer.Write(NPC.dontTakeDamage); for (int i = 0; i < 4; i++) writer.Write(NPC.Calamity().newAI[i]); @@ -89,6 +90,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void ReceiveExtraAI(BinaryReader reader) { + NPC.localAI[3] = reader.ReadSingle(); NPC.dontTakeDamage = reader.ReadBoolean(); for (int i = 0; i < 4; i++) NPC.Calamity().newAI[i] = reader.ReadSingle(); From f5bedc78c065b2a1819ce93feb1d0166fbc3d957 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 15 May 2024 21:50:02 -0500 Subject: [PATCH 018/177] Removed Hive Mind frame sync --- NPCs/HiveMind/HiveMind.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 6337421d61..1e7dd9165a 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -216,11 +216,6 @@ namespace CalamityMod.NPCs.HiveMind writer.Write(reelCount); writer.Write(frameX); writer.Write(frameY); - - writer.Write(NPC.frame.X); - writer.Write(NPC.frame.Y); - writer.Write(NPC.frame.Width); - writer.Write(NPC.frame.Height); } public override void ReceiveExtraAI(BinaryReader reader) @@ -243,10 +238,6 @@ namespace CalamityMod.NPCs.HiveMind reelCount = reader.ReadInt32(); frameX = reader.ReadInt32(); frameY = reader.ReadInt32(); - - Rectangle frame = new Rectangle(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32()); - if (frame.Width > 0 && frame.Height > 0) - NPC.frame = frame; } public override void FindFrame(int frameHeight) From aa9c96ec589820d1528ac1245cbe03a209773443 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 15 May 2024 22:10:23 -0500 Subject: [PATCH 019/177] Paladin despawns, I think this is all that has to be done, I hope --- NPCs/SlimeGod/CrimulanPaladin.cs | 45 ++++++++++++--------------- NPCs/SlimeGod/EbonianPaladin.cs | 39 ++++++++++++----------- NPCs/SlimeGod/SplitCrimulanPaladin.cs | 36 +++++++++++---------- NPCs/SlimeGod/SplitEbonianPaladin.cs | 36 +++++++++++---------- 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index b936b172c6..59c8c721e0 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -105,26 +105,25 @@ namespace CalamityMod.NPCs.SlimeGod Player player = Main.player[NPC.target]; - if (NPC.ai[0] != 3f && (player.dead || !player.active)) + if (NPC.ai[0] != 3f) { - NPC.TargetClosest(); - player = Main.player[NPC.target]; if (player.dead || !player.active) { - NPC.ai[0] = 3f; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - NPC.netUpdate = true; + NPC.TargetClosest(); + player = Main.player[NPC.target]; + if (player.dead || !player.active) + { + NPC.ai[0] = 3f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + NPC.netUpdate = true; + } } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; } - //Hey there's someone alive, please dont go - //else if (NPC.timeLeft < 300 && (!player.dead || player.active) && NPC.ai[0] == 3f) - //{ - //NPC.timeLeft = 300; - //NPC.ai[0] = 0f; - //} if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { @@ -566,29 +565,25 @@ namespace CalamityMod.NPCs.SlimeGod NPC.netUpdate = true; } } + + // Despawn else if (NPC.ai[0] == 3f) { - //This seems to be where it despawns - Shade // Avoid cheap bullshit NPC.damage = 0; NPC.noTileCollide = true; NPC.Opacity -= 0.03f; - //the game loves to set by default to 937, even if you set it to be otherwise on SetDefaults - if (NPC.timeLeft > 300) - NPC.timeLeft = 300; - NPC.timeLeft--; //it doesnt decrease automatically on NPCs - - //you should despawn NOW! - if (NPC.timeLeft <= 0) - NPC.active = false; + if (NPC.timeLeft > 10) + NPC.timeLeft = 10; if (NPC.Opacity < 0f) NPC.Opacity = 0f; NPC.velocity.X *= 0.98f; } + else if (NPC.ai[0] == 4f) { // Avoid cheap bullshit @@ -747,7 +742,7 @@ namespace CalamityMod.NPCs.SlimeGod return newColor * NPC.Opacity; } - public override bool CheckActive() => false; + public override bool CheckActive() => NPC.ai[0] == 3f; public override void HitEffect(NPC.HitInfo hit) { diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index eef32d7327..f59df6f5f8 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -102,19 +102,24 @@ namespace CalamityMod.NPCs.SlimeGod Player player = Main.player[NPC.target]; - if (NPC.ai[0] != 4f && (player.dead || !player.active)) + if (NPC.ai[0] != 4f) { - NPC.TargetClosest(); - player = Main.player[NPC.target]; if (player.dead || !player.active) { - NPC.ai[0] = 4f; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - NPC.netUpdate = true; + NPC.TargetClosest(); + player = Main.player[NPC.target]; + if (player.dead || !player.active) + { + NPC.ai[0] = 4f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + NPC.netUpdate = true; + } } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; } if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) @@ -604,29 +609,25 @@ namespace CalamityMod.NPCs.SlimeGod NPC.netUpdate = true; } } + + // Despawn else if (NPC.ai[0] == 4f) { - //This seems to be where it despawns - Shade // Avoid cheap bullshit NPC.damage = 0; NPC.noTileCollide = true; NPC.Opacity -= 0.03f; - //the game loves to set by default to 937, even if you set it to be otherwise on SetDefaults - if (NPC.timeLeft > 300) - NPC.timeLeft = 300; - NPC.timeLeft--; //it doesnt decrease automatically on NPCs - - //you should despawn NOW! - if (NPC.timeLeft <= 0) - NPC.active = false; + if (NPC.timeLeft > 10) + NPC.timeLeft = 10; if (NPC.Opacity < 0f) NPC.Opacity = 0f; NPC.velocity.X *= 0.98f; } + else if (NPC.ai[0] == 5f) { // Set damage @@ -786,7 +787,7 @@ namespace CalamityMod.NPCs.SlimeGod return newColor * NPC.Opacity; } - public override bool CheckActive() => false; + public override bool CheckActive() => NPC.ai[0] == 4f; public override void HitEffect(NPC.HitInfo hit) { diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 28898bab1d..7ad8a1e363 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -120,18 +120,23 @@ namespace CalamityMod.NPCs.SlimeGod Player player = Main.player[NPC.target]; - if (NPC.ai[0] != 3f && (player.dead || !player.active)) + if (NPC.ai[0] != 3f) { - NPC.TargetClosest(); - player = Main.player[NPC.target]; if (player.dead || !player.active) { - NPC.ai[0] = 3f; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - NPC.netUpdate = true; + NPC.TargetClosest(); + player = Main.player[NPC.target]; + if (player.dead || !player.active) + { + NPC.ai[0] = 3f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.netUpdate = true; + } } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; } bool enraged = true; @@ -542,6 +547,8 @@ namespace CalamityMod.NPCs.SlimeGod NPC.netUpdate = true; } } + + // Despawn else if (NPC.ai[0] == 3f) { // Avoid cheap bullshit @@ -550,20 +557,15 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noTileCollide = true; NPC.Opacity -= 0.03f; - //the game loves to set by default to 937, even if you set it to be otherwise on SetDefaults - if (NPC.timeLeft > 300) - NPC.timeLeft = 300; - NPC.timeLeft--; //it doesnt decrease automatically on NPCs - - //you should despawn NOW! - if (NPC.timeLeft <= 0) - NPC.active = false; + if (NPC.timeLeft > 10) + NPC.timeLeft = 10; if (NPC.Opacity < 0f) NPC.Opacity = 0f; NPC.velocity.X *= 0.98f; } + else if (NPC.ai[0] == 4f) { // Set damage @@ -734,7 +736,7 @@ namespace CalamityMod.NPCs.SlimeGod npcLoot.Add(ItemID.Gel, 1, 32, 48); } - public override bool CheckActive() => false; + public override bool CheckActive() => NPC.ai[0] == 3f; public override void HitEffect(NPC.HitInfo hit) { diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 4f0256cf06..8dddef1603 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -120,18 +120,23 @@ namespace CalamityMod.NPCs.SlimeGod Player player = Main.player[NPC.target]; - if (NPC.ai[0] != 4f && (player.dead || !player.active)) + if (NPC.ai[0] != 4f) { - NPC.TargetClosest(); - player = Main.player[NPC.target]; if (player.dead || !player.active) { - NPC.ai[0] = 4f; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - NPC.netUpdate = true; + NPC.TargetClosest(); + player = Main.player[NPC.target]; + if (player.dead || !player.active) + { + NPC.ai[0] = 4f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.netUpdate = true; + } } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; } bool enraged = true; @@ -589,6 +594,8 @@ namespace CalamityMod.NPCs.SlimeGod NPC.netUpdate = true; } } + + // Despawn else if (NPC.ai[0] == 4f) { // Avoid cheap bullshit @@ -597,20 +604,15 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noTileCollide = true; NPC.Opacity -= 0.03f; - //the game loves to set by default to 937, even if you set it to be otherwise on SetDefaults - if (NPC.timeLeft > 300) - NPC.timeLeft = 300; - NPC.timeLeft--; //it doesnt decrease automatically on NPCs - - //you should despawn NOW! - if (NPC.timeLeft <= 0) - NPC.active = false; + if (NPC.timeLeft > 10) + NPC.timeLeft = 10; if (NPC.Opacity < 0f) NPC.Opacity = 0f; NPC.velocity.X *= 0.98f; } + else if (NPC.ai[0] == 5f) { // Set damage @@ -778,7 +780,7 @@ namespace CalamityMod.NPCs.SlimeGod npcLoot.Add(ItemID.Gel, 1, 32, 48); } - public override bool CheckActive() => false; + public override bool CheckActive() => NPC.ai[0] == 4f; public override void HitEffect(NPC.HitInfo hit) { From 7f9f529621e930d7dc06b042224181f33ec1fc4a Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 15 May 2024 22:21:29 -0500 Subject: [PATCH 020/177] Tried to fix Skeletron's mp despawning issue --- NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index 0eb710efcb..bae728cb36 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -129,12 +129,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float distance = Vector2.Distance(Main.player[npc.target].Center, npc.Center); // Despawn - int despawnDistanceInTiles = 500; - if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistanceInTiles) + if (npc.ai[1] != 3f) { - npc.TargetClosest(); + int despawnDistanceInTiles = 500; if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistanceInTiles) - npc.ai[1] = 3f; + { + npc.TargetClosest(); + if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistanceInTiles) + npc.ai[1] = 3f; + } + else if (npc.timeLeft < 1800) + npc.timeLeft = 1800; } // Daytime enrage From 4c151d2107cba24ce13d4cce06559304aaaaba54 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 15 May 2024 23:00:47 -0500 Subject: [PATCH 021/177] Removed framing code that proved to be useless --- NPCs/CalamityGlobalNPC.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 40838282ad..a7bf7b1224 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6950,14 +6950,6 @@ namespace CalamityMod.NPCs if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - /*if (npc.type == NPCID.TheDestroyerBody) - { - if (npc.ai[2] == 0f) - npc.frame.Y = 0; - else - npc.frame.Y = frameHeight; - }*/ - Color segmentDrawColor = npc.GetAlpha(drawColor); // Check if Destroyer is behind tiles and, if so, how much of the segment is behind tiles and adjust color accordingly From 4131dde698862c45fb95f9ea2c19ba6e2bc22a2d Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 16 May 2024 00:54:15 -0500 Subject: [PATCH 022/177] Decreased Desert Scourge and Nuisance turn speeds --- NPCs/DesertScourge/DesertNuisanceHead.cs | 8 ++++---- NPCs/DesertScourge/DesertNuisanceHeadYoung.cs | 8 ++++---- NPCs/DesertScourge/DesertScourgeHead.cs | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 564cf646cc..453e4e5484 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -138,12 +138,12 @@ namespace CalamityMod.NPCs.DesertScourge // Percent life remaining. float lifeRatio = NPC.life / (float)NPC.lifeMax; - float speed = death ? 0.2f : 0.17f; - float turnSpeed = death ? 0.3f : 0.25f; + float speed = death ? 0.16f : 0.14f; + float turnSpeed = death ? 0.24f : 0.2f; speed += speed * 0.4f * (1f - lifeRatio); turnSpeed += turnSpeed * 0.4f * (1f - lifeRatio); - speed += 0.17f * enrageScale; - turnSpeed += 0.25f * enrageScale; + speed += 0.14f * enrageScale; + turnSpeed += 0.2f * enrageScale; if (Main.getGoodWorld) { diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index 9a3e19a915..9380abd265 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -134,12 +134,12 @@ namespace CalamityMod.NPCs.DesertScourge // Percent life remaining. float lifeRatio = NPC.life / (float)NPC.lifeMax; - float speed = death ? 0.22f : 0.19f; - float turnSpeed = death ? 0.32f : 0.27f; + float speed = death ? 0.18f : 0.16f; + float turnSpeed = death ? 0.26f : 0.22f; speed += speed * 0.4f * (1f - lifeRatio); turnSpeed += turnSpeed * 0.4f * (1f - lifeRatio); - speed += 0.19f * enrageScale; - turnSpeed += 0.27f * enrageScale; + speed += 0.16f * enrageScale; + turnSpeed += 0.22f * enrageScale; if (Main.getGoodWorld) { diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 803655aa4d..5f93dd98ec 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -238,8 +238,8 @@ namespace CalamityMod.NPCs.DesertScourge float burrowDistance = hide ? BurrowDistance_Hide : bossRush ? BurrowDistance_BossRush : BurrowDistance; - float speed = death ? 0.18f : 0.15f; - float turnSpeed = death ? 0.36f : 0.3f; + float speed = death ? 0.15f : 0.12f; + float turnSpeed = death ? 0.3f : 0.24f; if (expertMode) { @@ -249,12 +249,12 @@ namespace CalamityMod.NPCs.DesertScourge if (revenge) { - speed += (death ? 0.06f : 0.05f) * (1f - lifeRatio); - turnSpeed += (death ? 0.12f : 0.1f) * (1f - lifeRatio); + speed += (death ? 0.05f : 0.04f) * (1f - lifeRatio); + turnSpeed += (death ? 0.1f : 0.08f) * (1f - lifeRatio); } - speed += 0.15f * enrageScale; - turnSpeed += 0.3f * enrageScale; + speed += 0.12f * enrageScale; + turnSpeed += 0.24f * enrageScale; if (Main.getGoodWorld) { From 03fe0ce947646588f78426823c4822b6d5de5ee3 Mon Sep 17 00:00:00 2001 From: Memes Date: Thu, 16 May 2024 10:02:58 +0200 Subject: [PATCH 023/177] Wildfire Bloom syncing. --- Projectiles/Ranged/WildfireBloomHoldout.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Projectiles/Ranged/WildfireBloomHoldout.cs b/Projectiles/Ranged/WildfireBloomHoldout.cs index 6144e97939..cff7bfed63 100644 --- a/Projectiles/Ranged/WildfireBloomHoldout.cs +++ b/Projectiles/Ranged/WildfireBloomHoldout.cs @@ -1,12 +1,10 @@ -using CalamityMod.Items.Weapons.Ranged; +using System.IO; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -25,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged private ref float ShotCooldown => ref Projectile.ai[0]; private ref float ShotsFired => ref Projectile.ai[1]; private ref float ShootTimer => ref Projectile.ai[2]; - public int FireBlobs = 0; + public int FireBlobs { get; set; } public override void KillHoldoutLogic() { @@ -60,6 +58,8 @@ namespace CalamityMod.Projectiles.Ranged } else FireBlobs--; + + Projectile.netUpdate = true; } else ShotCooldown--; @@ -83,5 +83,9 @@ namespace CalamityMod.Projectiles.Ranged base.OnSpawn(source); SoundEngine.PlaySound(SoundID.Item73 with { Volume = 0.7f }, Projectile.Center); } + + public override void SendExtraAIHoldout(BinaryWriter writer) => writer.Write(FireBlobs); + + public override void ReceiveExtraAIHoldout(BinaryReader reader) => FireBlobs = reader.ReadInt32(); } } From 7e5710957a6a721fbf4bbee439665995187115c2 Mon Sep 17 00:00:00 2001 From: Memes Date: Thu, 16 May 2024 10:10:49 +0200 Subject: [PATCH 024/177] The Hive cleanup and syncing. --- Items/Weapons/Ranged/TheHive.cs | 1 + Projectiles/Ranged/TheHiveHoldout.cs | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index 2092626a5c..89e585472d 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public static float MaxCharge = 90f; public static int OriginalUseTime = 34; public override void SetDefaults() diff --git a/Projectiles/Ranged/TheHiveHoldout.cs b/Projectiles/Ranged/TheHiveHoldout.cs index f29cb26b3e..f2800e0a61 100644 --- a/Projectiles/Ranged/TheHiveHoldout.cs +++ b/Projectiles/Ranged/TheHiveHoldout.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; +using static CalamityMod.Items.Weapons.Ranged.TheHive; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles.Ranged @@ -25,14 +26,18 @@ namespace CalamityMod.Projectiles.Ranged // It'll carry over to the projectiles that it shoots. public static int DustEffectsID { get; set; } public static Color EffectsColor { get; set; } - public static Color StaticEffectsColor = Color.Lime; + public static Color StaticEffectsColor { get; set; } = Color.Lime; private ref float ShootingTimer => ref Projectile.ai[0]; - private bool FireNuke; - private float PostFireCooldown = 0; - private bool HasLetGo = false; - private SlotId HiveHum; - private const float MaxCharge = 90f; + private ref float PostFireCooldown => ref Projectile.ai[1]; + private bool HasLetGo + { + get => Projectile.ai[2] == 1f; + set => Projectile.ai[2] = value == true ? 1f : 0f; + } + + private bool FireNuke => ShootingTimer > MaxCharge; + private SlotId HiveHum { get; set; } public override void KillHoldoutLogic() { @@ -42,9 +47,6 @@ namespace CalamityMod.Projectiles.Ranged public override void HoldoutAI() { - - FireNuke = ShootingTimer > MaxCharge; - // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. if (Owner.CantUseHoldout() && !HasLetGo) { @@ -54,8 +56,8 @@ namespace CalamityMod.Projectiles.Ranged } if (HeldItem.type == ItemType()) ShootRocket(); - NetUpdate(); HasLetGo = true; + NetUpdate(); } if (!HasLetGo) From 5c4d78b792209dbd1bc190efff8355e526d804e4 Mon Sep 17 00:00:00 2001 From: Memes Date: Thu, 16 May 2024 10:16:00 +0200 Subject: [PATCH 025/177] Elemental Eruption syncing. --- Projectiles/Ranged/ElementalEruptionHouldout.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Projectiles/Ranged/ElementalEruptionHouldout.cs b/Projectiles/Ranged/ElementalEruptionHouldout.cs index e3c445aa01..93a5cbf4bd 100644 --- a/Projectiles/Ranged/ElementalEruptionHouldout.cs +++ b/Projectiles/Ranged/ElementalEruptionHouldout.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Ranged; +using System.IO; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Terraria; @@ -20,7 +21,7 @@ namespace CalamityMod.Projectiles.Ranged private ref float ShotCooldown => ref Projectile.ai[0]; private ref float ShotsFired => ref Projectile.ai[1]; private ref float ShootTimer => ref Projectile.ai[2]; - public int FireBlobs = 0; + private int FireBlobs { get; set; } public override void KillHoldoutLogic() { @@ -65,6 +66,8 @@ namespace CalamityMod.Projectiles.Ranged } else FireBlobs--; + + Projectile.netUpdate = true; } else ShotCooldown--; @@ -91,5 +94,9 @@ namespace CalamityMod.Projectiles.Ranged base.OnSpawn(source); SoundEngine.PlaySound(SoundID.Item73 with { Volume = 0.7f }, Projectile.Center); } + + public override void SendExtraAIHoldout(BinaryWriter writer) => writer.Write(FireBlobs); + + public override void ReceiveExtraAIHoldout(BinaryReader reader) => FireBlobs = reader.ReadInt32(); } } From fa6e15ab67c71b87c2e32f61989bcee4d9e6d250 Mon Sep 17 00:00:00 2001 From: Memes Date: Thu, 16 May 2024 10:43:17 +0200 Subject: [PATCH 026/177] Texture null check in base holdout. --- Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index ca12e9cbd7..ccb458a981 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -2,6 +2,7 @@ using System.IO; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; using Terraria.GameContent; @@ -126,6 +127,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles private Type AssociatedItemType => ItemLoader.GetItem(AssociatedItemID).GetType(); + private Asset ItemTexture => TextureAssets.Item[AssociatedItemID]; + #endregion #region Overridden Members @@ -138,7 +141,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void SetDefaults() { - Projectile.width = Projectile.height = TextureAssets.Item[AssociatedItemID].Width(); + Projectile.width = Projectile.height = ItemTexture is null ? 0 : ItemTexture.Width(); Projectile.tileCollide = false; Projectile.netImportant = true; } From 3834fd39e91df617e11915a284ba99c1e0f47157 Mon Sep 17 00:00:00 2001 From: Memes Date: Thu, 16 May 2024 18:10:24 +0200 Subject: [PATCH 027/177] The holdout syncing experiment. 1. Base holdout sets netUpdate to true every frame and netSpam to 0 every frame. 2. Eliminated all instances of netUpdate and netSpam on specific holdouts, since base holdout does it every frame. --- Items/Weapons/Magic/Omicron.cs | 3 + .../BaseGunHoldoutProjectile.cs | 12 +-- Projectiles/Magic/GenesisHoldout.cs | 16 +--- Projectiles/Magic/OmicronHoldout.cs | 77 +++++++------------ Projectiles/Ranged/ArcNovaDiffuserHoldout.cs | 17 ++-- .../Ranged/ElementalEruptionHouldout.cs | 13 +--- Projectiles/Ranged/FlakKrakenHoldout.cs | 10 --- Projectiles/Ranged/FlakToxicannonHoldout.cs | 2 +- Projectiles/Ranged/ScorpioHoldout.cs | 12 +-- Projectiles/Ranged/TheHiveHoldout.cs | 27 ++----- Projectiles/Ranged/WildfireBloomHoldout.cs | 11 +-- 11 files changed, 62 insertions(+), 138 deletions(-) diff --git a/Items/Weapons/Magic/Omicron.cs b/Items/Weapons/Magic/Omicron.cs index 5028c9f3a0..010a7b2f7e 100644 --- a/Items/Weapons/Magic/Omicron.cs +++ b/Items/Weapons/Magic/Omicron.cs @@ -12,6 +12,9 @@ namespace CalamityMod.Items.Weapons.Magic { public class Omicron : ModItem, ILocalizedModType { + public static float FireRate = 15f; + public static float StarterWinup = 60f; + public new string LocalizationCategory => "Items.Weapons.Magic"; public override void SetDefaults() diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index ccb458a981..f4605f3739 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void SetDefaults() { - Projectile.width = Projectile.height = ItemTexture is null ? 0 : ItemTexture.Width(); + Projectile.width = Projectile.height = ItemTexture is null ? 1 : ItemTexture.Width(); Projectile.tileCollide = false; Projectile.netImportant = true; } @@ -171,15 +171,12 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// /// Here goes the code for when the holdout needs to despawn.
- /// Defaults to despawning when the owner isn't holding or isn't using the correspondent weapon. + /// Defaults to despawning when the owner isn't using the correspondent weapon. ///
public virtual void KillHoldoutLogic() { if (Owner.CantUseHoldout()) - { - Projectile.netUpdate = true; Projectile.Kill(); - } } ///
@@ -225,6 +222,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles if (OffsetLengthFromArm != MaxOffsetLengthFromArm) OffsetLengthFromArm = MathHelper.Lerp(OffsetLengthFromArm, MaxOffsetLengthFromArm, RecoilResolveSpeed); + + Projectile.netUpdate = true; + Projectile.netSpam = 0; } /// @@ -258,6 +258,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles writer.Write(Projectile.rotation); writer.Write(KeepRefreshingLifetime); writer.Write(OffsetLengthFromArm); + writer.Write(Projectile.spriteDirection); SendExtraAIHoldout(writer); } @@ -266,6 +267,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.rotation = reader.ReadSingle(); KeepRefreshingLifetime = reader.ReadBoolean(); OffsetLengthFromArm = reader.ReadSingle(); + Projectile.spriteDirection = reader.ReadInt32(); ReceiveExtraAIHoldout(reader); } diff --git a/Projectiles/Magic/GenesisHoldout.cs b/Projectiles/Magic/GenesisHoldout.cs index 65385f8a61..28276d0701 100644 --- a/Projectiles/Magic/GenesisHoldout.cs +++ b/Projectiles/Magic/GenesisHoldout.cs @@ -34,10 +34,7 @@ namespace CalamityMod.Projectiles.Magic public override void KillHoldoutLogic() { if (HeldItem.type != Owner.ActiveItem().type || Owner.CantUseHoldout()) - { Projectile.Kill(); - Projectile.netUpdate = true; - } } public override void HoldoutAI() @@ -50,7 +47,6 @@ namespace CalamityMod.Projectiles.Magic { FireYBeam = true; Windup = 60f; - Projectile.netUpdate = true; } if (FireYBeam) @@ -61,11 +57,8 @@ namespace CalamityMod.Projectiles.Magic else Shoot(false); - if (Windup > 10f) - { - if (!FireYBeam) - Windup -= 12f; - } + if (Windup > 10f && !FireYBeam) + Windup -= 12f; else Windup = 10f; @@ -77,14 +70,13 @@ namespace CalamityMod.Projectiles.Magic { SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); Projectile.Kill(); - Projectile.netUpdate = true; } } ShootingTimer++; } - private void Shoot(bool yBeam) + public void Shoot(bool yBeam) { Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); @@ -129,8 +121,6 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(pulse3); } - Projectile.netUpdate = true; - // Inside here go all the things that dedicated servers shouldn't spend resources on. // Like visuals and sounds. if (Main.dedServ) diff --git a/Projectiles/Magic/OmicronHoldout.cs b/Projectiles/Magic/OmicronHoldout.cs index 49c022c8a6..9a73374df0 100644 --- a/Projectiles/Magic/OmicronHoldout.cs +++ b/Projectiles/Magic/OmicronHoldout.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using static CalamityMod.Items.Weapons.Magic.Omicron; namespace CalamityMod.Projectiles.Magic { @@ -18,50 +19,30 @@ namespace CalamityMod.Projectiles.Magic public override float BaseOffsetY => -5f; public override float OffsetYDownwards => 5f; - public Color StaticEffectsColor = Color.MediumVioletRed; + public ref float ShootingTimer => ref Projectile.ai[0]; + public ref float PostFireCooldown => ref Projectile.ai[1]; + public ref float MaxFireRateShots => ref Projectile.ai[2]; - public float FiringTime = 15; - public float Windup = 60; - public bool WindingUp = false; - public int time = 0; - public int PostFireCooldown = 0; - public bool fireYBeam = false; - public int maxFirerateShots = 0; - - private ref float ShootingTimer => ref Projectile.ai[0]; + public float Windup { get; set; } = StarterWinup; + public Color EffectsColor { get; set; } = Color.MediumVioletRed; public override void KillHoldoutLogic() { - if (Owner is null || !Owner.active || Owner.CCed || Owner.dead || Owner.noItems) - { - if (PostFireCooldown <= 0) - Projectile.Kill(); - Projectile.netUpdate = true; - } + if (Owner.CantUseHoldout() && PostFireCooldown <= 0) + Projectile.Kill(); } public override void HoldoutAI() { - Item heldItem = Owner.ActiveItem(); - - // Fire if the owner stops channeling or otherwise cannot use the weapon. - if (Owner.CantUseHoldout()) - { - if (PostFireCooldown <= 0) - Projectile.Kill(); - } - if (PostFireCooldown > 0) - { PostFiringCooldown(); - } if (Owner.Calamity().mouseRight && PostFireCooldown <= 0) { - if (Owner.CheckMana(Owner.ActiveItem(), (int)(heldItem.mana * Owner.manaCost) * 16, true, false)) + if (Owner.CheckMana(Owner.ActiveItem(), (int)(HeldItem.mana * Owner.manaCost) * 16, true, false)) { PostFireCooldown = 100; - Shoot(heldItem, true); + Shoot(true); ShootingTimer = 0; } else @@ -74,31 +55,26 @@ namespace CalamityMod.Projectiles.Magic } } } - else if (ShootingTimer >= FiringTime) + else if (ShootingTimer >= FireRate) { if (Owner.CheckMana(Owner.ActiveItem(), -1, true, false) && PostFireCooldown <= 0) { - maxFirerateShots++; + MaxFireRateShots++; - if (maxFirerateShots == 5) + if (MaxFireRateShots == 5) { Windup = 60; - maxFirerateShots = 1; + MaxFireRateShots = 1; } - Shoot(heldItem, false); + Shoot(false); ShootingTimer = 0; - if (Windup > 10) - { - if (maxFirerateShots > 0) - Windup -= 12; - } + if (Windup > 10 && MaxFireRateShots > 0) + Windup -= 12; else - { Windup = 10; - } } else if (PostFireCooldown <= 0) { @@ -107,9 +83,11 @@ namespace CalamityMod.Projectiles.Magic } } + ShootingTimer++; } - private void Shoot(Item item, bool yBeam) + + public void Shoot(bool yBeam) { Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); @@ -126,7 +104,7 @@ namespace CalamityMod.Projectiles.Magic for (int k = 0; k < 6; k++) { - Particle pulse2 = new GlowSparkParticle(GunTipPosition, shootDirection * 28, false, 8, 0.087f, StaticEffectsColor, new Vector2(2.3f, 0.9f), true); + Particle pulse2 = new GlowSparkParticle(GunTipPosition, shootDirection * 28, false, 8, 0.087f, EffectsColor, new Vector2(2.3f, 0.9f), true); GeneralParticleHandler.SpawnParticle(pulse2); } @@ -135,7 +113,7 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 8; i++) { - SparkParticle spark2 = new SparkParticle(GunTipPosition + Main.rand.NextVector2Circular(10, 10), firingVelocity3 * Main.rand.NextFloat(0.7f, 1.3f), false, Main.rand.Next(20, 30), Main.rand.NextFloat(0.4f, 0.55f), StaticEffectsColor); + SparkParticle spark2 = new SparkParticle(GunTipPosition + Main.rand.NextVector2Circular(10, 10), firingVelocity3 * Main.rand.NextFloat(0.7f, 1.3f), false, Main.rand.Next(20, 30), Main.rand.NextFloat(0.4f, 0.55f), EffectsColor); GeneralParticleHandler.SpawnParticle(spark2); } } @@ -155,7 +133,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); } - Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, StaticEffectsColor, new Vector2(1.7f, 0.8f), true); + Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, EffectsColor, new Vector2(1.7f, 0.8f), true); GeneralParticleHandler.SpawnParticle(pulse3); } @@ -171,7 +149,7 @@ namespace CalamityMod.Projectiles.Magic Dust dust2 = Dust.NewDustPerfect(GunTipPosition, Main.rand.NextBool(4) ? 267 : 66, shootVel); dust2.scale = Main.rand.NextFloat(1.15f, 1.45f); dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? Color.Lerp(StaticEffectsColor, Color.White, 0.5f) : StaticEffectsColor; + dust2.color = Main.rand.NextBool() ? Color.Lerp(EffectsColor, Color.White, 0.5f) : EffectsColor; } // By decreasing the offset length of the gun from the arms, we give an effect of recoil. @@ -180,18 +158,19 @@ namespace CalamityMod.Projectiles.Magic else OffsetLengthFromArm -= 6f; } - private void PostFiringCooldown() + + public void PostFiringCooldown() { Owner.channel = true; if (PostFireCooldown > 0 && Main.rand.NextBool()) { Vector2 smokeVel = new Vector2(0, -8) * Main.rand.NextFloat(0.1f, 1.1f); - Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel, StaticEffectsColor, Main.rand.Next(30, 50 + 1), Main.rand.NextFloat(0.1f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); + Particle smoke = new HeavySmokeParticle(GunTipPosition, smokeVel, EffectsColor, Main.rand.Next(30, 50 + 1), Main.rand.NextFloat(0.1f, 0.4f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true); GeneralParticleHandler.SpawnParticle(smoke); Dust dust = Dust.NewDustPerfect(GunTipPosition, 303, smokeVel.RotatedByRandom(0.1f), 80, default, Main.rand.NextFloat(0.2f, 0.8f)); dust.noGravity = false; - dust.color = StaticEffectsColor; + dust.color = EffectsColor; } ShootingTimer = 0; PostFireCooldown--; diff --git a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs index bc886a28f8..e042721fbb 100644 --- a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs +++ b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs @@ -24,19 +24,16 @@ namespace CalamityMod.Projectiles.Ranged public static float BulletSpeed = 12f; public SlotId NovaChargeSlot; - private ref float CurrentChargingFrames => ref Projectile.ai[0]; - private ref float ShotsLoaded => ref Projectile.ai[1]; - private ref float ShootRecoilTimer => ref Projectile.ai[2]; // Dual functions for rapid fire shooting cooldown and recoil - private bool ChargeLV1 => CurrentChargingFrames >= ArcNovaDiffuser.Charge1Frames; - private bool ChargeLV2 => CurrentChargingFrames >= ArcNovaDiffuser.Charge2Frames; + public ref float CurrentChargingFrames => ref Projectile.ai[0]; + public ref float ShotsLoaded => ref Projectile.ai[1]; + public ref float ShootRecoilTimer => ref Projectile.ai[2]; // Dual functions for rapid fire shooting cooldown and recoil + public bool ChargeLV1 => CurrentChargingFrames >= ArcNovaDiffuser.Charge1Frames; + public bool ChargeLV2 => CurrentChargingFrames >= ArcNovaDiffuser.Charge2Frames; public override void KillHoldoutLogic() { if (HeldItem.type != Owner.ActiveItem().type || Owner is null || !Owner.active || Owner.CCed || Owner.dead || Owner.noItems) - { Projectile.Kill(); - Projectile.netUpdate = true; - } } public override void HoldoutAI() @@ -74,8 +71,6 @@ namespace CalamityMod.Projectiles.Ranged ShotsLoaded = 0; ShootRecoilTimer = 24f; OffsetLengthFromArm -= 25f; - Projectile.netSpam = 0; - Projectile.netUpdate = true; } // Retracting recoil else if (ShootRecoilTimer > 0) @@ -107,8 +102,6 @@ namespace CalamityMod.Projectiles.Ranged ShotsLoaded--; ShootRecoilTimer = 16f; OffsetLengthFromArm -= 5f; - Projectile.netSpam = 0; - Projectile.netUpdate = true; } } // Retracting any remaining recoil diff --git a/Projectiles/Ranged/ElementalEruptionHouldout.cs b/Projectiles/Ranged/ElementalEruptionHouldout.cs index 93a5cbf4bd..bb8f4c68f1 100644 --- a/Projectiles/Ranged/ElementalEruptionHouldout.cs +++ b/Projectiles/Ranged/ElementalEruptionHouldout.cs @@ -18,19 +18,16 @@ namespace CalamityMod.Projectiles.Ranged public override float BaseOffsetY => -5f; public override float OffsetYDownwards => 10f; - private ref float ShotCooldown => ref Projectile.ai[0]; - private ref float ShotsFired => ref Projectile.ai[1]; - private ref float ShootTimer => ref Projectile.ai[2]; - private int FireBlobs { get; set; } + public ref float ShotCooldown => ref Projectile.ai[0]; + public ref float ShotsFired => ref Projectile.ai[1]; + public ref float ShootTimer => ref Projectile.ai[2]; + public int FireBlobs { get; set; } public override void KillHoldoutLogic() { base.KillHoldoutLogic(); if (ShotsFired >= 24) - { Projectile.Kill(); - Projectile.netUpdate = true; - } } public override void HoldoutAI() @@ -66,8 +63,6 @@ namespace CalamityMod.Projectiles.Ranged } else FireBlobs--; - - Projectile.netUpdate = true; } else ShotCooldown--; diff --git a/Projectiles/Ranged/FlakKrakenHoldout.cs b/Projectiles/Ranged/FlakKrakenHoldout.cs index 2eaeff6f2a..362c7e66a2 100644 --- a/Projectiles/Ranged/FlakKrakenHoldout.cs +++ b/Projectiles/Ranged/FlakKrakenHoldout.cs @@ -134,8 +134,6 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/FlakKrakenShoot") { Volume = 0.6f }, GunTipPosition); } - - NetUpdate(); } // When it has shot all the projectiles in the burst, reset all the variables and back to shooting. @@ -143,7 +141,6 @@ namespace CalamityMod.Projectiles.Ranged { ShootingTimer = 0f; TimerBetweenBursts = 0f; - NetUpdate(); } } @@ -155,12 +152,5 @@ namespace CalamityMod.Projectiles.Ranged base.OnSpawn(source); FrontArmStretch = Player.CompositeArmStretchAmount.ThreeQuarters; } - - public void NetUpdate() - { - Projectile.netUpdate = true; - if (Projectile.netSpam >= 10) - Projectile.netSpam = 9; - } } } diff --git a/Projectiles/Ranged/FlakToxicannonHoldout.cs b/Projectiles/Ranged/FlakToxicannonHoldout.cs index 05b47dfeeb..1bf6ce82a7 100644 --- a/Projectiles/Ranged/FlakToxicannonHoldout.cs +++ b/Projectiles/Ranged/FlakToxicannonHoldout.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Ranged } ShootingTimer = 0f; - Projectile.netUpdate = true; + } ShootingTimer++; diff --git a/Projectiles/Ranged/ScorpioHoldout.cs b/Projectiles/Ranged/ScorpioHoldout.cs index c18f942a5d..36669dd5f8 100644 --- a/Projectiles/Ranged/ScorpioHoldout.cs +++ b/Projectiles/Ranged/ScorpioHoldout.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged // It'll carry over to the projectiles that it shoots. public static int DustEffectsID { get; set; } public static Color EffectsColor { get; set; } - public static Color StaticEffectsColor = Color.Turquoise; + public static Color StaticEffectsColor { get; set; } = Color.Turquoise; public override void HoldoutAI() { @@ -58,7 +58,6 @@ namespace CalamityMod.Projectiles.Ranged { ShootingTimer = 0f; TimerBetweenBursts = 0f; - NetUpdate(); } } @@ -155,8 +154,6 @@ namespace CalamityMod.Projectiles.Ranged rocketType, projSpeed); - NetUpdate(); - // Inside here go all the things that dedicated servers shouldn't spend resources on. // Like visuals and sounds. if (Main.dedServ) @@ -195,13 +192,6 @@ namespace CalamityMod.Projectiles.Ranged GeneralParticleHandler.SpawnParticle(shootPulse); } - public void NetUpdate() - { - Projectile.netUpdate = true; - if (Projectile.netSpam >= 10) - Projectile.netSpam = 9; - } - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; diff --git a/Projectiles/Ranged/TheHiveHoldout.cs b/Projectiles/Ranged/TheHiveHoldout.cs index f2800e0a61..a282f52ad9 100644 --- a/Projectiles/Ranged/TheHiveHoldout.cs +++ b/Projectiles/Ranged/TheHiveHoldout.cs @@ -28,16 +28,16 @@ namespace CalamityMod.Projectiles.Ranged public static Color EffectsColor { get; set; } public static Color StaticEffectsColor { get; set; } = Color.Lime; - private ref float ShootingTimer => ref Projectile.ai[0]; - private ref float PostFireCooldown => ref Projectile.ai[1]; - private bool HasLetGo + public ref float ShootingTimer => ref Projectile.ai[0]; + public ref float PostFireCooldown => ref Projectile.ai[1]; + public bool HasLetGo { get => Projectile.ai[2] == 1f; set => Projectile.ai[2] = value == true ? 1f : 0f; } - private bool FireNuke => ShootingTimer > MaxCharge; - private SlotId HiveHum { get; set; } + public bool FireNuke => ShootingTimer > MaxCharge; + public SlotId HiveHum { get; set; } public override void KillHoldoutLogic() { @@ -57,7 +57,6 @@ namespace CalamityMod.Projectiles.Ranged if (HeldItem.type == ItemType()) ShootRocket(); HasLetGo = true; - NetUpdate(); } if (!HasLetGo) @@ -104,7 +103,7 @@ namespace CalamityMod.Projectiles.Ranged } } - private void ShootRocket() + public void ShootRocket() { // We use the velocity of this projectile as its direction vector. Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); @@ -175,8 +174,6 @@ namespace CalamityMod.Projectiles.Ranged PostFireCooldown = 30; } - NetUpdate(); - // Inside here go all the things that dedicated servers shouldn't spend resources on. // Like visuals and sounds. if (Main.dedServ) @@ -212,7 +209,7 @@ namespace CalamityMod.Projectiles.Ranged OffsetLengthFromArm -= FireNuke ? 16f : 6f; } - private void PostFiringCooldown() + public void PostFiringCooldown() { Owner.channel = true; if (PostFireCooldown > 0) @@ -229,21 +226,11 @@ namespace CalamityMod.Projectiles.Ranged else { if (SoundEngine.TryGetActiveSound(HiveHum, out var hum) && hum.IsPlaying) - { hum?.Stop(); - } Projectile.Kill(); - NetUpdate(); } } - private void NetUpdate() - { - Projectile.netUpdate = true; - if (Projectile.netSpam >= 10) - Projectile.netSpam = 9; - } - public override void OnSpawn(IEntitySource source) { base.OnSpawn(source); diff --git a/Projectiles/Ranged/WildfireBloomHoldout.cs b/Projectiles/Ranged/WildfireBloomHoldout.cs index cff7bfed63..dc4086d841 100644 --- a/Projectiles/Ranged/WildfireBloomHoldout.cs +++ b/Projectiles/Ranged/WildfireBloomHoldout.cs @@ -20,19 +20,16 @@ namespace CalamityMod.Projectiles.Ranged public override float BaseOffsetY => -5f; public override float OffsetYDownwards => 5f; - private ref float ShotCooldown => ref Projectile.ai[0]; - private ref float ShotsFired => ref Projectile.ai[1]; - private ref float ShootTimer => ref Projectile.ai[2]; + public ref float ShotCooldown => ref Projectile.ai[0]; + public ref float ShotsFired => ref Projectile.ai[1]; + public ref float ShootTimer => ref Projectile.ai[2]; public int FireBlobs { get; set; } public override void KillHoldoutLogic() { base.KillHoldoutLogic(); if (ShotsFired >= 16) - { Projectile.Kill(); - Projectile.netUpdate = true; - } } public override void HoldoutAI() @@ -58,8 +55,6 @@ namespace CalamityMod.Projectiles.Ranged } else FireBlobs--; - - Projectile.netUpdate = true; } else ShotCooldown--; From b16da521380c4fcc356eb2ee75f352531431f01a Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Thu, 16 May 2024 12:16:03 -0400 Subject: [PATCH 028/177] Bloodfire Arrow ignores the lifesteal cooldown --- Projectiles/Ranged/BloodfireArrowProj.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 822774e748..92725f50c7 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Ranged if (player.moonLeech) return; - if (Main.player[Main.myPlayer].lifeSteal <= 0f || target.lifeMax <= 5) + if (target.lifeMax <= 5) return; float lifeRatio = (float)player.statLife / player.statLifeMax2; From 52b9db58aab393b6fdf493cd51e80b14ff8961b5 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Thu, 16 May 2024 15:00:36 -0400 Subject: [PATCH 029/177] Added comment that SharpTears is Blood Thorn --- Items/CalamityGlobalItemTweaks.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 4b73cceaba..84cac6a50a 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -217,7 +217,7 @@ namespace CalamityMod.Items { ItemID.ShadowFlameBow, Do(PointBlank, DamageExact(55)) }, { ItemID.ShadowFlameHexDoll, Do(DamageExact(40), ShootSpeedExact(30)) }, { ItemID.ShadowFlameKnife, Do(DamageExact(70)) }, - { ItemID.SharpTears, Do(DamageExact(49)) }, + { ItemID.SharpTears, Do(DamageExact(49)) }, // Blood Thorn { ItemID.Shotgun, Do(PointBlank, DamageExact(36), AutoReuse) }, { ItemID.Shroomerang, Do(ShootSpeedExact(11)) }, { ItemID.SilverBullet, Do(DamageExact(8)) }, From 1ade3edb71f4409e14df142aa385e078549c0a31 Mon Sep 17 00:00:00 2001 From: Memes Date: Thu, 16 May 2024 22:59:04 +0200 Subject: [PATCH 030/177] Fixed Genesis in multiplayer. 1. Genesis Y-beam doesn't infinite proc chain anymore. 2. IMPORTANT: There's only one bug left where visually the Y-beam doesn't exist. 3. Fixed BaseGunHoldoutProjectile passing null values. --- Items/Weapons/Magic/Genesis.cs | 4 +- .../BaseGunHoldoutProjectile.cs | 12 ++-- Projectiles/Magic/GenesisBeam.cs | 58 +++++++++++-------- Projectiles/Magic/GenesisHoldout.cs | 26 ++++++--- 4 files changed, 61 insertions(+), 39 deletions(-) diff --git a/Items/Weapons/Magic/Genesis.cs b/Items/Weapons/Magic/Genesis.cs index 3574304c4f..9e3d003e4a 100644 --- a/Items/Weapons/Magic/Genesis.cs +++ b/Items/Weapons/Magic/Genesis.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public static float StarterWindup = 60f; public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetDefaults() { Item.width = 108; @@ -44,7 +45,8 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter); return false; } diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index f4605f3739..81c50e3baa 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -146,13 +146,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.netImportant = true; } - public override void OnSpawn(IEntitySource source) - { - Owner = Main.player[Projectile.owner]; - OffsetLengthFromArm = MaxOffsetLengthFromArm; - HeldItem = Owner.ActiveItem(); - Projectile.velocity = Owner.Calamity().mouseWorld - Owner.RotatedRelativePoint(Owner.MountedCenter); - } + public override void OnSpawn(IEntitySource source) => OffsetLengthFromArm = MaxOffsetLengthFromArm; public override bool ShouldUpdatePosition() => false; @@ -164,6 +158,10 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void AI() { + // Multiplayer null-checking. + Owner ??= Main.player[Projectile.owner]; + HeldItem ??= Owner.ActiveItem(); + KillHoldoutLogic(); ManageHoldout(); HoldoutAI(); diff --git a/Projectiles/Magic/GenesisBeam.cs b/Projectiles/Magic/GenesisBeam.cs index 9a2a2167fd..1a6f1196e0 100644 --- a/Projectiles/Magic/GenesisBeam.cs +++ b/Projectiles/Magic/GenesisBeam.cs @@ -2,7 +2,6 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic @@ -11,11 +10,17 @@ namespace CalamityMod.Projectiles.Magic { public new string LocalizationCategory => "Projectiles.Magic"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public ref float time => ref Projectile.ai[0]; - public ref float isSplit => ref Projectile.ai[1]; - public bool splitShot = false; - public Color mainColor = Color.MediumSlateBlue; + public ref float Time => ref Projectile.ai[0]; + public ref float IsSplit => ref Projectile.ai[1]; + public bool SplitShot + { + get => Projectile.ai[2] == 1f; + set => Projectile.ai[2] = value == true ? 1f : 0f; + } + + public Color MainColor { get; set; } = Color.MediumSlateBlue; + public override void SetDefaults() { Projectile.width = 12; @@ -29,47 +34,50 @@ namespace CalamityMod.Projectiles.Magic Projectile.extraUpdates = 75; Projectile.timeLeft = 20; } + public override void AI() { - if (isSplit == 0) + if (IsSplit == 0) + SplitShot = true; + + if (Time == 0) { - Projectile.netUpdate = true; - splitShot = true; - } - if (time == 0) - { - if (splitShot) + if (SplitShot) Projectile.penetrate = 1; else Projectile.timeLeft = 50; } - if (Projectile.timeLeft % 2 == 0 && (!splitShot && time > 2 || (splitShot && time > 3 && Projectile.timeLeft > 2))) + if (Projectile.timeLeft % 2 == 0 && (!SplitShot && Time > 2 || (SplitShot && Time > 3 && Projectile.timeLeft > 2))) { - Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 17, 0.06f, mainColor, new Vector2(0.5f, 1.3f)); + Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 17, 0.06f, MainColor, new Vector2(0.5f, 1.3f)); GeneralParticleHandler.SpawnParticle(spark); } Vector2 dustVel = new Vector2(2, 2).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.8f); Dust dust = Dust.NewDustPerfect(Projectile.Center + dustVel, Main.rand.NextBool(4) ? 264 : 66, dustVel, 0, default, Main.rand.NextFloat(0.9f, 1.2f)); dust.noGravity = true; - dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; + dust.color = Main.rand.NextBool() ? Color.Lerp(MainColor, Color.White, 0.5f) : MainColor; - time++; + Time++; } + public override void OnKill(int timeLeft) { int numProj = 2; float rotation = MathHelper.ToRadians(12); - if (splitShot) + if (SplitShot) { for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = Projectile.velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedSpeed, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 1f); + + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedSpeed, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 1f); + for (int k = 0; k < 3; k++) { - Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 0.4f, 35); + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, MainColor, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 0.4f, 35); GeneralParticleHandler.SpawnParticle(blastRing); Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.4f, 0.3f, 35); GeneralParticleHandler.SpawnParticle(blastRing2); @@ -81,7 +89,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 dustVel = new Vector2(13, 13).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.8f); Dust dust = Dust.NewDustPerfect(Projectile.Center + dustVel, Main.rand.NextBool(4) ? 264 : 66, dustVel, 0, default, Main.rand.NextFloat(0.9f, 1.2f)); dust.noGravity = true; - dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; + dust.color = Main.rand.NextBool() ? Color.Lerp(MainColor, Color.White, 0.5f) : MainColor; } } else @@ -91,13 +99,17 @@ namespace CalamityMod.Projectiles.Magic Vector2 dustVel = Projectile.velocity * Main.rand.NextFloat(0.1f, 1.5f); Dust dust = Dust.NewDustPerfect(Projectile.Center + dustVel + Main.rand.NextVector2Circular(6, 6), Main.rand.NextBool(4) ? 264 : 66, dustVel, 0, default, Main.rand.NextFloat(0.9f, 1.2f)); dust.noGravity = true; - dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; + dust.color = Main.rand.NextBool() ? Color.Lerp(MainColor, Color.White, 0.5f) : MainColor; } } + + Projectile.netSpam = 0; + Projectile.netUpdate = true; } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (splitShot) // This is the sweet spot + if (SplitShot) // This is the sweet spot { modifiers.SourceDamage *= 1.5f; @@ -108,7 +120,7 @@ namespace CalamityMod.Projectiles.Magic for (int k = 0; k < points; k++) { Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f * rotRando); - Particle subTrail = new GlowSparkParticle(Projectile.Center + velocity * 10.5f, velocity * 5, false, 10, 0.045f, mainColor, new Vector2(2, 0.4f), true); + Particle subTrail = new GlowSparkParticle(Projectile.Center + velocity * 10.5f, velocity * 5, false, 10, 0.045f, MainColor, new Vector2(2, 0.4f), true); GeneralParticleHandler.SpawnParticle(subTrail); } diff --git a/Projectiles/Magic/GenesisHoldout.cs b/Projectiles/Magic/GenesisHoldout.cs index 28276d0701..d0d83c08e1 100644 --- a/Projectiles/Magic/GenesisHoldout.cs +++ b/Projectiles/Magic/GenesisHoldout.cs @@ -41,8 +41,10 @@ namespace CalamityMod.Projectiles.Magic { if (ShootingTimer >= FireRate) { - if (Owner.CheckMana(Owner.ActiveItem(), -1, true, false)) + if (Owner.CheckMana(HeldItem, -1, true, false)) { + MaxFirerateShots++; + if (MaxFirerateShots == 6f) { FireYBeam = true; @@ -57,13 +59,16 @@ namespace CalamityMod.Projectiles.Magic else Shoot(false); - if (Windup > 10f && !FireYBeam) - Windup -= 12f; + ShootingTimer = 0f; + + if (Windup > 10f) + { + if (!FireYBeam) + Windup -= 12f; + } else Windup = 10f; - MaxFirerateShots++; - ShootingTimer = 0f; FireYBeam = false; } else @@ -91,7 +96,8 @@ namespace CalamityMod.Projectiles.Magic SoundStyle fire = new("CalamityMod/Sounds/Item/LanceofDestinyStrong"); SoundEngine.PlaySound(fire with { Volume = 0.35f, Pitch = 1f, PitchVariance = 0.15f }, Projectile.Center); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3, ModContent.ProjectileType(), Projectile.damage * 9, Projectile.knockBack, Projectile.owner, 0, 0); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3, ModContent.ProjectileType(), Projectile.damage * 9, Projectile.knockBack, Projectile.owner, 0, 0); Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, EffectsColor, new Vector2(1.7f, 0.8f), true); GeneralParticleHandler.SpawnParticle(pulse3); @@ -109,12 +115,16 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 4; i++) { firingVelocity3 = (shootDirection * 10).RotatedBy((0.05f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); + + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); } for (int i = 0; i < 4; i++) { firingVelocity3 = (shootDirection * 10).RotatedBy((-0.05f * (i + 1)) * Utils.GetLerpValue(0, 55, Windup, true)); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); + + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, firingVelocity3 * (1 - i * 0.1f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 1); } Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f, EffectsColor, new Vector2(1.7f, 0.8f), true); From 8343aeb488aef08ae6522ce4550f1353bdceff8f Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 16 May 2024 16:45:01 -0500 Subject: [PATCH 031/177] DoG targeting fix and fast turning while far away --- NPCs/DevourerofGods/DevourerofGodsHead.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 705f248c4c..9d5119195f 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -355,12 +355,10 @@ namespace CalamityMod.NPCs.DevourerofGods if (CalamityConfig.Instance.BossesStopWeather) CalamityMod.StopRain(); - // Get a target + // Get a target (time is checked in the second check to ensure a new target isn't being set constantly) if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + else if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles && Main.time % 60D == 0D) NPC.TargetClosest(); Player player = Main.player[NPC.target]; @@ -2354,6 +2352,10 @@ namespace CalamityMod.NPCs.DevourerofGods } } + // There is no escape... + if (NPC.Distance(player.Center) > 2400f) + NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; + // Calculate contact damage based on velocity float minimalContactDamageVelocity = segmentVelocity * 0.25f; float minimalDamageVelocity = segmentVelocity * 0.5f; From 44c5c1d669929303e47110a6a6bb583bc1aada57 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 16 May 2024 17:20:03 -0500 Subject: [PATCH 032/177] fixed hive mind p2 mp scrolling --- NPCs/HiveMind/HiveMind.cs | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 1e7dd9165a..fee10f41f3 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -270,8 +270,6 @@ namespace CalamityMod.NPCs.HiveMind if ((frameX * maxFramesY_Phase2) + frameY > 15) frameX = frameY = 0; } - - NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); } else { @@ -291,7 +289,7 @@ namespace CalamityMod.NPCs.HiveMind { SpriteEffects spriteEffects = NPC.direction == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; Texture2D texture = Phase2Texture.Value; - Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2); + Vector2 vector = new Vector2(NPC.width / 2, height_Phase2 / 2); Color afterimageBaseColor = Color.White; int numAfterimages = 5; @@ -303,15 +301,15 @@ namespace CalamityMod.NPCs.HiveMind afterimageColor = Color.Lerp(afterimageColor, afterimageBaseColor, 0.5f); afterimageColor = NPC.GetAlpha(afterimageColor); afterimageColor *= (numAfterimages - i) / 15f; - Vector2 afterimageCenter = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; + Vector2 afterimageCenter = NPC.oldPos[i] + new Vector2(NPC.width, height_Phase2) / 2f - screenPos; afterimageCenter -= new Vector2(texture.Width, texture.Height) / new Vector2(maxFramesX_Phase2, maxFramesY_Phase2) * NPC.scale / 2f; afterimageCenter += vector * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture, afterimageCenter, NPC.frame, afterimageColor, NPC.oldRot[i], vector, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, afterimageCenter, new Rectangle(NPC.width * frameX, height_Phase2 * frameY, NPC.width, height_Phase2), afterimageColor, NPC.oldRot[i], vector, NPC.scale, spriteEffects, 0f); } } Vector2 center = NPC.Center - screenPos; - spriteBatch.Draw(texture, center, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); + spriteBatch.Draw(texture, center, new Rectangle(NPC.width * frameX, height_Phase2 * frameY, NPC.width, height_Phase2), NPC.GetAlpha(drawColor), NPC.rotation, vector, NPC.scale, spriteEffects, 0f); return false; } @@ -349,12 +347,12 @@ namespace CalamityMod.NPCs.HiveMind while (NPC.AnyNPCs(type) && choice < 5); if (choice < 5) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(NPC.height), type); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(height_Phase2), type); } // Spawn a Hive Cyst if (Main.zenithWorld && NPC.CountNPCS(ModContent.NPCType()) < 3) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(NPC.height), ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.position.X + Main.rand.Next(NPC.width), (int)NPC.position.Y + Main.rand.Next(height_Phase2), ModContent.NPCType()); } private void ReelBack() @@ -778,7 +776,7 @@ namespace CalamityMod.NPCs.HiveMind if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[1] != 0f && NPC.ai[2] != 0f) { NPC.position.X = NPC.ai[1] * 16 - NPC.width / 2; - NPC.position.Y = NPC.ai[2] * 16 - NPC.height / 2; + NPC.position.Y = NPC.ai[2] * 16 - height_Phase2 / 2; } phase2timer = minimumDriftTime + Main.rand.Next(121); @@ -1010,7 +1008,7 @@ namespace CalamityMod.NPCs.HiveMind { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - Vector2 cloudSpawnPos = new Vector2(NPC.position.X + Main.rand.Next(NPC.width), NPC.position.Y + Main.rand.Next(NPC.height)); + Vector2 cloudSpawnPos = new Vector2(NPC.position.X + Main.rand.Next(NPC.width), NPC.position.Y + Main.rand.Next(height_Phase2)); Vector2 randomVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; Projectile.NewProjectile(NPC.GetSource_FromAI(), cloudSpawnPos, randomVelocity, type, damage, 0, Main.myPlayer, 11f); } @@ -1090,17 +1088,17 @@ namespace CalamityMod.NPCs.HiveMind public override void HitEffect(NPC.HitInfo hit) { - for (int k = 0; k < hit.Damage / NPC.lifeMax * 100.0; k++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); - // When Hive Mind starts flying around bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; + for (int k = 0; k < hit.Damage / NPC.lifeMax * 100.0; k++) + Dust.NewDust(NPC.position, NPC.width, phase2 ? height_Phase2 : NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); + if (phase2) { if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld ? NPC.CountNPCS(ModContent.NPCType()) < 10 : (Main.rand.NextBool(15) && NPC.CountNPCS(ModContent.NPCType()) < 2)) { - Vector2 spawnAt = NPC.Center + new Vector2(0f, NPC.height / 2f); + Vector2 spawnAt = NPC.Center + new Vector2(0f, height_Phase2 / 2f); NPC.NewNPC(NPC.GetSource_FromThis(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); } } @@ -1132,14 +1130,14 @@ namespace CalamityMod.NPCs.HiveMind } NPC.position.X = NPC.position.X + (NPC.width / 2); - NPC.position.Y = NPC.position.Y + (NPC.height / 2); + NPC.position.Y = NPC.position.Y + (height_Phase2 / 2); NPC.width = 200; NPC.height = 150; NPC.position.X = NPC.position.X - (NPC.width / 2); - NPC.position.Y = NPC.position.Y - (NPC.height / 2); + NPC.position.Y = NPC.position.Y - (height_Phase2 / 2); for (int i = 0; i < 40; i++) { - int killDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, 0f, 0f, 100, default, 2f); + int killDust = Dust.NewDust(NPC.position, NPC.width, height_Phase2, DustID.Demonite, 0f, 0f, 100, default, 2f); Main.dust[killDust].velocity *= 3f; if (Main.rand.NextBool()) { @@ -1149,10 +1147,10 @@ namespace CalamityMod.NPCs.HiveMind } for (int j = 0; j < 70; j++) { - int killDust2 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, 0f, 0f, 100, default, 3f); + int killDust2 = Dust.NewDust(NPC.position, NPC.width, height_Phase2, DustID.Demonite, 0f, 0f, 100, default, 3f); Main.dust[killDust2].noGravity = true; Main.dust[killDust2].velocity *= 5f; - killDust2 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, 0f, 0f, 100, default, 2f); + killDust2 = Dust.NewDust(NPC.position, NPC.width, height_Phase2, DustID.Demonite, 0f, 0f, 100, default, 2f); Main.dust[killDust2].velocity *= 2f; } } From 44a11cc90cf7549d5f811948902182a2d0ae9796 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 16 May 2024 17:23:41 -0500 Subject: [PATCH 033/177] Nullification Pistol and Molecluar Manipulator effects no longer work if a boss is alive --- Projectiles/Ranged/NullShot.cs | 5 +++-- Projectiles/Ranged/NullShot2.cs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index b0b6881f10..2a4eeb7c48 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.CalPlayer; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -43,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses) { return; } diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index 7342465df3..1b20a22fa1 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.CalPlayer; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -44,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target.type == NPCID.TargetDummy) + if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses) { return; } From 6560e30859950ddabbbe10ad5e81823679de616f Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 16 May 2024 17:28:33 -0500 Subject: [PATCH 034/177] aquatic scourge specific immunity since it's not considered a boss while it's not aggroed --- Projectiles/Ranged/NullShot.cs | 3 ++- Projectiles/Ranged/NullShot2.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index 2a4eeb7c48..e7b444bcb3 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using Terraria; @@ -44,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses) + if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) { return; } diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index 1b20a22fa1..dfcc271c29 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses) + if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) { return; } From bf9d8ac229fb505cf8f3ce4cc0f7698cb59e9d67 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 17 May 2024 01:22:51 -0400 Subject: [PATCH 035/177] After some thought, Nullification Pistol's effects EXCEPT scale work while a boss is alive again Scale was the only effect that was truly broken at all with bosses using this thing. Removing the rest of the weapon's gimmick for bosses feels very awkward and unsatisfying. Personally I'm in the camp that that the scale really should be considered a feature too but that is beyond my jurisdiction at this point. --- Projectiles/Ranged/NullShot.cs | 64 +++++++++++++-------------- Projectiles/Ranged/NullShot2.cs | 78 ++++++++++++++++----------------- 2 files changed, 70 insertions(+), 72 deletions(-) diff --git a/Projectiles/Ranged/NullShot.cs b/Projectiles/Ranged/NullShot.cs index e7b444bcb3..2ec483b36b 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -45,44 +45,44 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) + if (target.type == NPCID.TargetDummy) { return; } - int nullBuff = Main.rand.Next(7); + + int randAmt = (CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) ? 6 : 8; + int nullBuff = Main.rand.Next(randAmt); if (!target.boss) { - if (nullBuff == 0) + switch (nullBuff) { - target.scale *= 2f; - } - else if (nullBuff == 1) - { - target.scale *= 0.5f; - } - else if (nullBuff == 2 && target.type != ModContent.NPCType()) - { - target.damage += 10; - } - else if (nullBuff == 3) - { - target.damage -= 10; - } - else if (nullBuff == 4) - { - target.knockBackResist = 0f; - } - else if (nullBuff == 5) - { - target.knockBackResist = 1f; - } - else if (nullBuff == 6) - { - target.defense += 5; - } - else - { - target.defense -= 5; + case 0: + if (target.type != ModContent.NPCType()) + target.damage += 10; + break; + case 1: + target.damage -= 10; + break; + case 2: + target.knockBackResist = 0f; + break; + case 3: + target.knockBackResist = 1f; + break; + case 4: + target.defense += 5; + break; + case 5: + target.defense -= 5; + break; + case 6: + target.scale *= 2f; + break; + case 7: + target.scale *= 0.5f; + break; + default: + break; } } } diff --git a/Projectiles/Ranged/NullShot2.cs b/Projectiles/Ranged/NullShot2.cs index dfcc271c29..d24185b9d0 100644 --- a/Projectiles/Ranged/NullShot2.cs +++ b/Projectiles/Ranged/NullShot2.cs @@ -45,52 +45,50 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target.type == NPCID.TargetDummy || CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) + if (target.type == NPCID.TargetDummy) { return; } - int nullBuff = Main.rand.Next(10); + + int randAmt = (CalamityPlayer.areThereAnyDamnBosses || CalamityLists.AquaticScourgeIDs.Contains(target.type)) ? 8 : 10; + int nullBuff = Main.rand.Next(randAmt); if (!target.boss) { - if (nullBuff == 0) + switch (nullBuff) { - target.scale *= 5f; - } - else if (nullBuff == 1) - { - target.scale *= 0.1f; - } - else if (nullBuff == 2 && target.type != ModContent.NPCType()) - { - target.damage += 20; - } - else if (nullBuff == 3) - { - target.damage -= 20; - } - else if (nullBuff == 4) - { - target.knockBackResist = 0f; - } - else if (nullBuff == 5) - { - target.knockBackResist = 1f; - } - else if (nullBuff == 6) - { - target.defense += 10; - } - else if (nullBuff == 7) - { - target.defense -= 10; - } - else if (nullBuff == 8) - { - target.velocity.Y = Main.rand.NextBool() ? 30f : -30f; - } - else - { - target.velocity.X = Main.rand.NextBool() ? 30f : -30f; + case 0: + if (target.type != ModContent.NPCType()) + target.damage += 20; + break; + case 1: + target.damage -= 20; + break; + case 2: + target.knockBackResist = 0f; + break; + case 3: + target.knockBackResist = 1f; + break; + case 4: + target.defense += 10; + break; + case 5: + target.defense -= 10; + break; + case 6: + target.velocity.Y = Main.rand.NextBool() ? 30f : -30f; + break; + case 7: + target.velocity.X = Main.rand.NextBool() ? 30f : -30f; + break; + case 8: + target.scale *= 5f; + break; + case 9: + target.scale *= 0.1f; + break; + default: + break; } } } From 3c695f1246e99971a7cd192c2bbdba4aed8435fa Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 17 May 2024 16:42:03 +0700 Subject: [PATCH 036/177] Glorious End recode :bug: hopefully fixes a slew of issues it used to have at least in singleplayer idk about mp --- Items/Weapons/Magic/GloriousEnd.cs | 2 + Projectiles/Magic/MeteorStar.cs | 162 ++++++++++------------------- 2 files changed, 57 insertions(+), 107 deletions(-) diff --git a/Items/Weapons/Magic/GloriousEnd.cs b/Items/Weapons/Magic/GloriousEnd.cs index 29c4d96f19..59db80cd1d 100644 --- a/Items/Weapons/Magic/GloriousEnd.cs +++ b/Items/Weapons/Magic/GloriousEnd.cs @@ -31,5 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; } } diff --git a/Projectiles/Magic/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs index e123f24b7b..c2292cb1bb 100644 --- a/Projectiles/Magic/MeteorStar.cs +++ b/Projectiles/Magic/MeteorStar.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -10,6 +11,8 @@ namespace CalamityMod.Projectiles.Magic public class MeteorStar : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; + public Player Owner => Main.player[Projectile.owner]; + public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; @@ -22,128 +25,80 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 42; Projectile.height = 34; Projectile.friendly = true; + Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; Projectile.timeLeft = 361; } public override void AI() { - Player player = Main.player[Projectile.owner]; - bool flippedGravity = player.gravDir == -1f; - Projectile.frameCounter++; - if (Projectile.frameCounter > 6) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame >= Main.projFrames[Projectile.type]) - { - Projectile.frame = 0; - } - - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.15f / 255f); + Projectile.frame = Projectile.frameCounter / 6 % Main.projFrames[Projectile.type]; + Color LightYellow = new Color(255, 255, 76); + Lighting.AddLight(Projectile.Center, LightYellow.ToVector3() * Projectile.Opacity * 0.5f); bool explodingSoon = Projectile.timeLeft <= 120; if (Projectile.soundDelay <= 0) { - Projectile.soundDelay = 30 + Main.rand.Next(40); - if (explodingSoon) - Projectile.soundDelay -= 30; - if (Main.rand.NextBool(10) || explodingSoon) - { + Projectile.soundDelay = 30 + Main.rand.Next(explodingSoon ? 10 : 40); + if (Main.rand.NextBool(4) || explodingSoon) SoundEngine.PlaySound(SoundID.Item9, Projectile.Center); - } } - if ((Main.rand.NextBool(20) || explodingSoon) && Main.rand.NextBool(3) && Main.netMode != NetmodeID.Server) + if ((Main.rand.NextBool(12) || (explodingSoon && Main.rand.NextBool(3))) && Main.netMode != NetmodeID.Server) { - int idx = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, Projectile.velocity * 0.2f, Main.rand.Next(16, 18), 1f); - Main.gore[idx].velocity *= 0.66f; - Main.gore[idx].velocity += Projectile.velocity * 0.3f; + Gore star = Gore.NewGoreDirect(Projectile.GetSource_FromAI(), Projectile.Center, Projectile.velocity * 0.2f, Main.rand.Next(16, 18), 1f); + star.velocity *= 0.66f; + star.velocity += Projectile.velocity * 0.3f; } if (explodingSoon) { for (int i = 0; i < 3; i++) { - int smoke = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[smoke]; - dust.velocity *= 0.3f; - dust.position.X = Projectile.Center.X + 4f + Main.rand.NextFloat(-6f, 6f); - dust.position.Y = Projectile.Center.Y + Main.rand.NextFloat(-6f, 6f); - dust.noGravity = true; + Dust smoke = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 2f); + smoke.velocity *= 0.3f; + smoke.position.X = Projectile.Center.X + 4f + Main.rand.NextFloat(-6f, 6f); + smoke.position.Y = Projectile.Center.Y + Main.rand.NextFloat(-6f, 6f); + smoke.noGravity = true; } } if (Main.myPlayer == Projectile.owner) { - if (player.channel) + // Initialize position + if (Projectile.ai[2] != 1f) { - float speed = 14f; - float mouseDistX = (float)Main.mouseX + Main.screenPosition.X - Projectile.Center.X; - float mouseDistY = (float)Main.mouseY + Main.screenPosition.Y - Projectile.Center.Y; - if (player.gravDir == -1f) - { - mouseDistY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - Projectile.Center.Y; - } - Vector2 mouseVec = new Vector2(mouseDistX, mouseDistY); - float mouseDist = mouseVec.Length(); - if (mouseDist > speed) - { - mouseDist = speed / mouseDist; - mouseVec.X *= mouseDist; - mouseVec.Y *= mouseDist; - int mouseSpeedX = (int)(mouseVec.X * 1000f); - int projSpeedX = (int)(Projectile.velocity.X * 1000f); - int mouseSpeedY = (int)(mouseVec.Y * 1000f); - int projSpeedY = (int)(Projectile.velocity.Y * 1000f); - if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) - { - Projectile.netUpdate = true; - } - Projectile.velocity.X = mouseVec.X; - Projectile.velocity.Y = mouseVec.Y; - } + if (Owner.gravDir == -1f) + Projectile.Center = Owner.Top; else - { - int mouseSpeedX = (int)(mouseVec.X * 1000f); - int projSpeedX = (int)(Projectile.velocity.X * 1000f); - int mouseSpeedY = (int)(mouseVec.Y * 1000f); - int projSpeedY = (int)(Projectile.velocity.Y * 1000f); - if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) - { - Projectile.netUpdate = true; - } - Projectile.velocity.X = mouseVec.X; - Projectile.velocity.Y = mouseVec.Y; - } - player.ChangeDir((int)Projectile.velocity.X); - player.velocity = Projectile.velocity; - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - player.velocity.Y = 16f; - } - if (player.mount != null) - { - player.mount.Dismount(player); - } - if (!flippedGravity) - player.Bottom = Projectile.Center; + Projectile.Center = Owner.Bottom; + + Projectile.ai[2] = 1f; + Projectile.netUpdate = true; + Projectile.netSpam = 0; + } + if (Owner.channel) + { + Owner.mount?.Dismount(Owner); + Owner.RemoveAllGrapplingHooks(); + + Projectile.velocity = Owner.SafeDirectionTo(Owner.Calamity().mouseWorld) * 14f; + Owner.velocity = Projectile.velocity; + Owner.ChangeDir(Math.Sign(Projectile.velocity.X) <= 0 ? -1 : 1); + + // Move the player to the projectile, allowing them to bypass platforms + if (Owner.gravDir == -1f) + Owner.Top = Projectile.Center; else - player.Top = Projectile.Center; + Owner.Bottom = Projectile.Center; } else - { Explode(true); - } } - Projectile.tileCollide = Projectile.velocity != Vector2.Zero && ++Projectile.ai[0] >= 5f; - // Die immediately if the owner of this projectile is clipping into tiles because of its movement. - if (Collision.SolidCollision(player.position, player.width, player.height) && Projectile.velocity != Vector2.Zero) + if (Collision.SolidCollision(Owner.position, Owner.width, Owner.height) && Projectile.velocity != Vector2.Zero) { - player.velocity.Y = 0f; + Owner.velocity.Y = 0f; Explode(); } @@ -155,27 +110,14 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitPlayer(Player target, Player.HurtInfo info) => Explode(); - public override bool OnTileCollide(Vector2 oldVelocity) - { - Explode(); - return base.OnTileCollide(oldVelocity); - } - public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); // Draw the main texture in fullbright Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - - int frameHeight = texture.Height / Main.projFrames[Projectile.type]; - int frameY = frameHeight * Projectile.frame; - float scale = Projectile.scale; - float rotation = Projectile.rotation; - - Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); - Vector2 origin = rectangle.Size() / 2f; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), rectangle, Color.White, rotation, origin, scale, SpriteEffects.None, 0); + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } @@ -191,12 +133,12 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 10; i++) { - int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.2f); - Main.dust[idx].velocity *= 3f; + Dust smoke = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.2f); + smoke.velocity *= 3f; if (Main.rand.NextBool()) { - Main.dust[idx].scale = 0.5f; - Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + smoke.scale = 0.5f; + smoke.fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } if (Main.netMode != NetmodeID.Server) @@ -208,5 +150,11 @@ namespace CalamityMod.Projectiles.Magic } Projectile.Kill(); } + + public override void OnKill(int timeLeft) + { + Owner.velocity *= 0.8f; + Owner.fullRotation = 0f; + } } } From 7f42947c5530440af4ee3bb8c08f67cc79f89df5 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Fri, 17 May 2024 17:22:28 +0700 Subject: [PATCH 037/177] Deliverance displacement fix not reworking it in a hotfix but tempting ngl --- Projectiles/Typeless/RelicOfDeliveranceSpear.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Projectiles/Typeless/RelicOfDeliveranceSpear.cs b/Projectiles/Typeless/RelicOfDeliveranceSpear.cs index d8d5974075..1c2161af35 100644 --- a/Projectiles/Typeless/RelicOfDeliveranceSpear.cs +++ b/Projectiles/Typeless/RelicOfDeliveranceSpear.cs @@ -176,11 +176,8 @@ namespace CalamityMod.Projectiles.Typeless // Adjust the player's held projectile type. if (player.heldProj == -1) player.heldProj = Projectile.whoAmI; - if (player.mount != null) - { - player.mount.Dismount(player); - } - player.ChangeDir((int)Projectile.velocity.X); + player.mount?.Dismount(player); + player.ChangeDir(Math.Sign(Projectile.velocity.X) <= 0 ? -1 : 1); // Generate dust if (Projectile.ai[0] % DustSpawnInterval == DustSpawnInterval - 1f) { From 458248868d315eec94f9c0ce065df6219dcb37ca Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 12:43:51 +0200 Subject: [PATCH 038/177] Somewhat fixed visual bug with Genesis' beam. --- Projectiles/Magic/GenesisBeam.cs | 34 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Projectiles/Magic/GenesisBeam.cs b/Projectiles/Magic/GenesisBeam.cs index 1a6f1196e0..1290158ebd 100644 --- a/Projectiles/Magic/GenesisBeam.cs +++ b/Projectiles/Magic/GenesisBeam.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ModLoader; +using Terraria.WorldBuilding; namespace CalamityMod.Projectiles.Magic { @@ -31,7 +32,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 31; Projectile.penetrate = -1; - Projectile.extraUpdates = 75; + Projectile.extraUpdates = 10; Projectile.timeLeft = 20; } @@ -48,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.timeLeft = 50; } - if (Projectile.timeLeft % 2 == 0 && (!SplitShot && Time > 2 || (SplitShot && Time > 3 && Projectile.timeLeft > 2))) + if (Projectile.timeLeft < (SplitShot ? 20 : 50)) { Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 17, 0.06f, MainColor, new Vector2(0.5f, 1.3f)); GeneralParticleHandler.SpawnParticle(spark); @@ -74,14 +75,14 @@ namespace CalamityMod.Projectiles.Magic if (Main.myPlayer == Projectile.owner) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedSpeed, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 1f); + } - for (int k = 0; k < 3; k++) - { - Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, MainColor, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 0.4f, 35); - GeneralParticleHandler.SpawnParticle(blastRing); - Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.4f, 0.3f, 35); - GeneralParticleHandler.SpawnParticle(blastRing2); - } + for (int k = 0; k < 3; k++) + { + Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, MainColor, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 0.4f, 35); + GeneralParticleHandler.SpawnParticle(blastRing); + Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.4f, 0.3f, 35); + GeneralParticleHandler.SpawnParticle(blastRing2); } for (int i = 0; i < 20; i++) @@ -107,12 +108,10 @@ namespace CalamityMod.Projectiles.Magic Projectile.netUpdate = true; } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + public void OnHitEffects() { if (SplitShot) // This is the sweet spot { - modifiers.SourceDamage *= 1.5f; - int points = 10; float radians = MathHelper.TwoPi / points; Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)); @@ -127,6 +126,17 @@ namespace CalamityMod.Projectiles.Magic SoundStyle fire = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeImpact"); SoundEngine.PlaySound(fire with { Volume = 1.25f, Pitch = 0.4f, PitchVariance = 0.15f }, Projectile.Center); } + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(); + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (SplitShot) + modifiers.SourceDamage *= 1.5f; + if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.95f); if (Projectile.damage < 1) From 8378f2a9f070bb76422159aff19929c771c22988 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Fri, 17 May 2024 03:54:10 -0700 Subject: [PATCH 039/177] BR monolith item sprite crop --- .../Furniture/Monoliths/BossRushMonolith.png | Bin 500 -> 281 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Items/Placeables/Furniture/Monoliths/BossRushMonolith.png b/Items/Placeables/Furniture/Monoliths/BossRushMonolith.png index d00e2fd3043f23ef3d7e53400aa8a42a707308ee..700f5dca6d70d866ca0fc8bffc042f0549031d60 100644 GIT binary patch delta 267 zcmeyuJd5)K+y(Gvl_&*phNO?260fjgVJR*x382Ao@ zFyrz36)8Z$Do+>35DWjc7XtYj>J@mHFZ7DOuTRlz<^LJr7Skm8t#x6UZt7aM+uGb` z?ws{n{ZWZiVz)a(eS@b_gS^LwJSy!uVfF?L>-1jS9xyg+rJVn;BdBM zz3837z9Dplpm5ilhM;GrjZ@z+9Ftk7yp?&&``5Az=Bv!OZb}(2O$0iF!PC{xg=L*n GLK6V~6kPKF delta 487 zcmVPx$u1Q2eR9J=WmS0Q5 zFcigqoldMym{XCW56YaNhzP#uo8kxXlM6+}2T|C|D6_g1Et|SxeMqmG*ouE?#hsTl zH}{5|lhY(H#1Q`-)@KV2_6`B4R>uGcf`|C^xPN(LC9PKHU4I>=&R6>E0)85!A5F|+ zzO^+2fa_iZ;9uUvM(MjM{~ZMcCUZe`VIBad-vPk8=xO85?6!&iA3?Y%Hw z-CP0S?D+gw7Jrbx0{uZB0K06by4++QwAuhPQ750c|EtJf0r}`AXZZ5U8URgS#f7n) z^)Giol;r6@lFVabY+P|Q?}YpnxQmnr$|c(Z2wLqJ-ZFMweeVUPLIS5gq4m9sUJNik zIbs1gC?)b&;I=aWV5+80z|#};vRO|Ogt0I*T`%LJgkX3`AaUxd5hW_qWeW Date: Fri, 17 May 2024 14:54:24 +0200 Subject: [PATCH 040/177] Fixed Omicron in multiplayer. 1. LOTS OF SYNCING. 2. Cleand-up some code. 3. Appears now for other multiplayer clients. --- Items/Weapons/Magic/Omicron.cs | 14 ++- Projectiles/Magic/OmicronBeam.cs | 38 ++++++-- Projectiles/Magic/OmicronHoldout.cs | 10 +- Projectiles/Magic/OmicronWingman.cs | 138 +++++++++++++--------------- Projectiles/Magic/WingmanGrenade.cs | 90 ++++++++++-------- 5 files changed, 164 insertions(+), 126 deletions(-) diff --git a/Items/Weapons/Magic/Omicron.cs b/Items/Weapons/Magic/Omicron.cs index 010a7b2f7e..2f5274a96d 100644 --- a/Items/Weapons/Magic/Omicron.cs +++ b/Items/Weapons/Magic/Omicron.cs @@ -1,4 +1,6 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer; +using CalamityMod.DataStructures; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -14,6 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic { public static float FireRate = 15f; public static float StarterWinup = 60f; + public static float WingmanFireRate = 10f; public new string LocalizationCategory => "Items.Weapons.Magic"; @@ -40,7 +43,14 @@ namespace CalamityMod.Items.Weapons.Magic public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.ownedProjectileCounts[ModContent.ProjectileType()] < 2; // Makes the rotation of the mouse around the player sync in multiplayer. - public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + public override void HoldItem(Player player) + { + CalamityPlayer calPlayer = player.Calamity(); + calPlayer.mouseWorldListener = true; + calPlayer.mouseRotationListener = true; + calPlayer.rightClickListener = true; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { for (int i = 0; i < 2; i++) diff --git a/Projectiles/Magic/OmicronBeam.cs b/Projectiles/Magic/OmicronBeam.cs index e281affc55..2c12781212 100644 --- a/Projectiles/Magic/OmicronBeam.cs +++ b/Projectiles/Magic/OmicronBeam.cs @@ -1,8 +1,8 @@ -using CalamityMod.Particles; +using System.IO; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic @@ -11,13 +11,17 @@ namespace CalamityMod.Projectiles.Magic { public new string LocalizationCategory => "Projectiles.Magic"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; - - public Color mainColor = Color.MediumVioletRed; - public bool HitDirect = false; - public ref float isSplit => ref Projectile.ai[1]; - public bool splitShot = false; + public bool splitShot + { + get => Projectile.ai[2] == 1f; + set => Projectile.ai[2] = value == true ? 1f : 0f; + } + public bool HitDirect { get; set; } + public Color mainColor { get; set; } = Color.MediumVioletRed; + public override void SetDefaults() { Projectile.width = 50; @@ -31,21 +35,25 @@ namespace CalamityMod.Projectiles.Magic Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 91; } + public override void AI() { if (isSplit == 0) { + Projectile.netSpam = 0; Projectile.netUpdate = true; splitShot = true; } Player Owner = Main.player[Projectile.owner]; float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (Projectile.timeLeft % 2 == 0 && time > 2 && targetDist < 1400f) { Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.05f, false, 25, MathHelper.Clamp(0.34f - time * 0.07f, 0.085f, 0.34f), mainColor, new Vector2(0.5f, 1.3f)); GeneralParticleHandler.SpawnParticle(spark); } + if (Main.rand.NextBool()) { Vector2 trailPos = Projectile.Center; @@ -53,13 +61,21 @@ namespace CalamityMod.Projectiles.Magic Particle Trail = new SparkParticle(trailPos, Projectile.velocity * Main.rand.NextFloat(0.2f, 0.9f), false, Main.rand.Next(40, 50 + 1), trailScale, mainColor); GeneralParticleHandler.SpawnParticle(Trail); } + Vector2 dustVel = new Vector2(2, 2).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.8f); Dust dust = Dust.NewDustPerfect(Projectile.Center + dustVel, Main.rand.NextBool(4) ? 264 : 66, dustVel, 0, default, Main.rand.NextFloat(0.9f, 1.2f)); dust.noGravity = true; dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; time++; + + if (Projectile.numUpdates == 1) + { + Projectile.netSpam = 0; + Projectile.netUpdate = true; + } } + public override void OnKill(int timeLeft) { int numProj = 2; @@ -98,18 +114,21 @@ namespace CalamityMod.Projectiles.Magic dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; } } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (splitShot && time > 7 && !HitDirect) Projectile.Kill(); Player Owner = Main.player[Projectile.owner]; + for (int i = 0; i <= 8; i++) { Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(4) ? 264 : 66, (Projectile.velocity.SafeNormalize(Vector2.UnitY) * 15f).RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(1.2f, 1.6f)); dust.noGravity = true; dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; } + if (time <= 7 && splitShot) // This is the sweet spot { modifiers.SourceDamage *= 5; @@ -144,6 +163,11 @@ namespace CalamityMod.Projectiles.Magic HitDirect = true; } } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, time <= 7 ? 90 : 20, targetHitbox); + + public override void SendExtraAI(BinaryWriter writer) => writer.Write(HitDirect); + + public override void ReceiveExtraAI(BinaryReader reader) => HitDirect = reader.ReadBoolean(); } } diff --git a/Projectiles/Magic/OmicronHoldout.cs b/Projectiles/Magic/OmicronHoldout.cs index 9a73374df0..9d3aef3fb7 100644 --- a/Projectiles/Magic/OmicronHoldout.cs +++ b/Projectiles/Magic/OmicronHoldout.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Magic; +using System.IO; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; @@ -90,9 +91,6 @@ namespace CalamityMod.Projectiles.Magic public void Shoot(bool yBeam) { Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero); - - // Spawns the projectile. - Vector2 firingVelocity1 = (shootDirection * 8).RotatedBy(0.1f * Utils.GetLerpValue(10, 55, Windup, true)); Vector2 firingVelocity2 = (shootDirection * 8).RotatedBy(-0.1f * Utils.GetLerpValue(10, 55, Windup, true)); Vector2 firingVelocity3 = (shootDirection * 10); @@ -175,5 +173,9 @@ namespace CalamityMod.Projectiles.Magic ShootingTimer = 0; PostFireCooldown--; } + + public override void SendExtraAIHoldout(BinaryWriter writer) => writer.Write(Windup); + + public override void ReceiveExtraAIHoldout(BinaryReader reader) => Windup = reader.ReadSingle(); } } diff --git a/Projectiles/Magic/OmicronWingman.cs b/Projectiles/Magic/OmicronWingman.cs index a932b15d32..9b830bea2a 100644 --- a/Projectiles/Magic/OmicronWingman.cs +++ b/Projectiles/Magic/OmicronWingman.cs @@ -1,19 +1,16 @@ using System; +using System.Collections.Generic; +using System.IO; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; -using Humanizer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using System.Collections.Generic; -using System.IO; -using CalamityMod.Graphics.Renderers; namespace CalamityMod.Projectiles.Magic { @@ -26,7 +23,6 @@ namespace CalamityMod.Projectiles.Magic private ref float ShootingTimer => ref Projectile.ai[0]; private float FiringTime = 10; private float PostFireCooldown = 0; - private Vector2 MovementOffset; public bool MovingUp = true; public float xOffset = 1; public float yOffset = 0; @@ -42,45 +38,48 @@ namespace CalamityMod.Projectiles.Magic public bool recharging = false; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 9; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + public override void SetDefaults() { Projectile.width = Projectile.height = 142; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.netImportant = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; Projectile.hide = true; } public override void AI() { + Owner ??= Main.player[Projectile.owner]; + if (time > 1 && Owner.ownedProjectileCounts[ModContent.ProjectileType()] < 1 && PostFireCooldown <= 0) Projectile.Kill(); + Lighting.AddLight(Projectile.Center, StaticEffectsColor.ToVector3() * 0.2f); + if (time == 0) - { - MovingUp = Projectile.ai[2] == 1 ? true : false; - } + MovingUp = Projectile.ai[2] == 1; + firingDelay--; Item heldItem = Owner.ActiveItem(); // Update damage based on curent magic damage stat (so Mana Sickness affects it) Projectile.damage = heldItem is null ? 0 : Owner.GetWeaponDamage(heldItem); - Vector2 tipPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(-0.05f * Projectile.direction) * 12f; // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. if (PostFireCooldown == 0 && launchDelay == 0 && Owner.CantUseHoldout() || heldItem.type != ModContent.ItemType()) { - NetUpdate(); if (PostFireCooldown <= 0) Projectile.Kill(); } if (PostFireCooldown > 0) - { PostFiringCooldown(); - } if (launchDelay > 0 || (PostFireCooldown <= 0 && (Owner.Calamity().mouseRight || (firingDelay <= 0 && Projectile.ai[2] == 1 || Projectile.ai[2] == -1)))) { @@ -89,10 +88,10 @@ namespace CalamityMod.Projectiles.Magic { if (launchDelay < 50) launchDelay++; - + if (launchDelay >= 50 && (Owner.CheckMana(Owner.ActiveItem(), (int)(heldItem.mana * Owner.manaCost) * 2, true, false))) { - Shoot(heldItem, true); + Shoot(true); PostFireCooldown = 50; ShootingTimer = 0; launchDelay = 0; @@ -102,13 +101,11 @@ namespace CalamityMod.Projectiles.Magic { if (Owner.CheckMana(Owner.ActiveItem(), -1, false, false)) { - Shoot(heldItem, false); + Shoot(false); ShootingTimer = 0; } else if (PostFireCooldown <= 0) - { Projectile.Kill(); - } } } @@ -119,7 +116,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 ownerToMouse = Owner.Calamity().mouseWorld - ownerPosition; // Deals with the holdout's rotation and direction, the owner's arms, etc. - ManageHoldout(ownerPosition, ownerToMouse); + ManagePlayerProjectileMembers(ownerToMouse); // When we change the distance of the gun from the arms for the recoil, // recover to the original position smoothly. @@ -127,82 +124,66 @@ namespace CalamityMod.Projectiles.Magic OffsetLength = MathHelper.Lerp(OffsetLength, MaxOffsetLength, 0.1f); ShootingTimer++; - - // Inside here go all the things that dedicated servers shouldn't spend resources on. - // Like visuals and sounds. - if (Main.dedServ) - return; - - Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero) * 20; time++; Projectile.soundDelay--; + + Projectile.netSpam = 0; + Projectile.netUpdate = true; } - private void ManageHoldout(Vector2 mountedCenter, Vector2 ownerToMouse) + private void ManagePlayerProjectileMembers(Vector2 ownerToMouse) { Vector2 rotationVector = Projectile.rotation.ToRotationVector2(); float velocityRotation = Projectile.velocity.ToRotation(); - float proximityLookingUpwards = Vector2.Dot(ownerToMouse.SafeNormalize(Vector2.Zero), -Vector2.UnitY); int direction = MathF.Sign(ownerToMouse.X); - - Vector2 armPosition = Owner.RotatedRelativePoint(mountedCenter, true); Vector2 lengthOffset = rotationVector * OffsetLength; - Vector2 armOffset = new Vector2(Utils.Remap(proximityLookingUpwards, -1f, 1f, 0f, -12f) * direction, -10f + Utils.Remap(MathF.Abs(proximityLookingUpwards), 0f, 1f, 0f, proximityLookingUpwards > 0f ? 15f : 0f)); if (time % 30 == 0) - { MovingUp = !MovingUp; - } //xOffset = MathHelper.Lerp(xOffset, placementOffset.X, 0.01f); yOffset = MathHelper.Lerp(yOffset, 150 * (MovingUp ? -1 : 1), (0.085f - (FiringTime * 0.0012f))); Vector2 placementOffset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * (yOffset); - Vector2 location = Owner.MountedCenter + placementOffset; Projectile.Center = lengthOffset + location; - - Projectile.velocity = velocityRotation.AngleTowards(ownerToMouse.ToRotation(), 0.2f).ToRotationVector2(); - Projectile.rotation = (Main.MouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX).ToRotation(); + Projectile.rotation = (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX).ToRotation(); Projectile.timeLeft = 2; - - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = Owner.itemAnimation = 2; - Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); - Projectile.spriteDirection = Projectile.direction = direction; } - private void Shoot(Item item, bool isGrenade) + private void Shoot(bool isGrenade) { - Vector2 shootDirection = (Main.MouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX); + Vector2 shootDirection = (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX); // The position of the tip of the gun. Vector2 tipPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(-0.05f * Projectile.direction) * 12f; - // Spawns the projectile. - Vector2 firingVelocity = shootDirection * 10; if (isGrenade) { SoundStyle fire = new("CalamityMod/Sounds/Item/DeadSunExplosion"); SoundEngine.PlaySound(fire with { Volume = 0.2f, Pitch = -0.4f, PitchVariance = 0.2f }, Projectile.Center); - Projectile bomb = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage * 14, Projectile.knockBack * 5, Projectile.owner, 0, 2); - bomb.timeLeft = 530; - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * 1.2f, ModContent.ProjectileType(), Projectile.damage * 14, Projectile.knockBack * 5, Projectile.owner, 0, 2); + if (Main.myPlayer == Projectile.owner) + { + Projectile bomb = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage * 14, Projectile.knockBack * 5, Projectile.owner, 0, 2); + bomb.timeLeft = 530; + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * 1.2f, ModContent.ProjectileType(), Projectile.damage * 14, Projectile.knockBack * 5, Projectile.owner, 0, 2); + } } else { SoundStyle fire = new("CalamityMod/Sounds/Item/MagnaCannonShot"); SoundEngine.PlaySound(fire with { Volume = 0.25f, Pitch = 1f, PitchVariance = 0.35f }, Projectile.Center); - - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity.RotatedBy(-0.05) * 0.85f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity.RotatedBy(0.05) * 0.85f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); - } - NetUpdate(); + if (Main.myPlayer == Projectile.owner) + { + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity.RotatedBy(-0.05) * 0.85f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity.RotatedBy(0.05) * 0.85f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 2); + } + } // Inside here go all the things that dedicated servers shouldn't spend resources on. // Like visuals and sounds. @@ -218,6 +199,7 @@ namespace CalamityMod.Projectiles.Magic dust2.noGravity = true; dust2.color = Main.rand.NextBool() ? Color.Lerp(StaticEffectsColor, Color.White, 0.5f) : StaticEffectsColor; } + Particle pulse = new GlowSparkParticle((tipPosition - shootDirection * 14), shootDirection * 20, false, Main.rand.Next(7, 11 + 1), 0.035f, StaticEffectsColor, new Vector2(1.5f, 0.9f), true); GeneralParticleHandler.SpawnParticle(pulse); @@ -227,6 +209,7 @@ namespace CalamityMod.Projectiles.Magic else OffsetLength -= 5f; } + private void PostFiringCooldown() { Owner.channel = true; @@ -242,23 +225,13 @@ namespace CalamityMod.Projectiles.Magic dust.noGravity = false; dust.color = StaticEffectsColor; } + ShootingTimer = 0; firingDelay = 15; PostFireCooldown--; } - private void NetUpdate() - { - Projectile.netUpdate = true; - if (Projectile.netSpam >= 10) - Projectile.netSpam = 9; - } - - public override void OnSpawn(IEntitySource source) - { - Owner = Main.player[Projectile.owner]; - OffsetLength = MaxOffsetLength; - } + public override void OnSpawn(IEntitySource source) => OffsetLength = MaxOffsetLength; // Because we use the velocity as a direction, we don't need it to change its position. public override bool ShouldUpdatePosition() => false; @@ -270,8 +243,7 @@ namespace CalamityMod.Projectiles.Magic if (time <= 0) return false; - Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/Wingman").Value; - + Texture2D texture; if (Projectile.ai[2] == 1) texture = ModContent.Request("CalamityMod/Projectiles/Magic/OmicronWingman").Value; else @@ -291,9 +263,29 @@ namespace CalamityMod.Projectiles.Magic return false; } - public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) => behindNPCs.Add(index); + + public override void SendExtraAI(BinaryWriter writer) { - behindNPCs.Add(index); + writer.Write(Projectile.rotation); + writer.Write(Projectile.spriteDirection); + writer.Write(OffsetLength); + writer.Write(time); + writer.Write(firingDelay); + writer.Write(launchDelay); + writer.Write(MovingUp); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + Projectile.rotation = reader.ReadSingle(); + Projectile.spriteDirection = reader.ReadInt32(); + OffsetLength = reader.ReadSingle(); + time = reader.ReadInt32(); + firingDelay = reader.ReadInt32(); + launchDelay = reader.ReadInt32(); + MovingUp = reader.ReadBoolean(); } } } diff --git a/Projectiles/Magic/WingmanGrenade.cs b/Projectiles/Magic/WingmanGrenade.cs index fe6b7fb52a..d25fad5311 100644 --- a/Projectiles/Magic/WingmanGrenade.cs +++ b/Projectiles/Magic/WingmanGrenade.cs @@ -1,25 +1,31 @@ -using CalamityMod.Particles; -using CalamityMod.Projectiles.Summon; +using System.IO; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Magic { public class WingmanGrenade : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Magic"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public int BounceHits = 0; - public Color mainColor = Color.White; - public bool exploding = false; - public float sizeBonus = 1; + + public bool exploding + { + get => Projectile.ai[0] == 1f; + set => Projectile.ai[0] = value == true ? 1f : 0f; + } + public float sizeBonus { get; set; } = 1f; + public Color mainColor { get; set; } = Color.White; + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 14; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 14; + ProjectileID.Sets.TrailingMode[Type] = 2; } public override void SetDefaults() @@ -35,6 +41,8 @@ namespace CalamityMod.Projectiles.Magic Projectile.localNPCHitCooldown = -1; } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, exploding ? 120 * sizeBonus : 20 * sizeBonus, targetHitbox); + public override void AI() { if (mainColor == Color.White) @@ -60,8 +68,10 @@ namespace CalamityMod.Projectiles.Magic if (exploding) { Projectile.velocity = Vector2.Zero; + if (Projectile.timeLeft > 65) Projectile.timeLeft = 65; + if (Projectile.timeLeft == 65) { Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor, "CalamityMod/Particles/HighResHollowCircleHardEdge", Vector2.One, Main.rand.NextFloat(-10, 10), 0f, 0.12f * sizeBonus, 15); @@ -71,6 +81,7 @@ namespace CalamityMod.Projectiles.Magic SoundStyle fire = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeImpact"); SoundEngine.PlaySound(fire with { Volume = 1.25f, Pitch = -0.2f, PitchVariance = 0.15f }, Projectile.Center); } + if (Projectile.timeLeft == 65) { Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, mainColor, "CalamityMod/Particles/HighResHollowCircleHardEdge", Vector2.One, Main.rand.NextFloat(-10, 10), 0.12f * sizeBonus, 0.135f * sizeBonus, 50); @@ -83,10 +94,11 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(blastRing2); } } - Lighting.AddLight(Projectile.Center, mainColor.ToVector3() * 0.7f); - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - + Projectile.velocity *= 0.988f; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Lighting.AddLight(Projectile.Center, mainColor.ToVector3() * 0.7f); + if (Projectile.timeLeft % 2 == 0) { if (!exploding && Main.rand.NextBool() || exploding) @@ -97,51 +109,49 @@ namespace CalamityMod.Projectiles.Magic dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; } } - } - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture = ModContent.Request("CalamityMod/Particles/Light").Value; - Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Color drawColor = Projectile.GetAlpha(lightColor); - float drawRotation = Projectile.rotation; - Vector2 rotationPoint = texture.Size() * 0.5f; - if (!exploding) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(mainColor, Color.White, 0.5f) * 0.6f, 1); - Main.EntitySpriteDraw(texture, drawPosition, null, mainColor with { A = 0 }, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None); - Main.EntitySpriteDraw(texture, drawPosition, null, Color.White with { A = 0 }, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None); - - } - return false; + Projectile.netSpam = 0; + Projectile.netUpdate = true; } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (!exploding) - { exploding = true; - } + if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.80f); if (Projectile.damage < 1) Projectile.damage = 1; } - public override void OnKill(int timeLeft) - { - for (int i = 0; i <= 5; i++) - { - //Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(4) ? 264 : 66, (Projectile.velocity.SafeNormalize(Vector2.UnitY) * 15f).RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(1.2f, 1.6f)); - //dust.noGravity = true; - //dust.color = Main.rand.NextBool() ? Color.Lerp(mainColor, Color.White, 0.5f) : mainColor; - } - } + public override bool OnTileCollide(Vector2 oldVelocity) { Projectile.tileCollide = false; exploding = true; return false; } - public override bool? CanDamage() => null; - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, exploding ? 120 * sizeBonus : 20 * sizeBonus, targetHitbox); + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request("CalamityMod/Particles/Light").Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation; + Vector2 rotationPoint = texture.Size() * 0.5f; + + if (!exploding) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], Color.Lerp(mainColor, Color.White, 0.5f) * 0.6f, 1); + Main.EntitySpriteDraw(texture, drawPosition, null, mainColor with { A = 0 }, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None); + Main.EntitySpriteDraw(texture, drawPosition, null, Color.White with { A = 0 }, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None); + + } + + return false; + } + + public override void SendExtraAI(BinaryWriter writer) => writer.Write(sizeBonus); + + public override void ReceiveExtraAI(BinaryReader reader) => sizeBonus = reader.ReadSingle(); } } From 66657ea473ac59e7fea7a62970be77c3cc13cf6f Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 15:08:12 +0200 Subject: [PATCH 041/177] Fixed Arc Nova Diffuser in multiplayer. --- Items/Weapons/Ranged/ArcNovaDiffuser.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Ranged/ArcNovaDiffuser.cs b/Items/Weapons/Ranged/ArcNovaDiffuser.cs index c47d25ca28..e770b3f61d 100644 --- a/Items/Weapons/Ranged/ArcNovaDiffuser.cs +++ b/Items/Weapons/Ranged/ArcNovaDiffuser.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Materials; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -26,10 +27,8 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() - { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - } + public override void SetStaticDefaults() => ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + public override void SetDefaults() { Item.width = 58; @@ -53,6 +52,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + public override void AddRecipes() { CreateRecipe(). From 6c9c9d3d5638527bbae7828d1cd15ce42c4c4c89 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 15:17:46 +0200 Subject: [PATCH 042/177] Fixed Elemental Eruption in multiplayer. --- Items/Weapons/Ranged/ElementalEruption.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Ranged/ElementalEruption.cs b/Items/Weapons/Ranged/ElementalEruption.cs index 8c8449aafd..e282838825 100644 --- a/Items/Weapons/Ranged/ElementalEruption.cs +++ b/Items/Weapons/Ranged/ElementalEruption.cs @@ -14,10 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged public int FlareCounter = 0; - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; - } + public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; public override void SetDefaults() { @@ -41,13 +38,18 @@ namespace CalamityMod.Items.Weapons.Ranged } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + // Spawning the holdout cannot consume ammo public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position, Vector2.Zero, type, 0, 0f, player.whoAmI); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter); return false; } From 29152e1b21625823e009404bde409b799dc8815f Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 15:26:05 +0200 Subject: [PATCH 043/177] Arc Nova Diffuser spawns pointing at your mouse. --- Items/Weapons/Ranged/ArcNovaDiffuser.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Ranged/ArcNovaDiffuser.cs b/Items/Weapons/Ranged/ArcNovaDiffuser.cs index e770b3f61d..2ce192c482 100644 --- a/Items/Weapons/Ranged/ArcNovaDiffuser.cs +++ b/Items/Weapons/Ranged/ArcNovaDiffuser.cs @@ -1,5 +1,4 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -54,6 +53,13 @@ namespace CalamityMod.Items.Weapons.Ranged public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter); + return false; + } + public override void AddRecipes() { CreateRecipe(). From 8df7375cadf19e0c25f49c07f2f570e08de4e12d Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 15:38:55 +0200 Subject: [PATCH 044/177] Fixed Flak Kraken on multiplayer. --- Projectiles/Ranged/FlakKrakenProjectile.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Projectiles/Ranged/FlakKrakenProjectile.cs b/Projectiles/Ranged/FlakKrakenProjectile.cs index 962a9ba3c5..98db63bb3b 100644 --- a/Projectiles/Ranged/FlakKrakenProjectile.cs +++ b/Projectiles/Ranged/FlakKrakenProjectile.cs @@ -61,6 +61,8 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { + Owner ??= Main.player[Projectile.owner]; + // Enforces the gravity. if (IsShrapnel) { @@ -124,15 +126,9 @@ namespace CalamityMod.Projectiles.Ranged trailDust.noGravity = true; trailDust.noLight = true; trailDust.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 127f, 0f); - - Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * (IsShrapnel ? 0.3f : 1f)); } - public override void OnSpawn(IEntitySource source) - { - Owner = Main.player[Projectile.owner]; - Projectile.scale = 1.5f; - } + public override void OnSpawn(IEntitySource source) => Projectile.scale = 1.5f; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { @@ -169,7 +165,7 @@ namespace CalamityMod.Projectiles.Ranged { bool usedClusterRockets = RocketID == ItemID.ClusterRocketI || RocketID == ItemID.ClusterRocketII; int flakAmount = usedClusterRockets ? ClusterShrapnelAmount : ShrapnelAmount; - for (int i = 0; i < flakAmount; i++) + for (int i = 0; i < flakAmount && Main.myPlayer == Projectile.owner; i++) { Projectile shrapnel = Projectile.NewProjectileDirect( Projectile.GetSource_FromThis(), From bbf492c69159dd2b22e7852ee98efb710f8addd9 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 15:45:07 +0200 Subject: [PATCH 045/177] Fixed Flak Toxicannon in multiplayer. --- Projectiles/Ranged/FlakToxicannonProjectile.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Projectiles/Ranged/FlakToxicannonProjectile.cs b/Projectiles/Ranged/FlakToxicannonProjectile.cs index 01b0f9336b..a01cdd3535 100644 --- a/Projectiles/Ranged/FlakToxicannonProjectile.cs +++ b/Projectiles/Ranged/FlakToxicannonProjectile.cs @@ -59,6 +59,8 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { + Owner ??= Main.player[Projectile.owner]; + // Enforces the gravity. if (IsShrapnel) { @@ -119,11 +121,7 @@ namespace CalamityMod.Projectiles.Ranged Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3() * (IsShrapnel ? 1.5f : 2.5f)); } - public override void OnSpawn(IEntitySource source) - { - Owner = Main.player[Projectile.owner]; - Projectile.scale = 1.5f; - } + public override void OnSpawn(IEntitySource source) => Projectile.scale = 1.5f; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { @@ -160,7 +158,7 @@ namespace CalamityMod.Projectiles.Ranged { bool usedClusterRockets = RocketID == ItemID.ClusterRocketI || RocketID == ItemID.ClusterRocketII; int flakAmount = usedClusterRockets ? ClusterShrapnelAmount : ShrapnelAmount; - for (int i = 0; i < flakAmount; i++) + for (int i = 0; i < flakAmount && Main.myPlayer == Projectile.owner; i++) { Projectile shrapnel = Projectile.NewProjectileDirect( Projectile.GetSource_FromThis(), From 52da30c8f070e9ab8584da0a04bc7248e0abbcea Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 15:59:21 +0200 Subject: [PATCH 046/177] Fixed Wilfire Bloom on multiplayer. --- Items/Weapons/Ranged/WildfireBloom.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/WildfireBloom.cs b/Items/Weapons/Ranged/WildfireBloom.cs index b6c2286b1a..d821089aeb 100644 --- a/Items/Weapons/Ranged/WildfireBloom.cs +++ b/Items/Weapons/Ranged/WildfireBloom.cs @@ -39,13 +39,21 @@ namespace CalamityMod.Items.Weapons.Ranged } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; + // Spawning the holdout cannot consume ammo public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position, Vector2.Zero, type, 0, 0f, player.whoAmI); + Projectile holdout = Projectile.NewProjectileDirect(source, position, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + + // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + return false; } From fa4e98fdecfcc18bf44ee0d413db844d84d5df01 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 16:30:58 +0200 Subject: [PATCH 047/177] Implemented Magna Cannon to Base Holdout. 1. Implemented Magna Cannon to the BaseGunHoldoutProjectile abstract class. 2. Gave multiplayer support to Magna Cannon. --- Items/Weapons/Ranged/MagnaCannon.cs | 15 ++- Projectiles/Ranged/MagnaCannonHoldout.cs | 123 ++++++++--------------- Utilities/PlayerUtils.cs | 2 +- 3 files changed, 56 insertions(+), 84 deletions(-) diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs index 4a320fba08..88422994c3 100644 --- a/Items/Weapons/Ranged/MagnaCannon.cs +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -22,10 +22,8 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() - { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - } + public override void SetStaticDefaults() => ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; + public override void SetDefaults() { Item.width = 56; @@ -49,6 +47,15 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter); + Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter), ModContent.ProjectileType(), 0, 0f, player.whoAmI); + return false; + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Projectiles/Ranged/MagnaCannonHoldout.cs b/Projectiles/Ranged/MagnaCannonHoldout.cs index 46cd0b8502..ef4ea8c38e 100644 --- a/Projectiles/Ranged/MagnaCannonHoldout.cs +++ b/Projectiles/Ranged/MagnaCannonHoldout.cs @@ -1,67 +1,48 @@ -using System; -using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using ReLogic.Utilities; using Terraria; using Terraria.Audio; -using Terraria.Localization; +using Terraria.GameContent; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class MagnaCannonHoldout : ModProjectile + public class MagnaCannonHoldout : BaseGunHoldoutProjectile { - // Take the name and texture from the weapon - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override string Texture => "CalamityMod/Items/Weapons/Ranged/MagnaCannon"; - - public static int FramesPerLoad = 9; - public static int MaxLoadableShots = 20; - public static float BulletSpeed = 12f; - - private Player Owner => Main.player[Projectile.owner]; - public SlotId MagnaChargeSlot; + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 20f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -5f; private ref float CurrentChargingFrames => ref Projectile.ai[0]; private ref float ShotsLoaded => ref Projectile.ai[1]; private ref float ShootTimer => ref Projectile.ai[2]; private bool FullyCharged => CurrentChargingFrames >= MagnaCannon.FullChargeFrames; - public int Time = 0; + public SlotId MagnaChargeSlot; + public static int FramesPerLoad = 9; + public static int MaxLoadableShots = 20; + public static float BulletSpeed = 12f; - public override void SetDefaults() + public override void KillHoldoutLogic() { - Projectile.width = 58; - Projectile.height = 30; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Ranged; - Projectile.ignoreWater = true; + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type) + Projectile.Kill(); } - public override void AI() + public override void HoldoutAI() { - Time++; - if (Time == 1) - Projectile.alpha = 255; - else - Projectile.alpha = 0; - - if (Owner.dead) // destroy the holdout if the player dies - { - Projectile.Kill(); - return; - } - - Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); - Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.9f; - if (SoundEngine.TryGetActiveSound(MagnaChargeSlot, out var ChargeSound) && ChargeSound.IsPlaying) ChargeSound.Position = Projectile.Center; // Fire if the owner stops channeling or otherwise cannot use the weapon. if (Owner.CantUseHoldout()) { + KeepRefreshingLifetime = false; + if (ShotsLoaded > 0) { // While bullets are remaining, refresh the lifespan; it will not refresh again after bullets run out @@ -75,24 +56,19 @@ namespace CalamityMod.Projectiles.Ranged SoundEngine.PlaySound(MagnaCannon.Fire, Projectile.position); Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(9f)), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * (FullyCharged ? 3 : 1), Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity.RotatedByRandom(MathHelper.ToRadians(9f)), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * (FullyCharged ? 3 : 1), Projectile.owner); for (int i = 0; i <= 3; i++) { - Dust dust = Dust.NewDustPerfect(tipPosition, 187, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(1.5f, 2.3f)); + Dust dust = Dust.NewDustPerfect(GunTipPosition, 187, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(1.5f, 2.3f)); dust.noGravity = true; } ShotsLoaded--; - ShootTimer = (FullyCharged ? 4f : 5f); - Projectile.netSpam = 0; - Projectile.netUpdate = true; + ShootTimer = FullyCharged ? 4f : 5f; } } else { - // While channeled, keep refreshing the projectile lifespan - Projectile.timeLeft = 2; - // Loads shots until maxed out if (ShotsLoaded < MaxLoadableShots && CurrentChargingFrames % FramesPerLoad == 0) ShotsLoaded++; @@ -116,13 +92,13 @@ namespace CalamityMod.Projectiles.Ranged { if (!FullyCharged) { - Particle streak = new ManaDrainStreak(Owner, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.White, Color.Aqua, 7, tipPosition); + Particle streak = new ManaDrainStreak(Owner, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.White, Color.Aqua, 7, GunTipPosition); GeneralParticleHandler.SpawnParticle(streak); } float orbScale = MathHelper.Clamp(CurrentChargingFrames, 0f, MagnaCannon.FullChargeFrames); - Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.DarkBlue, orbScale / 135f, 2); + Particle orb = new GenericBloom(GunTipPosition, Projectile.velocity, Color.DarkBlue, orbScale / 135f, 2); GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.Aqua, orbScale / 200f, 2); + Particle orb2 = new GenericBloom(GunTipPosition, Projectile.velocity, Color.Aqua, orbScale / 200f, 2); GeneralParticleHandler.SpawnParticle(orb2); } @@ -131,49 +107,38 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i < 36; i++) { - Dust chargefull = Dust.NewDustPerfect(tipPosition, 160); + Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 160); chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 18f + Owner.velocity; chargefull.scale = Main.rand.NextFloat(1f, 1.5f); chargefull.noGravity = true; } } } - UpdateProjectileHeldVariables(armPosition); - ManipulatePlayerVariables(); } - private void UpdateProjectileHeldVariables(Vector2 armPosition) - { - if (Main.myPlayer == Projectile.owner) - { - float interpolant = Utils.GetLerpValue(5f, 40f, Projectile.Distance(Main.MouseWorld), true); - Vector2 oldVelocity = Projectile.velocity; - Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant); - } - Projectile.Center = armPosition + Projectile.velocity * 20; - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); - Projectile.spriteDirection = Projectile.direction; - - // Rumble (only while channeling) - float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, MagnaCannon.FullChargeFrames); - if (!Owner.CantUseHoldout()) - Projectile.position += Main.rand.NextVector2Circular(rumble / 43f, rumble / 43f); - } - - private void ManipulatePlayerVariables() - { - Owner.ChangeDir(Projectile.direction); - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = 2; - Owner.itemAnimation = 2; - Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); - } public override void OnKill(int timeLeft) { if (SoundEngine.TryGetActiveSound(MagnaChargeSlot, out var ChargeSound)) ChargeSound?.Stop(); } - public override bool? CanDamage() => false; + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + if (!Owner.CantUseHoldout()) + { + float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, MagnaCannon.FullChargeFrames); + drawPosition += Main.rand.NextVector2Circular(rumble / 43f, rumble / 43f); + } + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + + return false; + } } } diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index eab0501756..faf8ed2d66 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -887,7 +887,7 @@ namespace CalamityMod /// /// The player using the holdout. /// Returns if the player CAN'T use the item. - public static bool CantUseHoldout(this Player player) => player == null || !player.active || player.dead || !player.channel || player.CCed || player.noItems; + public static bool CantUseHoldout(this Player player, bool needsToHold = true) => player == null || !player.active || player.dead || (!player.channel && needsToHold) || player.CCed || player.noItems; /// /// Makes the given player send the given packet to all appropriate receivers.
From f0e1297f4b140788e848449a8276c4c6b20dfad2 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Fri, 17 May 2024 10:40:35 -0400 Subject: [PATCH 048/177] Changed Draetalk line --- Localization/en-US/Mods.CalamityMod.UI.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 7fbda27580..4037840c25 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -260,7 +260,7 @@ Communication: { The final to begin construction was Artemis. Rather than being founded on raw power, it was made to be the apex of speed and accuracy. There is elegance in simplicity, for all of Artemis' combat efficacy comes from an onboard predictive AI and a battery of hard-light bolt emitters.\n - It was the perfect partner to its twin and required no revisions. Organic beings are naturally inclined to fixate their senses on fire, presenting Artemis with the perfect opportunity to strike with unparalleled precision. + It was the perfect partner to its twin and required only a single revision. Organic beings are naturally inclined to fixate their senses on fire, presenting Artemis with the perfect opportunity to strike with unparalleled precision. ''' } From 443705543746a6e6e92b9c95bbdd6acdca90ca14 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 16:59:43 +0200 Subject: [PATCH 049/177] Implemented Opal Striker as a base holdout. 1. Implemented Opal Striker to the BaseGunHoldoutProjectile abstract class. 2. Made Opal Striker spawn pointing at the mouse. 3. Implmemented some syncing. --- Items/Weapons/Ranged/OpalStriker.cs | 15 ++- Projectiles/Ranged/ArcNovaDiffuserHoldout.cs | 2 +- Projectiles/Ranged/OpalStrikerHoldout.cs | 123 +++++++------------ 3 files changed, 57 insertions(+), 83 deletions(-) diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index b7add585c2..35158cca97 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -21,10 +21,8 @@ namespace CalamityMod.Items.Weapons.Ranged public static int AftershotCooldownFrames = 17; public static int FullChargeFrames = 88; - public override void SetStaticDefaults() - { - ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true; - } + public override void SetStaticDefaults() => ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + public override void SetDefaults() { Item.width = 48; @@ -48,6 +46,15 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); + Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + return false; + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs index e042721fbb..bfda144189 100644 --- a/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs +++ b/Projectiles/Ranged/ArcNovaDiffuserHoldout.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged public override void KillHoldoutLogic() { - if (HeldItem.type != Owner.ActiveItem().type || Owner is null || !Owner.active || Owner.CCed || Owner.dead || Owner.noItems) + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type) Projectile.Kill(); } diff --git a/Projectiles/Ranged/OpalStrikerHoldout.cs b/Projectiles/Ranged/OpalStrikerHoldout.cs index afc3cb7b6d..7a42eabdbf 100644 --- a/Projectiles/Ranged/OpalStrikerHoldout.cs +++ b/Projectiles/Ranged/OpalStrikerHoldout.cs @@ -1,92 +1,71 @@ -using System; -using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using ReLogic.Utilities; using Terraria; using Terraria.Audio; -using Terraria.Localization; +using Terraria.GameContent; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class OpalStrikerHoldout : ModProjectile + public class OpalStrikerHoldout : BaseGunHoldoutProjectile { - // Take the name and texture from the weapon - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override string Texture => "CalamityMod/Items/Weapons/Ranged/OpalStriker"; + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 15f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -5f; + private ref float CurrentChargingFrames => ref Projectile.ai[0]; + private bool FullyCharged => CurrentChargingFrames >= OpalStriker.FullChargeFrames; + public SlotId OpalChargeSlot; public static float ChargedDamageMult = 5f; public static float ChargedKBMult = 3f; public static float BulletSpeed = 12f; - private Player Owner => Main.player[Projectile.owner]; - public SlotId OpalChargeSlot; - - private ref float CurrentChargingFrames => ref Projectile.ai[0]; - private bool FullyCharged => CurrentChargingFrames >= OpalStriker.FullChargeFrames; - public int Time = 0; - - public override void SetDefaults() + public override void KillHoldoutLogic() { - Projectile.width = 46; - Projectile.height = 30; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Ranged; - Projectile.ignoreWater = true; + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type) + Projectile.Kill(); } - public override void AI() + public override void HoldoutAI() { - Time++; - if (Time == 1) - Projectile.alpha = 255; - else - Projectile.alpha = 0; - - if (Owner.dead) // destroy the holdout if the player dies - { - Projectile.Kill(); - return; - } - - Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); - Vector2 tipPosition = (armPosition + Projectile.velocity * Projectile.width * 0.85f) + (Projectile.velocity * 4).RotatedBy(-0.3f * Projectile.direction); - if (SoundEngine.TryGetActiveSound(OpalChargeSlot, out var ChargeSound) && ChargeSound.IsPlaying) ChargeSound.Position = Projectile.Center; // Fire if the owner stops channeling or otherwise cannot use the weapon. if (Owner.CantUseHoldout()) { + KeepRefreshingLifetime = false; + if (Projectile.ai[1] != 1f) { + Projectile.timeLeft = OpalStriker.AftershotCooldownFrames; + ChargeSound?.Stop(); SoundEngine.PlaySound(FullyCharged ? OpalStriker.ChargedFire : OpalStriker.Fire, Projectile.Center); Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; if (FullyCharged) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * ChargedDamageMult), Projectile.knockBack * ChargedKBMult, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * ChargedDamageMult), Projectile.knockBack * ChargedKBMult, Projectile.owner); for (int i = 0; i <= 10; i++) { - Dust dust = Dust.NewDustPerfect(tipPosition, 162, shootVelocity.RotatedByRandom(MathHelper.ToRadians(20f)) * Main.rand.NextFloat(0.8f, 1.4f), 0, default, Main.rand.NextFloat(1.5f, 2.3f)); + Dust dust = Dust.NewDustPerfect(GunTipPosition, 162, shootVelocity.RotatedByRandom(MathHelper.ToRadians(20f)) * Main.rand.NextFloat(0.8f, 1.4f), 0, default, Main.rand.NextFloat(1.5f, 2.3f)); dust.noGravity = true; } } else - Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); Projectile.ai[1] = 1f; - Projectile.netSpam = 0; - Projectile.netUpdate = true; } } else { - // While channeled, keep refreshing the projectile lifespan to the amount when attacking - Projectile.timeLeft = OpalStriker.AftershotCooldownFrames; CurrentChargingFrames++; // Sounds @@ -103,14 +82,14 @@ namespace CalamityMod.Projectiles.Ranged { if (!FullyCharged) { - Particle streak = new ManaDrainStreak(Owner, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.Gold, Color.Orange, 7, tipPosition); + Particle streak = new ManaDrainStreak(Owner, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.Gold, Color.Orange, 7, GunTipPosition); GeneralParticleHandler.SpawnParticle(streak); } float orbScale = MathHelper.Clamp(CurrentChargingFrames, 0f, OpalStriker.FullChargeFrames); - Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.OrangeRed, orbScale / 135f, 2); + Particle orb = new GenericBloom(GunTipPosition, Projectile.velocity, Color.OrangeRed, orbScale / 135f, 2); GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.Coral, orbScale / 200f, 2); + Particle orb2 = new GenericBloom(GunTipPosition, Projectile.velocity, Color.Coral, orbScale / 200f, 2); GeneralParticleHandler.SpawnParticle(orb2); } @@ -119,50 +98,38 @@ namespace CalamityMod.Projectiles.Ranged { for (int i = 0; i < 36; i++) { - Dust chargefull = Dust.NewDustPerfect(tipPosition, 162); + Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 162); chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 13f + Owner.velocity; chargefull.scale = Main.rand.NextFloat(2f, 2.5f); chargefull.noGravity = true; } } } - - UpdateProjectileHeldVariables(armPosition); - ManipulatePlayerVariables(); } - private void UpdateProjectileHeldVariables(Vector2 armPosition) - { - if (Main.myPlayer == Projectile.owner) - { - float interpolant = Utils.GetLerpValue(5f, 35f, Projectile.Distance(Main.MouseWorld), true); - Vector2 oldVelocity = Projectile.velocity; - Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant); - } - Projectile.Center = armPosition + Projectile.velocity * 15 + new Vector2(0, 3); - Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); - Projectile.spriteDirection = Projectile.direction; - - // Rumble (only while channeling) - float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, OpalStriker.FullChargeFrames); - if (!Owner.CantUseHoldout()) - Projectile.position += Main.rand.NextVector2Circular(rumble / 30f, rumble / 30f); - } - - private void ManipulatePlayerVariables() - { - Owner.ChangeDir(Projectile.direction); - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = 2; - Owner.itemAnimation = 2; - Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); - } public override void OnKill(int timeLeft) { if (SoundEngine.TryGetActiveSound(OpalChargeSlot, out var ChargeSound)) ChargeSound?.Stop(); } - public override bool? CanDamage() => false; + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + if (!Owner.CantUseHoldout()) + { + float rumble = MathHelper.Clamp(CurrentChargingFrames, 0f, OpalStriker.FullChargeFrames); + drawPosition += Main.rand.NextVector2Circular(rumble / 30f, rumble / 30f); + } + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + + return false; + } } } From 62415e89cdfd0814fe6444d03d22be87892d17c8 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 18:18:01 +0200 Subject: [PATCH 050/177] Implemented Aetherflux Cannon as a base holdout. 1. Implemented Aetherflux Cannon in BaseGunHoldoutProjectile. 2. Fixed multiplayer issues. --- Items/Weapons/Magic/AetherfluxCannon.cs | 7 +- Projectiles/Magic/AetherfluxCannonHoldout.cs | 131 ++++++------------- Projectiles/Magic/PhasedGodRay.cs | 4 +- 3 files changed, 49 insertions(+), 93 deletions(-) diff --git a/Items/Weapons/Magic/AetherfluxCannon.cs b/Items/Weapons/Magic/AetherfluxCannon.cs index 11d3ad3d29..782fffeba9 100644 --- a/Items/Weapons/Magic/AetherfluxCannon.cs +++ b/Items/Weapons/Magic/AetherfluxCannon.cs @@ -39,11 +39,12 @@ namespace CalamityMod.Items.Weapons.Magic public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Vector2 shootVelocity = velocity; - Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); - Projectile.NewProjectile(source, position, shootDirection, type, damage, knockback, player.whoAmI); + Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); + Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Projectiles/Magic/AetherfluxCannonHoldout.cs b/Projectiles/Magic/AetherfluxCannonHoldout.cs index 94e57a3010..f516b8a025 100644 --- a/Projectiles/Magic/AetherfluxCannonHoldout.cs +++ b/Projectiles/Magic/AetherfluxCannonHoldout.cs @@ -1,65 +1,54 @@ using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class AetherfluxCannonHoldout : ModProjectile + public class AetherfluxCannonHoldout : BaseGunHoldoutProjectile { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - private const int FramesPerFireRateIncrease = 36; - - private Player Owner => Main.player[Projectile.owner]; + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 10f; + public override float OffsetXUpwards => -15f; + public override float OffsetXDownwards => 10f; + public override float BaseOffsetY => -15f; + public override float OffsetYUpwards => 8f; + public override float OffsetYDownwards => 15f; + public override string Texture => "CalamityMod/Projectiles/Magic/AetherfluxCannonHoldout"; private ref float DeployedFrames => ref Projectile.ai[0]; private ref float AnimationRate => ref Projectile.ai[1]; private ref float LastShootAttemptTime => ref Projectile.localAI[0]; private ref float LastAnimationTime => ref Projectile.localAI[1]; - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 8; - } + public override void SetStaticDefaults() => Main.projFrames[Type] = 8; - public override void SetDefaults() + public override void KillHoldoutLogic() { - Projectile.width = 58; - Projectile.height = 94; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.DamageType = DamageClass.Magic; - } + base.KillHoldoutLogic(); - public override void AI() - { - Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); - Vector2 gunBarrelPos = armPosition + Projectile.velocity * Projectile.height * 0.4f; - - // If the player is unable to continue using the holdout, delete it. - if (Owner.CantUseHoldout() || !Owner.HasAmmo(Owner.ActiveItem())) - { + bool actuallyShoot = DeployedFrames >= (HeldItem?.useAnimation ?? AetherfluxCannon.UseTime); + bool manaOK = !actuallyShoot || Owner.CheckMana(Owner.ActiveItem(), -1, true, false); + if (!manaOK) Projectile.Kill(); - return; - } + } + public override void HoldoutAI() + { // Play a sound frame 1. if (DeployedFrames <= 0f) - { SoundEngine.PlaySound(SoundID.DD2_DarkMageCastHeal with { Volume = SoundID.DD2_DarkMageCastHeal.Volume * 1.5f }, Projectile.Center); - } // Update damage based on curent magic damage stat (so Mana Sickness affects it) - Item weaponItem = Owner.ActiveItem(); - Projectile.damage = weaponItem is null ? 0 : Owner.GetWeaponDamage(weaponItem); + Projectile.damage = HeldItem is null ? 0 : Owner.GetWeaponDamage(HeldItem); // Get the original weapon's use time. - int itemUseTime = weaponItem?.useAnimation ?? AetherfluxCannon.UseTime; + int itemUseTime = HeldItem?.useAnimation ?? AetherfluxCannon.UseTime; // 36, base use time, will result in 5. Speed increasing reforges push it to 4. int framesPerShot = itemUseTime / 7; @@ -73,7 +62,7 @@ namespace CalamityMod.Projectiles.Magic if (DeployedFrames - LastAnimationTime >= AnimationRate) { LastAnimationTime = DeployedFrames; - Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type]; + Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type]; } // Once past the initial spin-up time, fire constantly as long as mana is available. @@ -89,7 +78,7 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(SoundID.Item91, Projectile.Center); int projID = ModContent.ProjectileType(); - float shootSpeed = weaponItem.shootSpeed; + float shootSpeed = HeldItem.shootSpeed; Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.UnitY); Vector2 shootVelocity = shootDirection * shootSpeed; @@ -102,67 +91,24 @@ namespace CalamityMod.Projectiles.Magic for (int i = -1; i <= 1; i += 2) { - Vector2 laserStartPos = gunBarrelPos + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f); + Vector2 laserStartPos = GunTipPosition + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f); Vector2 dustOnlySpread = Main.rand.NextVector2Circular(shootSpeed, shootSpeed); Vector2 dustVelocity = shootVelocity + dustInaccuracy * dustOnlySpread; - if (actuallyShoot) - { - Projectile godRay = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), laserStartPos, shootVelocity, projID, Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); - // Tell this Phased God Ray exactly which way it should be waving. - godRay.localAI[1] = i * 0.5f; - } - SpawnFiringDust(gunBarrelPos, dustVelocity); + if (actuallyShoot && Main.myPlayer == Projectile.owner) + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), laserStartPos, shootVelocity, projID, Projectile.damage, Projectile.knockBack, Projectile.owner, i * 0.5f); + SpawnFiringDust(GunTipPosition, dustVelocity); } } - - // Delete the laser gun if a mana cost cannot be paid. - else - { - Projectile.Kill(); - return; - } } - - UpdateProjectileHeldVariables(armPosition); - ManipulatePlayerVariables(); } - private void UpdateProjectileHeldVariables(Vector2 armPosition) - { - if (Main.myPlayer == Projectile.owner) - { - float interpolant = Utils.GetLerpValue(5f, 25f, Projectile.Distance(Main.MouseWorld), true); - Vector2 oldVelocity = Projectile.velocity; - Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant); - if (Projectile.velocity != oldVelocity) - { - Projectile.netSpam = 0; - Projectile.netUpdate = true; - } - } - - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - Projectile.Center = armPosition + Projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) * 8f; - Projectile.spriteDirection = Projectile.direction; - Projectile.timeLeft = 2; - } - - private void ManipulatePlayerVariables() - { - Owner.ChangeDir(Projectile.direction); - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = 2; - Owner.itemAnimation = 2; - Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); - } - - private void SpawnFiringDust(Vector2 gunBarrelPos, Vector2 laserVelocity) + private void SpawnFiringDust(Vector2 GunTipPosition, Vector2 laserVelocity) { int dustID = 133; int dustRadius = 12; float dustRandomness = 11f; int dustDiameter = 2 * dustRadius; - Vector2 dustCorner = gunBarrelPos - Vector2.One * dustRadius; + Vector2 dustCorner = GunTipPosition - Vector2.One * dustRadius; for (int i = 0; i < 2; i++) { Vector2 dustVel = laserVelocity + Main.rand.NextVector2Circular(dustRandomness, dustRandomness); @@ -173,9 +119,18 @@ namespace CalamityMod.Projectiles.Magic } } - public override bool? CanDamage() => false; + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Projectile.frame); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f) + MathHelper.PiOver2; + Vector2 rotationPoint = frame.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipVertically : SpriteEffects.None; - // prevents the item from appearing backwards frame 1 - public override bool PreDraw(ref Color lightColor) => FramesPerFireRateIncrease > 0f; + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + + return false; + } } } diff --git a/Projectiles/Magic/PhasedGodRay.cs b/Projectiles/Magic/PhasedGodRay.cs index 97b300715c..633e74c335 100644 --- a/Projectiles/Magic/PhasedGodRay.cs +++ b/Projectiles/Magic/PhasedGodRay.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Magic // They are extremely carefully chosen and barely work as is! private const float WaveTheta = 0.09f; private const int WaveTwistFrames = 9; - private ref float WaveFrameState => ref Projectile.localAI[1]; + private ref float WaveFrameState => ref Projectile.ai[0]; public override string Texture => "CalamityMod/Projectiles/LaserProj"; @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Magic float waveSign = WaveFrameState < 0f ? -1f : 1f; - // Initialize waving. Setting localAI[1] to a number between -1 and 1 tells it which way to wave. + // Initialize waving. Setting ai[0] to a number between -1 and 1 tells it which way to wave. // Exactly 0 is a coinflip. if (Math.Abs(WaveFrameState) < 1f) { From 859563abb7ae163911fd622ea9396c53c8fa775c Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 18:51:09 +0200 Subject: [PATCH 051/177] Fixed Wingman in multiplayer. 1. Wingman now appears for other multiplayer clients. 2. No Xyk, this ain't a holdout bro. --- Items/Weapons/Magic/Wingman.cs | 11 +- .../{WingmanHoldout.cs => WingmanGun.cs} | 140 ++++++++---------- 2 files changed, 68 insertions(+), 83 deletions(-) rename Projectiles/Magic/{WingmanHoldout.cs => WingmanGun.cs} (79%) diff --git a/Items/Weapons/Magic/Wingman.cs b/Items/Weapons/Magic/Wingman.cs index 1526be5dd7..dd721ceff9 100644 --- a/Items/Weapons/Magic/Wingman.cs +++ b/Items/Weapons/Magic/Wingman.cs @@ -28,20 +28,25 @@ namespace CalamityMod.Items.Weapons.Magic Item.UseSound = null; Item.autoReuse = true; Item.shootSpeed = 25f; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.channel = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 2; // Makes the rotation of the mouse around the player sync in multiplayer. - public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + public override void HoldItem(Player player) + { + var modPlayer = player.Calamity(); + modPlayer.mouseRotationListener = true; + modPlayer.rightClickListener = true; + } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { for (int i = 0; i < 2; i++) { - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, i == 0 ? 1 : -1); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, i == 0 ? 1 : -1); holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); } diff --git a/Projectiles/Magic/WingmanHoldout.cs b/Projectiles/Magic/WingmanGun.cs similarity index 79% rename from Projectiles/Magic/WingmanHoldout.cs rename to Projectiles/Magic/WingmanGun.cs index bca2231d0b..a5edea2490 100644 --- a/Projectiles/Magic/WingmanHoldout.cs +++ b/Projectiles/Magic/WingmanGun.cs @@ -1,45 +1,42 @@ using System; +using System.Collections.Generic; +using System.IO; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; -using Humanizer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using System.Collections.Generic; -using System.IO; -using CalamityMod.Graphics.Renderers; namespace CalamityMod.Projectiles.Magic { - public class WingmanHoldout : ModProjectile + public class WingmanGun : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Magic/Wingman"; public Color StaticEffectsColor = Color.HotPink; private ref float ShootingTimer => ref Projectile.ai[0]; + private ref float PostFireCooldown => ref Projectile.ai[1]; + public float yOffset; + private float OffsetLength; private float FiringTime = 40; - private float PostFireCooldown = 0; - private Vector2 MovementOffset; - public bool MovingUp = true; - public float xOffset = 1; - public float yOffset = 0; - public int time = 0; + public int time; public int firingDelay = 45; - - private ref float OffsetLength => ref Projectile.localAI[0]; - + public bool MovingUp = true; private Player Owner; - private float MaxOffsetLength = 5f; + private static readonly float MaxOffsetLength = 5f; - public bool recharging = false; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 9; + ProjectileID.Sets.TrailingMode[Type] = 2; + } public override void SetDefaults() { @@ -47,34 +44,32 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.netImportant = true; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 9; - ProjectileID.Sets.TrailingMode[Projectile.type] = 2; Projectile.hide = true; } public override void AI() { + Owner ??= Main.player[Projectile.owner]; + Lighting.AddLight(Projectile.Center, StaticEffectsColor.ToVector3() * 0.2f); + if (time == 0) - { - MovingUp = Projectile.ai[2] == 1 ? true : false; - } + MovingUp = Projectile.ai[2] == 1; + firingDelay--; + Item heldItem = Owner.ActiveItem(); // Update damage based on curent magic damage stat (so Mana Sickness affects it) Projectile.damage = heldItem is null ? 0 : Owner.GetWeaponDamage(heldItem); if (PostFireCooldown > 0) - { PostFiringCooldown(); - } Vector2 tipPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(-0.05f * Projectile.direction) * 12f; // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. - if (Owner.CantUseHoldout() || heldItem.type != ModContent.ItemType() ) + if (Owner.CantUseHoldout() || heldItem.type != ModContent.ItemType()) { - NetUpdate(); if (PostFireCooldown <= 0) Projectile.Kill(); } @@ -83,9 +78,9 @@ namespace CalamityMod.Projectiles.Magic // If the player's pressing RMB, it'll shoot the grenade. if (Owner.Calamity().mouseRight) { - if ((Owner.CheckMana(Owner.ActiveItem(), (int)(heldItem.mana * Owner.manaCost) * 5, true, false))) + if (Owner.CheckMana(Owner.ActiveItem(), (int)(heldItem.mana * Owner.manaCost) * 5, true, false)) { - Shoot(heldItem, true); + Shoot(true); PostFireCooldown = 35 + 55 * Utils.GetLerpValue(10, 40, FiringTime, true); ShootingTimer = 0; FiringTime = 40; @@ -104,7 +99,7 @@ namespace CalamityMod.Projectiles.Magic { if (Owner.CheckMana(Owner.ActiveItem(), -1, true, false)) { - Shoot(heldItem, false); + Shoot(false); ShootingTimer = 0; if (FiringTime > 10) @@ -121,7 +116,6 @@ namespace CalamityMod.Projectiles.Magic } ShootingTimer = 0; } - } } @@ -132,7 +126,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 ownerToMouse = Owner.Calamity().mouseWorld - ownerPosition; // Deals with the holdout's rotation and direction, the owner's arms, etc. - ManageHoldout(ownerPosition, ownerToMouse); + ManageHoldout(ownerToMouse); // When we change the distance of the gun from the arms for the recoil, // recover to the original position smoothly. @@ -140,73 +134,50 @@ namespace CalamityMod.Projectiles.Magic OffsetLength = MathHelper.Lerp(OffsetLength, MaxOffsetLength, 0.1f); ShootingTimer++; - - // Inside here go all the things that dedicated servers shouldn't spend resources on. - // Like visuals and sounds. - if (Main.dedServ) - return; - - Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero) * 20; time++; Projectile.soundDelay--; + + Projectile.netSpam = 0; + Projectile.netUpdate = true; } - private void ManageHoldout(Vector2 mountedCenter, Vector2 ownerToMouse) + private void ManageHoldout(Vector2 ownerToMouse) { Vector2 rotationVector = Projectile.rotation.ToRotationVector2(); float velocityRotation = Projectile.velocity.ToRotation(); - float proximityLookingUpwards = Vector2.Dot(ownerToMouse.SafeNormalize(Vector2.Zero), -Vector2.UnitY); int direction = MathF.Sign(ownerToMouse.X); - - Vector2 armPosition = Owner.RotatedRelativePoint(mountedCenter, true); Vector2 lengthOffset = rotationVector * OffsetLength; - Vector2 armOffset = new Vector2(Utils.Remap(proximityLookingUpwards, -1f, 1f, 0f, -12f) * direction, -10f + Utils.Remap(MathF.Abs(proximityLookingUpwards), 0f, 1f, 0f, proximityLookingUpwards > 0f ? 15f : 0f)); if (time % 40 == 0) - { MovingUp = !MovingUp; - } //xOffset = MathHelper.Lerp(xOffset, placementOffset.X, 0.01f); yOffset = MathHelper.Lerp(yOffset, 150 * (MovingUp ? -1 : 1), (0.085f - (FiringTime * 0.0012f))); Vector2 placementOffset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * (yOffset); - Vector2 location = Owner.MountedCenter + placementOffset; Projectile.Center = lengthOffset + location; - - Projectile.velocity = velocityRotation.AngleTowards(ownerToMouse.ToRotation(), 0.2f).ToRotationVector2(); - Projectile.rotation = (Main.MouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX).ToRotation(); + Projectile.rotation = (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX).ToRotation(); Projectile.timeLeft = 2; - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = Owner.itemAnimation = 2; - Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); - Projectile.spriteDirection = Projectile.direction = direction; Owner.ChangeDir(direction); float armRotation = (Projectile.rotation - MathHelper.PiOver2); // -Pi/2 because the arms rotation starts with arms pointing down. if (Projectile.ai[2] == 1) - { - Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Quarter, armRotation); - } + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, armRotation); else - { Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, armRotation); - } } - private void Shoot(Item item, bool isGrenade) + private void Shoot(bool isGrenade) { - Vector2 shootDirection = (Main.MouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX); + Vector2 shootDirection = (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX); // The position of the tip of the gun. Vector2 tipPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(-0.05f * Projectile.direction) * 12f; - // Spawns the projectile. - Vector2 firingVelocity = shootDirection * 10; if (isGrenade) { @@ -221,8 +192,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * Utils.GetLerpValue(80, 10, FiringTime, true), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0); } - NetUpdate(); - // Inside here go all the things that dedicated servers shouldn't spend resources on. // Like visuals and sounds. if (Main.dedServ) @@ -246,6 +215,7 @@ namespace CalamityMod.Projectiles.Magic else OffsetLength -= 5f; } + private void PostFiringCooldown() { Owner.channel = true; @@ -266,18 +236,7 @@ namespace CalamityMod.Projectiles.Magic PostFireCooldown--; } - private void NetUpdate() - { - Projectile.netUpdate = true; - if (Projectile.netSpam >= 10) - Projectile.netSpam = 9; - } - - public override void OnSpawn(IEntitySource source) - { - Owner = Main.player[Projectile.owner]; - OffsetLength = MaxOffsetLength; - } + public override void OnSpawn(IEntitySource source) => OffsetLength = MaxOffsetLength; // Because we use the velocity as a direction, we don't need it to change its position. public override bool ShouldUpdatePosition() => false; @@ -289,8 +248,7 @@ namespace CalamityMod.Projectiles.Magic if (time <= 0 && !Main.dedServ) return false; - Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/Wingman").Value; - + Texture2D texture; if (Projectile.ai[2] == 1) texture = ModContent.Request("CalamityMod/Items/Weapons/Magic/Wingman").Value; else @@ -309,9 +267,31 @@ namespace CalamityMod.Projectiles.Magic return false; } - public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) => behindNPCs.Add(index); + + public override void SendExtraAI(BinaryWriter writer) { - behindNPCs.Add(index); + writer.Write(Projectile.rotation); + writer.Write(Projectile.spriteDirection); + writer.Write(OffsetLength); + writer.Write(FiringTime); + writer.Write(time); + writer.Write(firingDelay); + writer.Write(MovingUp); + writer.Write(yOffset); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + Projectile.rotation = reader.ReadSingle(); + Projectile.spriteDirection = reader.ReadInt32(); + OffsetLength = reader.ReadSingle(); + FiringTime = reader.ReadSingle(); + time = reader.ReadInt32(); + firingDelay = reader.ReadInt32(); + MovingUp = reader.ReadBoolean(); + yOffset = reader.ReadSingle(); } } } From 7214e2f4ab5df57ddb8deff1ac93ce36353fbfef Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 17 May 2024 13:17:58 -0400 Subject: [PATCH 052/177] Depth Crusher buff --- Items/Weapons/Melee/DepthCrusher.cs | 4 ++-- Projectiles/Melee/DepthCrusherProjectile.cs | 10 +++++----- Projectiles/Melee/DepthCrusherSplitProjectile.cs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Items/Weapons/Melee/DepthCrusher.cs b/Items/Weapons/Melee/DepthCrusher.cs index 1714581a67..86f994eb02 100644 --- a/Items/Weapons/Melee/DepthCrusher.cs +++ b/Items/Weapons/Melee/DepthCrusher.cs @@ -16,12 +16,12 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.height = 50; - Item.damage = 35; + Item.damage = 48; Item.knockBack = 7.25f; Item.useTime = 65; Item.useAnimation = 65; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 3f; + Item.shootSpeed = 6f; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Projectiles/Melee/DepthCrusherProjectile.cs b/Projectiles/Melee/DepthCrusherProjectile.cs index 8e65dbcd00..d0b0e7f55d 100644 --- a/Projectiles/Melee/DepthCrusherProjectile.cs +++ b/Projectiles/Melee/DepthCrusherProjectile.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Melee } Projectile.rotation += (0.4f * (MathF.Abs(Projectile.velocity.Y) * 0.2f + 0.6f)) * Projectile.direction; - if (Projectile.velocity.Y < 20) + if (Projectile.velocity.Y < 16) Projectile.velocity.Y += Projectile.numHits >= 3 ? 0.7f : 0.4f; if (Projectile.numHits >= 3) { @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.velocity.Y > 0) Projectile.velocity.X *= 0.975f; - if (Collision.SolidCollision(Projectile.Center, 15, 15)) + if (Collision.SolidCollision(Projectile.Center, 25, 25)) { Projectile.tileCollide = true; } @@ -133,9 +133,9 @@ namespace CalamityMod.Projectiles.Melee if (!setDamage) { if (Projectile.velocity.Y > 0) - Projectile.velocity.Y = -9; + Projectile.velocity.Y -= 6; else - Projectile.velocity.Y = -7; + Projectile.velocity.Y = -6; } for (int i = 0; i < 15; i++) @@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(HitSound, Projectile.Center); for (int i = 0; i < 3; i++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(0, -5).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), startDamage / 4, Projectile.knockBack / 4, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Bottom, new Vector2(0, -5).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.9f, 1.1f), ModContent.ProjectileType(), (int)(startDamage * 0.3f), Projectile.knockBack / 4, Projectile.owner); } Projectile.Kill(); } diff --git a/Projectiles/Melee/DepthCrusherSplitProjectile.cs b/Projectiles/Melee/DepthCrusherSplitProjectile.cs index 5c2b6ef338..4da528c2f8 100644 --- a/Projectiles/Melee/DepthCrusherSplitProjectile.cs +++ b/Projectiles/Melee/DepthCrusherSplitProjectile.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Melee } if (Time > 20 && Time < (randTimer - 70)) { - CalamityUtils.HomeInOnNPC(Projectile, true, 280f, MathHelper.Clamp(1f + Time * 0.06f, 1, 10), 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 384f, MathHelper.Clamp(1f + Time * 0.12f, 1, 11), 20f); } else if (Time >= (randTimer - 70)) { From 59b0a8553846f1d0c5d5aad157cd08a854c6b6e8 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 21:01:02 +0200 Subject: [PATCH 053/177] Nano Purge belongs in base holdout. 1. Implemented Nano Purge to BaseGunHoldoutProjectile. 2. Many multiplayer syncing. --- Items/Weapons/Magic/NanoPurge.cs | 10 +- Projectiles/Magic/NanoPurgeHoldout.cs | 128 ++++++++++---------------- 2 files changed, 57 insertions(+), 81 deletions(-) diff --git a/Items/Weapons/Magic/NanoPurge.cs b/Items/Weapons/Magic/NanoPurge.cs index 558c24ab99..a0522394b9 100644 --- a/Items/Weapons/Magic/NanoPurge.cs +++ b/Items/Weapons/Magic/NanoPurge.cs @@ -10,8 +10,9 @@ namespace CalamityMod.Items.Weapons.Magic [LegacyName("Purge")] public class NanoPurge : ModItem, ILocalizedModType { + public static int UseTime = 20; + public new string LocalizationCategory => "Items.Weapons.Magic"; - public const int UseTime = 20; public override void SetDefaults() { @@ -35,11 +36,12 @@ namespace CalamityMod.Items.Weapons.Magic public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Vector2 shootVelocity = velocity; - Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); - Projectile.NewProjectile(source, position, shootDirection, type, damage, knockback, player.whoAmI); + Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); + Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Projectiles/Magic/NanoPurgeHoldout.cs b/Projectiles/Magic/NanoPurgeHoldout.cs index b68d0f826f..54a6a8e99a 100644 --- a/Projectiles/Magic/NanoPurgeHoldout.cs +++ b/Projectiles/Magic/NanoPurgeHoldout.cs @@ -1,57 +1,53 @@ -using CalamityMod.Items.Weapons.Magic; +using System; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class NanoPurgeHoldout : ModProjectile + public class NanoPurgeHoldout : BaseGunHoldoutProjectile { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); + public override int AssociatedItemID => ModContent.ItemType(); + public override string Texture => "CalamityMod/Projectiles/Magic/NanoPurgeHoldout"; + public override float MaxOffsetLengthFromArm => 10f; + public override float OffsetXUpwards => -15f; + public override float OffsetXDownwards => 5f; + public override float BaseOffsetY => -10f; + public override float OffsetYUpwards => 5f; + public override float OffsetYDownwards => 10f; + private const int FramesPerFireRateIncrease = 36; private static int[] LaserOffsetByAnimationFrame = { 4, 3, 0, 3 }; - private Player Owner => Main.player[Projectile.owner]; private ref float DeployedFrames => ref Projectile.ai[0]; private ref float ChargeTowardsNextShot => ref Projectile.ai[1]; - public override void SetStaticDefaults() - { - Main.projFrames[Projectile.type] = 4; - } + public override void SetStaticDefaults() => Main.projFrames[Type] = 4; - public override void SetDefaults() + public override void KillHoldoutLogic() { - Projectile.width = 34; - Projectile.height = 62; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.DamageType = DamageClass.Magic; - } + base.KillHoldoutLogic(); - public override void AI() - { - Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); - Vector2 gunBarrelPos = armPosition + Projectile.velocity * Projectile.height * 0.5f; - - // If the player is unable to continue using the holdout, delete it. - if (Owner.CantUseHoldout() || !Owner.HasAmmo(Owner.ActiveItem())) - { + bool actuallyShoot = DeployedFrames >= (HeldItem?.useAnimation ?? NanoPurge.UseTime); + bool manaOK = !actuallyShoot || Owner.CheckMana(Owner.ActiveItem(), -1, true, false); + if (!manaOK) Projectile.Kill(); - return; - } + } + public override void HoldoutAI() + { // Update damage based on curent magic damage stat (so Mana Sickness affects it) - Item weaponItem = Owner.ActiveItem(); - Projectile.damage = weaponItem is null ? 0 : Owner.GetWeaponDamage(weaponItem); + Projectile.damage = HeldItem is null ? 0 : Owner.GetWeaponDamage(HeldItem); // Get the original weapon's use time. - int itemUseTime = weaponItem?.useAnimation ?? NanoPurge.UseTime; + int itemUseTime = HeldItem?.useAnimation ?? NanoPurge.UseTime; // Update time. DeployedFrames += 1f; @@ -76,7 +72,7 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(SoundID.Item91, Projectile.Center); int projID = ModContent.ProjectileType(); - float shootSpeed = weaponItem.shootSpeed; + float shootSpeed = HeldItem.shootSpeed; float inaccuracyRatio = 0.045f; Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.UnitY); Vector2 perp = shootDirection.RotatedBy(MathHelper.PiOver2); @@ -86,59 +82,22 @@ namespace CalamityMod.Projectiles.Magic { Vector2 spread = Main.rand.NextVector2CircularEdge(shootSpeed, shootSpeed); Vector2 shootVelocity = shootDirection * shootSpeed + inaccuracyRatio * spread; - Vector2 splitBarrelPos = gunBarrelPos + i * LaserOffsetByAnimationFrame[Projectile.frame] * perp; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), splitBarrelPos, shootVelocity, projID, Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + Vector2 splitBarrelPos = GunTipPosition + i * LaserOffsetByAnimationFrame[Projectile.frame] * perp; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), splitBarrelPos, shootVelocity, projID, Projectile.damage, Projectile.knockBack, Projectile.owner); SpawnFiringDust(splitBarrelPos, shootVelocity); } } - - // Delete the laser gun if a mana cost cannot be paid. - else - { - Projectile.Kill(); - return; - } } - UpdateProjectileHeldVariables(armPosition); - ManipulatePlayerVariables(); + ExtraBackArmRotation = Utils.Remap(Vector2.Dot(-Vector2.UnitY, Projectile.velocity.SafeNormalize(-Vector2.UnitY)), 0f, 1f, MathHelper.PiOver4, 0f); } - private void UpdateProjectileHeldVariables(Vector2 armPosition) - { - if (Main.myPlayer == Projectile.owner) - { - float interpolant = Utils.GetLerpValue(5f, 25f, Projectile.Distance(Main.MouseWorld), true); - Vector2 oldVelocity = Projectile.velocity; - Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant); - if (Projectile.velocity != oldVelocity) - { - Projectile.netSpam = 0; - Projectile.netUpdate = true; - } - } - - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - Projectile.Center = armPosition + Projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) * 8f; - Projectile.spriteDirection = Projectile.direction; - Projectile.timeLeft = 2; - } - - private void ManipulatePlayerVariables() - { - Owner.ChangeDir(Projectile.direction); - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = 2; - Owner.itemAnimation = 2; - Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); - } - - private void SpawnFiringDust(Vector2 gunBarrelPos, Vector2 laserVelocity) + private void SpawnFiringDust(Vector2 GunTipPosition, Vector2 laserVelocity) { int dustID = 107; int dustRadius = 5; int dustDiameter = 2 * dustRadius; - Vector2 dustCorner = gunBarrelPos - Vector2.One * dustRadius; + Vector2 dustCorner = GunTipPosition - Vector2.One * dustRadius; for (int i = 0; i < 2; i++) { Vector2 dustVel = laserVelocity + Main.rand.NextVector2Circular(7f, 7f); @@ -149,9 +108,24 @@ namespace CalamityMod.Projectiles.Magic } } - public override bool? CanDamage() => false; + public override void OnSpawn(IEntitySource source) + { + base.OnSpawn(source); + FrontArmStretch = Player.CompositeArmStretchAmount.Quarter; + } - // prevents the item from appearing backwards frame 1 - public override bool PreDraw(ref Color lightColor) => DeployedFrames > 0f; + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Projectile.frame); + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f) + MathHelper.PiOver2; + Vector2 rotationPoint = frame.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipVertically : SpriteEffects.None; + + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + + return false; + } } } From c8274f4a97c9886a383973bae7d3a412eda2d669 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 22:11:59 +0200 Subject: [PATCH 054/177] Semi-fixed Harvest Staff in multiplayer. --- Projectiles/Summon/HarvestStaffMinion.cs | 56 ++++++++++-------------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/Projectiles/Summon/HarvestStaffMinion.cs b/Projectiles/Summon/HarvestStaffMinion.cs index c00e7bf69b..c2b19b285f 100644 --- a/Projectiles/Summon/HarvestStaffMinion.cs +++ b/Projectiles/Summon/HarvestStaffMinion.cs @@ -46,8 +46,6 @@ namespace CalamityMod.Projectiles.Summon } else if (value == AIState.Idle) Animation = AnimationState.Idle; - - NetUpdate(); } } @@ -127,8 +125,6 @@ namespace CalamityMod.Projectiles.Summon FramesUntilNextAnimationFrame = 5; break; } - - NetUpdate(); } } @@ -138,9 +134,10 @@ namespace CalamityMod.Projectiles.Summon public int AnimationFrames { get; set; } /// - /// The amount of time, in frames, that it'll take to go to the next frame of animation. + /// The amount of time, in frames, that it'll take to go to the next frame of animation.
+ /// Defaults to 1 so it doesn't divide by 0. ///
- public int FramesUntilNextAnimationFrame { get; set; } + public int FramesUntilNextAnimationFrame { get; set; } = 1; ///
/// A convienent bool for when the animation has been completed.
@@ -214,7 +211,7 @@ namespace CalamityMod.Projectiles.Summon } } - public int NetUpdateTimer { get; set; } + public bool KILLYOURSELF { get; set; } #endregion @@ -222,11 +219,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Owner ??= Main.player[Projectile.owner]; + Projectile.width = Projectile.height = Variant == 0 ? 28 : (Variant == 1 ? 22 : 20); + if (Animation == AnimationState.Grow && (MySentry is null || Projectile.Distance(MySentry.Center) > 600f)) - { Projectile.Kill(); - NetUpdate(); - } Target = Projectile.Center.MinionHoming(State == AIState.Still ? PlantedEnemyDistanceDetection : NormalEnemyDistanceDetection, Owner, false); @@ -246,16 +243,13 @@ namespace CalamityMod.Projectiles.Summon if (IdleJumpCooldown > 0) IdleJumpCooldown--; + if (KILLYOURSELF) + Projectile.Kill(); + Projectile.timeLeft = 2; DoGravity(); DoAnimation(); - - NetUpdateTimer++; - if (NetUpdateTimer > 60) - { - NetUpdateTimer = 0; - NetUpdate(); - } + NetUpdate(); } public override bool OnTileCollide(Vector2 oldVelocity) @@ -300,7 +294,7 @@ namespace CalamityMod.Projectiles.Summon { if (State != AIState.Attack) return; - + Projectile.ExpandHitboxBy(4f); Projectile.Damage(); @@ -312,7 +306,7 @@ namespace CalamityMod.Projectiles.Summon gore.timeLeft = 15; } - NetUpdate(); + KILLYOURSELF = true; if (Main.dedServ) return; @@ -374,7 +368,6 @@ namespace CalamityMod.Projectiles.Summon { IdleWalkingTime = IdleWalkingTimer = Main.rand.Next(60, 180); IdleWalkingDirection = MySentry == null || Projectile.WithinRange(MySentry.Center, 960f) ? (Main.rand.NextBool() ? -1 : 1) : MathF.Sign(MySentry.Center.X - Projectile.Center.X); - NetUpdate(); } else if (IdleWalkingTimer != 0f) @@ -447,8 +440,6 @@ namespace CalamityMod.Projectiles.Summon Animation = AnimationState.Jump; SoundEngine.PlaySound(_jumpSound with { Pitch = Utils.Remap(Variant, 0f, 2f, -0.3f, 0.3f) }, Projectile.Center); - - NetUpdate(); } ///
@@ -478,7 +469,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.velocity.Y = -MathF.Sqrt(-2f * PumpkinGravityStrength * (destination.Y - Projectile.Bottom.Y)); Animation = AnimationState.Jump; SoundEngine.PlaySound(_jumpSound with { Pitch = Utils.Remap(Variant, 0f, 2f, -0.3f, 0.3f) }, Projectile.Center); - NetUpdate(); } /// @@ -524,9 +514,10 @@ namespace CalamityMod.Projectiles.Summon return; Projectile.frameCounter++; - if (Projectile.frameCounter % FramesUntilNextAnimationFrame == 0) + if (Projectile.frameCounter >= FramesUntilNextAnimationFrame) { Projectile.frame = Math.Min(Projectile.frame + 1, AnimationFrames - 1); + Projectile.frameCounter = 0; // If it's the run animation, loop it. if (Animation == AnimationState.Run && CompletedAnimation) @@ -539,9 +530,8 @@ namespace CalamityMod.Projectiles.Summon /// public void NetUpdate() { + Projectile.netSpam = 0; Projectile.netUpdate = true; - if (Projectile.netSpam >= 10) - Projectile.netSpam = 9; } #endregion @@ -566,34 +556,36 @@ namespace CalamityMod.Projectiles.Summon public override void SendExtraAI(BinaryWriter writer) { + writer.Write(Direction); writer.Write(IdleWalkingTime); writer.Write(IdleWalkingTimer); writer.Write(IdleJumpCount); writer.Write(IdleJumpCooldown); writer.Write(IdleWalkingDirection); - writer.Write(NetUpdateTimer); + writer.Write(AnimationFrames); + writer.Write(FramesUntilNextAnimationFrame); + writer.Write(KILLYOURSELF); } public override void ReceiveExtraAI(BinaryReader reader) { + Direction = reader.ReadInt32(); IdleWalkingTime = reader.ReadInt32(); IdleWalkingTimer = reader.ReadInt32(); IdleJumpCount = reader.ReadInt32(); IdleJumpCooldown = reader.ReadInt32(); IdleWalkingDirection = reader.ReadInt32(); - NetUpdateTimer = reader.ReadInt32(); + AnimationFrames = reader.ReadInt32(); + FramesUntilNextAnimationFrame = reader.ReadInt32(); + KILLYOURSELF = reader.ReadBoolean(); } public override bool? CanDamage() => State == AIState.Attack ? null : false; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => NetUpdate(); - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= Utils.Remap(Variant, 0f, 2f, 1.5f, 0.5f); public override void OnSpawn(IEntitySource source) { - Owner = Main.player[Projectile.owner]; - Projectile.width = Projectile.height = Variant == 0 ? 28 : (Variant == 1 ? 22 : 20); Direction = Main.rand.NextBool() ? -1 : 1; Animation = AnimationState.None; } From 7ae7ace8d1fc0d8a2bd749cbd025a5c575103d9c Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 22:23:27 +0200 Subject: [PATCH 055/177] Sorry Xyk, it was a holdout. --- Items/Weapons/Magic/Wingman.cs | 4 ++-- .../Magic/{WingmanGun.cs => WingmanHoldout.cs} | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) rename Projectiles/Magic/{WingmanGun.cs => WingmanHoldout.cs} (96%) diff --git a/Items/Weapons/Magic/Wingman.cs b/Items/Weapons/Magic/Wingman.cs index dd721ceff9..b4960be3d1 100644 --- a/Items/Weapons/Magic/Wingman.cs +++ b/Items/Weapons/Magic/Wingman.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.UseSound = null; Item.autoReuse = true; Item.shootSpeed = 25f; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.channel = true; } @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic { for (int i = 0; i < 2; i++) { - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, i == 0 ? 1 : -1); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0, i == 0 ? 1 : -1); holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); } diff --git a/Projectiles/Magic/WingmanGun.cs b/Projectiles/Magic/WingmanHoldout.cs similarity index 96% rename from Projectiles/Magic/WingmanGun.cs rename to Projectiles/Magic/WingmanHoldout.cs index a5edea2490..7a7d41eec1 100644 --- a/Projectiles/Magic/WingmanGun.cs +++ b/Projectiles/Magic/WingmanHoldout.cs @@ -14,7 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class WingmanGun : ModProjectile + public class WingmanHoldout : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Magic/Wingman"; @@ -54,8 +54,9 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(Projectile.Center, StaticEffectsColor.ToVector3() * 0.2f); if (time == 0) - MovingUp = Projectile.ai[2] == 1; - + { + MovingUp = Projectile.ai[2] == 1 ? true : false; + } firingDelay--; Item heldItem = Owner.ActiveItem(); @@ -64,7 +65,9 @@ namespace CalamityMod.Projectiles.Magic Projectile.damage = heldItem is null ? 0 : Owner.GetWeaponDamage(heldItem); if (PostFireCooldown > 0) + { PostFiringCooldown(); + } Vector2 tipPosition = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(-0.05f * Projectile.direction) * 12f; // If there's no player, or the player is the server, or the owner's stunned, there'll be no holdout. @@ -78,7 +81,7 @@ namespace CalamityMod.Projectiles.Magic // If the player's pressing RMB, it'll shoot the grenade. if (Owner.Calamity().mouseRight) { - if (Owner.CheckMana(Owner.ActiveItem(), (int)(heldItem.mana * Owner.manaCost) * 5, true, false)) + if ((Owner.CheckMana(Owner.ActiveItem(), (int)(heldItem.mana * Owner.manaCost) * 5, true, false))) { Shoot(true); PostFireCooldown = 35 + 55 * Utils.GetLerpValue(10, 40, FiringTime, true); @@ -97,7 +100,7 @@ namespace CalamityMod.Projectiles.Magic } else if (ShootingTimer >= FiringTime) { - if (Owner.CheckMana(Owner.ActiveItem(), -1, true, false)) + if (Owner.CheckMana(Owner.ActiveItem(), (int)(heldItem.mana * Owner.manaCost), true, false)) { Shoot(false); ShootingTimer = 0; @@ -116,6 +119,7 @@ namespace CalamityMod.Projectiles.Magic } ShootingTimer = 0; } + } } @@ -164,6 +168,10 @@ namespace CalamityMod.Projectiles.Magic Projectile.spriteDirection = Projectile.direction = direction; Owner.ChangeDir(direction); + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); + float armRotation = (Projectile.rotation - MathHelper.PiOver2); // -Pi/2 because the arms rotation starts with arms pointing down. if (Projectile.ai[2] == 1) Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, armRotation); From 53d67c8081654d0a1285abf18e4c764028204514 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 17 May 2024 16:25:44 -0400 Subject: [PATCH 056/177] 1 - Stopped Terratomere from drawing its trails multiple times in an attempt to stop projectiles from flickering out of existence. 2 - Renamed Terratomere projectiles to make more sense. --- .../en-US/Mods.CalamityMod.Projectiles.Melee.hjson | 4 ++-- Projectiles/Melee/TerratomereHoldoutProj.cs | 8 ++++---- ...{TerratomereBeam.cs => TerratomereMeleeSlash.cs} | 6 +++--- ...erratomereBeam.png => TerratomereMeleeSlash.png} | Bin ...rratomereBigSlash.cs => TerratomereSwordBeam.cs} | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) rename Projectiles/Melee/{TerratomereBeam.cs => TerratomereMeleeSlash.cs} (86%) rename Projectiles/Melee/{TerratomereBeam.png => TerratomereMeleeSlash.png} (100%) rename Projectiles/Melee/{TerratomereBigSlash.cs => TerratomereSwordBeam.cs} (90%) diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 6f5c733c72..f49ed13e17 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -268,8 +268,8 @@ TaintedBladeSlasher.DisplayName: Tainted Blade TenebreusTidesWaterProjectile.DisplayName: Water Spear TenebreusTidesWaterSpear.DisplayName: Tenebreus Tides Water Spear TenebreusTidesWaterSword.DisplayName: Tenebreus Tides Water Sword -TerratomereBeam.DisplayName: Terra Slash Beam -TerratomereBigSlash.DisplayName: Terratomere Slash +TerratomereMeleeSlash.DisplayName: Terratomere Slash +TerratomereSwordBeam.DisplayName: Terra Slash Beam TerratomereExplosion.DisplayName: Terratomere Explosion TerratomereHoldoutProj.DisplayName: Terratomere TerratomereSlash.DisplayName: Terratomere Slash diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 9861f0ab15..95ff843ca5 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -169,21 +169,21 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < totalBeams; i++) { Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(randomVelocityLimit, randomVelocityLimit); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - bigSlashVelocity * 0.4f, bigSlashVelocity + randomVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center - bigSlashVelocity * 0.4f, bigSlashVelocity + randomVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } } - // This is a slash, not a beam. + // Close range slash effect if (Main.myPlayer == Projectile.owner && Time == (int)(Terratomere.SwingTime * RecoveryCompletionRatio) + 5f) { Vector2 bigSlashVelocity = InitialRotation.ToRotationVector2() * Owner.ActiveItem().shootSpeed / 6f; Vector2 bigSlashSpawnPosition = Projectile.Center + bigSlashVelocity.SafeNormalize(Vector2.UnitY) * 64f; - int slash = Projectile.NewProjectile(Projectile.GetSource_FromThis(), bigSlashSpawnPosition, bigSlashVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + int slash = Projectile.NewProjectile(Projectile.GetSource_FromThis(), bigSlashSpawnPosition, bigSlashVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); if (Main.projectile.IndexInRange(slash)) { Main.projectile[slash].ai[0] = (Direction == 1f).ToInt(); - Main.projectile[slash].ModProjectile().ControlPoints = GenerateSlashPoints().ToArray(); + Main.projectile[slash].ModProjectile().ControlPoints = GenerateSlashPoints().ToArray(); } } } diff --git a/Projectiles/Melee/TerratomereBeam.cs b/Projectiles/Melee/TerratomereMeleeSlash.cs similarity index 86% rename from Projectiles/Melee/TerratomereBeam.cs rename to Projectiles/Melee/TerratomereMeleeSlash.cs index e25ce01dd4..1f95774c5f 100644 --- a/Projectiles/Melee/TerratomereBeam.cs +++ b/Projectiles/Melee/TerratomereMeleeSlash.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class TerratomereBeam : ModProjectile, ILocalizedModType + public class TerratomereMeleeSlash : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; public Vector2[] ControlPoints; @@ -54,8 +54,8 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < ControlPoints.Length; i++) points.Add(ControlPoints[i] + ControlPoints[i].SafeNormalize(Vector2.Zero) * (Projectile.scale - 1f) * 40f); - for (int i = 0; i < 3; i++) - PrimitiveRenderer.RenderTrail(points, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 65); + // 17MAY2024: Ozzatron: remove Terratomere rendering its trails multiple times + PrimitiveRenderer.RenderTrail(points, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Center, shader: GameShaders.Misc["CalamityMod:ExobladeSlash"]), 65); Main.spriteBatch.ExitShaderRegion(); return false; diff --git a/Projectiles/Melee/TerratomereBeam.png b/Projectiles/Melee/TerratomereMeleeSlash.png similarity index 100% rename from Projectiles/Melee/TerratomereBeam.png rename to Projectiles/Melee/TerratomereMeleeSlash.png diff --git a/Projectiles/Melee/TerratomereBigSlash.cs b/Projectiles/Melee/TerratomereSwordBeam.cs similarity index 90% rename from Projectiles/Melee/TerratomereBigSlash.cs rename to Projectiles/Melee/TerratomereSwordBeam.cs index 0e339a35e8..b31f77baca 100644 --- a/Projectiles/Melee/TerratomereBigSlash.cs +++ b/Projectiles/Melee/TerratomereSwordBeam.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class TerratomereBigSlash : ModProjectile, ILocalizedModType + public class TerratomereSwordBeam : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; public int TargetIndex = -1; @@ -72,8 +72,8 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExobladePierce"].UseColor(Terratomere.TerraColor1); GameShaders.Misc["CalamityMod:ExobladePierce"].UseSecondaryColor(Terratomere.TerraColor2); - for (int i = 0; i < 4; i++) - PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); + // 17MAY2024: Ozzatron: remove Terratomere rendering its trails multiple times + PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(SlashWidthFunction, SlashColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 30); return false; } From f3acbdc49d076e854d7023bcb7e96ce0e2589f97 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 22:28:11 +0200 Subject: [PATCH 057/177] Fixed Aetherflux Cannon and Nano Purge mana bug. --- Projectiles/Magic/AetherfluxCannonHoldout.cs | 3 +-- Projectiles/Magic/NanoPurgeHoldout.cs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Projectiles/Magic/AetherfluxCannonHoldout.cs b/Projectiles/Magic/AetherfluxCannonHoldout.cs index f516b8a025..69891cace5 100644 --- a/Projectiles/Magic/AetherfluxCannonHoldout.cs +++ b/Projectiles/Magic/AetherfluxCannonHoldout.cs @@ -31,9 +31,8 @@ namespace CalamityMod.Projectiles.Magic public override void KillHoldoutLogic() { base.KillHoldoutLogic(); - bool actuallyShoot = DeployedFrames >= (HeldItem?.useAnimation ?? AetherfluxCannon.UseTime); - bool manaOK = !actuallyShoot || Owner.CheckMana(Owner.ActiveItem(), -1, true, false); + bool manaOK = !actuallyShoot || Owner.CheckMana(Owner.ActiveItem()); if (!manaOK) Projectile.Kill(); } diff --git a/Projectiles/Magic/NanoPurgeHoldout.cs b/Projectiles/Magic/NanoPurgeHoldout.cs index 54a6a8e99a..4127860c0a 100644 --- a/Projectiles/Magic/NanoPurgeHoldout.cs +++ b/Projectiles/Magic/NanoPurgeHoldout.cs @@ -34,9 +34,8 @@ namespace CalamityMod.Projectiles.Magic public override void KillHoldoutLogic() { base.KillHoldoutLogic(); - bool actuallyShoot = DeployedFrames >= (HeldItem?.useAnimation ?? NanoPurge.UseTime); - bool manaOK = !actuallyShoot || Owner.CheckMana(Owner.ActiveItem(), -1, true, false); + bool manaOK = !actuallyShoot || Owner.CheckMana(Owner.ActiveItem()); if (!manaOK) Projectile.Kill(); } From e3794c233bad5c04da3367b74e13be0193319fb0 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 17 May 2024 15:28:20 -0500 Subject: [PATCH 058/177] Master Rev+ Prime heads can charge at the player in all phases. --- NPCs/NormalNPCs/SkeletronPrime2.cs | 42 +++++++++++-------- .../Bosses/SkeletronPrimeAI.cs | 12 +++++- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs index 6164daf879..87cfa1a4bf 100644 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ b/NPCs/NormalNPCs/SkeletronPrime2.cs @@ -268,28 +268,34 @@ namespace CalamityMod.NPCs.NormalNPCs // Start other phases; if arms are dead, start with spin phase bool otherHeadChargingOrSpinning = Main.npc[(int)NPC.ai[0]].ai[1] == 5f || Main.npc[(int)NPC.ai[0]].ai[1] == 1f; - if (phase2 || CalamityWorld.LegendaryMode || allArmsDead) + + // Start spin phase after 1.875 seconds + NPC.ai[2] += phase3 ? 1.2f : 0.8f; + if (NPC.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || phase3) && canUseAttackInMaster) { - // Start spin phase after 1.875 seconds - NPC.ai[2] += phase3 ? 1.2f : 0.8f; - if (NPC.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || phase3) && canUseAttackInMaster) + bool shouldSpinAround = NPC.ai[1] == 4f && NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - 400f && + Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) > 400f; + + bool shouldCharge = !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; + if (shouldCharge) { - bool shouldSpinAround = NPC.ai[1] == 4f && NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - 400f && - Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) > 400f; - - if (shouldSpinAround || NPC.ai[1] != 4f) + NPC.ai[2] = 0f; + NPC.ai[1] = 1f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + else if (shouldSpinAround || NPC.ai[1] != 4f) + { + if (shouldSpinAround) { - if (shouldSpinAround) - { - NPC.localAI[3] = 300f; - NPC.SyncVanillaLocalAI(); - } - - NPC.ai[2] = 0f; - NPC.ai[1] = shouldSpinAround ? 5f : 1f; - NPC.TargetClosest(); - NPC.netUpdate = true; + NPC.localAI[3] = 300f; + NPC.SyncVanillaLocalAI(); } + + NPC.ai[2] = 0f; + NPC.ai[1] = shouldSpinAround ? 5f : 1f; + NPC.TargetClosest(); + NPC.netUpdate = true; } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index 96febd4b2a..3d01ee7107 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -260,7 +260,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Start other phases; if arms are dead, start with spin phase bool otherHeadChargingOrSpinning = Main.npc[(int)npc.ai[0]].ai[1] == 5f || Main.npc[(int)npc.ai[0]].ai[1] == 1f; - if (phase2 || CalamityWorld.LegendaryMode || allArmsDead) + if (phase2 || CalamityWorld.LegendaryMode || allArmsDead || masterMode) { // Start spin phase after 1.5 seconds npc.ai[2] += phase3 ? 1.5f : 1f; @@ -269,7 +269,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool shouldSpinAround = npc.ai[1] == 4f && npc.position.Y < Main.player[npc.target].position.Y - 400f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 600f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 400f; - if (shouldSpinAround || npc.ai[1] != 4f) + bool shouldCharge = masterMode && !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; + if (shouldCharge) + { + npc.ai[2] = 0f; + npc.ai[1] = 1f; + npc.TargetClosest(); + npc.netUpdate = true; + } + else if (shouldSpinAround || npc.ai[1] != 4f) { if (shouldSpinAround) { From bc4c56fc68610d72abdd0d1e14cb9c3588eecb7a Mon Sep 17 00:00:00 2001 From: Xyk Date: Fri, 17 May 2024 14:01:55 -0700 Subject: [PATCH 059/177] wingman and terratomere fix --- Projectiles/Magic/WingmanHoldout.cs | 2 +- Projectiles/Melee/TerratomereExplosion.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Projectiles/Magic/WingmanHoldout.cs b/Projectiles/Magic/WingmanHoldout.cs index 7a7d41eec1..c0a303c917 100644 --- a/Projectiles/Magic/WingmanHoldout.cs +++ b/Projectiles/Magic/WingmanHoldout.cs @@ -191,7 +191,7 @@ namespace CalamityMod.Projectiles.Magic { SoundStyle fire = new("CalamityMod/Sounds/Item/DeadSunExplosion"); SoundEngine.PlaySound(fire with { Volume = 0.35f, Pitch = -0.4f, PitchVariance = 0.2f }, Projectile.Center); - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, (firingVelocity * 2) * Utils.GetLerpValue(60, 10, FiringTime, true), ModContent.ProjectileType(), (int)(Projectile.damage * 6), Projectile.knockBack * 5, Projectile.owner, 0); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), tipPosition, (firingVelocity * 1.3f) * Utils.GetLerpValue(60, 10, FiringTime, true), ModContent.ProjectileType(), (int)(Projectile.damage * 6), Projectile.knockBack * 5, Projectile.owner, 0); } else { diff --git a/Projectiles/Melee/TerratomereExplosion.cs b/Projectiles/Melee/TerratomereExplosion.cs index ecb1d3d4f6..4c5bb9a0fa 100644 --- a/Projectiles/Melee/TerratomereExplosion.cs +++ b/Projectiles/Melee/TerratomereExplosion.cs @@ -60,11 +60,11 @@ namespace CalamityMod.Projectiles.Melee Vector2 drawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = frame.Size() * 0.5f; - for (int i = 0; i < 36; i++) + for (int i = 0; i < 2; i++) { Vector2 lightDrawPosition = drawPosition + (MathHelper.TwoPi * i / 36f + Main.GlobalTimeWrappedHourly * 5f).ToRotationVector2() * Projectile.scale * 12f; Color lightBurstColor = CalamityUtils.MulticolorLerp(Projectile.timeLeft / 144f, Terratomere.TerraColor1, Terratomere.TerraColor2); - lightBurstColor = Color.Lerp(lightBurstColor, Color.White, 0.4f) * Projectile.Opacity * 0.184f; + lightBurstColor = Color.Lerp(lightBurstColor, Color.White, 0.4f) * Projectile.Opacity * 0.24f; Main.spriteBatch.Draw(lightTexture, lightDrawPosition, null, lightBurstColor, 0f, lightTexture.Size() * 0.5f, Projectile.scale * 1.32f, SpriteEffects.None, 0); } Main.spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1.6f, SpriteEffects.None, 0); From af8bc849e2cd60d617f2cf72254d7ac9d2cff02b Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 17 May 2024 17:02:21 -0400 Subject: [PATCH 060/177] Fixed Exoblade dash having a jagged trail. --- Projectiles/Melee/ExobladeProj.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index 028976e98e..e3de37a700 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -363,6 +363,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity = Owner.MountedCenter.DirectionTo(Owner.Calamity().mouseWorld); Projectile.oldPos = new Vector2[Projectile.oldPos.Length]; + + // Prevent zeroed out garbage from messing up the trail rendering. + for (int i = 0; i < Projectile.oldPos.Length; ++i) + Projectile.oldPos[i] = Projectile.position; } // Do the dash. @@ -418,8 +422,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4 * Direction; } - - public float SlashWidthFunction(float completionRatio) => SquishAtProgress(RealProgressionAtTrailCompletion(completionRatio)) * Projectile.scale * 60.5f; public Color SlashColorFunction(float completionRatio) => Color.Lime * Utils.GetLerpValue(0.9f, 0.4f, completionRatio, true) * Projectile.Opacity; @@ -487,7 +489,6 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.EnterShaderRegion(); - Color mainColor = MulticolorLerp((Main.GlobalTimeWrappedHourly * 2f) % 1, Color.Cyan, Color.Lime, Color.GreenYellow, Color.Goldenrod, Color.Orange); Color secondaryColor = MulticolorLerp((Main.GlobalTimeWrappedHourly * 2f + 0.2f) % 1, Color.Cyan, Color.Lime, Color.GreenYellow, Color.Goldenrod, Color.Orange); @@ -500,7 +501,12 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:ExobladePierce"].UseColor(mainColor); GameShaders.Misc["CalamityMod:ExobladePierce"].UseSecondaryColor(secondaryColor); GameShaders.Misc["CalamityMod:ExobladePierce"].Apply(); - PrimitiveRenderer.RenderTrail(Projectile.oldPos.Take(51).ToArray(), new(PierceWidthFunction, PierceColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), 53); + + // Exoblade tracks 120 positions in oldPos. + // Provide 60 points for smoothing, but only render 30 + int numPoints = 30; + var positionsToUse = Projectile.oldPos.Take(numPoints * 2).ToArray(); + PrimitiveRenderer.RenderTrail(positionsToUse, new(PierceWidthFunction, PierceColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), numPoints); Main.spriteBatch.ExitShaderRegion(); } From dd3745472866a5ab1a74be1572bf5fb9ea263ed4 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 17 May 2024 17:22:31 -0400 Subject: [PATCH 061/177] Fix Photon Ripper trails bugging out (same fix as Exoblade). --- Projectiles/Melee/ExobladeProj.cs | 7 ++++--- Projectiles/Melee/PrismTooth.cs | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index e3de37a700..c754b6d14e 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -504,9 +504,10 @@ namespace CalamityMod.Projectiles.Melee // Exoblade tracks 120 positions in oldPos. // Provide 60 points for smoothing, but only render 30 - int numPoints = 30; - var positionsToUse = Projectile.oldPos.Take(numPoints * 2).ToArray(); - PrimitiveRenderer.RenderTrail(positionsToUse, new(PierceWidthFunction, PierceColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), numPoints); + int numPointsRendered = 30; + int numPointsProvided = 60; + var positionsToUse = Projectile.oldPos.Take(numPointsProvided).ToArray(); + PrimitiveRenderer.RenderTrail(positionsToUse, new(PierceWidthFunction, PierceColorFunction, (_) => trailOffset, shader: GameShaders.Misc["CalamityMod:ExobladePierce"]), numPointsRendered); Main.spriteBatch.ExitShaderRegion(); } diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index d7a1981016..27b738b95c 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Graphics.Primitives; using Microsoft.Xna.Framework; @@ -22,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetStaticDefaults() { ProjectileID.Sets.TrailingMode[Projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 36; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 90; } public override void SetDefaults() @@ -42,6 +43,14 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { + // Frame 1 effect: Prevent zeroed out garbage from messing up the trail rendering. + if (Projectile.localAI[1] == 0f) + { + Projectile.localAI[1] = 1f; + for (int i = 0; i < Projectile.oldPos.Length; ++i) + Projectile.oldPos[i] = Projectile.position; + } + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.Pi * Time / Lifetime; Vector2 baseDirection = (MathHelper.TwoPi * Time / Lifetime - MathHelper.PiOver2).ToRotationVector2(); @@ -128,7 +137,12 @@ namespace CalamityMod.Projectiles.Melee Main.spriteBatch.EnterShaderRegion(); GameShaders.Misc["CalamityMod:PrismaticStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak")); - PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + generalOffset, shader: GameShaders.Misc["CalamityMod:PrismaticStreak"]), 65); + // Photon Ripper tracks 90 positions in oldPos. + // Provide 60 points for smoothing, but only render 12 + int numPointsRendered = 12; + int numPointsProvided = 60; + var positionsToUse = Projectile.oldPos.Take(numPointsProvided).ToArray(); + PrimitiveRenderer.RenderTrail(positionsToUse, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + generalOffset, shader: GameShaders.Misc["CalamityMod:PrismaticStreak"], smoothen: false), numPointsRendered); Main.spriteBatch.ExitShaderRegion(); return true; } From c8d08dfad029d446187c1e40444554a0515d3dda Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 23:22:52 +0200 Subject: [PATCH 062/177] Fixed Lilies of Finality in multiplayer. --- Items/Weapons/Summon/LiliesOfFinality.cs | 4 +- Projectiles/Summon/LiliesOfFinalityAoE.cs | 5 +-- Projectiles/Summon/LiliesOfFinalityAriane.cs | 40 ++++++++------------ Projectiles/Summon/LiliesOfFinalityElster.cs | 15 ++------ 4 files changed, 22 insertions(+), 42 deletions(-) diff --git a/Items/Weapons/Summon/LiliesOfFinality.cs b/Items/Weapons/Summon/LiliesOfFinality.cs index 849286cb14..7e441ab524 100644 --- a/Items/Weapons/Summon/LiliesOfFinality.cs +++ b/Items/Weapons/Summon/LiliesOfFinality.cs @@ -59,8 +59,8 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectileDirect(source, Main.MouseWorld, new Vector2(-1f, -1f) * 3f, type, damage, knockback, player.whoAmI); - Projectile.NewProjectileDirect(source, Main.MouseWorld, new Vector2(1f, -1f) * 3f, ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectileDirect(source, player.Calamity().mouseWorld, new Vector2(-1f, -1f) * 3f, type, damage, knockback, player.whoAmI); + Projectile.NewProjectileDirect(source, player.Calamity().mouseWorld, new Vector2(1f, -1f) * 3f, ProjectileType(), damage, knockback, player.whoAmI); if (Main.dedServ) return false; diff --git a/Projectiles/Summon/LiliesOfFinalityAoE.cs b/Projectiles/Summon/LiliesOfFinalityAoE.cs index 8ea6e54e24..819d1308fb 100644 --- a/Projectiles/Summon/LiliesOfFinalityAoE.cs +++ b/Projectiles/Summon/LiliesOfFinalityAoE.cs @@ -2,7 +2,6 @@ using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ModLoader; using static CalamityMod.Items.Weapons.Summon.LiliesOfFinality; @@ -38,6 +37,8 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Ariane ??= Main.projectile[(int)ArianeID]; + if (Ariane != null && Ariane.active && Ariane.owner == Projectile.owner && Ariane.type == ModContent.ProjectileType() && Ariane.ModProjectile().State == LiliesOfFinalityAriane.AIState.Attack) Projectile.timeLeft = 2; @@ -100,8 +101,6 @@ namespace CalamityMod.Projectiles.Summon Timer++; } - public override void OnSpawn(IEntitySource source) => Ariane = Main.projectile[(int)ArianeID]; - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= Ariane_AoEDMGMultiplier; } } diff --git a/Projectiles/Summon/LiliesOfFinalityAriane.cs b/Projectiles/Summon/LiliesOfFinalityAriane.cs index 1da87b762c..a6e2b0c3bf 100644 --- a/Projectiles/Summon/LiliesOfFinalityAriane.cs +++ b/Projectiles/Summon/LiliesOfFinalityAriane.cs @@ -7,9 +7,6 @@ using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.ID; using Terraria.ModLoader; using static System.MathF; using static CalamityMod.Items.Weapons.Summon.LiliesOfFinality; @@ -58,8 +55,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ProjectileType(), Projectile.damage, 0f, Projectile.owner, Projectile.whoAmI); Timer = 0f; - - NetUpdate(); } } @@ -128,23 +123,23 @@ namespace CalamityMod.Projectiles.Summon public override void CheckMinionExistence() { + if (Elster is null) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile p = Main.projectile[i]; + if (p == null || !p.active || p.owner != Projectile.owner || p.type != ProjectileType()) + continue; + Elster = p; + break; + } + } + Projectile.timeLeft = 2; if (Elster is null || !Elster.active || Elster.owner != Projectile.owner || Elster.type != ProjectileType()) Projectile.Kill(); } - public override void OnSpawn(IEntitySource source) - { - for (int i = 0; i < Main.maxProjectiles; i++) - { - Projectile p = Main.projectile[i]; - if (p == null || !p.active || p.owner != Projectile.owner || p.type != ProjectileType()) - continue; - Elster = p; - break; - } - } - public override bool OnTileCollide(Vector2 oldVelocity) => false; public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) @@ -182,6 +177,9 @@ namespace CalamityMod.Projectiles.Summon Timer++; + Projectile.netSpam = 0; + Projectile.netUpdate = true; + // If on a dedicated server, don't bother running the visuals and sounds to save resources. if (Main.dedServ) return; @@ -297,7 +295,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.owner); Timer = 0f; - NetUpdate(); // If on a dedicated server, don't bother running the visuals and sounds to save resources. if (Main.dedServ) @@ -347,13 +344,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.spriteDirection = spriteDirection; } - private void NetUpdate() - { - Projectile.netUpdate = true; - if (Projectile.netSpam >= 10) - Projectile.netSpam = 9; - } - #endregion #region Syncing diff --git a/Projectiles/Summon/LiliesOfFinalityElster.cs b/Projectiles/Summon/LiliesOfFinalityElster.cs index a34bfd5172..04baf4f098 100644 --- a/Projectiles/Summon/LiliesOfFinalityElster.cs +++ b/Projectiles/Summon/LiliesOfFinalityElster.cs @@ -7,8 +7,6 @@ using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.Audio; -using Terraria.GameContent; -using Terraria.ID; using Terraria.ModLoader; using static System.MathF; using static CalamityMod.Items.Weapons.Summon.LiliesOfFinality; @@ -54,8 +52,6 @@ namespace CalamityMod.Projectiles.Summon // Because some states mess with the rotation, we reset it so it doesn't cause visual issues on the states that don't deal with rotation. Projectile.rotation = 0f; - - NetUpdate(); } } @@ -179,6 +175,9 @@ namespace CalamityMod.Projectiles.Summon } Timer++; + + Projectile.netSpam = 0; + Projectile.netUpdate = true; } private void IdleState() @@ -316,7 +315,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.owner); HasShotOnce = true; - NetUpdate(); // If on a dedicated server, don't bother running the visuals and sounds to save resources. if (Main.dedServ) @@ -368,13 +366,6 @@ namespace CalamityMod.Projectiles.Summon } } - private void NetUpdate() - { - Projectile.netUpdate = true; - if (Projectile.netSpam >= 10) - Projectile.netSpam = 9; - } - #endregion #region Syncing From 0204aada769f4c13c58c6b80a51cf4b30036b09d Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Fri, 17 May 2024 14:26:41 -0700 Subject: [PATCH 063/177] Parry Acc and Weapon buffs --- CalPlayer/CalamityPlayerHitHurt.cs | 4 ++-- Items/Accessories/BlazingCore.cs | 2 +- Items/Accessories/FlameLickedShell.cs | 4 ++-- Items/Weapons/Melee/Basher.cs | 2 +- Items/Weapons/Ranged/Alluvion.cs | 2 +- Items/Weapons/Ranged/Phangasm.cs | 2 +- Projectiles/Typeless/FlameLickedBarrage.cs | 2 +- Projectiles/Typeless/FlameLickedHellblast.cs | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 7dad272e20..30b3177ccb 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1672,7 +1672,7 @@ namespace CalamityMod.CalPlayer if (blazingCoreParry > 0) //check for active parry { - if (blazingCoreParry >= 18) //only the first 12 frames (0.2 seconds) counts for a valid parry + if (blazingCoreParry >= 12) //only the first 18 frames (0.3 seconds) counts for a valid parry { if (!Player.HasCooldown(ParryCooldown.ID)) { @@ -1696,7 +1696,7 @@ namespace CalamityMod.CalPlayer } else if (flameLickedShellParry > 0) { - if (flameLickedShellParry >= 18) + if (flameLickedShellParry >= 12) { if (!Player.HasCooldown(ParryCooldown.ID)) { diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index b481df9a76..95911b09b7 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Accessories for (int i = 0; i < chains; i++) { int projectileType = ModContent.ProjectileType(); - int dmgAmt = 90; + int dmgAmt = 250; if (!empowered && Main.rand.NextBool(5)) { projectileType = ModContent.ProjectileType(); diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index cbf6b96a33..733218f7e3 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Accessories int totalProjectiles = 6; float offsetAngle = (float)Math.PI * radialOffset; int type = ModContent.ProjectileType(); - int damage = (int)player.GetBestClassDamage().ApplyTo(60); + int damage = (int)player.GetBestClassDamage().ApplyTo(200); damage = player.ApplyArmorAccDamageBonusesTo(damage); if (player.whoAmI == Main.myPlayer) @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Accessories totalProjectiles = 12; float radians2 = MathHelper.TwoPi / totalProjectiles; type = ModContent.ProjectileType(); - damage = (int)player.GetBestClassDamage().ApplyTo(20); + damage = (int)player.GetBestClassDamage().ApplyTo(70); damage = player.ApplyArmorAccDamageBonusesTo(damage); double angleA = radians2 * 0.5; diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index ae3d491e6c..f63ec86d3d 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 56; Item.height = 60; - Item.damage = 41; + Item.damage = 50; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 40; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index 86ef655e99..a062ad960f 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 62; Item.height = 90; - Item.damage = 78; + Item.damage = 83; Item.DamageType = DamageClass.Ranged; Item.useTime = 15; Item.useAnimation = 30; diff --git a/Items/Weapons/Ranged/Phangasm.cs b/Items/Weapons/Ranged/Phangasm.cs index 5f4e9d8ac4..7a8aab8725 100644 --- a/Items/Weapons/Ranged/Phangasm.cs +++ b/Items/Weapons/Ranged/Phangasm.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 48; Item.height = 82; - Item.damage = 87; + Item.damage = 117; Item.useTime = 12; Item.useAnimation = 12; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Projectiles/Typeless/FlameLickedBarrage.cs b/Projectiles/Typeless/FlameLickedBarrage.cs index 9cf48e17df..494f9b6096 100644 --- a/Projectiles/Typeless/FlameLickedBarrage.cs +++ b/Projectiles/Typeless/FlameLickedBarrage.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.penetrate = -1; + Projectile.penetrate = 3; Projectile.timeLeft = 300; Projectile.localNPCHitCooldown = -1; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Typeless/FlameLickedHellblast.cs b/Projectiles/Typeless/FlameLickedHellblast.cs index b9e0ee19ff..8ce1b6bcf2 100644 --- a/Projectiles/Typeless/FlameLickedHellblast.cs +++ b/Projectiles/Typeless/FlameLickedHellblast.cs @@ -27,9 +27,9 @@ namespace CalamityMod.Projectiles.Typeless Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.penetrate = -1; + Projectile.penetrate = 5; Projectile.timeLeft = 255; - Projectile.localNPCHitCooldown = -1; + Projectile.localNPCHitCooldown = 10; Projectile.usesLocalNPCImmunity = true; } From 1e31332afea168a83bbd87ad94a1c8e681265946 Mon Sep 17 00:00:00 2001 From: Memes Date: Fri, 17 May 2024 23:30:15 +0200 Subject: [PATCH 064/177] Mineral Mortar points correctly when spawned. --- Items/Weapons/Ranged/MineralMortar.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Ranged/MineralMortar.cs b/Items/Weapons/Ranged/MineralMortar.cs index aef7481495..2b06fe3f35 100644 --- a/Items/Weapons/Ranged/MineralMortar.cs +++ b/Items/Weapons/Ranged/MineralMortar.cs @@ -43,11 +43,8 @@ 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) { - Projectile holdout = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); - - // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out. - holdout.rotation = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero).ToRotation(); - + Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); + Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), 0, 0f, player.whoAmI); return false; } From e5c3e7f399100de7878866804edb43ac8bce74a1 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 17 May 2024 17:31:32 -0400 Subject: [PATCH 065/177] Grrrrrr rogue Hydrothermic armor --- Items/CalamityGlobalItem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 8c6efe6774..6b546a1061 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -437,8 +437,8 @@ namespace CalamityMod.Items modPlayer.canFireAtaxiaRogueProjectile = false; int flareID = ModContent.ProjectileType(); - // Ataxia Rogue Flares: 6 x 50%, soft cap starts at 90 base damage - int flareDamage = CalamityUtils.DamageSoftCap(damage * 0.5, 90); + // Hydrothermic Rogue Flares: 6 x (50 + 15%), soft cap starts at 90 base damage + int flareDamage = CalamityUtils.DamageSoftCap(50 + damage * 0.15, 90); flareDamage = player.ApplyArmorAccDamageBonusesTo(flareDamage); if (player.whoAmI == Main.myPlayer) From dd2a0571e8ead77c5096b781b48de5b4177d0166 Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Fri, 17 May 2024 14:33:40 -0700 Subject: [PATCH 066/177] Minor iframes mistake --- Projectiles/Typeless/FlameLickedHellblast.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Typeless/FlameLickedHellblast.cs b/Projectiles/Typeless/FlameLickedHellblast.cs index 8ce1b6bcf2..d9071df464 100644 --- a/Projectiles/Typeless/FlameLickedHellblast.cs +++ b/Projectiles/Typeless/FlameLickedHellblast.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.tileCollide = false; Projectile.penetrate = 5; Projectile.timeLeft = 255; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; Projectile.usesLocalNPCImmunity = true; } From 5e2e8b5b3ee9fc2a901fa332a687ab7447a0c6bc Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 17 May 2024 17:56:34 -0400 Subject: [PATCH 067/177] Fix Violence trails being jagged and strange. --- Projectiles/Melee/ViolenceThrownProjectile.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Projectiles/Melee/ViolenceThrownProjectile.cs b/Projectiles/Melee/ViolenceThrownProjectile.cs index 345883e0f8..393fc828d1 100644 --- a/Projectiles/Melee/ViolenceThrownProjectile.cs +++ b/Projectiles/Melee/ViolenceThrownProjectile.cs @@ -215,7 +215,12 @@ namespace CalamityMod.Projectiles.Melee drawPoints[i] -= (Projectile.oldRot[i] + MathHelper.PiOver4).ToRotationVector2() * Projectile.height * 0.5f; if (Time > Projectile.oldPos.Length) - PrimitiveRenderer.RenderTrail(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 88); + { + // Violence trakcs 36 positions in oldPos. + // Provide all 36 points for smoothing, but only render 24. + int numPointsRendered = 24; + PrimitiveRenderer.RenderTrail(drawPoints, new(PrimitiveWidthFunction, PrimitiveColorFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"], smoothen: true), numPointsRendered); + } Vector2 drawPosition = Projectile.Center - Main.screenPosition; for (int i = 0; i < 6; i++) From 883b91043441f40bd73fc5fa7cce4dd62c6f7111 Mon Sep 17 00:00:00 2001 From: Xyk Date: Fri, 17 May 2024 15:01:49 -0700 Subject: [PATCH 068/177] beam slash buggy visual replacement small genesis fix --- Items/Weapons/Magic/Genesis.cs | 2 +- Projectiles/Melee/DarklightGreatswordSlash.cs | 31 +++++-------------- Projectiles/Melee/ExobeamSlash.cs | 29 +++++------------ Projectiles/Melee/TerratomereExplosion.cs | 7 +++-- Projectiles/Melee/TerratomereSlash.cs | 29 +++++------------ Projectiles/Melee/TerratomereSwordBeam.cs | 12 +++++-- 6 files changed, 36 insertions(+), 74 deletions(-) diff --git a/Items/Weapons/Magic/Genesis.cs b/Items/Weapons/Magic/Genesis.cs index 9e3d003e4a..44c82b67ff 100644 --- a/Items/Weapons/Magic/Genesis.cs +++ b/Items/Weapons/Magic/Genesis.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 0); holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter); return false; } diff --git a/Projectiles/Melee/DarklightGreatswordSlash.cs b/Projectiles/Melee/DarklightGreatswordSlash.cs index 240b16bdc5..f745eabf07 100644 --- a/Projectiles/Melee/DarklightGreatswordSlash.cs +++ b/Projectiles/Melee/DarklightGreatswordSlash.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -34,6 +36,11 @@ namespace CalamityMod.Projectiles.Melee { Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.Opacity = Projectile.timeLeft / 35f; + if (Projectile.timeLeft == 34) + { + Particle spark2 = new GlowSparkParticle(Projectile.Center, new Vector2(0.1f, 0.1f).RotatedByRandom(100), false, 12, Main.rand.NextFloat(0.03f, 0.05f), Main.rand.NextBool() ? Color.Pink : Color.Cyan, new Vector2(2, 0.5f), true); + GeneralParticleHandler.SpawnParticle(spark2); + } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); @@ -44,30 +51,6 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (Projectile.timeLeft >= 34f) - return false; - - Main.spriteBatch.SetBlendState(BlendState.Additive); - - float progress = (33f - Projectile.timeLeft) / 33f; - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Texture2D bloomTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; - - Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Vector2 origin = texture.Size() * 0.5f; - Vector2 scale = new Vector2(MathHelper.Lerp(0.8f, 1.25f, (float)Math.Pow(progress, 0.45)), MathHelper.Lerp(0.6f, 0.24f, (float)Math.Pow(progress, 0.4))) * Projectile.scale; - - // Draw an inner bloom circle to signify power at the center of the strike along with two thinner lines. - Vector2 bloomScale = Projectile.Size / bloomTexture.Size() * new Vector2(1f, 2f); - Vector2 bloomOrigin = bloomTexture.Size() * 0.5f; - Color outerSlashColor = Projectile.ai[2] == 0f ? Color.DarkBlue : Color.DarkRed; - Color innerSlashColor = Projectile.ai[2] == 0f ? Color.Cyan : Color.Pink; - Main.spriteBatch.Draw(bloomTexture, drawPosition, null, outerSlashColor * Projectile.Opacity, Projectile.rotation, bloomOrigin, bloomScale, 0, 0f); - Main.spriteBatch.Draw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, scale, 0, 0f); - Main.spriteBatch.Draw(texture, drawPosition, null, innerSlashColor * Projectile.Opacity, Projectile.rotation, origin, scale * new Vector2(1f, 0.6f), 0, 0f); - - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); return false; } } diff --git a/Projectiles/Melee/ExobeamSlash.cs b/Projectiles/Melee/ExobeamSlash.cs index 556a8b8b79..c93a8ee983 100644 --- a/Projectiles/Melee/ExobeamSlash.cs +++ b/Projectiles/Melee/ExobeamSlash.cs @@ -1,5 +1,7 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -32,6 +34,11 @@ namespace CalamityMod.Projectiles.Melee { Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.Opacity = Projectile.timeLeft / 35f; + if (Projectile.timeLeft == 34) + { + Particle spark2 = new GlowSparkParticle(Projectile.Center, new Vector2(0.1f, 0.1f).RotatedByRandom(100), false, 12, Main.rand.NextFloat(0.05f, 0.09f), (Main.rand.NextBool() ? Color.Cyan : Main.rand.NextBool() ? Color.LightGoldenrodYellow : Color.Lime) * 0.7f, new Vector2(2, 0.5f), true); + GeneralParticleHandler.SpawnParticle(spark2); + } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) @@ -55,28 +62,6 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (Projectile.timeLeft > 33) - return false; - - Main.spriteBatch.SetBlendState(BlendState.Additive); - - float progress = (33 - Projectile.timeLeft) / 33f; - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Texture2D bloomTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; - - Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Vector2 origin = texture.Size() * 0.5f; - Vector2 scale = new Vector2(0.5f + 0.7f * (float)Math.Pow(progress, 0.45), 0.55f - 0.3f * (float)Math.Pow(progress, 0.4)) * Projectile.scale; - - - Vector2 bloomScale = Projectile.Size / bloomTexture.Size() * new Vector2(1f, 2f); - Vector2 bloomOrigin = bloomTexture.Size() * 0.5f; - Main.spriteBatch.Draw(bloomTexture, drawPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, bloomOrigin, bloomScale, 0, 0f); - Main.spriteBatch.Draw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, scale, 0, 0f); - Main.spriteBatch.Draw(texture, drawPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, origin, scale * new Vector2(1f, 0.6f), 0, 0f); - - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); return false; } } diff --git a/Projectiles/Melee/TerratomereExplosion.cs b/Projectiles/Melee/TerratomereExplosion.cs index 4c5bb9a0fa..6082d67ae7 100644 --- a/Projectiles/Melee/TerratomereExplosion.cs +++ b/Projectiles/Melee/TerratomereExplosion.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Melee // Play an explosion sound on the first frame of this projectile's existence. if (Projectile.localAI[0] == 0f) { - SoundEngine.PlaySound(SubsumingVortex.ExplosionSound, Projectile.Center); + SoundEngine.PlaySound(SubsumingVortex.ExplosionSound with { Volume = 0.6f }, Projectile.Center); Projectile.localAI[0] = 1f; } @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.frameCounter++; if (Projectile.frameCounter % 5 == 4) Projectile.frame++; - if (Projectile.frame >= 18) + if (Projectile.frame >= 17) Projectile.Kill(); // Exponentially accelerate. @@ -67,7 +67,8 @@ namespace CalamityMod.Projectiles.Melee lightBurstColor = Color.Lerp(lightBurstColor, Color.White, 0.4f) * Projectile.Opacity * 0.24f; Main.spriteBatch.Draw(lightTexture, lightDrawPosition, null, lightBurstColor, 0f, lightTexture.Size() * 0.5f, Projectile.scale * 1.32f, SpriteEffects.None, 0); } - Main.spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1.6f, SpriteEffects.None, 0); + if (Projectile.timeLeft < 149) + Main.spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1.6f, SpriteEffects.None, 0); } } } diff --git a/Projectiles/Melee/TerratomereSlash.cs b/Projectiles/Melee/TerratomereSlash.cs index eb7bdb2e23..56677a094d 100644 --- a/Projectiles/Melee/TerratomereSlash.cs +++ b/Projectiles/Melee/TerratomereSlash.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -33,6 +35,11 @@ namespace CalamityMod.Projectiles.Melee { Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.Opacity = Projectile.timeLeft / 35f; + if (Projectile.timeLeft == 34) + { + Particle spark2 = new GlowSparkParticle(Projectile.Center, new Vector2(0.1f, 0.1f).RotatedByRandom(100), false, 12, Main.rand.NextFloat(0.05f, 0.09f), Main.rand.NextBool() ? Terratomere.TerraColor1 : Terratomere.TerraColor2, new Vector2(2, 0.5f), true); + GeneralParticleHandler.SpawnParticle(spark2); + } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) @@ -46,28 +53,6 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - if (Projectile.timeLeft >= 34f) - return false; - - Main.spriteBatch.SetBlendState(BlendState.Additive); - - float progress = (33f - Projectile.timeLeft) / 33f; - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Texture2D bloomTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; - - Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Vector2 origin = texture.Size() * 0.5f; - Vector2 scale = new Vector2(MathHelper.Lerp(0.8f, 1.25f, (float)Math.Pow(progress, 0.45)), MathHelper.Lerp(0.6f, 0.24f, (float)Math.Pow(progress, 0.4))) * Projectile.scale; - - // Draw an inner bloom circle to signify power at the center of the strike along with two thinner lines. - Vector2 bloomScale = Projectile.Size / bloomTexture.Size() * new Vector2(1f, 2f); - Vector2 bloomOrigin = bloomTexture.Size() * 0.5f; - Main.spriteBatch.Draw(bloomTexture, drawPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, bloomOrigin, bloomScale, 0, 0f); - Main.spriteBatch.Draw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, scale, 0, 0f); - Main.spriteBatch.Draw(texture, drawPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, origin, scale * new Vector2(1f, 0.6f), 0, 0f); - - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); return false; } } diff --git a/Projectiles/Melee/TerratomereSwordBeam.cs b/Projectiles/Melee/TerratomereSwordBeam.cs index b31f77baca..1343fe2c9f 100644 --- a/Projectiles/Melee/TerratomereSwordBeam.cs +++ b/Projectiles/Melee/TerratomereSwordBeam.cs @@ -39,13 +39,21 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 24f, 20f); + CalamityUtils.HomeInOnNPC(Projectile, true, 400f, 24f, 20f); Projectile.scale = Utils.GetLerpValue(0f, 8f, Projectile.timeLeft, true); + + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? 131 : 294, -Projectile.velocity * Main.rand.NextFloat(0.05f, 0.3f)); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(0.75f, 0.95f); + if (dust.type == 131) + dust.scale = Main.rand.NextFloat(0.55f, 0.75f); + else + dust.fadeIn = 0.5f; } public float SlashWidthFunction(float _) => Projectile.width * Projectile.scale * Utils.GetLerpValue(0f, 0.1f, _, true); - public Color SlashColorFunction(float _) => Color.Lime * Projectile.Opacity; + public Color SlashColorFunction(float _) => Color.Turquoise; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { From 442dea5966fe16cbab0309d8e417f67523cff78f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 17 May 2024 18:05:45 -0400 Subject: [PATCH 069/177] Exorcism stars have predictive aim --- Projectiles/Rogue/ExorcismProj.cs | 25 ++++++++++++++----------- Projectiles/Rogue/ExorcismStar.cs | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Projectiles/Rogue/ExorcismProj.cs b/Projectiles/Rogue/ExorcismProj.cs index ff5246efc9..79b74887d0 100644 --- a/Projectiles/Rogue/ExorcismProj.cs +++ b/Projectiles/Rogue/ExorcismProj.cs @@ -73,6 +73,20 @@ namespace CalamityMod.Projectiles.Rogue } } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + // Stars + if (Projectile.Calamity().stealthStrike) + { + for (int i = 0; i < 6; i++) + { + Vector2 pos = new Vector2(Projectile.Center.X + (float)Projectile.width * 0.5f + (float)Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 starVelocity = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 30f, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, starVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack * 0.5f, Projectile.owner, Main.rand.NextFloat(-3f, 3f), 0f); + } + } + } + public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; @@ -97,17 +111,6 @@ namespace CalamityMod.Projectiles.Rogue Main.projectile[p].rotation = Projectile.rotation; if (Projectile.Calamity().stealthStrike) Main.projectile[p].Calamity().stealthStrike = true; - // Stars - if (Projectile.Calamity().stealthStrike) - { - for (int i = 0; i < 6; i++) - { - Vector2 pos = new Vector2(Projectile.Center.X + (float)Projectile.width * 0.5f + (float)Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - float speedX = (Projectile.Center.X - pos.X) / 20f; - float speedY = (Projectile.Center.Y - pos.Y) / 20f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos.X, pos.Y, speedX, speedY, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack * 0.5f, Projectile.owner, Main.rand.NextFloat(-3f, 3f), 0f); - } - } } } } diff --git a/Projectiles/Rogue/ExorcismStar.cs b/Projectiles/Rogue/ExorcismStar.cs index 1205f4d2c5..9c31376c1d 100644 --- a/Projectiles/Rogue/ExorcismStar.cs +++ b/Projectiles/Rogue/ExorcismStar.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; + Projectile.MaxUpdates = 2; Projectile.DamageType = RogueDamageClass.Instance; } From c3ac6c2c59851a6a9a79cda21edc3b840a4afd87 Mon Sep 17 00:00:00 2001 From: HwakYuk <133916598+HwakYuk@users.noreply.github.com> Date: Sat, 18 May 2024 07:08:21 +0900 Subject: [PATCH 070/177] Difficulties are now actually sorted (#40) --- Systems/DifficultyModeSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Systems/DifficultyModeSystem.cs b/Systems/DifficultyModeSystem.cs index 514d003dd5..afbfc41794 100644 --- a/Systems/DifficultyModeSystem.cs +++ b/Systems/DifficultyModeSystem.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Systems public static void CalculateDifficultyData() { MostAlternateDifficulties = 1; - Difficulties.OrderBy(d => d.DifficultyScale); + Difficulties = Difficulties.OrderBy(d => d.DifficultyScale).ToList(); //Difficulties are arranged in "tiers". This is done so that multiple mods can add their own alternate difficulties sharing a tier with the base ones DifficultyTiers = new List(); From c4d0bed38a72c6f57ffd4c10168277d638ad89d3 Mon Sep 17 00:00:00 2001 From: Xyk Date: Fri, 17 May 2024 15:14:43 -0700 Subject: [PATCH 071/177] Stream gouge fix --- Projectiles/Melee/Spears/StreamGougeProj.cs | 16 +++++----------- Projectiles/Melee/StreamGougePortal.cs | 13 ++++++------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index 1f7d7b90fa..49a36ff07b 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -111,20 +111,16 @@ namespace CalamityMod.Projectiles.Melee.Spears // Black portal. Color color = Color.Lerp(baseColor, Color.Black, 0.55f).MultiplyRGB(Color.DarkGray) * opacity; - Main.EntitySpriteDraw(portalTexture, drawPosition, null, color, rotation, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(portalTexture, drawPosition, null, color, -rotation, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); - - Main.spriteBatch.SetBlendState(BlendState.Additive); + Main.EntitySpriteDraw(portalTexture, drawPosition, null, color with { A = 0 }, rotation, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(portalTexture, drawPosition, null, color with { A = 0 }, -rotation, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); // Cyan portal. color = Color.Lerp(baseColor, Color.Cyan, 0.55f) * opacity * 1.6f; - Main.EntitySpriteDraw(portalTexture, drawPosition, null, color, rotation * 0.6f, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(portalTexture, drawPosition, null, color with { A = 0 }, rotation * 0.6f, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); // Magenta portal. color = Color.Lerp(baseColor, Color.Fuchsia, 0.55f) * opacity * 1.6f; - Main.EntitySpriteDraw(portalTexture, drawPosition, null, color, rotation * -0.6f, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); - - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); + Main.EntitySpriteDraw(portalTexture, drawPosition, null, color with { A = 0 }, rotation * -0.6f, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); } public override bool PreDraw(ref Color lightColor) @@ -134,8 +130,6 @@ namespace CalamityMod.Projectiles.Melee.Spears { Texture2D smear = ModContent.Request("CalamityMod/Particles/SemiCircularSmear").Value; - Main.spriteBatch.EnterShaderRegion(BlendState.Additive); - float rotation = Projectile.rotation - MathHelper.Pi / 5f; if (SpinDirection == -1f) rotation += MathHelper.Pi; @@ -143,7 +137,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Color smearColor = Color.Fuchsia * CalamityUtils.Convert01To010(SpinCompletion) * 0.9f; Vector2 smearOrigin = smear.Size() * 0.5f; - Main.EntitySpriteDraw(smear, Owner.Center - Main.screenPosition, null, smearColor, rotation, smearOrigin, Projectile.scale * 1.45f, 0, 0); + Main.EntitySpriteDraw(smear, Owner.Center - Main.screenPosition, null, smearColor with { A = 0 }, rotation, smearOrigin, Projectile.scale * 1.45f, 0, 0); Main.spriteBatch.ExitShaderRegion(); } diff --git a/Projectiles/Melee/StreamGougePortal.cs b/Projectiles/Melee/StreamGougePortal.cs index eaccceee17..12c3f98945 100644 --- a/Projectiles/Melee/StreamGougePortal.cs +++ b/Projectiles/Melee/StreamGougePortal.cs @@ -59,6 +59,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { + Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Melee/StreamGouge").Value; Vector2 spearDrawPosition = SpearCenter - Main.screenPosition; Vector2 spearOrigin = texture.Size() * 0.5f; @@ -76,19 +77,17 @@ namespace CalamityMod.Projectiles.Melee // Black portal. Color color = Color.Lerp(baseColor, Color.Black, 0.55f).MultiplyRGB(Color.DarkGray) * Projectile.Opacity; - Main.EntitySpriteDraw(portalTexture, drawPosition, null, color, rotation, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(portalTexture, drawPosition, null, color, -rotation, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); - - Main.spriteBatch.SetBlendState(BlendState.Additive); + Main.EntitySpriteDraw(portalTexture, drawPosition, null, color with { A = 0 }, rotation, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(portalTexture, drawPosition, null, color with { A = 0 }, -rotation, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); // Cyan portal. color = Color.Lerp(baseColor, Color.Cyan, 0.55f) * Projectile.Opacity * 1.4f; - Main.EntitySpriteDraw(portalTexture, drawPosition, null, color, rotation * 0.6f, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(portalTexture, drawPosition, null, color with { A = 0 }, rotation * 0.6f, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); // Magenta portal. color = Color.Lerp(baseColor, Color.Fuchsia, 0.55f) * Projectile.Opacity * 1.4f; - Main.EntitySpriteDraw(portalTexture, drawPosition, null, color, rotation * -0.7f, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); + Main.EntitySpriteDraw(portalTexture, drawPosition, null, color with { A = 0 }, rotation * -0.7f, origin, Projectile.scale * 1.2f, SpriteEffects.None, 0); + return false; } From 933f84a29c897a74056b99f4cc64382b9c0053c9 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 17 May 2024 18:21:53 -0500 Subject: [PATCH 072/177] Rev+ Skeletron post-charge skull spreads happen later in the fight. --- NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index bae728cb36..843d68d94c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -34,6 +34,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float phase3LifeRatio = masterMode ? 0.9f : 0.7f; float respawnHandsLifeRatio = 0.5f; float phase4LifeRatio = masterMode ? 0.4f : 0.3f; + float useSkullSpreadsAfterChargeLifeRatio = masterMode ? 0.3f : 0.2f; float phase5LifeRatio = masterMode ? 0.2f : 0.1f; // Begin firing spreads of skulls phase @@ -48,6 +49,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Fire giant cursed skull projectiles (yes, these curse you if you get hit) during charge attack and hands fire skulls phase bool phase4 = lifeRatio < phase4LifeRatio; + // Self-explanatory + bool useSkullSpreadsAfterCharge = lifeRatio < useSkullSpreadsAfterChargeLifeRatio; + // Rapid teleport and charge, stop using idle phase bool phase5 = lifeRatio < phase5LifeRatio; @@ -699,7 +703,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (respawnHands && !disableSkullsAfterCharge && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + if (useSkullSpreadsAfterCharge && !disableSkullsAfterCharge && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { // Spawn projectiles if (Main.netMode != NetmodeID.MultiplayerClient) @@ -707,7 +711,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int chargeSkullAmt = death ? 5 : 3; int chargeSkullSpread = death ? 80 : 60; float rotation = MathHelper.ToRadians(chargeSkullSpread); - float skullProjSpeed = phase4 ? (6f + (death ? 2f * ((phase4LifeRatio - lifeRatio) / phase4LifeRatio) : 0f)) : 4f; + float skullProjSpeed = phase5 ? (6f + (death ? 2f * ((phase5LifeRatio - lifeRatio) / phase5LifeRatio) : 0f)) : 4f; Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * skullProjSpeed; int type = ProjectileID.Skull; int damage = npc.GetProjectileDamage(type); From 45586734549fc79edf491f5affe30b09b6d9e580 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 17 May 2024 19:12:39 -0500 Subject: [PATCH 073/177] Destroyer laser syncing fixes. --- .../Bosses/DestroyerAI.cs | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 3a00c07cb0..455726721e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -381,9 +381,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (calamityGlobalNPC.newAI[0] < laserBreathGateValue) calamityGlobalNPC.newAI[0] += 1f; - // Sync newAI every 20 frames for the new telegraph - if (calamityGlobalNPC.newAI[0] % 20f == 0f) - npc.SyncExtraAI(); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + // Sync newAI every 20 frames for the new telegraph + if (calamityGlobalNPC.newAI[0] % 20f == 10f) + npc.SyncExtraAI(); + } if ((player.Center - npc.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(npc.velocity.ToRotation(), MathHelper.PiOver4) == npc.velocity.ToRotation() && calamityGlobalNPC.newAI[0] >= laserBreathGateValue && Vector2.Distance(npc.Center, player.Center) > 480f && @@ -493,9 +496,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (ableToFireLaser) calamityGlobalNPC.newAI[0] += laserTimerIncrement; - // Sync newAI every 20 frames for the new telegraph - if (calamityGlobalNPC.newAI[0] % 20f == 0f && ableToFireLaser) - npc.SyncExtraAI(); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + // Sync newAI every 20 frames for the new telegraph + if (calamityGlobalNPC.newAI[0] % 20f == 10f && ableToFireLaser) + npc.SyncExtraAI(); + } Color telegraphColor = Color.Transparent; switch (calamityGlobalNPC.destroyerLaserColor) @@ -1228,9 +1234,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (ableToFireLaser) npc.localAI[0] += laserTimerIncrement; - // Sync newAI every 20 frames for the new telegraph - if (npc.localAI[0] % 20f == 0f && ableToFireLaser) - npc.SyncVanillaLocalAI(); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + // Sync newAI every 20 frames for the new telegraph + if (npc.localAI[0] % 20f == 10f && ableToFireLaser) + npc.SyncVanillaLocalAI(); + } Color telegraphColor = Color.Transparent; switch (npc.Calamity().destroyerLaserColor) From 2ac645ab95281053d0cf295d37d7c857d4b6d7b9 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 17 May 2024 20:35:27 -0400 Subject: [PATCH 074/177] Version bump to 2.0.4.002 --- build.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.txt b/build.txt index f6d015e792..b80ad208f0 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 2.0.4.001 +version = 2.0.4.002 displayName = Calamity Mod modReferences = CalamityModMusic homepage = https://discord.gg/calamity From 40c54eb0cfe714c51765731ccb073e946a14018d Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 18 May 2024 12:26:34 +0700 Subject: [PATCH 075/177] so true memes (magna cannon 0 damage) --- Items/Weapons/Ranged/MagnaCannon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs index 88422994c3..aa926fe2ab 100644 --- a/Items/Weapons/Ranged/MagnaCannon.cs +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -52,7 +52,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) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter), ModContent.ProjectileType(), 0, 0f, player.whoAmI); + Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter), ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } From e8bcfdd2b9c38e816bdcf3511431ede183e798ca Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 18 May 2024 12:27:40 +0700 Subject: [PATCH 076/177] opal --- Items/Weapons/Ranged/OpalStriker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 35158cca97..2367059962 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -51,7 +51,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) { Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true); - Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } From 6d9c76d69e1866552a6a15518836b7df303a6b82 Mon Sep 17 00:00:00 2001 From: Memes Date: Sat, 18 May 2024 14:09:15 +0200 Subject: [PATCH 077/177] Entirely fixed MP Harvest Staff, thanks Direwolf. --- Projectiles/Summon/HarvestStaffMinion.cs | 55 +++++++++++------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/Projectiles/Summon/HarvestStaffMinion.cs b/Projectiles/Summon/HarvestStaffMinion.cs index c2b19b285f..15842a6816 100644 --- a/Projectiles/Summon/HarvestStaffMinion.cs +++ b/Projectiles/Summon/HarvestStaffMinion.cs @@ -211,8 +211,6 @@ namespace CalamityMod.Projectiles.Summon } } - public bool KILLYOURSELF { get; set; } - #endregion #region AI and Collisions @@ -222,8 +220,11 @@ namespace CalamityMod.Projectiles.Summon Owner ??= Main.player[Projectile.owner]; Projectile.width = Projectile.height = Variant == 0 ? 28 : (Variant == 1 ? 22 : 20); - if (Animation == AnimationState.Grow && (MySentry is null || Projectile.Distance(MySentry.Center) > 600f)) + if (Animation == AnimationState.Grow && (MySentry is null || Projectile.Distance(MySentry.Center) > 600f) && Main.myPlayer == Projectile.owner) + { Projectile.Kill(); + return; + } Target = Projectile.Center.MinionHoming(State == AIState.Still ? PlantedEnemyDistanceDetection : NormalEnemyDistanceDetection, Owner, false); @@ -243,9 +244,6 @@ namespace CalamityMod.Projectiles.Summon if (IdleJumpCooldown > 0) IdleJumpCooldown--; - if (KILLYOURSELF) - Projectile.Kill(); - Projectile.timeLeft = 2; DoGravity(); DoAnimation(); @@ -296,7 +294,11 @@ namespace CalamityMod.Projectiles.Summon return; Projectile.ExpandHitboxBy(4f); - Projectile.Damage(); + if (Main.myPlayer == Projectile.owner) + Projectile.Damage(); + + if (Main.dedServ) + return; for (int i = 0; i < (int)Utils.Remap(Variant, 0f, 2f, 4f, 2f); i++) { @@ -306,11 +308,6 @@ namespace CalamityMod.Projectiles.Summon gore.timeLeft = 15; } - KILLYOURSELF = true; - - if (Main.dedServ) - return; - for (int i = 0; i < 20; i++) { if (BirthdayParty.PartyIsUp) @@ -556,28 +553,26 @@ namespace CalamityMod.Projectiles.Summon public override void SendExtraAI(BinaryWriter writer) { - writer.Write(Direction); - writer.Write(IdleWalkingTime); - writer.Write(IdleWalkingTimer); - writer.Write(IdleJumpCount); - writer.Write(IdleJumpCooldown); - writer.Write(IdleWalkingDirection); - writer.Write(AnimationFrames); - writer.Write(FramesUntilNextAnimationFrame); - writer.Write(KILLYOURSELF); + writer.Write7BitEncodedInt(Direction); + writer.Write7BitEncodedInt(IdleWalkingTime); + writer.Write7BitEncodedInt(IdleWalkingTimer); + writer.Write7BitEncodedInt(IdleJumpCount); + writer.Write7BitEncodedInt(IdleJumpCooldown); + writer.Write7BitEncodedInt(IdleWalkingDirection); + writer.Write7BitEncodedInt(AnimationFrames); + writer.Write7BitEncodedInt(FramesUntilNextAnimationFrame); } public override void ReceiveExtraAI(BinaryReader reader) { - Direction = reader.ReadInt32(); - IdleWalkingTime = reader.ReadInt32(); - IdleWalkingTimer = reader.ReadInt32(); - IdleJumpCount = reader.ReadInt32(); - IdleJumpCooldown = reader.ReadInt32(); - IdleWalkingDirection = reader.ReadInt32(); - AnimationFrames = reader.ReadInt32(); - FramesUntilNextAnimationFrame = reader.ReadInt32(); - KILLYOURSELF = reader.ReadBoolean(); + Direction = reader.Read7BitEncodedInt(); + IdleWalkingTime = reader.Read7BitEncodedInt(); + IdleWalkingTimer = reader.Read7BitEncodedInt(); + IdleJumpCount = reader.Read7BitEncodedInt(); + IdleJumpCooldown = reader.Read7BitEncodedInt(); + IdleWalkingDirection = reader.Read7BitEncodedInt(); + AnimationFrames = reader.Read7BitEncodedInt(); + FramesUntilNextAnimationFrame = reader.Read7BitEncodedInt(); } public override bool? CanDamage() => State == AIState.Attack ? null : false; From d8fa7c3b4078cada5097b2883c422b2292d5e5a0 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sat, 18 May 2024 20:50:05 -0500 Subject: [PATCH 078/177] Reduced Purple Candle defense effectiveness increase from 15% to 10% and Blue Candle movement speed and wing time increase from 10% to 5%. --- Buffs/Placeables/CirrusPurpleCandleBuff.cs | 2 +- CalPlayer/CalamityPlayerMiscEffects.cs | 4 ++-- Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Buffs/Placeables/CirrusPurpleCandleBuff.cs b/Buffs/Placeables/CirrusPurpleCandleBuff.cs index 1d50225a40..a56d3e179b 100644 --- a/Buffs/Placeables/CirrusPurpleCandleBuff.cs +++ b/Buffs/Placeables/CirrusPurpleCandleBuff.cs @@ -6,7 +6,7 @@ namespace CalamityMod.Buffs.Placeables { public class CirrusPurpleCandleBuff : ModBuff { - public static float DefenseRatioBonus = 0.15f; + public static float DefenseRatioBonus = 0.1f; public override void SetStaticDefaults() { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index e7486c2ef0..4da98a113f 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2819,7 +2819,7 @@ namespace CalamityMod.CalPlayer (harpyRing ? 0.2 : 0D) + (reaverSpeed ? 0.1 : 0D) + (angelTreads ? 0.1 : 0D) + - (blueCandle ? 0.1 : 0D) + + (blueCandle ? 0.05 : 0D) + (soaring ? 0.1 : 0D) + (prismaticGreaves ? 0.1 : 0D) + (plagueReaper ? 0.05 : 0D) + @@ -2827,7 +2827,7 @@ namespace CalamityMod.CalPlayer (Player.empressBrooch ? 0.25 : 0D); if (blueCandle) - Player.moveSpeed += 0.1f; + Player.moveSpeed += 0.05f; if (community) { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 2db3dd95ea..15755848c2 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -730,7 +730,7 @@ ResilientCandle: { DisplayName: Resilient Candle Tooltip: ''' - When placed, nearby players' defense blocks 15% more damage + When placed, nearby players' defense blocks 10% more damage 'Neither rain nor wind can snuff its undying flame' ''' } @@ -984,7 +984,7 @@ WeightlessCandle: { DisplayName: Weightless Candle Tooltip: ''' - When placed, nearby players gain 10% movement speed, 10% wing time and 5% acceleration + When placed, nearby players gain 5% increased movement speed, wing time and acceleration 'The floating flame seems to uplift your very spirit' ''' } From c9b11a006e725450b65ba45e087eb5da286a5092 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 18 May 2024 22:04:58 -0400 Subject: [PATCH 079/177] Increased Ink Bomb drop rates Cuttlefish: 5% / 10% -> 10% / 20% Colossal Squid: 20% -> 33% --- NPCs/Abyss/ColossalSquid.cs | 2 +- NPCs/Abyss/Cuttlefish.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 3081a1a826..e44d689057 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -630,7 +630,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemID.BlackInk, 1, 3, 5); - npcLoot.Add(ModContent.ItemType(), 5); + npcLoot.Add(ModContent.ItemType(), 3); var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 26, 38, 31, 45)); diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index 1770f6b684..fe588479a6 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -379,7 +379,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 2); - npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 20, 10)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 5)); } public override void HitEffect(NPC.HitInfo hit) From 7c4cc8c7fbe13033ded1f94f8349b712f6f89151 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 18 May 2024 19:53:33 -0700 Subject: [PATCH 080/177] electrified intensity change --- NPCs/CalamityGlobalNPC.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index a7bf7b1224..0431d27c13 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6442,7 +6442,10 @@ namespace CalamityMod.NPCs drawColor = Color.Cyan; else if (electrified > 0) - drawColor = Main.rand.NextBool(5) ? Color.White : Color.SlateGray; + { + int scaleFactor = (int)(Utils.Remap(npc.width, 30, 400, 5, 15, true)); + drawColor = Main.rand.NextBool(scaleFactor) ? Color.Lerp(Color.SlateGray, Color.White, Utils.Remap(npc.width, 30, 400, 0, 0.7f, true)) : Color.White; + } else if (absorberAffliction > 0) drawColor = Color.DarkSeaGreen; From 05b331ea14b038da3a687df4e972676ca5f23fc2 Mon Sep 17 00:00:00 2001 From: tomat Date: Sat, 18 May 2024 20:46:56 -0700 Subject: [PATCH 081/177] Mergreable tile system now works with vanilla tiles. --- Tiles/Abyss/AbyssGravel.cs | 4 +- Tiles/Abyss/HardenedSulphurousSandstone.cs | 4 +- Tiles/Abyss/PlantyMush.cs | 4 +- Tiles/Abyss/PyreMantle.cs | 6 +- Tiles/Abyss/PyreMantleMolten.cs | 4 +- Tiles/Abyss/SulphurousSand.cs | 4 +- Tiles/Abyss/SulphurousSandstone.cs | 4 +- Tiles/Abyss/SulphurousShale.cs | 4 +- Tiles/Abyss/Voidstone.cs | 4 +- Tiles/AerialiteBrick.cs | 5 +- Tiles/Astral/AstralClay.cs | 5 +- Tiles/Astral/AstralDirt.cs | 5 +- Tiles/Astral/AstralMonolith.cs | 4 +- Tiles/Astral/AstralStone.cs | 5 +- Tiles/Astral/NovaeSlag.cs | 5 +- Tiles/AstralBrick.cs | 5 +- Tiles/AstralDesert/AstralSand.cs | 5 +- Tiles/AstralDesert/AstralSandstone.cs | 5 +- Tiles/AstralDesert/CelestialRemains.cs | 5 +- Tiles/AstralDesert/HardenedAstralSand.cs | 5 +- Tiles/AstralSnow/AstralIce.cs | 5 +- Tiles/AstralSnow/AstralSnow.cs | 5 +- Tiles/Crags/BrimstoneSlab.cs | 4 +- Tiles/Crags/BrimstoneSlag.cs | 4 +- Tiles/Crags/ScorchedBone.cs | 5 +- Tiles/Crags/ScorchedRemains.cs | 5 +- Tiles/Crags/ScorchedRemainsGrass.cs | 4 +- Tiles/CryonicBrick.cs | 5 +- Tiles/DraedonStructures/LaboratoryPanels.cs | 5 +- .../LaboratoryPipePlating.cs | 5 +- Tiles/DraedonStructures/LaboratoryPlating.cs | 4 +- Tiles/DraedonStructures/RustedPlating.cs | 6 +- Tiles/IMergeableTile.cs | 62 ------------------- Tiles/MergeableTile.cs | 57 +++++++++++++++++ Tiles/Ores/AerialiteOre.cs | 5 +- Tiles/Ores/AerialiteOreDisenchanted.cs | 6 +- Tiles/Ores/AstralOre.cs | 5 +- Tiles/Ores/AuricOre.cs | 5 +- Tiles/Ores/ExodiumOre.cs | 5 +- Tiles/Ores/HallowedOre.cs | 5 +- Tiles/Ores/InfernalSuevite.cs | 6 +- Tiles/Ores/PerennialOre.cs | 4 +- Tiles/Ores/ScoriaOre.cs | 4 +- Tiles/Ores/UelibloomOre.cs | 5 +- Tiles/PerennialBrick.cs | 5 +- Tiles/ScoriaBrick.cs | 5 +- Tiles/SunkenSea/EutrophicSand.cs | 4 +- Tiles/SunkenSea/HardenedEutrophicSand.cs | 4 +- Tiles/SunkenSea/Navystone.cs | 4 +- Tiles/SunkenSea/SeaPrism.cs | 4 +- Tiles/UelibloomBrick.cs | 4 +- Tiles/VernalSoil.cs | 5 +- 52 files changed, 137 insertions(+), 216 deletions(-) delete mode 100644 Tiles/IMergeableTile.cs create mode 100644 Tiles/MergeableTile.cs diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index 1754b7fc58..04d2dd8bb0 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -9,13 +9,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { - public class AbyssGravel : ModTile, IMergeableTile + public class AbyssGravel : ModTile { int animationFrameWidth = 234; public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/AbyssGravelMine", 3); - - List IMergeableTile.TileAdjacencies { get; } = []; public override void SetStaticDefaults() { diff --git a/Tiles/Abyss/HardenedSulphurousSandstone.cs b/Tiles/Abyss/HardenedSulphurousSandstone.cs index e7f7eeb788..f48079fad5 100644 --- a/Tiles/Abyss/HardenedSulphurousSandstone.cs +++ b/Tiles/Abyss/HardenedSulphurousSandstone.cs @@ -8,10 +8,8 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { - public class HardenedSulphurousSandstone : ModTile, IMergeableTile + public class HardenedSulphurousSandstone : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index f80d61113a..52fa770985 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -14,11 +14,9 @@ namespace CalamityMod.Tiles.Abyss { // Transforms any and all Tenebris in old worlds into planty mush. [LegacyName("Tenebris")] - public class PlantyMush : ModTile, IMergeableTile + public class PlantyMush : ModTile { public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/PlantyMushMine", 3); - - List IMergeableTile.TileAdjacencies { get; } = []; public override void SetStaticDefaults() { diff --git a/Tiles/Abyss/PyreMantle.cs b/Tiles/Abyss/PyreMantle.cs index 12d1cd6f9c..90da582ec4 100644 --- a/Tiles/Abyss/PyreMantle.cs +++ b/Tiles/Abyss/PyreMantle.cs @@ -11,12 +11,10 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { - public class PyreMantle : ModTile, IMergeableTile + public class PyreMantle : ModTile { public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f }; - - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Abyss/PyreMantleMolten.cs b/Tiles/Abyss/PyreMantleMolten.cs index 74c659b73f..9fe87dc7c4 100644 --- a/Tiles/Abyss/PyreMantleMolten.cs +++ b/Tiles/Abyss/PyreMantleMolten.cs @@ -11,13 +11,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { - public class PyreMantleMolten : ModTile, IMergeableTile + public class PyreMantleMolten : ModTile { public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f }; internal static Texture2D GlowTexture; - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { if (!Main.dedServ) diff --git a/Tiles/Abyss/SulphurousSand.cs b/Tiles/Abyss/SulphurousSand.cs index c0e83d585a..3dbc1957d9 100644 --- a/Tiles/Abyss/SulphurousSand.cs +++ b/Tiles/Abyss/SulphurousSand.cs @@ -16,10 +16,8 @@ namespace CalamityMod.Tiles.Abyss // It would create block swap issues with regular sulphurous sand and was rendered obsolete with the removal of this tile's water emission mechanic. // For compatibility reasons (including with schematics), however, that tile is converted into this one. [LegacyName("SulphurousSandNoWater")] - public class SulphurousSand : ModTile, IMergeableTile + public class SulphurousSand : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Abyss/SulphurousSandstone.cs b/Tiles/Abyss/SulphurousSandstone.cs index 5b2c948dfe..692a04edbc 100644 --- a/Tiles/Abyss/SulphurousSandstone.cs +++ b/Tiles/Abyss/SulphurousSandstone.cs @@ -8,10 +8,8 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { - public class SulphurousSandstone : ModTile, IMergeableTile + public class SulphurousSandstone : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Abyss/SulphurousShale.cs b/Tiles/Abyss/SulphurousShale.cs index c4652868ac..22bddd38b4 100644 --- a/Tiles/Abyss/SulphurousShale.cs +++ b/Tiles/Abyss/SulphurousShale.cs @@ -13,14 +13,12 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { - public class SulphurousShale : ModTile, IMergeableTile + public class SulphurousShale : ModTile { int animationFrameWidth = 234; public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/AbyssGravelMine", 3); - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index 45f6f30719..8d859cad1f 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -11,12 +11,10 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { - public class Voidstone : ModTile, IMergeableTile + public class Voidstone : ModTile { public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f }; internal static Texture2D GlowTexture; - - List IMergeableTile.TileAdjacencies { get; } = []; public override void SetStaticDefaults() { diff --git a/Tiles/AerialiteBrick.cs b/Tiles/AerialiteBrick.cs index 73a3990d3f..d5df1c8c04 100644 --- a/Tiles/AerialiteBrick.cs +++ b/Tiles/AerialiteBrick.cs @@ -7,10 +7,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles { - public class AerialiteBrick : ModTile, IMergeableTile + public class AerialiteBrick : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Astral/AstralClay.cs b/Tiles/Astral/AstralClay.cs index d5afdd919e..b84e3de8ab 100644 --- a/Tiles/Astral/AstralClay.cs +++ b/Tiles/Astral/AstralClay.cs @@ -9,10 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral { - public class AstralClay : ModTile, IMergeableTile + public class AstralClay : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Astral/AstralDirt.cs b/Tiles/Astral/AstralDirt.cs index 4cd269dab8..18ff19942a 100644 --- a/Tiles/Astral/AstralDirt.cs +++ b/Tiles/Astral/AstralDirt.cs @@ -9,10 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral { - public class AstralDirt : ModTile, IMergeableTile + public class AstralDirt : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Astral/AstralMonolith.cs b/Tiles/Astral/AstralMonolith.cs index 9724660bfb..1ce58af87c 100644 --- a/Tiles/Astral/AstralMonolith.cs +++ b/Tiles/Astral/AstralMonolith.cs @@ -10,13 +10,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral { - public class AstralMonolith : ModTile, IMergeableTile + public class AstralMonolith : ModTile { private static int sheetWidth = 216; private static int sheetHeight = 72; - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Astral/AstralStone.cs b/Tiles/Astral/AstralStone.cs index 5d4eb9f993..75f1648019 100644 --- a/Tiles/Astral/AstralStone.cs +++ b/Tiles/Astral/AstralStone.cs @@ -9,10 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral { - public class AstralStone : ModTile, IMergeableTile + public class AstralStone : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Astral/NovaeSlag.cs b/Tiles/Astral/NovaeSlag.cs index 60fd932b1d..b8fda17830 100644 --- a/Tiles/Astral/NovaeSlag.cs +++ b/Tiles/Astral/NovaeSlag.cs @@ -11,10 +11,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral { [LegacyName("AstralSilt")] - public class NovaeSlag : ModTile, IMergeableTile + public class NovaeSlag : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/AstralBrick.cs b/Tiles/AstralBrick.cs index 3af5cfe613..17921c8fcb 100644 --- a/Tiles/AstralBrick.cs +++ b/Tiles/AstralBrick.cs @@ -9,13 +9,12 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles { - public class AstralBrick : ModTile, IMergeableTile + public class AstralBrick : ModTile { private const short subsheetWidth = 324; private const short subsheetHeight = 90; - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/AstralDesert/AstralSand.cs b/Tiles/AstralDesert/AstralSand.cs index b93e3e27db..1d49d41226 100644 --- a/Tiles/AstralDesert/AstralSand.cs +++ b/Tiles/AstralDesert/AstralSand.cs @@ -11,10 +11,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralDesert { - public class AstralSand : ModTile, IMergeableTile + public class AstralSand : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/AstralDesert/AstralSandstone.cs b/Tiles/AstralDesert/AstralSandstone.cs index 026c0bf2df..12389f0650 100644 --- a/Tiles/AstralDesert/AstralSandstone.cs +++ b/Tiles/AstralDesert/AstralSandstone.cs @@ -9,10 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralDesert { - public class AstralSandstone : ModTile, IMergeableTile + public class AstralSandstone : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/AstralDesert/CelestialRemains.cs b/Tiles/AstralDesert/CelestialRemains.cs index 515e549546..984b7f9937 100644 --- a/Tiles/AstralDesert/CelestialRemains.cs +++ b/Tiles/AstralDesert/CelestialRemains.cs @@ -10,10 +10,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralDesert { [LegacyName("AstralFossil")] - public class CelestialRemains : ModTile, IMergeableTile + public class CelestialRemains : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/AstralDesert/HardenedAstralSand.cs b/Tiles/AstralDesert/HardenedAstralSand.cs index 0918cabd0a..1c2a7d92d0 100644 --- a/Tiles/AstralDesert/HardenedAstralSand.cs +++ b/Tiles/AstralDesert/HardenedAstralSand.cs @@ -8,10 +8,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralDesert { - public class HardenedAstralSand : ModTile, IMergeableTile + public class HardenedAstralSand : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/AstralSnow/AstralIce.cs b/Tiles/AstralSnow/AstralIce.cs index a339f14e98..767b6e94dd 100644 --- a/Tiles/AstralSnow/AstralIce.cs +++ b/Tiles/AstralSnow/AstralIce.cs @@ -9,10 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralSnow { - public class AstralIce : ModTile, IMergeableTile + public class AstralIce : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/AstralSnow/AstralSnow.cs b/Tiles/AstralSnow/AstralSnow.cs index 6ab01d8390..27b8b2a29e 100644 --- a/Tiles/AstralSnow/AstralSnow.cs +++ b/Tiles/AstralSnow/AstralSnow.cs @@ -9,10 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralSnow { - public class AstralSnow : ModTile, IMergeableTile + public class AstralSnow : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Crags/BrimstoneSlab.cs b/Tiles/Crags/BrimstoneSlab.cs index 04d2cd4666..61ff7a8d59 100644 --- a/Tiles/Crags/BrimstoneSlab.cs +++ b/Tiles/Crags/BrimstoneSlab.cs @@ -9,13 +9,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Crags { - public class BrimstoneSlab : ModTile, IMergeableTile + public class BrimstoneSlab : ModTile { private int subsheetWidth = 450; private int subsheetHeight = 198; - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Crags/BrimstoneSlag.cs b/Tiles/Crags/BrimstoneSlag.cs index 3a1a485968..b63f9e0daa 100644 --- a/Tiles/Crags/BrimstoneSlag.cs +++ b/Tiles/Crags/BrimstoneSlag.cs @@ -8,13 +8,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Crags { - public class BrimstoneSlag : ModTile, IMergeableTile + public class BrimstoneSlag : ModTile { private const short subsheetWidth = 450; private const short subsheetHeight = 198; - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Crags/ScorchedBone.cs b/Tiles/Crags/ScorchedBone.cs index 9a875a0ff7..540a6774d7 100644 --- a/Tiles/Crags/ScorchedBone.cs +++ b/Tiles/Crags/ScorchedBone.cs @@ -8,13 +8,12 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Crags { - public class ScorchedBone : ModTile, IMergeableTile + public class ScorchedBone : ModTile { private int sheetWidth = 450; private int sheetHeight = 198; - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Crags/ScorchedRemains.cs b/Tiles/Crags/ScorchedRemains.cs index 74f47d6744..065de6ee5c 100644 --- a/Tiles/Crags/ScorchedRemains.cs +++ b/Tiles/Crags/ScorchedRemains.cs @@ -8,13 +8,12 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Crags { - public class ScorchedRemains : ModTile, IMergeableTile + public class ScorchedRemains : ModTile { private int sheetWidth = 234; private int sheetHeight = 90; - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Crags/ScorchedRemainsGrass.cs b/Tiles/Crags/ScorchedRemainsGrass.cs index a83fa18de3..5cf19faafc 100644 --- a/Tiles/Crags/ScorchedRemainsGrass.cs +++ b/Tiles/Crags/ScorchedRemainsGrass.cs @@ -10,15 +10,13 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Crags { - public class ScorchedRemainsGrass : ModTile, IMergeableTile + public class ScorchedRemainsGrass : ModTile { private const short subsheetWidth = 234; private const short subsheetHeight = 90; private int extraFrameHeight = 36; private int extraFrameWidth = 90; - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/CryonicBrick.cs b/Tiles/CryonicBrick.cs index 96c010298a..cd7dbfeaa2 100644 --- a/Tiles/CryonicBrick.cs +++ b/Tiles/CryonicBrick.cs @@ -7,13 +7,12 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles { - public class CryonicBrick : ModTile, IMergeableTile + public class CryonicBrick : ModTile { int subsheetHeight = 90; int subsheetWidth = 234; - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/DraedonStructures/LaboratoryPanels.cs b/Tiles/DraedonStructures/LaboratoryPanels.cs index 61724a0d54..d63549d56c 100644 --- a/Tiles/DraedonStructures/LaboratoryPanels.cs +++ b/Tiles/DraedonStructures/LaboratoryPanels.cs @@ -8,12 +8,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.DraedonStructures { - public class LaboratoryPanels : ModTile, IMergeableTile + public class LaboratoryPanels : ModTile { public static readonly SoundStyle MinePlatingSound = new("CalamityMod/Sounds/Custom/PlatingMine", 3); - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/DraedonStructures/LaboratoryPipePlating.cs b/Tiles/DraedonStructures/LaboratoryPipePlating.cs index 963d4ed162..d7ec964a52 100644 --- a/Tiles/DraedonStructures/LaboratoryPipePlating.cs +++ b/Tiles/DraedonStructures/LaboratoryPipePlating.cs @@ -8,12 +8,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.DraedonStructures { - public class LaboratoryPipePlating : ModTile, IMergeableTile + public class LaboratoryPipePlating : ModTile { public static readonly SoundStyle MinePlatingSound = new("CalamityMod/Sounds/Custom/PlatingMine", 3); - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/DraedonStructures/LaboratoryPlating.cs b/Tiles/DraedonStructures/LaboratoryPlating.cs index 9f6e1c8f72..c778e72cba 100644 --- a/Tiles/DraedonStructures/LaboratoryPlating.cs +++ b/Tiles/DraedonStructures/LaboratoryPlating.cs @@ -8,12 +8,10 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.DraedonStructures { - public class LaboratoryPlating : ModTile, IMergeableTile + public class LaboratoryPlating : ModTile { public static readonly SoundStyle MinePlatingSound = new("CalamityMod/Sounds/Custom/PlatingMine", 3); - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/DraedonStructures/RustedPlating.cs b/Tiles/DraedonStructures/RustedPlating.cs index 44eff8e23b..3dac585830 100644 --- a/Tiles/DraedonStructures/RustedPlating.cs +++ b/Tiles/DraedonStructures/RustedPlating.cs @@ -8,12 +8,10 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.DraedonStructures { - public class RustedPlating : ModTile, IMergeableTile + public class RustedPlating : ModTile { public static readonly SoundStyle MinePlatingSound = new("CalamityMod/Sounds/Custom/PlatingMine", 3); - - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/IMergeableTile.cs b/Tiles/IMergeableTile.cs deleted file mode 100644 index 9455c50bcc..0000000000 --- a/Tiles/IMergeableTile.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using Microsoft.Xna.Framework.Graphics; -using Terraria.ModLoader; - -namespace CalamityMod.Tiles -{ - /// - /// Interface for tiles that specify custom universal merge data. - /// - internal interface IMergeableTile - { - List TileAdjacencies { get; } - } - - internal static class MergeableTile - { - private sealed class MergeableTileGlobalTile : GlobalTile - { - public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) - { - if (!TryGetMergeableTile(type, out var mergeableTile)) - return; - - TileFraming.DrawUniversalMergeFrames(i, j, mergeableTile.TileAdjacencies); - } - - public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) - { - if (!TryGetMergeableTile(type, out var mergeableTile)) - return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); - - foreach (var adjacency in mergeableTile.TileAdjacencies) - TileFraming.GetAdjacencyData(i, j, adjacency); - - return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); - } - - private static bool TryGetMergeableTile(int type, [NotNullWhen(returnValue: true)] out IMergeableTile mergeableTile) - { - if (TileLoader.GetTile(type) is IMergeableTile theMergeableTile) - { - mergeableTile = theMergeableTile; - return true; - } - - mergeableTile = null; - return false; - } - } - - public static void RegisterUniversalMerge(this IMergeableTile mergeableTile, int tileId, string blendSheetPath) - { - if (mergeableTile is not ModTile tile) - throw new InvalidCastException($"{nameof(IMergeableTile)} is implemented on type {mergeableTile.GetType().FullName}; said type should inherit from {nameof(ModTile)}"); - - TileFraming.SetUpUniversalMerge(tile.Type, tileId, blendSheetPath, out var data); - mergeableTile.TileAdjacencies.Add(data); - } - } -} diff --git a/Tiles/MergeableTile.cs b/Tiles/MergeableTile.cs new file mode 100644 index 0000000000..9f5742457a --- /dev/null +++ b/Tiles/MergeableTile.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using Microsoft.Xna.Framework.Graphics; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles +{ + internal static class MergeableTile + { + private sealed class MergeableTileGlobalTile : GlobalTile + { + public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) + { + TileFraming.DrawUniversalMergeFrames(i, j, GetOrCreateTileAdjacencies(type)); + } + + public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) + { + foreach (var adjacency in GetOrCreateTileAdjacencies(type)) + TileFraming.GetAdjacencyData(i, j, adjacency); + + return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); + } + } + + private sealed class MergeableTileSystem : ModSystem + { + public override void PostSetupContent() + { + // Tomat: @heartplusup, you can add vanilla merges like so: + // RegisterUniversalMerge(TileID.Dirt, TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); - Already-merged tiles look weird; needs changes by someone else. + // RegisterUniversalMerge(TileID.WoodBlock, TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); + } + } + + private static readonly Dictionary> tileAdjacencyMap = []; + + public static void RegisterUniversalMerge(this ModTile tile, int mergeType, string blendSheetPath) + { + RegisterUniversalMerge(tile.Type, mergeType, blendSheetPath); + } + + public static void RegisterUniversalMerge(int tileId, int mergeType, string blendSheetPath) + { + TileFraming.SetUpUniversalMerge(tileId, mergeType, blendSheetPath, out var data); + GetOrCreateTileAdjacencies(tileId).Add(data); + } + + private static List GetOrCreateTileAdjacencies(int tileId) + { + if (!tileAdjacencyMap.TryGetValue(tileId, out var adjacencies)) + tileAdjacencyMap[tileId] = adjacencies = []; + + return adjacencies; + } + } +} diff --git a/Tiles/Ores/AerialiteOre.cs b/Tiles/Ores/AerialiteOre.cs index 427c90d2b2..4c0aeb9049 100644 --- a/Tiles/Ores/AerialiteOre.cs +++ b/Tiles/Ores/AerialiteOre.cs @@ -11,13 +11,12 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { - public class AerialiteOre : ModTile, IMergeableTile + public class AerialiteOre : ModTile { public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/MagicalRockMine", 3); internal static Texture2D GlowTexture; - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { if (!Main.dedServ) diff --git a/Tiles/Ores/AerialiteOreDisenchanted.cs b/Tiles/Ores/AerialiteOreDisenchanted.cs index 4780b063e0..bd6f41dac4 100644 --- a/Tiles/Ores/AerialiteOreDisenchanted.cs +++ b/Tiles/Ores/AerialiteOreDisenchanted.cs @@ -7,12 +7,10 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { - public class AerialiteOreDisenchanted : ModTile, IMergeableTile + public class AerialiteOreDisenchanted : ModTile { private const int AnimationFrameWidth = 234; - - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileBlockLight[Type] = true; diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index c2e220d120..2b9da5ece9 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -10,10 +10,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { - public class AstralOre : ModTile, IMergeableTile + public class AstralOre : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileLighted[Type] = true; diff --git a/Tiles/Ores/AuricOre.cs b/Tiles/Ores/AuricOre.cs index 8d5facedb2..bc4ad02243 100644 --- a/Tiles/Ores/AuricOre.cs +++ b/Tiles/Ores/AuricOre.cs @@ -14,14 +14,13 @@ using Terraria.ObjectData; namespace CalamityMod.Tiles.Ores { - public class AuricOre : ModTile, IMergeableTile + public class AuricOre : ModTile { public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/AuricMine", 3); public static bool Animate; internal static Texture2D GlowTexture; - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { if (!Main.dedServ) diff --git a/Tiles/Ores/ExodiumOre.cs b/Tiles/Ores/ExodiumOre.cs index 41fc92d67f..298a81c0e1 100644 --- a/Tiles/Ores/ExodiumOre.cs +++ b/Tiles/Ores/ExodiumOre.cs @@ -10,10 +10,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { - public class ExodiumOre : ModTile, IMergeableTile + public class ExodiumOre : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Ores/HallowedOre.cs b/Tiles/Ores/HallowedOre.cs index 049ca594f2..dfe58dd453 100644 --- a/Tiles/Ores/HallowedOre.cs +++ b/Tiles/Ores/HallowedOre.cs @@ -9,10 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { - public class HallowedOre : ModTile, IMergeableTile + public class HallowedOre : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileLighted[Type] = true; diff --git a/Tiles/Ores/InfernalSuevite.cs b/Tiles/Ores/InfernalSuevite.cs index 4d00e3d10c..9c5aa5ff20 100644 --- a/Tiles/Ores/InfernalSuevite.cs +++ b/Tiles/Ores/InfernalSuevite.cs @@ -10,13 +10,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { [LegacyName("CharredOre")] - public class InfernalSuevite : ModTile, IMergeableTile + public class InfernalSuevite : ModTile { private int sheetWidth = 234; private int sheetHeight = 90; - - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/Ores/PerennialOre.cs b/Tiles/Ores/PerennialOre.cs index 08d732e51e..3cc6d1c162 100644 --- a/Tiles/Ores/PerennialOre.cs +++ b/Tiles/Ores/PerennialOre.cs @@ -11,12 +11,10 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { - public class PerennialOre : ModTile, IMergeableTile + public class PerennialOre : ModTile { internal static Texture2D GlowTexture; - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { if (!Main.dedServ) diff --git a/Tiles/Ores/ScoriaOre.cs b/Tiles/Ores/ScoriaOre.cs index 238f5f1cd4..fe8efcf707 100644 --- a/Tiles/Ores/ScoriaOre.cs +++ b/Tiles/Ores/ScoriaOre.cs @@ -12,10 +12,8 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { [LegacyName("ChaoticOre")] - public class ScoriaOre : ModTile, IMergeableTile + public class ScoriaOre : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileLighted[Type] = true; diff --git a/Tiles/Ores/UelibloomOre.cs b/Tiles/Ores/UelibloomOre.cs index 14ab406efd..b213b57d7b 100644 --- a/Tiles/Ores/UelibloomOre.cs +++ b/Tiles/Ores/UelibloomOre.cs @@ -9,10 +9,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Ores { - public class UelibloomOre : ModTile, IMergeableTile + public class UelibloomOre : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/PerennialBrick.cs b/Tiles/PerennialBrick.cs index 9133c5f6cb..0b647557dc 100644 --- a/Tiles/PerennialBrick.cs +++ b/Tiles/PerennialBrick.cs @@ -8,10 +8,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles { - public class PerennialBrick : ModTile, IMergeableTile + public class PerennialBrick : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/ScoriaBrick.cs b/Tiles/ScoriaBrick.cs index 800e5d6d57..1509aa27f4 100644 --- a/Tiles/ScoriaBrick.cs +++ b/Tiles/ScoriaBrick.cs @@ -10,13 +10,12 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles { [LegacyName("ChaoticBrick")] - public class ScoriaBrick : ModTile, IMergeableTile + public class ScoriaBrick : ModTile { int subsheetHeight = 72; internal static Texture2D GlowTexture; - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { if (!Main.dedServ) diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index c9ef48f1f5..58baf6e83c 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -10,10 +10,8 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { - public class EutrophicSand : ModTile, IMergeableTile + public class EutrophicSand : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/SunkenSea/HardenedEutrophicSand.cs b/Tiles/SunkenSea/HardenedEutrophicSand.cs index 209e0a22cd..b198501573 100644 --- a/Tiles/SunkenSea/HardenedEutrophicSand.cs +++ b/Tiles/SunkenSea/HardenedEutrophicSand.cs @@ -8,10 +8,8 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { - public class HardenedEutrophicSand : ModTile, IMergeableTile + public class HardenedEutrophicSand : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index 8799172e30..783d94f011 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -8,10 +8,8 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { - public class Navystone : ModTile, IMergeableTile + public class Navystone : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/SunkenSea/SeaPrism.cs b/Tiles/SunkenSea/SeaPrism.cs index 83d6da7082..c0227a3a46 100644 --- a/Tiles/SunkenSea/SeaPrism.cs +++ b/Tiles/SunkenSea/SeaPrism.cs @@ -8,13 +8,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.SunkenSea { - public class SeaPrism : ModTile, IMergeableTile + public class SeaPrism : ModTile { private const short subsheetWidth = 450; private const short subsheetHeight = 198; - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index ee453b6ab0..49b1e8e449 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -10,13 +10,11 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles { - public class UelibloomBrick : ModTile, IMergeableTile + public class UelibloomBrick : ModTile { private int extraFrameHeight = 36; private int extraFrameWidth = 90; - List IMergeableTile.TileAdjacencies { get; } = []; - public override void SetStaticDefaults() { Main.tileSolid[Type] = true; diff --git a/Tiles/VernalSoil.cs b/Tiles/VernalSoil.cs index eb4e766460..ebfd615be2 100644 --- a/Tiles/VernalSoil.cs +++ b/Tiles/VernalSoil.cs @@ -11,10 +11,9 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles { - public class VernalSoil : ModTile, IMergeableTile + public class VernalSoil : ModTile { - List IMergeableTile.TileAdjacencies { get; } = []; - + public override void SetStaticDefaults() { Main.tileSolid[Type] = true; From 5a3ea190bb046aec21dcfdc03c6e09ef85e2b941 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 18 May 2024 22:30:14 -0700 Subject: [PATCH 082/177] ash wood sword counts as a wooden sword --- Utilities/CalamityRecipes.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 81a27225f2..bc4aefe0a0 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -356,7 +356,8 @@ namespace CalamityMod ItemID.PalmWoodSword, ItemID.EbonwoodSword, ItemID.ShadewoodSword, - ItemID.PearlwoodSword + ItemID.PearlwoodSword, + ItemID.AshWoodSword }); AnyWoodenSword = RecipeGroup.RegisterGroup("AnyWoodenSword", group); From 60321974ee2d362e9dbceb74cfdfe59151b0e58f Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 19 May 2024 02:07:43 -0500 Subject: [PATCH 083/177] Reduced the defense provided by various accessories due to it being way too much in total (it was possible to take 1 damage from many Master Death Mode attacks, which isn't okay and means that on lower difficulties this issue is even more pronounced), especially given that these items also provide a lot of utility outside of raw defense. --- Items/Accessories/AsgardianAegis.cs | 2 +- Items/Accessories/AsgardsValor.cs | 2 +- Items/Accessories/ElysianAegis.cs | 2 +- Items/Accessories/OrnateShield.cs | 2 +- Items/Accessories/RampartofDeities.cs | 2 +- Items/Accessories/Regenator.cs | 2 +- Items/Accessories/ShieldoftheHighRuler.cs | 2 +- Items/Accessories/YharimsGift.cs | 2 +- Items/CalamityGlobalItemTweaks.cs | 16 ++++++++-------- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 4bffcce0e7..cbb8941b60 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories Item.width = 60; Item.height = 54; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 20; + Item.defense = 12; Item.accessory = true; Item.rare = ModContent.RarityType(); } diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index e2aacf1b97..a4e4da6e8c 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories Item.height = 44; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 12; // we buff Ankh Shield to 12 + Item.defense = 8; // we buff Ankh Shield to 8 Item.accessory = true; } diff --git a/Items/Accessories/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index a7231b9b11..3c1b4d6f67 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories Item.height = 42; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); - Item.defense = 16; + Item.defense = 10; Item.accessory = true; } diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index 4591e8c680..2b12a2aa69 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories Item.height = 32; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 8; + Item.defense = 4; // This has a ram dash, it should give a bit less defense due to how good it is Item.accessory = true; } diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index 04b7481d08..2ac41f439d 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories Item.width = 64; Item.height = 62; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 18; + Item.defense = 12; Item.accessory = true; Item.rare = ModContent.RarityType(); } diff --git a/Items/Accessories/Regenator.cs b/Items/Accessories/Regenator.cs index 292b762fa4..f13b41822a 100644 --- a/Items/Accessories/Regenator.cs +++ b/Items/Accessories/Regenator.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories Item.height = 56; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 10; + Item.defense = 4; // This should have less defense due to the regen it provides Item.accessory = true; } diff --git a/Items/Accessories/ShieldoftheHighRuler.cs b/Items/Accessories/ShieldoftheHighRuler.cs index f717c20560..aa530beaaa 100644 --- a/Items/Accessories/ShieldoftheHighRuler.cs +++ b/Items/Accessories/ShieldoftheHighRuler.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; - Item.defense = 12; + Item.defense = 6; Item.accessory = true; } diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index 6f5cc3c2e9..0a59362b0f 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 22; - Item.defense = 30; + Item.defense = 15; // Why did this give 30 defense? This thing really needs a rework lol Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 84cac6a50a..33eba91d0c 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -282,31 +282,31 @@ namespace CalamityMod.Items #region CATEGORY 2: Defense Balancing { ItemID.AncientHallowedGreaves, Do(DefenseDelta(+2)) }, { ItemID.AncientHallowedPlateMail, Do(DefenseDelta(+3)) }, - { ItemID.AnkhShield, Do(DefenseDelta(+8)) }, - { ItemID.CobaltShield, Do(DefenseDelta(+3)) }, + { ItemID.AnkhShield, Do(DefenseDelta(+4)) }, // 8 total + { ItemID.CobaltShield, Do(DefenseDelta(+3)) }, // 4 total { ItemID.EoCShield, Do(DefenseDelta(+1)) }, // Shield of Cthulhu - { ItemID.FrozenShield, Do(DefenseDelta(+7)) }, + { ItemID.FrozenShield, Do(DefenseDelta(+4)) }, // 10 total (plus the Frozen Turtle Shell DR effect) { ItemID.FrozenTurtleShell, Do(DefenseExact(6)) }, { ItemID.HallowedGreaves, Do(DefenseDelta(+2)) }, { ItemID.HallowedPlateMail, Do(DefenseDelta(+3)) }, - { ItemID.HeroShield, Do(DefenseDelta(+10)) }, + { ItemID.HeroShield, Do(DefenseDelta(+5)) }, // 15 total (plus increased max life) { ItemID.LavaSkull, Do(DefenseExact(4)) }, // Magma Skull { ItemID.MoltenSkullRose, Do(DefenseExact(8)) }, - { ItemID.ObsidianShield, Do(DefenseDelta(+5)) }, - { ItemID.ObsidianSkull, Do(DefenseDelta(+1)) }, + { ItemID.ObsidianShield, Do(DefenseDelta(+4)) }, // 6 total + { ItemID.ObsidianSkull, Do(DefenseDelta(+1)) }, // 2 total { ItemID.ObsidianSkullRose, Do(DefenseExact(4)) }, { ItemID.OrichalcumBreastplate, Do(DefenseDelta(+3)) }, { ItemID.OrichalcumHeadgear, Do(DefenseDelta(+2)) }, { ItemID.OrichalcumHelmet, Do(DefenseDelta(+3)) }, { ItemID.OrichalcumLeggings, Do(DefenseDelta(+4)) }, { ItemID.OrichalcumMask, Do(DefenseDelta(+3)) }, - { ItemID.PaladinsShield, Do(DefenseDelta(+3)) }, + { ItemID.PaladinsShield, Do(DefenseDelta(+2)) }, // 8 total { ItemID.PalladiumBreastplate, Do(DefenseDelta(+3)) }, { ItemID.PalladiumHeadgear, Do(DefenseDelta(+2)) }, { ItemID.PalladiumHelmet, Do(DefenseDelta(+3)) }, { ItemID.PalladiumMask, Do(DefenseDelta(+1)) }, { ItemID.PalladiumLeggings, Do(DefenseDelta(+3)) }, - { ItemID.Shackle, Do(DefenseDelta(+2)) }, + { ItemID.Shackle, Do(DefenseDelta(+2)) }, // 3 total #endregion #region CATEGORY 3: Tool Balancing From a9b96e1ee7c1db15593cfb90aa837bc0ae7da9b8 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 19 May 2024 06:10:18 -0500 Subject: [PATCH 084/177] Updated many vanilla boss player targeting behaviors (some target one player aggressively, others will swap targets, etc.). --- NPCs/NormalNPCs/SkeletronPrime2.cs | 5 - .../Bosses/BrainOfCthulhuAI.cs | 5 - .../VanillaNPCAIOverrides/Bosses/CultistAI.cs | 16 ++-- .../Bosses/DestroyerAI.cs | 10 +- .../Bosses/DukeFishronAI.cs | 19 +--- .../Bosses/EaterOfWorldsAI.cs | 7 +- .../Bosses/EyeOfCthulhuAI.cs | 19 +--- NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs | 63 +++++-------- .../Bosses/KingSlimeAI.cs | 8 -- .../Bosses/PlanteraAI.cs | 13 +-- .../Bosses/QueenBeeAI.cs | 12 +-- .../Bosses/QueenSlimeAI.cs | 7 -- .../Bosses/SkeletronAI.cs | 27 +++--- .../Bosses/SkeletronPrimeAI.cs | 91 ++++++++----------- NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs | 29 +----- .../Bosses/WallOfFleshAI.cs | 8 +- 16 files changed, 105 insertions(+), 234 deletions(-) diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs index 87cfa1a4bf..d644a5d641 100644 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ b/NPCs/NormalNPCs/SkeletronPrime2.cs @@ -281,7 +281,6 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.ai[2] = 0f; NPC.ai[1] = 1f; - NPC.TargetClosest(); NPC.netUpdate = true; } else if (shouldSpinAround || NPC.ai[1] != 4f) @@ -294,7 +293,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[2] = 0f; NPC.ai[1] = shouldSpinAround ? 5f : 1f; - NPC.TargetClosest(); NPC.netUpdate = true; } } @@ -438,7 +436,6 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.ai[2] >= (phaseTimer - (death ? 60f * (1f - lifeRatio) : 0f))) { - NPC.TargetClosest(); NPC.ai[2] = 0f; NPC.ai[1] = 4f; NPC.localAI[0] = 0f; @@ -697,7 +694,6 @@ namespace CalamityMod.NPCs.NormalNPCs calamityGlobalNPC.newAI[0] = 0f; NPC.SyncVanillaLocalAI(); NPC.SyncExtraAI(); - NPC.TargetClosest(); NPC.netUpdate = true; } } @@ -775,7 +771,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.localAI[0] = 0f; NPC.SyncVanillaLocalAI(); NPC.SyncExtraAI(); - NPC.TargetClosest(); NPC.netUpdate = true; } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index ebfd7f20ae..78bf26e4cb 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -29,10 +29,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - bool enrage = true; int targetTileX = (int)Main.player[npc.target].Center.X / 16; int targetTileY = (int)Main.player[npc.target].Center.Y / 16; @@ -517,7 +513,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs index cc7f023757..c3fe7ce175 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs @@ -96,23 +96,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses idleTime = 20; } - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(false); - // Center and target Player player = Main.player[npc.target]; - if (npc.target < 0 || npc.target == Main.maxPlayers || player.dead || !player.active) + if (npc.target < 0 || npc.target == Main.maxPlayers || player.dead || !player.active || Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles) { npc.TargetClosest(false); player = Main.player[npc.target]; npc.netUpdate = true; } - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(false); - // Enrage if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) || CalamityWorld.LegendaryMode) { @@ -157,6 +149,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[3] += 1f; npc.velocity = Vector2.Zero; + npc.TargetClosest(false); npc.netUpdate = true; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -170,7 +163,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Despawn - if (player.dead || Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles) + if (player.dead || !player.active || Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles) { npc.life = 0; npc.HitEffect(0, 10.0); @@ -803,6 +796,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[3] += 1f; npc.velocity = Vector2.Zero; + npc.TargetClosest(false); npc.netUpdate = true; } } @@ -1309,6 +1303,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[3] += 1f; npc.velocity = Vector2.Zero; + npc.TargetClosest(false); npc.netUpdate = true; List list = new List(); for (int i = 0; i < Main.maxNPCs; i++) @@ -2030,6 +2025,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[3] += 1f; npc.velocity = Vector2.Zero; + npc.TargetClosest(false); npc.netUpdate = true; } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 455726721e..1308fee41f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -92,10 +92,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Return to ground phase, with less time spent in later phases if (calamityGlobalNPC.newAI[3] >= FlightPhaseResetGateValue) - { calamityGlobalNPC.newAI[3] = flightPhaseTimerSetValue; - npc.TargetClosest(); - } // Spawn DR check bool hasSpawnDR = calamityGlobalNPC.newAI[1] < DRIncreaseTime && calamityGlobalNPC.newAI[1] > 60f; @@ -124,10 +121,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool increaseSpeed = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles; bool increaseSpeedMore = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; - // Get a new target if current target is too far away - if (increaseSpeedMore && npc.type == NPCID.TheDestroyer) - npc.TargetClosest(); - float enrageScale = bossRush ? 1f : 0f; if (Main.IsItDay() || bossRush) { @@ -1144,7 +1137,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] > 0f) npc.realLife = (int)npc.ai[3]; - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead) + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); if (npc.type >= NPCID.TheDestroyer && npc.type <= NPCID.TheDestroyerTail) @@ -1546,7 +1539,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (!flag2) { - npc.TargetClosest(); npc.velocity.Y += 0.15f; if (Main.masterMode && npc.velocity.Y > 0f) npc.velocity.Y += 0.05f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index b351e11655..c50a12c01b 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -121,22 +121,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Player player = Main.player[npc.target]; // Get target - if (npc.target < 0 || npc.target == Main.maxPlayers || player.dead || !player.active) + if (npc.target < 0 || npc.target == Main.maxPlayers || player.dead || !player.active || Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles) { npc.TargetClosest(); player = Main.player[npc.target]; npc.netUpdate = true; } - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Despawn if (player.dead || Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles) { - npc.TargetClosest(); - npc.velocity.Y -= 0.4f; if (npc.timeLeft > 10) @@ -477,7 +471,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] += 2f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -526,7 +519,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -566,7 +558,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -592,7 +583,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -751,7 +741,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] += 2f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -797,7 +786,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] = 5f; npc.ai[1] = 0f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -825,7 +813,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] = 5f; npc.ai[1] = 0f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -871,7 +858,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -1062,7 +1048,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!phase4 || !death) npc.ai[3] += 1f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -1163,7 +1148,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 velocityVector = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); float inertia = 30f; - float velocity = 25f; + float velocity = 24f; npc.velocity = (npc.velocity * inertia + velocityVector * velocity) / (inertia + 1f); npc.scale = npc.ai[3]; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index 22922a5ce6..7e10b43aef 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles && npc.type == NPCID.EaterofWorldsHead) - npc.TargetClosest(); - bool enrage = true; int targetTileX = (int)Main.player[npc.target].Center.X / 16; int targetTileY = (int)Main.player[npc.target].Center.Y / 16; @@ -785,7 +781,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.realLife = -1; - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead) + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); if (Main.player[npc.target].dead) @@ -998,7 +994,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (!flag2) { - npc.TargetClosest(); npc.velocity.Y += 0.11f; if (Main.masterMode && npc.velocity.Y > 0f) npc.velocity.Y += 0.07f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index 8bf28b1f87..535d6b48c8 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -55,10 +55,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - bool dead = Main.player[npc.target].dead; float targetXDistance = npc.Center.X - Main.player[npc.target].position.X - (Main.player[npc.target].width / 2); float targetYDistance = npc.position.Y + npc.height - 59f - Main.player[npc.target].position.Y - (Main.player[npc.target].height / 2); @@ -277,7 +273,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.rotation = eyeRotation; float numCharges = death ? 4f : 3f; @@ -503,7 +498,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 1f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -570,7 +564,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.rotation = eyeRotation; float numCharges = death ? 4f : 3f; @@ -598,7 +591,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Deal less damage overall while not charging npc.damage = reducedSetDamage; - npc.TargetClosest(); npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -874,7 +866,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } - npc.TargetClosest(); calamityGlobalNPC.newAI[0] += ((masterMode && calamityGlobalNPC.newAI[0] % 2f != 0f) ? Main.rand.Next(2) + 1f : 1f); if (calamityGlobalNPC.newAI[0] > 3f) calamityGlobalNPC.newAI[0] = masterMode ? Main.rand.Next(2) : 0f; @@ -1114,7 +1105,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 1f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.target = Main.maxPlayers; + npc.TargetClosest(); npc.netUpdate = true; } else if ((npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && num15 < 500f) || (Main.expertMode && num15 < (Main.masterMode ? 750f : 500f))) @@ -1233,7 +1224,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.target = Main.maxPlayers; npc.rotation = num7; if (npc.ai[3] >= (Main.masterMode ? 4f : 3f)) { @@ -1263,6 +1253,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; + npc.TargetClosest(); npc.netUpdate = true; if (npc.netSpam > 10) npc.netSpam = 10; @@ -1464,13 +1455,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.expertMode && (double)npc.life < (double)npc.lifeMax * (Main.masterMode ? 0.45 : 0.35)) npc.ai[1] = 3f; - npc.target = Main.maxPlayers; npc.netUpdate = true; } if (Main.expertMode && flag3) { - npc.TargetClosest(); npc.netUpdate = true; npc.ai[1] = 3f; npc.ai[2] = 0f; @@ -1542,7 +1531,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.target = Main.maxPlayers; npc.rotation = num7; if (npc.ai[3] >= 3f) { @@ -1572,7 +1560,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Deal less damage while not charging npc.damage = reducedSetDamage; - npc.TargetClosest(); npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -1582,7 +1569,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (Main.netMode != NetmodeID.MultiplayerClient) { - npc.TargetClosest(); float num50 = Main.masterMode ? 24f : 20f; Vector2 vector10 = npc.Center; float num51 = Main.player[npc.target].Center.X - vector10.X; @@ -1775,7 +1761,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; if (npc.ai[2] >= (Main.masterMode ? 40f : 70f)) { - npc.TargetClosest(); npc.ai[1] = 3f; npc.ai[2] = -1f; npc.ai[3] = Main.rand.Next(-3, 1); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index df15000bff..4ade8b50a9 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -43,14 +43,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 3, (int)npc.Center.Y - 57, NPCID.GolemHead); } - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Despawn if (npc.target >= 0 && Main.player[npc.target].dead) { @@ -265,7 +257,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == -1f) { // Set jump velocity - npc.TargetClosest(); + if (!headAlive) + npc.TargetClosest(); // Set damage npc.damage = npc.defDamage; @@ -412,8 +405,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Avoid cheap bullshit npc.damage = 0; - npc.TargetClosest(); - // Play sound SoundEngine.PlaySound(SoundID.Item14, npc.Center); @@ -602,6 +593,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity.Y = maxFallSpeed; } + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + // Despawn if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) + Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) > despawnDistance) { @@ -705,8 +700,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float fistPunchGateValue = masterMode ? 120f : 40f; if (npc.ai[1] >= fistPunchGateValue) { - npc.TargetClosest(); - if (canPunch) { npc.ai[1] = 0f; @@ -950,10 +943,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Die if body is gone if (NPC.golemBoss < 0) { @@ -1021,8 +1010,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] >= shootFireballGateValue) { - npc.TargetClosest(); - npc.ai[1] = 0f; Vector2 headCent = new Vector2(npc.Center.X, npc.Center.Y + 10f * npc.scale); @@ -1076,8 +1063,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] >= shootFireballGateValue) { - npc.TargetClosest(); - npc.ai[1] = 0f; float fireballSpeedFistsDed = turboEnrage ? 32f : enrage ? 24f : 12f; @@ -1111,8 +1096,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] >= 300f) { - npc.TargetClosest(); - npc.ai[2] = 0f; int projType = ProjectileID.EyeBeam; @@ -1199,10 +1182,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Die if body is gone if (NPC.golemBoss < 0) { @@ -1393,8 +1372,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[1] >= shootFireballGateValue) { - npc.TargetClosest(); - npc.ai[1] = 0f; Vector2 freeHeadCenter = new Vector2(npc.Center.X, npc.Center.Y + 20f * npc.scale); @@ -1434,8 +1411,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float laserGateValue = 300f - (death ? 240f * (1f - combinedLifeRatio) : 180f * (1f - combinedLifeRatio)); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] >= laserGateValue) { - npc.TargetClosest(); - npc.ai[2] = 0f; int numLasers = 2; @@ -1676,7 +1651,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = npc.defDamage; npc.noTileCollide = true; - npc.TargetClosest(); + + if (!flag) + npc.TargetClosest(); + npc.velocity.X = 4 * npc.direction; if (npc.life < npc.lifeMax) { @@ -1718,7 +1696,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + (float)npc.width > Main.player[npc.target].position.X + (float)Main.player[npc.target].width) { npc.velocity.X *= 0.9f; @@ -1752,7 +1729,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (npc.target <= 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead) + if (npc.target <= 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); int num8 = 3000; @@ -1776,6 +1753,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.getGoodWorld) enrageScale += 3f; + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + if ((!Main.player[npc.target].ZoneLihzhardTemple && !Main.player[npc.target].ZoneJungle) || (double)Main.player[npc.target].Center.Y < Main.worldSurface * 16.0) enrageScale *= 2f; @@ -1843,7 +1824,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] >= 60f) { - npc.TargetClosest(); if ((npc.type == NPCID.GolemFistLeft && npc.Center.X + 100f > Main.player[npc.target].Center.X) || (npc.type == NPCID.GolemFistRight && npc.Center.X - 100f < Main.player[npc.target].Center.X)) { npc.ai[1] = 0f; @@ -2044,6 +2024,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.getGoodWorld) enrageScale += 3f; + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + if ((!Main.player[npc.target].ZoneLihzhardTemple && !Main.player[npc.target].ZoneJungle) || (double)Main.player[npc.target].Center.Y < Main.worldSurface * 16.0) enrageScale *= 2f; @@ -2103,7 +2087,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] >= (float)num711) { - npc.TargetClosest(); npc.ai[1] = 0f; Vector2 vector90 = new Vector2(npc.Center.X, npc.Center.Y + 10f * npc.scale); float num712 = 8f; @@ -2122,7 +2105,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[0] == 1f) { - npc.TargetClosest(); Vector2 vector91 = new Vector2(npc.Center.X, npc.Center.Y + 10f * npc.scale); if (Main.player[npc.target].Center.X < npc.Center.X - (float)npc.width) { @@ -2153,7 +2135,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] >= (float)num720) { - npc.TargetClosest(); npc.ai[1] = 0f; float num721 = 8f; float num722 = Main.player[npc.target].Center.X - vector91.X; @@ -2257,6 +2238,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.getGoodWorld) enrageScale += 3f; + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + if ((!Main.player[npc.target].ZoneLihzhardTemple && !Main.player[npc.target].ZoneJungle) || (double)Main.player[npc.target].Center.Y < Main.worldSurface * 16.0) enrageScale *= 2f; @@ -2276,7 +2261,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } - npc.TargetClosest(); float num742 = 7f; float num743 = 0.05f; Vector2 vector92 = npc.Center; @@ -2337,7 +2321,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] >= (float)num748) { - npc.TargetClosest(); npc.ai[1] = 0f; Vector2 vector93 = new Vector2(npc.Center.X, npc.Center.Y + 20f * npc.scale); float num749 = 8f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index 54060f5524..d2f68c28c4 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Phases based on life percentage // Higher velocity jumps phase @@ -330,7 +326,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = setDamage; npc.netUpdate = true; - npc.TargetClosest(); float distanceBelowTarget = npc.position.Y - (Main.player[npc.target].position.Y + 80f); float speedMult = 1f; @@ -603,7 +598,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 5f; if (Main.netMode != NetmodeID.MultiplayerClient) { - npc.TargetClosest(faceTarget: false); Point point3 = npc.Center.ToTileCoordinates(); Point point4 = Main.player[npc.target].Center.ToTileCoordinates(); Vector2 vector30 = Main.player[npc.target].Center - npc.Center; @@ -790,7 +784,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = npc.defDamage; npc.netUpdate = true; - npc.TargetClosest(); if (npc.ai[1] == 3f) { npc.velocity.Y = -13f; @@ -890,7 +883,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static void GetPlaceToTeleportTo(NPC npc) { - npc.TargetClosest(false); float distanceAhead = 800f; Vector2 randomDefault = Main.rand.NextBool() ? Vector2.UnitX : -Vector2.UnitX; Vector2 vectorAimedAheadOfTarget = Main.player[npc.target].Center + new Vector2((float)Math.Round(Main.player[npc.target].velocity.X), 0f).SafeNormalize(randomDefault) * distanceAhead; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs index a7c993715b..04d87dc3be 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -301,6 +297,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + npc.TargetClosest(); + npc.ai[1] = -SeedGatlingDuration; } } @@ -622,7 +620,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[1] >= shootProjectileGateValue) { npc.localAI[1] = 0f; - npc.TargetClosest(); bool shootPoisonSeed = CalamityWorld.LegendaryMode || Main.rand.NextBool(masterMode ? 2 : 4); int projectileType = shootPoisonSeed ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera; float projectileSpeed = masterMode ? 16f : 14f; @@ -1208,7 +1205,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { bool flag39 = false; bool flag40 = false; - npc.TargetClosest(); + + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + if (Main.player[npc.target].dead) { flag40 = true; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index 95257c3031..e8bb17fb34 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -23,10 +23,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - bool bossRush = BossRushEvent.BossRushActive; bool masterMode = Main.masterMode || bossRush; bool death = CalamityWorld.death || bossRush; @@ -1031,6 +1027,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } while ((float)num647 == num646); + npc.TargetClosest(); npc.ai[0] = num647; npc.ai[1] = 0f; npc.ai[2] = 0f; @@ -1081,8 +1078,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { // Avoid cheap bullshit npc.damage = 0; - - npc.TargetClosest(); float chargeDistanceY = 20f; chargeDistanceY += 20f * num644; @@ -1239,8 +1234,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Avoid cheap bullshit npc.damage = 0; - npc.TargetClosest(); - float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; @@ -1290,8 +1283,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Avoid cheap bullshit npc.damage = 0; - npc.TargetClosest(); - float playerLocation = npc.Center.X - Main.player[npc.target].Center.X; npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; @@ -1322,7 +1313,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; npc.localAI[0] = 0f; - npc.TargetClosest(); float num672 = Main.masterMode ? 16f : 14f; float num673 = Main.masterMode ? 0.15f : 0.1f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index 40b7d577b3..1ce6e0c5c6 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -68,7 +68,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.netUpdate = true; - npc.TargetClosest(faceTarget: false); Vector2 vectorAimedAheadOfTarget = Main.player[npc.target].Center + new Vector2((float)Math.Round(Main.player[npc.target].velocity.X), 0f).SafeNormalize(Vector2.Zero) * 800f; Point predictiveTeleportPoint = vectorAimedAheadOfTarget.ToTileCoordinates(); int randomTeleportOffset = 5; @@ -403,7 +402,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses speedMult = 2f; npc.netUpdate = true; - npc.TargetClosest(); if (npc.ai[2] == 3f) { npc.velocity.Y = -13f * speedMult; @@ -931,7 +929,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.netUpdate = true; - npc.TargetClosest(false); Point point = npc.Center.ToTileCoordinates(); Point point2 = Main.player[npc.target].Center.ToTileCoordinates(); Vector2 vector = Main.player[npc.target].Center - npc.Center; @@ -1251,7 +1248,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = npc.defDamage; npc.netUpdate = true; - npc.TargetClosest(); if (npc.ai[2] == 3f) { npc.velocity.Y = -13f; @@ -1629,8 +1625,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float flyAcceleration = bossRush ? 0.3f : death ? (masterMode ? 0.18f : 0.14f) : (masterMode ? 0.16f : 0.12f); float flyDistanceY = masterMode ? 350f : 450f; - npc.TargetClosest(); - Vector2 desiredVelocity = npc.Center; if (npc.timeLeft > 10) @@ -1698,7 +1692,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float num = Main.masterMode ? 18f : Main.expertMode ? 15f : 12f; float num2 = Main.masterMode ? 0.12f : Main.expertMode ? 0.1f : 0.085f; float num3 = 250f; - npc.TargetClosest(); Vector2 desiredVelocity = npc.Center; if (npc.timeLeft > 10) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index 843d68d94c..abf2444bac 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -64,10 +64,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Spawn hands if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -467,7 +463,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[2] = 0f; calamityGlobalNPC.newAI[1] = 0f; - npc.TargetClosest(); npc.SyncExtraAI(); npc.SyncVanillaLocalAI(); npc.netUpdate = true; @@ -870,10 +865,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - float yMultiplier = 1f; if (calamityGlobalNPC.newAI[0] != 0f) yMultiplier = calamityGlobalNPC.newAI[0]; @@ -1018,6 +1009,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += slapTimerIncrement; if (npc.ai[3] >= slapGateValue) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; npc.ai[3] = calamityGlobalNPC.newAI[2] = slapGateValue; calamityGlobalNPC.newAI[3] = 0f; @@ -1107,7 +1099,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); npc.ai[2] = 2f; npc.ai[3] = 0f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * handSwipeVelocity; @@ -1167,7 +1158,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); npc.ai[2] = 5f; npc.ai[3] = 0f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * handSwipeVelocity; @@ -1254,9 +1244,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.reflectsProjectiles = false; npc.defense = npc.defDefense; + + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + if (npc.ai[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { - npc.TargetClosest(); npc.ai[0] = 1f; int num148 = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X), (int)npc.Center.Y, NPCID.SkeletronHand, npc.whoAmI); Main.npc[num148].ai[0] = -1f; @@ -1355,7 +1349,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] = 0f; npc.ai[1] = 1f; - npc.TargetClosest(); npc.netUpdate = true; } @@ -1451,6 +1444,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] = 0f; npc.ai[1] = 0f; + npc.TargetClosest(); } npc.rotation += (float)npc.direction * 0.3f; @@ -1575,6 +1569,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + if (npc.ai[2] == 0f || npc.ai[2] == 3f) { // Avoid cheap bullshit @@ -1640,6 +1638,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] >= 300f) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; npc.ai[3] = 0f; npc.netUpdate = true; @@ -1765,7 +1764,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); npc.ai[2] = 2f; vector23 = npc.Center; num184 = Main.player[npc.target].Center.X - vector23.X; @@ -1820,7 +1818,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); npc.ai[2] = 5f; vector24 = npc.Center; num187 = Main.player[npc.target].Center.X - vector24.X; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index 3d01ee7107..a7f40acc14 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -26,10 +26,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -208,11 +204,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Despawn - if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 6000f || Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) > 6000f) + if (npc.ai[1] != 3f) { - npc.TargetClosest(); - if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 6000f || Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) > 6000f) - npc.ai[1] = 3f; + int despawnDistanceInTiles = 500; + if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistanceInTiles) + { + npc.TargetClosest(); + if (Main.player[npc.target].dead || Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) / 16f > despawnDistanceInTiles) + npc.ai[1] = 3f; + } + else if (npc.timeLeft < 1800) + npc.timeLeft = 1800; } // Activate daytime enrage @@ -274,7 +276,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] = 0f; npc.ai[1] = 1f; - npc.TargetClosest(); npc.netUpdate = true; } else if (shouldSpinAround || npc.ai[1] != 4f) @@ -287,7 +288,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; npc.ai[1] = shouldSpinAround ? 5f : 1f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -788,10 +788,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Set direction npc.spriteDirection = -(int)npc.ai[0]; @@ -922,10 +918,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] >= (masterMode ? 200f : 800f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; npc.ai[2] = 1f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } @@ -949,7 +945,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] >= 48f) { npc.localAI[0] = 0f; - npc.TargetClosest(); float laserSpeed = bossRush ? 5f : 4f; int type = ProjectileID.DeathLaser; int damage = npc.GetProjectileDamage(type); @@ -991,10 +986,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] >= timeLimit) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } @@ -1017,7 +1012,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] >= 120f) { npc.localAI[0] = 0f; - npc.TargetClosest(); int totalProjectiles = bossRush ? 32 : (masterMode ? 24 : 16); float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; @@ -1063,10 +1057,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - npc.spriteDirection = -(int)npc.ai[0]; if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) @@ -1139,11 +1129,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] >= (masterMode ? 200f : 800f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; npc.ai[2] = 1f; fireSlower = false; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -1163,11 +1153,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] >= timeLimit) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; npc.ai[2] = 0f; fireSlower = true; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } } @@ -1259,7 +1249,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.Item62, npc.Center); npc.localAI[0] = 0f; - npc.TargetClosest(); int type = ProjectileID.RocketSkeleton; int damage = npc.GetProjectileDamage(type); @@ -1307,7 +1296,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.Item62, npc.Center); npc.localAI[0] = 0f; - npc.TargetClosest(); int type = ProjectileID.RocketSkeleton; int damage = npc.GetProjectileDamage(type); @@ -1349,10 +1337,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - // Direction npc.spriteDirection = -(int)npc.ai[0]; @@ -1495,9 +1479,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] >= (masterMode ? 150f : 600f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } @@ -1603,7 +1587,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity += 1.5f; npc.ai[2] = 2f; - npc.TargetClosest(); viceArmChargePosition = npc.Center; viceArmChargeTargetX = Main.player[npc.target].Center.X - viceArmChargePosition.X; viceArmChargeTargetY = Main.player[npc.target].Center.Y - viceArmChargePosition.Y; @@ -1636,7 +1619,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Return to head npc.ai[2] = 3f; npc.ai[3] = 0f; - npc.TargetClosest(); return false; } @@ -1673,7 +1655,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity += 1.15f; npc.ai[2] = 5f; - npc.TargetClosest(); viceArmOtherChargePosition = npc.Center; viceArmOtherChargeTargetX = Main.player[npc.target].Center.X - viceArmOtherChargePosition.X; viceArmOtherChargeTargetY = Main.player[npc.target].Center.Y - viceArmOtherChargePosition.Y; @@ -1704,7 +1685,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Return to head npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); return false; } @@ -1726,10 +1706,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - Vector2 sawArmLocation = npc.Center; float sawArmIdleXPos = Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0] - sawArmLocation.X; float sawArmIdleYPos = Main.npc[(int)npc.ai[1]].position.Y + 230f - sawArmLocation.Y; @@ -1866,9 +1842,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] >= (masterMode ? 90f : 180f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } @@ -1968,7 +1944,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity += 1.5f; npc.ai[2] = 2f; - npc.TargetClosest(); sawArmChargePos = npc.Center; sawArmChargeTargetX = Main.player[npc.target].Center.X - sawArmChargePos.X; sawArmChargeTargetY = Main.player[npc.target].Center.Y - sawArmChargePos.Y; @@ -2057,7 +2032,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } @@ -2133,7 +2107,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] = 0f; npc.ai[1] = 1f; - npc.TargetClosest(); npc.netUpdate = true; } @@ -2220,6 +2193,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] = 0f; npc.ai[1] = 0f; + npc.TargetClosest(); } if (NPC.IsMechQueenUp) @@ -2375,6 +2349,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + npc.damage = 0; if (npc.ai[2] == 0f || npc.ai[2] == 3f) @@ -2443,6 +2421,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; if (npc.ai[3] >= (Main.masterMode ? 400f : Main.expertMode ? 600f : 800f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; npc.ai[3] = 0f; npc.netUpdate = true; @@ -2502,7 +2481,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - npc.TargetClosest(); Vector2 vector68 = npc.Center; float num559 = Main.player[npc.target].Center.X - vector68.X; float num560 = Main.player[npc.target].Center.Y - vector68.Y; @@ -2546,6 +2524,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; if (npc.ai[3] >= (Main.masterMode ? 150f : Main.expertMode ? 175f : 200f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -2602,7 +2581,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity.Y += num498; } - npc.TargetClosest(); vector69 = npc.Center; num566 = Main.player[npc.target].Center.X - vector69.X; num567 = Main.player[npc.target].Center.Y - vector69.Y; @@ -2656,6 +2634,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + npc.damage = 0; if (npc.ai[2] == 0f) @@ -2724,6 +2706,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; if (npc.ai[3] >= (Main.masterMode ? 700f : Main.expertMode ? 900f : 1100f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; npc.ai[2] = 1f; npc.ai[3] = 0f; @@ -2815,6 +2798,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; if (npc.ai[3] >= (Main.masterMode ? 180f : Main.expertMode ? 240f : 300f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.localAI[0] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -2872,7 +2856,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.velocity.Y += num498; } - npc.TargetClosest(); vector67 = npc.Center; num552 = Main.player[npc.target].Center.X - vector67.X; num553 = Main.player[npc.target].Center.Y - vector67.Y; @@ -2926,6 +2909,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + // Avoid cheap bullshit npc.damage = 0; @@ -2991,7 +2978,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.npc[(int)npc.ai[1]].ai[1] != 0f) { - npc.TargetClosest(); if (Main.player[npc.target].dead) { npc.velocity.Y += 0.1f; @@ -3033,6 +3019,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; if (npc.ai[3] >= (Main.masterMode ? 400f : Main.expertMode ? 500f : 600f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; npc.ai[3] = 0f; npc.netUpdate = true; @@ -3120,7 +3107,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); npc.ai[2] = 2f; vector64 = npc.Center; num539 = Main.player[npc.target].Center.X - vector64.X; @@ -3169,7 +3155,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); npc.ai[2] = 5f; vector65 = npc.Center; num542 = Main.player[npc.target].Center.X - vector65.X; @@ -3228,6 +3213,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.TargetClosest(); + // Min saw damage int reducedSetDamage = (int)Math.Round(npc.defDamage * 0.5); @@ -3296,7 +3285,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.npc[(int)npc.ai[1]].ai[1] != 0f) { - npc.TargetClosest(); if (Main.player[npc.target].dead) { npc.velocity.Y += 0.1f; @@ -3362,6 +3350,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; if (npc.ai[3] >= (Main.masterMode ? 180f : Main.expertMode ? 240f : 300f)) { + npc.target = Main.npc[(int)npc.ai[1]].target; npc.ai[2] += 1f; npc.ai[3] = 0f; npc.netUpdate = true; @@ -3446,7 +3435,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); npc.ai[2] = 2f; vector59 = npc.Center; num524 = Main.player[npc.target].Center.X - vector59.X; @@ -3471,7 +3459,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.TargetClosest(); Vector2 vector60 = npc.Center; float num527 = Main.player[npc.target].Center.X - vector60.X; float num528 = Main.player[npc.target].Center.Y - vector60.Y; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index 7f270bebca..1647c03d42 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -25,10 +25,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - float enrageScale = bossRush ? 0.5f : masterMode ? 0.4f : 0f; if (Main.IsItDay() || bossRush) { @@ -382,13 +378,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.rotation = retinazerHoverRotation; float totalCharges = death ? 6f : 5f; if (npc.ai[3] >= totalCharges) { npc.ai[1] = 0f; npc.ai[3] = 0f; + npc.TargetClosest(); } else npc.ai[1] = 1f; @@ -895,13 +891,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += chargeIncrement; - npc.TargetClosest(); npc.rotation = retinazerHoverRotation; float maxChargeAmt = spazAlive ? 2f : 4f; if (npc.ai[3] >= maxChargeAmt) { npc.ai[1] = 0f; npc.ai[3] = 0f; + npc.TargetClosest(); } else npc.ai[1] = 4f; @@ -974,7 +970,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; if (npc.ai[2] >= (spazAlive ? 75f : 60f) - (death ? 20f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f)) { - npc.TargetClosest(); npc.ai[1] = 2f; npc.ai[2] = 0f; npc.netUpdate = true; @@ -998,10 +993,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - float enrageScale = bossRush ? 0.5f : masterMode ? 0.4f : 0f; if (Main.IsItDay() || bossRush) { @@ -1261,7 +1252,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 1f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } else @@ -1367,7 +1357,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Reset AI array and go to cursed fireball phase npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.rotation = spazmatismRotation; float totalCharges = 8f; if (death) @@ -1584,7 +1573,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = (!retAlive || finalPhase) ? 5f : 1f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.TargetClosest(); npc.netUpdate = true; } @@ -1744,7 +1732,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.TargetClosest(); npc.rotation = spazmatismRotation; if (npc.ai[3] >= 5f) { @@ -1766,7 +1753,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float secondFastCharge = 4f; if (npc.ai[3] >= (retAlive ? secondFastCharge : secondFastCharge + 1f)) { - npc.TargetClosest(); npc.ai[1] = retAlive ? 0f : 5f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -1996,7 +1982,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Take 3 seconds to get in position, then charge if (npc.ai[2] >= (retAlive ? 180f : 135f) - (death ? 45f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f)) { - npc.TargetClosest(); npc.ai[1] = 3f; npc.ai[2] = -1f; npc.ai[3] = 0f; @@ -2196,7 +2181,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 1f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.target = Main.maxPlayers; + npc.TargetClosest(); npc.netUpdate = true; } else if (npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y && num425 < (Main.masterMode ? 720f : Main.expertMode ? 560f : 400f)) @@ -2299,11 +2284,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.target = Main.maxPlayers; npc.rotation = num414; float numCharges = Main.masterMode ? 6f : Main.expertMode ? 5f : 4f; if (npc.ai[3] >= numCharges) { + npc.TargetClosest(); npc.ai[1] = 0f; npc.ai[3] = 0f; } @@ -2318,6 +2303,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; + npc.TargetClosest(); npc.netUpdate = true; } @@ -2748,7 +2734,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Avoid cheap bullshit npc.damage = 0; - npc.TargetClosest(); float num463 = 12f; float num464 = 0.4f; if (Main.expertMode) @@ -2838,7 +2823,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 1f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.target = Main.maxPlayers; npc.netUpdate = true; } else @@ -2942,7 +2926,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.target = Main.maxPlayers; npc.rotation = num458; float numCharges = Main.masterMode ? 6f : Main.expertMode ? 8f : 10f; if (npc.ai[3] >= numCharges) @@ -3130,7 +3113,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] = 1f; npc.ai[2] = 0f; npc.ai[3] = 0f; - npc.target = Main.maxPlayers; npc.netUpdate = true; } @@ -3274,7 +3256,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[3] += 1f; npc.ai[2] = 0f; - npc.target = Main.maxPlayers; npc.rotation = num458; float numCharges = Main.masterMode ? Main.rand.Next(4, 7) : 6f; if (npc.ai[3] >= numCharges) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 8ece6740c8..0a8ab9133b 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -872,7 +872,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.localAI[2] = 1f; npc.localAI[1] = 0f; - npc.TargetClosest(); } } else if (npc.localAI[1] > 45f && (canHit || masterModeDetach) && !charging) @@ -880,7 +879,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] = 0f; npc.localAI[2] += 1f; if (npc.localAI[2] >= TotalLasersPerBarrage + 1f) + { npc.localAI[2] = 0f; + npc.TargetClosest(); + } if (shouldFireLasers) { @@ -1351,7 +1353,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Avoid cheap bullshit npc.damage = 0; - npc.TargetClosest(); npc.position.X = Main.npc[Main.wofNPCIndex].position.X; npc.direction = Main.npc[Main.wofNPCIndex].direction; npc.spriteDirection = npc.direction; @@ -1464,7 +1465,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] = 0f; npc.localAI[2] += 1f; if (npc.localAI[2] >= (float)num396) + { npc.localAI[2] = 0f; + npc.TargetClosest(); + } if (flag27) { From 061b636a1c6bde08a7b07ea511a0313373c7ac26 Mon Sep 17 00:00:00 2001 From: Memes Date: Sun, 19 May 2024 13:31:35 +0200 Subject: [PATCH 085/177] Adamantite Particle Accelerator as a base holdout. --- .../BaseGunHoldoutProjectile.cs | 4 +- .../Ranged/AdamantiteAcceleratorHoldout.cs | 110 ++++++++---------- 2 files changed, 48 insertions(+), 66 deletions(-) diff --git a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs index 81c50e3baa..48e3be1879 100644 --- a/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseGunHoldoutProjectile.cs @@ -256,7 +256,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles writer.Write(Projectile.rotation); writer.Write(KeepRefreshingLifetime); writer.Write(OffsetLengthFromArm); - writer.Write(Projectile.spriteDirection); + writer.Write7BitEncodedInt(Projectile.spriteDirection); SendExtraAIHoldout(writer); } @@ -265,7 +265,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles Projectile.rotation = reader.ReadSingle(); KeepRefreshingLifetime = reader.ReadBoolean(); OffsetLengthFromArm = reader.ReadSingle(); - Projectile.spriteDirection = reader.ReadInt32(); + Projectile.spriteDirection = reader.Read7BitEncodedInt(); ReceiveExtraAIHoldout(reader); } diff --git a/Projectiles/Ranged/AdamantiteAcceleratorHoldout.cs b/Projectiles/Ranged/AdamantiteAcceleratorHoldout.cs index 57f572b000..3af7722d96 100644 --- a/Projectiles/Ranged/AdamantiteAcceleratorHoldout.cs +++ b/Projectiles/Ranged/AdamantiteAcceleratorHoldout.cs @@ -1,59 +1,59 @@ -using System; +using System.IO; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; using static CalamityMod.CalamityUtils; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Projectiles.Ranged { - public class AdamantiteAcceleratorHoldout : ModProjectile + public class AdamantiteAcceleratorHoldout : BaseGunHoldoutProjectile { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override string Texture => "CalamityMod/Items/Weapons/Ranged/AdamantiteParticleAccelerator"; - const float maxTimeAnim = 35; - public Player Owner => Main.player[Projectile.owner]; - public float Timer => maxTimeAnim - Projectile.timeLeft; + public override int AssociatedItemID => ItemType(); + public override Vector2 GunTipPosition => Owner.MountedCenter + Projectile.rotation.ToRotationVector2() * 70f + (Vector2.UnitY * -12f * Owner.direction).RotatedBy(Projectile.rotation); + public override float MaxOffsetLengthFromArm => base.MaxOffsetLengthFromArm; + public override float OffsetXUpwards => base.OffsetXUpwards; + public override float OffsetXDownwards => base.OffsetXDownwards; + public override float BaseOffsetY => base.BaseOffsetY; + public override float OffsetYUpwards => base.OffsetYUpwards; + public override float OffsetYDownwards => base.OffsetYDownwards; + public ref float ChargeTimer => ref Projectile.ai[0]; public ref float DelayTimer => ref Projectile.ai[1]; public ref float ChargeRate => ref Projectile.localAI[0]; public ref float BounceBackPower => ref Projectile.localAI[1]; - public Vector2 NuzzlePosition => Owner.MountedCenter + Projectile.rotation.ToRotationVector2() * 70f + (Vector2.UnitY * -12f * Owner.direction).RotatedBy(Projectile.rotation); private SlotId ChargeupSoundSlot; - public override void SetDefaults() + public override void KillHoldoutLogic() { - Projectile.width = 54; - Projectile.height = 52; - // This projectile has no hitboxes and no damage type. - Projectile.friendly = false; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.timeLeft = 900; - Projectile.velocity = Vector2.Zero; + int maxTime = AdamantiteParticleAccelerator.ChargeFrames + AdamantiteParticleAccelerator.CooldownFrames; + if (ChargeTimer > maxTime) + { + if (!Owner.CantUseHoldout()) + ResetToStart(); + else + { + Projectile.Kill(); + return; + } + } } // ChargeTimer is a time-dilated frame counter. DelayTimer is the frame counter for when the beams are fired. // ChargeRate is the rate at which the "frame" counter increases. BounceBackPower is there for the visuals of the gun recoiling in the players hands. - public override void AI() + public override void HoldoutAI() { - Player player = Main.player[Projectile.owner]; - Vector2 rrp = player.RotatedRelativePoint(player.MountedCenter, true); - - Projectile.rotation = Owner.MountedCenter.AngleTo(Owner.Calamity().mouseWorld); - // Calculate how quickly the gun should charge. Charge increases by some number close to 1 every frame. // Speed increasing reforges make this number greater than 1. Slowing reforges make it smaller than 1. if (ChargeRate == 0f) - ChargeRate = 44f / player.ActiveItem().useTime; + ChargeRate = 44f / HeldItem.useTime; if (ChargeTimer == 0f) ChargeupSoundSlot = SoundEngine.PlaySound(SoundID.DD2_WitherBeastAuraPulse with { Volume = SoundID.DD2_WitherBeastAuraPulse.Volume * 1.6f }, Projectile.Center); @@ -69,24 +69,10 @@ namespace CalamityMod.Projectiles.Ranged // Increment the timer for the gun. If the timer has passed 44, destroy it. ChargeTimer += ChargeRate; - int maxTime = AdamantiteParticleAccelerator.ChargeFrames + AdamantiteParticleAccelerator.CooldownFrames; - if (ChargeTimer > maxTime) - { - if (Owner.channel) - ResetToStart(); - else - { - Projectile.Kill(); - return; - } - } // Compute the weapon's charge. float chargeLevel = MathHelper.Clamp(Projectile.ai[0] / AdamantiteParticleAccelerator.ChargeFrames, 0f, 1f); - // Common code among holdouts to keep the holdout projectile directly in the player's hand - UpdatePlayerVisuals(player, rrp); - // Firing or charging? if (chargeLevel >= 1f) { @@ -96,8 +82,8 @@ namespace CalamityMod.Projectiles.Ranged FiringEffects(new Color(235, 40, 121)); if (Projectile.owner == Main.myPlayer) { - Projectile redLaser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), NuzzlePosition, Projectile.rotation.ToRotationVector2(), ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 120); - redLaser.Center = NuzzlePosition; + Projectile redLaser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.rotation.ToRotationVector2(), ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, 120); + redLaser.Center = GunTipPosition; } } @@ -107,8 +93,8 @@ namespace CalamityMod.Projectiles.Ranged FiringEffects(new Color(49, 161, 246)); if (Projectile.owner == Main.myPlayer) { - Projectile blueLaser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), NuzzlePosition, Projectile.rotation.ToRotationVector2(), ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, -120); - blueLaser.Center = NuzzlePosition; + Projectile blueLaser = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.rotation.ToRotationVector2(), ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, -120); + blueLaser.Center = GunTipPosition; } } DelayTimer += 1f; @@ -124,27 +110,12 @@ namespace CalamityMod.Projectiles.Ranged public CurveSegment oversquish = new CurveSegment(SineBumpEasing, 0.7f, 0f, -0.6f); internal float RecoilSquish => PiecewiseAnimation(1 - MathHelper.Clamp(BounceBackPower * 2f, 0f, 1f), new CurveSegment[] { unsquish, oversquish }); - private void UpdatePlayerVisuals(Player player, Vector2 rrp) - { - // Place the projectile directly into the player's hand at all times - Projectile.Center = rrp; - - // The gun is a holdout projectile, so change the player's variables to reflect that - player.ChangeDir(Math.Sign(Projectile.rotation.ToRotationVector2().X)); - player.heldProj = Projectile.whoAmI; - player.itemTime = 2; - player.itemAnimation = 2; - - player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation - MathHelper.PiOver2); - - } - private void FiringEffects(Color color) { - SoundEngine.PlaySound(SoundID.Item92, NuzzlePosition); - SoundEngine.PlaySound(SoundID.Item60, NuzzlePosition); + SoundEngine.PlaySound(SoundID.Item92, GunTipPosition); + SoundEngine.PlaySound(SoundID.Item60, GunTipPosition); - Particle pulse = new DirectionalPulseRing(NuzzlePosition + Projectile.rotation.ToRotationVector2() * 5f, Vector2.Zero, color, new Vector2(0.5f, 1f), Projectile.rotation, 0.05f, 0.34f + Main.rand.NextFloat(0.3f), 30); + Particle pulse = new DirectionalPulseRing(GunTipPosition + Projectile.rotation.ToRotationVector2() * 5f, Vector2.Zero, color, new Vector2(0.5f, 1f), Projectile.rotation, 0.05f, 0.34f + Main.rand.NextFloat(0.3f), 30); GeneralParticleHandler.SpawnParticle(pulse); if (Owner == Main.LocalPlayer && Owner.Calamity().GeneralScreenShakePower < 5) @@ -174,7 +145,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreKill(int timeLeft) { - if (Owner.channel) + if (!Owner.CantUseHoldout()) { ResetToStart(); return false; @@ -185,9 +156,20 @@ namespace CalamityMod.Projectiles.Ranged public void ResetToStart() { - Projectile.timeLeft = 900; ChargeTimer = 0f; DelayTimer = 0f; } + + public override void SendExtraAIHoldout(BinaryWriter writer) + { + writer.Write(ChargeRate); + writer.Write(BounceBackPower); + } + + public override void ReceiveExtraAIHoldout(BinaryReader reader) + { + ChargeRate = reader.ReadSingle(); + BounceBackPower = reader.ReadSingle(); + } } } From 24e78d29b9ec6ce9ee62a81d182a40f4635ff64d Mon Sep 17 00:00:00 2001 From: Memes Date: Sun, 19 May 2024 14:01:43 +0200 Subject: [PATCH 086/177] Condemnation as a base holdout. --- Items/Weapons/Ranged/Condemnation.cs | 11 +- Projectiles/Ranged/CondemnationHoldout.cs | 163 +++++++++------------- 2 files changed, 71 insertions(+), 103 deletions(-) diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index 9f80655ae3..8adb29a61a 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -44,10 +44,15 @@ namespace CalamityMod.Items.Weapons.Ranged public override void HoldItem(Player player) { - if (Main.myPlayer == player.whoAmI) - player.Calamity().rightClickListener = true; + var calPlayer = player.Calamity(); - if (player.Calamity().mouseRight && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) + if (Main.myPlayer == player.whoAmI) + { + calPlayer.rightClickListener = true; + calPlayer.mouseRotationListener = true; + } + + if (calPlayer.mouseRight && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) { Item.noUseGraphic = false; } diff --git a/Projectiles/Ranged/CondemnationHoldout.cs b/Projectiles/Ranged/CondemnationHoldout.cs index 04693f2c48..adb6c6d397 100644 --- a/Projectiles/Ranged/CondemnationHoldout.cs +++ b/Projectiles/Ranged/CondemnationHoldout.cs @@ -1,18 +1,20 @@ -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Sounds; +using System.IO; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { - public class CondemnationHoldout : ModProjectile + public class CondemnationHoldout : BaseGunHoldoutProjectile { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - private Player Owner => Main.player[Projectile.owner]; + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 25f; + public override float OffsetXUpwards => -5f; + public override float BaseOffsetY => -5f; private ref float CurrentChargingFrames => ref Projectile.ai[0]; private ref float ArrowsLoaded => ref Projectile.ai[1]; @@ -22,24 +24,8 @@ namespace CalamityMod.Projectiles.Ranged public const float velocityMultiplier = 1.2f; public bool homing = false; - public override string Texture => "CalamityMod/Items/Weapons/Ranged/Condemnation"; - - public override void SetDefaults() + public override void KillHoldoutLogic() { - Projectile.width = 130; - Projectile.height = 42; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Ranged; - Projectile.ignoreWater = true; - } - - public override void AI() - { - Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); - Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.5f; - // Fire arrows if the owner stops channeling or otherwise cannot use the weapon. if (Owner.CantUseHoldout()) { @@ -51,65 +37,61 @@ namespace CalamityMod.Projectiles.Ranged } // Fire one charged arrow every frame until you're out of arrows. - ShootProjectiles(tipPosition, homing); + ShootProjectiles(homing); --ArrowsLoaded; if (ArrowsLoaded == 0 && homing == true) homing = false; } - else + } + + public override void HoldoutAI() + { + // Frame 1 effects: Record how fast the Condemnation item being used is, to determine how fast to load arrows. + if (FramesToLoadNextArrow == 0f) { + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + FramesToLoadNextArrow = HeldItem.useAnimation; + } - // Frame 1 effects: Record how fast the Condemnation item being used is, to determine how fast to load arrows. - if (FramesToLoadNextArrow == 0f) + // If no arrows are loaded, spawn a bit of dust to indicate it's not ready yet. + // Spawn the same dust if the max number of arrows have been loaded or the player ran out of ammos to load. + if (ArrowsLoaded <= 0f || ArrowsLoaded >= Condemnation.MaxLoadedArrows || !Owner.HasAmmo(Owner.ActiveItem())) + SpawnCannotLoadArrowsDust(GunTipPosition); + + if (Owner.HasAmmo(HeldItem)) + { + // Actually make progress towards loading more arrows. + ++CurrentChargingFrames; + + // If it is time to load an arrow, produce a pulse of dust and add an arrow. + // Also accelerate charging, because it's fucking awesome. + // Take the ammo here as well + if (CurrentChargingFrames >= FramesToLoadNextArrow && ArrowsLoaded < Condemnation.MaxLoadedArrows) { - SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - FramesToLoadNextArrow = Owner.ActiveItem().useAnimation; - } + // Save the stats here for later + Owner.PickAmmo(HeldItem, out _, out float shootSpeed, out int damage, out float knockback, out _); + Projectile.damage = damage; + Projectile.knockBack = knockback; + storedVelocity = shootSpeed * velocityMultiplier; - // If no arrows are loaded, spawn a bit of dust to indicate it's not ready yet. - // Spawn the same dust if the max number of arrows have been loaded or the player ran out of ammos to load. - if (ArrowsLoaded <= 0f || ArrowsLoaded >= Condemnation.MaxLoadedArrows || !Owner.HasAmmo(Owner.ActiveItem())) - SpawnCannotLoadArrowsDust(tipPosition); + SpawnArrowLoadedDust(); + CurrentChargingFrames = 0f; + ++ArrowsLoaded; + --FramesToLoadNextArrow; - if (Owner.HasAmmo(Owner.ActiveItem())) - { - // Actually make progress towards loading more arrows. - ++CurrentChargingFrames; + // Play a sound for additional notification that an arrow has been loaded. + var loadSound = SoundEngine.PlaySound(SoundID.Item108 with { Volume = SoundID.Item108.Volume * 0.3f }); - // If it is time to load an arrow, produce a pulse of dust and add an arrow. - // Also accelerate charging, because it's fucking awesome. - // Take the ammo here as well - if (CurrentChargingFrames >= FramesToLoadNextArrow && ArrowsLoaded < Condemnation.MaxLoadedArrows) + if (ArrowsLoaded >= Condemnation.MaxLoadedArrows) { - // Save the stats here for later - Item heldItem = Owner.ActiveItem(); - Owner.PickAmmo(heldItem, out _, out float shootSpeed, out int damage, out float knockback, out _); - Projectile.damage = damage; - Projectile.knockBack = knockback; - storedVelocity = shootSpeed * velocityMultiplier; - - SpawnArrowLoadedDust(tipPosition); - CurrentChargingFrames = 0f; - ++ArrowsLoaded; - --FramesToLoadNextArrow; - - // Play a sound for additional notification that an arrow has been loaded. - var loadSound = SoundEngine.PlaySound(SoundID.Item108 with { Volume = SoundID.Item108.Volume * 0.3f }); - - if (ArrowsLoaded >= Condemnation.MaxLoadedArrows) - { - SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/AbilitySounds/BrimflameRecharge")); - homing = true; - } + SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/AbilitySounds/BrimflameRecharge")); + homing = true; } } } - - UpdateProjectileHeldVariables(armPosition); - ManipulatePlayerVariables(); } - public void SpawnArrowLoadedDust(Vector2 tipPosition) + public void SpawnArrowLoadedDust() { if (Main.dedServ) return; @@ -126,7 +108,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 end = nextAngle.ToRotationVector2(); for (int j = 0; j < 40; j++) { - Dust starDust = Dust.NewDustPerfect(tipPosition, 267); + Dust starDust = Dust.NewDustPerfect(GunTipPosition, 267); starDust.scale = 2.5f; starDust.velocity = Vector2.Lerp(start, end, j / 40f) * 16f; starDust.color = Color.Crimson; @@ -138,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 36; i++) { - Dust chargeMagic = Dust.NewDustPerfect(tipPosition, 267); + Dust chargeMagic = Dust.NewDustPerfect(GunTipPosition, 267); chargeMagic.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 5f + Owner.velocity; chargeMagic.scale = Main.rand.NextFloat(1f, 1.5f); chargeMagic.color = Color.Violet; @@ -146,62 +128,43 @@ namespace CalamityMod.Projectiles.Ranged } } - public void SpawnCannotLoadArrowsDust(Vector2 tipPosition) + public void SpawnCannotLoadArrowsDust(Vector2 GunTipPosition) { if (Main.dedServ) return; for (int i = 0; i < 2; i++) { - Dust chargeMagic = Dust.NewDustPerfect(tipPosition + Main.rand.NextVector2Circular(20f, 20f), 267); - chargeMagic.velocity = (tipPosition - chargeMagic.position) * 0.1f + Owner.velocity; + Dust chargeMagic = Dust.NewDustPerfect(GunTipPosition + Main.rand.NextVector2Circular(20f, 20f), 267); + chargeMagic.velocity = (GunTipPosition - chargeMagic.position) * 0.1f + Owner.velocity; chargeMagic.scale = Main.rand.NextFloat(1f, 1.5f); chargeMagic.color = Projectile.GetAlpha(Color.White); chargeMagic.noGravity = true; } } - public void ShootProjectiles(Vector2 tipPosition, bool homing) + public void ShootProjectiles(bool homing) { if (Main.myPlayer != Projectile.owner) return; Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * storedVelocity; int ArrowType = homing ? ModContent.ProjectileType() : ModContent.ProjectileType(); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity, ArrowType, Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ArrowType, Projectile.damage, Projectile.knockBack, Projectile.owner); } - private void UpdateProjectileHeldVariables(Vector2 armPosition) + public override void SendExtraAIHoldout(BinaryWriter writer) { - if (Main.myPlayer == Projectile.owner) - { - float interpolant = Utils.GetLerpValue(5f, 25f, Projectile.Distance(Main.MouseWorld), true); - Vector2 oldVelocity = Projectile.velocity; - Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant); - if (Projectile.velocity != oldVelocity) - { - Projectile.netSpam = 0; - Projectile.netUpdate = true; - } - } - - Projectile.position = armPosition - Projectile.Size * 0.5f; - Projectile.rotation = Projectile.velocity.ToRotation(); - if (Projectile.spriteDirection == -1) - Projectile.rotation += MathHelper.Pi; - Projectile.spriteDirection = Projectile.direction; - Projectile.timeLeft = 2; + writer.Write(FramesToLoadNextArrow); + writer.Write(storedVelocity); + writer.Write(homing); } - private void ManipulatePlayerVariables() + public override void ReceiveExtraAIHoldout(BinaryReader reader) { - Owner.ChangeDir(Projectile.direction); - Owner.heldProj = Projectile.whoAmI; - Owner.itemTime = 2; - Owner.itemAnimation = 2; - Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); + FramesToLoadNextArrow = reader.ReadSingle(); + storedVelocity = reader.ReadSingle(); + homing = reader.ReadBoolean(); } - - public override bool? CanDamage() => false; } } From 55239aa42be0a120f61023641ce47ff5f68c000d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 19 May 2024 11:22:28 -0400 Subject: [PATCH 087/177] Thank You shenanigans --- Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index 17aec33a70..c48fa96e83 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -72,7 +72,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "CosmaticMango", "CrabBar", "Dia", - "DylanDoe21", "enamoured", "Fluffi", "HaguriHat", @@ -94,7 +93,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Shayy", "Spider Prov", "StipulateVenus", - "Tomat", "Triangle", "Uncle Danny", "Xyk", @@ -126,6 +124,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Doog", "drh", "dwshin", + "DylanDoe21", "Earth", "EchoDuck", "Ein", @@ -191,6 +190,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "ThousandFields", "TikiWiki", "Tinymanx", + "Tomat", "Trivaxy", "Uberransy", "Vaikyia", From 2d90fc12f2f6998dd5f2f8dcd1648d32cd915b32 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sun, 19 May 2024 22:24:06 +0700 Subject: [PATCH 088/177] basher tooltip update --- Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index afeab0b76b..7fa39e9879 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -169,7 +169,7 @@ BansheeHook: { Basher: { DisplayName: Basher - Tooltip: Swings a rotten club that poisons and irradiates enemies on hit + Tooltip: Swings a rotten club that irradiates enemies on hit } BladecrestOathsword: { From fefbbf99c9e2affe048e5aa9641a353deb67bb4b Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 19 May 2024 17:16:59 -0400 Subject: [PATCH 089/177] Reverted Basher tooltip change --- Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 7fa39e9879..afeab0b76b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -169,7 +169,7 @@ BansheeHook: { Basher: { DisplayName: Basher - Tooltip: Swings a rotten club that irradiates enemies on hit + Tooltip: Swings a rotten club that poisons and irradiates enemies on hit } BladecrestOathsword: { From 8e883e7171ba0b1a81a7286cc4b1474b77363379 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 19 May 2024 17:17:29 -0400 Subject: [PATCH 090/177] ENNWAY development absorption --- Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index c48fa96e83..63db3bcde1 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -73,6 +73,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "CrabBar", "Dia", "enamoured", + "ENNWAY", "Fluffi", "HaguriHat", "Heart Plus Up!", @@ -128,7 +129,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Earth", "EchoDuck", "Ein", - "ENNWAY", "Enreden", "Epsilon", "Fargowilta", From 90a75046c92b952540b04b31e81a364a737dda23 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 19 May 2024 22:00:56 -0500 Subject: [PATCH 091/177] Fixed Slime God Core despawn issue. --- NPCs/SlimeGod/SlimeGodCore.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index c0bdd4c2f6..153c0e85ad 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -158,6 +158,9 @@ namespace CalamityMod.NPCs.SlimeGod calamityGlobalNPC.newAI[0] = Main.npc[CalamityGlobalNPC.slimeGodPurple].Center.X; calamityGlobalNPC.newAI[1] = Main.npc[CalamityGlobalNPC.slimeGodPurple].Center.Y; + // Despawn check + calamityGlobalNPC.newAI[3] = Main.npc[CalamityGlobalNPC.slimeGodPurple].ai[0] == 4f ? 1f : 0f; + purpleSlimeAlive = true; } } @@ -173,6 +176,9 @@ namespace CalamityMod.NPCs.SlimeGod NPC.ai[1] = Main.npc[CalamityGlobalNPC.slimeGodRed].Center.X; NPC.ai[2] = Main.npc[CalamityGlobalNPC.slimeGodRed].Center.Y; + + // Despawn check + calamityGlobalNPC.newAI[3] = Main.npc[CalamityGlobalNPC.slimeGodRed].ai[0] == 3f ? 1f : 0f; redSlimeAlive = true; } @@ -265,6 +271,7 @@ namespace CalamityMod.NPCs.SlimeGod { NPC.ApplyInteraction(i); } + NPC.active = false; NPC.HitEffect(); NPC.NPCLoot(); @@ -275,11 +282,15 @@ namespace CalamityMod.NPCs.SlimeGod } // Despawn - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles) || calamityGlobalNPC.newAI[3] == 1f) { - NPC.TargetClosest(false); - player = Main.player[NPC.target]; - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) + if (calamityGlobalNPC.newAI[3] != 1f) + { + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + } + + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles) || calamityGlobalNPC.newAI[3] == 1f) { if (NPC.velocity.Y < -3f) NPC.velocity.Y = -3f; From df8097995a002b64e2667cae742d7bb1fef41c15 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 20 May 2024 00:39:59 -0400 Subject: [PATCH 092/177] New Chaos State cooldown end sound --- .../Custom/AbilitySounds/ChaosStateOver.ogg | Bin 22883 -> 23940 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Sounds/Custom/AbilitySounds/ChaosStateOver.ogg b/Sounds/Custom/AbilitySounds/ChaosStateOver.ogg index 8019d05fd430649c22f831c27a9009c5be855779..38d88f18ed2e026eb927d0c6936e214c00ad5f81 100644 GIT binary patch literal 23940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=}w)y$?>-{N;+gM+f*N@YcGrQIJ_qBoG$3GXbPl7eElF97@l$27rOeD!aAsflhBZuYsdw)H_!d z*>0;sKt;*wHLws=0$v09<%Jp^2^r1yMhS!^aC2Wq1{ag6l>`991cU+-yLppl1WTU; zm<9}#`w1LV7S&%ZfF`F6L!eZ8k&#sn(=tHxSP%Q%eB z;`w@=Z}aHW2iV?^ZHP=WozYBH!=$nck^lezzn%Tg>p#io8n(YPYm2W3>2TBD`{DZ5 z6WYu7ym#kUU$xiSKGT=8_~fo#`}GWcUp-O=M$rmjMO9R#6e@BuGNhL1WK(J`ue|e`AfGOEK(PWCUjEwS>%bK;C5=a2RQQT<_KwEAW;2&7iQ*x7WWH}W^m6b(SRzl#aDkJ5o zlnl;ZJen-Sy8$~D`73x7X0!|dA5&2TTtVNwl87$jKCS{xI|xMq(4~y$D7*p3DoeSY z3;-yO^oG|$32a6R5KTqe Date: Mon, 20 May 2024 15:40:58 +0700 Subject: [PATCH 093/177] bestiary debuff type icon resprites --- UI/DebuffSystem/ColdDebuffType.png | Bin 255 -> 375 bytes UI/DebuffSystem/ElectricityDebuffType.png | Bin 234 -> 286 bytes UI/DebuffSystem/HeatDebuffType.png | Bin 259 -> 367 bytes UI/DebuffSystem/SicknessDebuffType.png | Bin 262 -> 349 bytes UI/DebuffSystem/WaterDebuffType.png | Bin 247 -> 330 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/UI/DebuffSystem/ColdDebuffType.png b/UI/DebuffSystem/ColdDebuffType.png index eb0a88f11a4aef5fa48ab549419c5bc63996b16e..f64ac9f30b9ad41d72f684cba46dbdf46f07f298 100644 GIT binary patch literal 375 zcmV--0f_#IP)Px$F-b&0R7i>KlP^-kKp4e;g$hJx%J9c!&~-(0a0oJ_s*2vBaDYbS1QF>0Xfa#> zR25}F;1~or4iE_povEl{ibx*KW*RVE1j94=_PtH^mv49BUw>bv>c!P8YmD2?Qg*Do z$j`sGvTVY#in!$g;N({R(I1Xvb?gx8-$ih`yAMG3?HPb!JO!Y#vkgFRqh^qe+s)(b z2krGx5}8O^&RUw(jC_FxV1e-K9IAJ7qVJ{No;=w(W&qWrLjd+R9RPy$ zEdavz7Xa>G=3GOqaNu>#;$pddVi5Gvb?OE!%jgqNT2z<$OkMCegbk-8002ovPDHLkV1gNDq=*0j literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9R!3-o1bjN}y#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvVv3w_=LEs*4+R6^Z)X@->sH>mWbWfe)0dQxBr2Xik@0>K#HRz$S?Rm1Tfrd z-Wv%N<1FxqEM{QfI}E~%$MaXD00m<_T^vI+g17cMaxoZkFmHAH{a;=`@I%1u$80=l z8Ef7w+%FjF?VhD@^|Jb-$6L>28QBXoYdz%NxJ)-JKO_IZ8QVj5c}_%&s~ifrY%j;r nF`>jkjX)S3j3^P6Px#*hxe|R7i=*Mis&>%BA!4);T60F?W#3AgP%mN^+vYw0(3NbtJyEI z*REaRic`*=nVh-b9r$+wyAUlJ@jDmv=9knRl~0WQOP`c`& zkg@+9%Ag3n$eQ}~&|-g#C1VZ&55v5IO~1$tuQ_~5S!VX<6qyNsL!orbnhF1u?Oc{M k6F-^5FlX;eGx2r9JK=vy7!SyAsQ>@~07*qoM6N<$f8vp!lvI6=10X`wFN)4xr&)mNB|5xGf|3I-VYnP=0Db|u8zu^Bs!0>w;UocRBv%n*= zn1O-sFbFdq&tH)O6b$xsaSYK2u00pc#h}39a`EHF|E9+?0w+}Mf7BxOXSK4;SCvIs z6SFcL8)mwsRc}y`n_T4UdLVM|^v#p*Stb3+aa!}gWMtr$B-(^ W{IKc!x4S^&89ZJ6T-G@yGywo(TvdMn diff --git a/UI/DebuffSystem/HeatDebuffType.png b/UI/DebuffSystem/HeatDebuffType.png index 8b25d715bb4dc37b19812f8b2e54523043c10ff5..d1c54b3e8d75325068f98ca9270e714ac47a823e 100644 GIT binary patch literal 367 zcmV-#0g(QQP)Px$DM>^@R7i=vlRZiUK@`V-8)Mibq)s7LR;ffG#71%siANCZyhcdx4MLg?Lc}VS zmFx-j2%AJ)i+MBdOmGD7+)6vtk!)1Zr_R|mIKgfbN)r$ z-^h|XV;^JgON>88sz+$aMmwLZ`*8-qHp`8n=W?g=o&67?`@@Ym1|$236#RUM{r`(HAH{8o{rb6gy zSPmm(B1?AiZ0^-u92@^ZJ;HGQLRm65pQMd(`kN9BjF5-YBmBzbAoIrLy*WetE!lvI6;{0X`wFJFFyrl{5Ul&G5s7;s0i}|9^h~WrDU?WC1Dmk|4j}|6sr%<<0B{ z6yhxKh%9Dc;5!V$jK}j=qyPm|JY5_^G=f{tI|?-@@Hk)Gmbvr)#HZbQE*El6*|aHc zEjxDR?z_*XX-rCaF_UMCOw_EMTs`%>N43-pNyEPuf}*Q_G%U|vHxHl!PC{xWt~$(69CQSTVMbH diff --git a/UI/DebuffSystem/SicknessDebuffType.png b/UI/DebuffSystem/SicknessDebuffType.png index db56ba844955181a82e20d6f327aeb8ffb6cb113..8c498f6d77d10490b457ff2fdf388a7d4f50f1c8 100644 GIT binary patch literal 349 zcmV-j0iyniP)Px$7fD1xR7i>Kl(A|8K@f&NMZHb~0YMP)6+}|S5YRUe!8gctHokz6Iu8&bkY2D( zVFC&%!lvI6d34x4LxK`F!|xFLRoD!6rSE21NlU1)%&Zi=R3`inAohFZe$c zFa-NofNbF`@Q5sCVBk9p!i>lBSEK+1<2_v*Lo|Z-p7Z8wP~c&?@bC0r|24rKiX3`# zc|Ul}Uij^lz01@>`Qu(LXNs0Tp2x82Oxn8x!kq~QkGhRq&nOwps8pKrPx$1W80eR7i={l(B2VKoo~RYnLpYN)YQL)FFtAo2a03R}oygsnGwXQ*jeS5Lfqr z7XJW|4rVThIJt;}jYD!^LXvav4*J{PyBG5Daqr;Y$Eew^QM27!=O6A3@F*L|WeNZ| z(Dhq`r1`rOrs58SH>*?u;Agc2;J9eSegirk3U}dJ=2E@G*VeBK@MJy%aML;n^qs2B6=m2I{a&efLn1iHMDfNWi5! zLUG@~1Yo}Y3k(Xk`D`+SIzngqk^-3FZOU8Ij3oLTZ2>qg8a*w9()Tc&2r^BZl8|mp cU(b7Z0fpB^*a1S7umAu607*qoM6N<$g1o?y@&Et; literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^LO?9R!3-o1bjN}y#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;{0X`wFoVNQ_L!TOF|16yT`^2|@lQ;ea%KX^G@*GI9mjw9*{|5sGDQ{*s zpb%$)M`SSr1K(i~W;~w1A_XWI;pyTSq7htsu95420tZXL)-V6`vLL+`gtvWs{iPhb-TQy^R*aigE8dB*PoB{QIgt{S0?Z fztd@Z%sEZ`Rv$ZSYeq~W&<+MqS3j3^P6 Date: Mon, 20 May 2024 03:43:37 -0500 Subject: [PATCH 094/177] I hate how things despawn in this game so much --- NPCs/SlimeGod/CrimulanPaladin.cs | 2 - NPCs/SlimeGod/EbonianPaladin.cs | 2 - NPCs/SlimeGod/SlimeGodCore.cs | 70 ++++++++++++------- NPCs/SlimeGod/SplitCrimulanPaladin.cs | 2 - NPCs/SlimeGod/SplitEbonianPaladin.cs | 2 - .../Bosses/SkeletronAI.cs | 3 - 6 files changed, 44 insertions(+), 37 deletions(-) diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index 59c8c721e0..8d7147dc4d 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -742,8 +742,6 @@ namespace CalamityMod.NPCs.SlimeGod return newColor * NPC.Opacity; } - public override bool CheckActive() => NPC.ai[0] == 3f; - public override void HitEffect(NPC.HitInfo hit) { Color dustColor = Color.Crimson; diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index f59df6f5f8..fe2ae3f8a7 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -787,8 +787,6 @@ namespace CalamityMod.NPCs.SlimeGod return newColor * NPC.Opacity; } - public override bool CheckActive() => NPC.ai[0] == 4f; - public override void HitEffect(NPC.HitInfo hit) { Color dustColor = Color.Lavender; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 153c0e85ad..d2f4e0bb7c 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -100,6 +100,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SendExtraAI(BinaryWriter writer) { + writer.Write(slimesSpawned); writer.Write(buffedSlime); writer.Write(NPC.Opacity); for (int i = 0; i < 4; i++) @@ -108,6 +109,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void ReceiveExtraAI(BinaryReader reader) { + slimesSpawned = reader.ReadBoolean(); buffedSlime = reader.ReadInt32(); NPC.Opacity = reader.ReadSingle(); for (int i = 0; i < 4; i++) @@ -135,11 +137,14 @@ namespace CalamityMod.NPCs.SlimeGod Player player = Main.player[NPC.target]; - if (Main.netMode != NetmodeID.MultiplayerClient && !slimesSpawned) + if (!slimesSpawned) { slimesSpawned = true; - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType()); - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType()); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType()); + } } // Enrage based on large slimes @@ -188,7 +193,7 @@ namespace CalamityMod.NPCs.SlimeGod bool phase2 = !purpleSlimeAlive || !redSlimeAlive; // Vanish phase - if (!purpleSlimeAlive && !redSlimeAlive) + if ((!purpleSlimeAlive && !redSlimeAlive) || calamityGlobalNPC.newAI[3] == 1f || NPC.ai[3] == 1f) { // Avoid cheap bullshit NPC.damage = 0; @@ -257,40 +262,53 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimyDust2].velocity *= 2f; } - // Let the player know that the Slime God isn't dead fr - if (!DownedBossSystem.downedSlimeGod) + if (calamityGlobalNPC.newAI[3] != 1f) { - string key = "Mods.CalamityMod.Status.Boss.SlimeGodRun"; - Color messageColor = Color.Magenta; + // Let the player know that the Slime God isn't dead fr + if (!DownedBossSystem.downedSlimeGod) + { + string key = "Mods.CalamityMod.Status.Boss.SlimeGodRun"; + Color messageColor = Color.Magenta; - CalamityUtils.DisplayLocalizedText(key, messageColor); + CalamityUtils.DisplayLocalizedText(key, messageColor); + } + + // Set Slime God to have interacted with all players + for (int i = Main.maxPlayers - 1; i >= 0; i--) + NPC.ApplyInteraction(i); + + NPC.active = false; + NPC.HitEffect(); + NPC.NPCLoot(); + NPC.netUpdate = true; } - - // Set Slime God to have interacted with all players - for (int i = Main.maxPlayers - 1; i >= 0; i--) + else { - NPC.ApplyInteraction(i); - } + for (int x = 0; x < Main.maxNPCs; x++) + { + if (Main.npc[x].type == ModContent.NPCType() || Main.npc[x].type == ModContent.NPCType() || + Main.npc[x].type == ModContent.NPCType() || Main.npc[x].type == ModContent.NPCType()) + { + Main.npc[x].active = false; + Main.npc[x].netUpdate = true; + } + } - NPC.active = false; - NPC.HitEffect(); - NPC.NPCLoot(); - NPC.netUpdate = true; + NPC.active = false; + NPC.HitEffect(); + NPC.netUpdate = true; + } } return; } // Despawn - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles) || calamityGlobalNPC.newAI[3] == 1f) + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) { - if (calamityGlobalNPC.newAI[3] != 1f) - { - NPC.TargetClosest(false); - player = Main.player[NPC.target]; - } - - if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles) || calamityGlobalNPC.newAI[3] == 1f) + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > (bossRush ? CalamityGlobalNPC.CatchUpDistance350Tiles : CalamityGlobalNPC.CatchUpDistance200Tiles)) { if (NPC.velocity.Y < -3f) NPC.velocity.Y = -3f; diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index 7ad8a1e363..a51706798a 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -736,8 +736,6 @@ namespace CalamityMod.NPCs.SlimeGod npcLoot.Add(ItemID.Gel, 1, 32, 48); } - public override bool CheckActive() => NPC.ai[0] == 3f; - public override void HitEffect(NPC.HitInfo hit) { Color dustColor = Color.Crimson; diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 8dddef1603..fad784a39e 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -780,8 +780,6 @@ namespace CalamityMod.NPCs.SlimeGod npcLoot.Add(ItemID.Gel, 1, 32, 48); } - public override bool CheckActive() => NPC.ai[0] == 4f; - public override void HitEffect(NPC.HitInfo hit) { Color dustColor = Color.Lavender; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index abf2444bac..68e01972b2 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -125,9 +125,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - // Distance from target - float distance = Vector2.Distance(Main.player[npc.target].Center, npc.Center); - // Despawn if (npc.ai[1] != 3f) { From 340df966d3930aa32e843b9f2a5735fcbb87a1f1 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 20 May 2024 09:18:45 -0400 Subject: [PATCH 095/177] Chaos State cooldown end sound V2 --- .../Custom/AbilitySounds/ChaosStateOver.ogg | Bin 23940 -> 25141 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Sounds/Custom/AbilitySounds/ChaosStateOver.ogg b/Sounds/Custom/AbilitySounds/ChaosStateOver.ogg index 38d88f18ed2e026eb927d0c6936e214c00ad5f81..cef7b850098fe9cd9ea4091891ed77c3de5b378f 100644 GIT binary patch literal 25141 zcmeFZcT`hN_b7Z4LTI74fPkU5fC){ih90VP2u*qir6Y=lDqVU9>C&5kf`Ulzy`zXA z(y_~l1?_urj08D{qEnSExLnLTsnaK+Wt7=Qx*g!ig{GH-H2 zu0psVLD&2o-2Kl$P_?>$P<;O&KZaa6Yx(bR))E4ixJA~e7)(z8TSz7O)0HTQVc~w= zP5g?VE6U5=!R$8ylom&`6G#FE5QQj`%id~vOvH6|}Rb|QY`$DbLDpX>vv)a1Y1vAHnF1XDt|4F%>f`1Z<-{U}m&!PfnbD~orKkGhL zxH88N?CQ_3Pyi7eCZL(hq}9wc*32<6!*}H)+K^FtMpE6_M9&lqfi~tr&PzdoOF?0T zoM@}ZVT8xgR?E>gC(-uEn1AA5VXsck;_soOAV4v%T-KIwDGz(;rd%mWR7@Qda5`fN ziXx3iIIT>p(#4~}J-^+pw%vQI1wGb+_>BUJ8+P_IK(TvX<^LiZenF_(^H{OAYxef>AR-Z6rf?;q%ndA$0ROjUXmY~-p+ZHHG;nCcI;@s&x|4A)G zUd5l>4TgNO`s!H_#k7Wp^G;XNzb7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W1OT8Pz!^uDwV|k1-gJ68g|_f!W;-g~Twr1(n?e?xuDQ;pWD^@w#`&Mg zY&)AjRXnGE&z5(g=l9=s&tMgAAOKbVm0U0Gt+vqv(1pC6{jo`qWfVxcacGp6&ooEq z+3AwmWSQlvsw%)ZvOlb}nTy`P9}m6PnqT>Ey$a+VcQUm#?u)r;;P{8Lho5|LZi}~i zcsQ>QoN3?R=DFSP{x(wkU|_uY_s;&Ri=i@l>Y;gYALhd_hI)s``!?o2`*Do-G4#W^ zVCl-!dVg#lIubo>4q{01rOE#Ekh6cMo~9m~?XSyga(mtT_5hmau1$9{)N_s2?3j~H z(R~id^qFOtm4{v>z&1giqJ$udz8q#&y3={LBSI8}kci8#jRDC*a2fqKRTnw-9>By; z@uw`9$lQ)1L61(egCySIMUDgvPJGjQoqdlE6UoMj34~^(U716eMt1y2X7fcr)`PlbepUj!c+uqaLeVFbkv#H0wy3XDw z;%k%B$sF_ie7nupu^7Yc(aK%^Y0`Om&*7pP2JtmqHCIRLVeT{L?AOdz4bwbR18fyD zw03RIeUUX!eGb!=44RXjvo4h+H~Zw~as2t^ZBJ}`!7si>?xZ%qo%MDnFzC*m6o7>T zJE3Zs%3DzX$bVUY0$`9X+XP_yXnv;l6A%Yn`#4H;wlRH2VkiWLDg`0WLswYI?6TkN z5`qnZIqFKnAp6R>FEBdjLTiaYtBQ>tBT?=SeR}vXau#Lg~QN5A^_T&jDZq$+ZXY From eb450e06c6d19bd4809ec0563888f8b59a01d0f1 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 18 May 2024 14:00:41 -0400 Subject: [PATCH 096/177] DR calcs support Hellfire in case they need to for some reason --- NPCs/CalamityGlobalNPC.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 0431d27c13..f337e08be9 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3307,6 +3307,7 @@ namespace CalamityMod.NPCs // Apply flat reductions first. All vanilla debuffs check their internal booleans. FlatEditDR(ref calcDR, npc.poisoned, BuffID.Poisoned); FlatEditDR(ref calcDR, npc.onFire, BuffID.OnFire); + FlatEditDR(ref calcDR, npc.onFire3, BuffID.OnFire3); FlatEditDR(ref calcDR, npc.venom, BuffID.Venom); FlatEditDR(ref calcDR, npc.onFrostBurn, BuffID.Frostburn); FlatEditDR(ref calcDR, npc.shadowFlame, BuffID.ShadowFlame); @@ -3325,6 +3326,7 @@ namespace CalamityMod.NPCs // Apply multiplicative reductions second. All vanilla debuffs check their internal booleans. MultEditDR(ref calcDR, npc.poisoned, BuffID.Poisoned); MultEditDR(ref calcDR, npc.onFire, BuffID.OnFire); + MultEditDR(ref calcDR, npc.onFire3, BuffID.OnFire3); MultEditDR(ref calcDR, npc.venom, BuffID.Venom); MultEditDR(ref calcDR, npc.onFrostBurn, BuffID.Frostburn); MultEditDR(ref calcDR, npc.shadowFlame, BuffID.ShadowFlame); From bb95090f51d3699a9a792c6bd2ebea2cc2b6d49f Mon Sep 17 00:00:00 2001 From: SandKingg <47184464+SandKingg@users.noreply.github.com> Date: Mon, 20 May 2024 17:56:25 +0100 Subject: [PATCH 097/177] Removed duplicate Harvest Staff tooltip (#41) --- .../en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 4f9a2d7f91..7c20016cf2 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -392,11 +392,6 @@ HadalUrn: { ''' } -HarvestStaff: { - DisplayName: Harvest Staff - Tooltip: Casts flaming pumpkins -} - HeliumFlash: { DisplayName: Helium Flash Tooltip: From 2646f687524bcf72958af8f7e1e6b84d78aee027 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 20 May 2024 17:23:27 -0400 Subject: [PATCH 098/177] 1 - Frog Leg and upgrades no longer stack. 2 - Amphibian Boots specifically (not any others) nerfed from +1.6 jump speed to +1.0. --- Balancing/BalancingConstants.cs | 6 ++++++ CalPlayer/CalamityPlayer.cs | 2 ++ Items/CalamityGlobalItem.cs | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 5087a7a6cf..4b931a4b1f 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -17,6 +17,12 @@ // This is a const because it replaces a hardcoded value in vanilla internal const float BalloonJumpSpeedBoost = 0.75f; + // Default jump speed boost provided by Frog Leg and tinker combinations in vanilla + internal const float VanillaFrogLegJumpSpeedBoost = 1.6f; + + // Altered jump speed boost provided by Amphibian Boots via global item UpdateAccessory + internal static readonly float AmphibianBootsJumpSpeedBoost = 1f; + // Altered movement stats provided by Shadow Armor via IL edit // This item is modified to not stack with Magiluminescence if on the ground. If in the air, it still functions. internal static readonly float ShadowArmorRunAccelerationMultiplier = 1.25f; // Vanilla and Magi = 1.75f diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 6106b15c9e..70989c1168 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -507,6 +507,7 @@ namespace CalamityMod.CalPlayer public bool ascendantTrail = false; public bool eGauntlet = false; public int gloveLevel = 0; // Used to prevent glove stacking + public bool alreadyHasFrogLeg = false; // Used to prevent Frog Leg tinker stacking public bool eTalisman = false; public int statisTimer = 0; public bool nucleogenesis = false; @@ -1703,6 +1704,7 @@ namespace CalamityMod.CalPlayer ascendantTrail = false; eGauntlet = false; gloveLevel = 0; + alreadyHasFrogLeg = false; eTalisman = false; nucleogenesis = false; nuclearFuelRod = false; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 6b546a1061..10845a70b5 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using CalamityMod.Balancing; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; @@ -1237,6 +1238,29 @@ namespace CalamityMod.Items player.GetDamage() += 0.02f; } + // The Frog Leg line is prevented from stacking. + // Additionally, Amphibian boots are directly nerfed so they aren't the best in slot boots at all times. + switch (item.type) + { + default: + break; + case ItemID.AmphibianBoots: + if (modPlayer.alreadyHasFrogLeg) + player.jumpSpeedBoost -= BalancingConstants.VanillaFrogLegJumpSpeedBoost; + else + player.jumpSpeedBoost += BalancingConstants.AmphibianBootsJumpSpeedBoost - BalancingConstants.VanillaFrogLegJumpSpeedBoost; + modPlayer.alreadyHasFrogLeg = true; + break; + case ItemID.FrogLeg: + case ItemID.FrogFlipper: + case ItemID.FrogGear: + case ItemID.FrogWebbing: + if (modPlayer.alreadyHasFrogLeg) + player.jumpSpeedBoost -= BalancingConstants.VanillaFrogLegJumpSpeedBoost; + modPlayer.alreadyHasFrogLeg = true; + break; + } + // Feral Claws line melee speed adjustments and nonstacking // First removes all their melee speed so it can be given based on which you wear without stacking if (item.type == ItemID.FeralClaws) From c789f9b7f40fd067c71a2fcd09683bdb01f32cfe Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 20 May 2024 20:37:00 -0400 Subject: [PATCH 099/177] Added new NPC targeting algorithm with numerous customizable options. Not used yet. --- Enums/NPCTargetType.cs | 9 + Utilities/NPCUtils.cs | 505 +++++++++++++++++++++++++++++++---------- 2 files changed, 395 insertions(+), 119 deletions(-) create mode 100644 Enums/NPCTargetType.cs diff --git a/Enums/NPCTargetType.cs b/Enums/NPCTargetType.cs new file mode 100644 index 0000000000..6fc9b0ac5c --- /dev/null +++ b/Enums/NPCTargetType.cs @@ -0,0 +1,9 @@ +namespace CalamityMod.Enums +{ + public enum NPCTargetType + { + Anyone = 0, + PreferSame = 1, + ForceSwitch = 2, + } +} diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 08c4955552..5617cc237d 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -1,9 +1,8 @@ -using System.Linq; -using System.Reflection; +using System; +using System.Linq; using CalamityMod.Balancing; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.DataStructures; +using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; @@ -24,8 +23,85 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod { + #region Calamity Targeting Parameters Struct + public struct CalamityTargetingParameters + { + // Vanilla argument to TargetClosest. Defaults to true as it does in vanilla. + // If true, the NPC will turn to face the target. + public bool faceTarget = true; + + // Vanilla argument to TargetClosestUpgraded. That function is never used, but the flexibility is implemented here. + // Allows targeting distance calculations to be measured from a different position than the NPC's center, if desired. + public Vector2? targetingCenter = null; + + // Hard maximum range to search for targets. Players outside this physical Manhattan distance will always be ignored. + // + // Vanilla always uses infinity for this, leading to behavior like Queen Bee crossing the world to spawncamp you. + // Calamity defaults to a very high but not infinite value. + public float maxSearchRange = 9600f; // 600 tiles + + // Targeting preference enum. + // Anyone = Target the "closest" player, no other considerations. Vanilla behavior. + // PreferSame = Always pick the same player if they're within the search range, even if another player is closer or has more aggro. + // ForceSwitch = Try to pick any other player but the current player, if possible. Similar to an "aggro drop" in MMOs. + // + // ForceSwitch intentionally does nothing in single player, because there is nobody to switch to. + public NPCTargetType targetType = NPCTargetType.Anyone; + + // The ratio at which to consider aggro bonuses from player gear. + // 1f is vanilla. Set to 0f to ignore aggro bonuses entirely. + // Set to a negative value to make the NPC intentionally avoid tanks and preferentially go after other players. + public float aggroRatio = 1f; + + // Whether or not players must have line of sight to the NPC to be considered valid targets. + // This is always line of sight to the NPC itself, even if a different targeting center for range finding is specified. + public bool requireLineOfSight = false; + + // If true, the targeting algorithm counts missing health as a gigantic boost to aggro. + // This makes for a "merciless" or "bloodthirsty" NPC which is focused on killing the lowest health players. + public bool finishThemOff = false; + internal const float FinishThemOff_MaxAggroBoost = 4000f; + + // If true, this NPC ignores the Stardust armor set bonus "JoJo Tank Minion" (or "Algalon the Observer" according to the wiki). + // + // This is set to false by default, because that's vanilla behavior. + // As Stardust armor is postgame in vanilla, no vanilla bosses ignore the Stardust Guardian. + // It is highly recommended to set this to true for all bosses, or their aggro can be abusively manipulated. + public bool ignoreTankMinions = false; + + // If true, this NPC ignores players who have less than zero net aggro and are not actively using items. + // + // This is set to true by default, because it's (undocumented) vanilla behavior. + // Bosses will automatically attack stealthed players anyway -- you don't need to set this to false for that to occur. + public bool ignoreStealthedPlayers = true; + + // If true, this targeting change forces a net update. + // In vanilla, targeting updates cause net updates if direction changed or the target player changed, + // but NEVER if the NPC has collideX or collideY set to true. + // + // Generally this doesn't need to be set to true, as bosses will never have collideX or collideY set to true. + public bool forceNetUpdate = false; + + public CalamityTargetingParameters() + { + } + + // Quick defaults for recommended boss settings. + public CalamityTargetingParameters(bool isBoss) + { + ignoreTankMinions = isBoss; + } + + public static CalamityTargetingParameters BossDefaults => new(true); + } + #endregion + + public static partial class CalamityUtils { + public static T ModNPC(this NPC npc) where T : ModNPC => npc.ModNPC as T; + + #region NPC Counting ///

/// Efficiently counts the amount of existing enemies. May be used for multiple enemies. /// @@ -49,6 +125,22 @@ namespace CalamityMod return count; } + public static bool AnyBossNPCS(bool checkForMechs = false) + { + foreach (NPC npc in Main.ActiveNPCs) + { + if (npc.IsABoss()) + { + // Added due to the new mech boss ore progression, return true if any mech is alive and checkForMechs is true, reduces mech boss projectile damage if true. + if (checkForMechs) + return npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer; + return true; + } + } + return FindFirstProjectile(ProjectileType()) != -1; + } + #endregion + /// /// Hides an NPC from the bestiary. This should be called in SetStaticDefaults. /// @@ -62,23 +154,7 @@ namespace CalamityMod NPCID.Sets.NPCBestiaryDrawOffset.Add(n.Type, value); } - /// - /// Syncs position and velocity from a client to the server. This is to be used in contexts where these things are reliant on client-side information, such as . - /// - /// - public static void SyncMotionToServer(this NPC npc) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - return; - - var netMessage = CalamityMod.Instance.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.SyncNPCMotionDataToServer); - netMessage.Write(npc.whoAmI); - netMessage.WriteVector2(npc.Center); - netMessage.WriteVector2(npc.velocity); - netMessage.Send(); - } - + #region Stat Setting /// /// Allows you to set the lifeMax value of a NPC to different values based on the mode. Called instead of npc.lifeMax = X. /// @@ -123,7 +199,9 @@ namespace CalamityMod if (customDR.HasValue) npc.Calamity().customDR = true; } + #endregion + #region NPC Threat Classification // This function controls the behavior of Proximity Rage. // // TODO -- In multiplayer, with more than one player, all enemies are listed as statue spawned. @@ -171,39 +249,9 @@ namespace CalamityMod return npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType(); } + #endregion - public static bool AnyBossNPCS(bool checkForMechs = false) - { - foreach (NPC npc in Main.ActiveNPCs) - { - if (npc.IsABoss()) - { - // Added due to the new mech boss ore progression, return true if any mech is alive and checkForMechs is true, reduces mech boss projectile damage if true. - if (checkForMechs) - return npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer; - return true; - } - } - return FindFirstProjectile(ProjectileType()) != -1; - } - - /// - /// Syncs . This exists to sync the Destroyer's lasers so that the telegraphs and segment colors display properly. - /// - /// - public static void SyncDestroyerLaserColor(this NPC npc) - { - // Don't bother attempting to send packets in singleplayer. - if (Main.netMode == NetmodeID.SinglePlayer) - return; - - ModPacket packet = CalamityMod.Instance.GetPacket(); - packet.Write((byte)CalamityModMessageType.SyncDestroyerLaserColor); - packet.Write((byte)npc.whoAmI); - packet.Write(npc.Calamity().destroyerLaserColor); - packet.Send(); - } - + #region Net Synchronization /// /// Syncs . This exists specifically for AIs manipulated in a global context, as has no netUpdate related hooks. /// @@ -244,6 +292,257 @@ namespace CalamityMod packet.Send(); } + /// + /// Syncs position and velocity from a client to the server. This is to be used in contexts where these things are reliant on client-side information, such as . + /// + /// + public static void SyncMotionToServer(this NPC npc) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + return; + + var netMessage = CalamityMod.Instance.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.SyncNPCMotionDataToServer); + netMessage.Write(npc.whoAmI); + netMessage.WriteVector2(npc.Center); + netMessage.WriteVector2(npc.velocity); + netMessage.Send(); + } + + /// + /// Syncs . This exists to sync the Destroyer's lasers so that the telegraphs and segment colors display properly. + /// + /// + public static void SyncDestroyerLaserColor(this NPC npc) + { + // Don't bother attempting to send packets in singleplayer. + if (Main.netMode == NetmodeID.SinglePlayer) + return; + + ModPacket packet = CalamityMod.Instance.GetPacket(); + packet.Write((byte)CalamityModMessageType.SyncDestroyerLaserColor); + packet.Write((byte)npc.whoAmI); + packet.Write(npc.Calamity().destroyerLaserColor); + packet.Send(); + } + #endregion + + #region Smooth Movement + /// + /// Smoother movement for NPCs + /// + /// The NPC getting the movement change. + /// The distance where the NPC should stop moving once it's close enough to its destination. + /// How far the NPC is from its destination. + /// How quickly the NPC moves towards its destination. + /// Whether the NPC should use SimpleFlyMovement to make the movement more affected by acceleration. + public static void SmoothMovement(NPC npc, float movementDistanceGateValue, Vector2 distanceFromDestination, float baseVelocity, float acceleration, bool useSimpleFlyMovement) + { + // Inverse lerp returns the percentage of progress between A and B + float lerpValue = Utils.GetLerpValue(movementDistanceGateValue, 2400f, distanceFromDestination.Length(), true); + + // Min velocity + float minVelocity = distanceFromDestination.Length(); + float minVelocityCap = baseVelocity; + if (minVelocity > minVelocityCap) + minVelocity = minVelocityCap; + + // Max velocity + Vector2 maxVelocity = distanceFromDestination / 24f; + float maxVelocityCap = minVelocityCap * 3f; + if (maxVelocity.Length() > maxVelocityCap) + maxVelocity = distanceFromDestination.SafeNormalize(Vector2.Zero) * maxVelocityCap; + + // Set the velocity + Vector2 desiredVelocity = Vector2.Lerp(distanceFromDestination.SafeNormalize(Vector2.Zero) * minVelocity, maxVelocity, lerpValue); + if (useSimpleFlyMovement) + npc.SimpleFlyMovement(desiredVelocity, acceleration); + else + npc.velocity = desiredVelocity; + } + #endregion + + #region Calamity Style Targeting + /// + /// Replacement and extension for vanilla's NPC.TargetClosest. Has very flexible behavior.
+ /// Like vanilla's function, this function does not return any value, but makes its changes in-place. + ///
+ /// Struct to specify all options. Refer to struct definition in NPCUtils for details. + /// The targeted player ID. + public static int CalamityTargeting(this NPC npc, CalamityTargetingParameters options) + { + float distance = 0f; + // float realDist = 0f; // Defined but not used by vanilla. Commented out here. + bool anyTargetAvailable = false; + int tankMinionProjectileID = -1; + + // The setup and initial loop is equivalent to vanilla NPC.TargetClosest, but optimized. + foreach (Player p in Main.ActivePlayers) + { + bool playerDead = p.dead || p.ghost; + if (playerDead) + continue; + + // ForceSwitch targeting. If the same player from last time is iterated over, just ignore them. + bool sameTargetAsLastTime = p.whoAmI == npc.oldTarget; + bool notSinglePlayer = Main.netMode != NetmodeID.SinglePlayer; + if (options.targetType == NPCTargetType.ForceSwitch && notSinglePlayer && sameTargetAsLastTime) + continue; + + // + // The below code is implemented in vanilla as a separate method. Here, it's inlined for efficiency. + // + + Vector2 pCenter = p.Center; + Vector2 targetCenter = options.targetingCenter ?? npc.Center; + float manhattanDist = Math.Abs(targetCenter.X - pCenter.X) + Math.Abs(targetCenter.Y - pCenter.Y); + + // Hard cutoff range specified in options. If the player is further, completely ignore them. + if (manhattanDist > options.maxSearchRange) + continue; + + // Line of sight requirement specified in options. Please don't use this without reducing the max search range. + if (options.requireLineOfSight && !Collision.CanHit(npc.Center, 1, 1, pCenter, 1, 1)) + continue; + + float aggroAdjustedDist = manhattanDist - options.aggroRatio * p.aggro; + + // Implementation of "Finish Them Off": Add enormous amounts of virtual aggro to low health players + if (options.finishThemOff) + { + float missingHPRatio = MathHelper.Clamp(1f - p.statLife / (float)p.statLifeMax2, 0f, 1f); + float bloodthirstAggro = MathHelper.Lerp(0f, CalamityTargetingParameters.FinishThemOff_MaxAggroBoost, missingHPRatio); + aggroAdjustedDist -= bloodthirstAggro; + } + + bool aggroDisabled = p.npcTypeNoAggro[npc.type]; + if (aggroDisabled && npc.direction != 0) + aggroAdjustedDist += 1000f; + + bool cancelTargeting = false; + + // PreferSame targeting. If the same player from last time is a valid target, even if not the "best" target, pick it anyway. + bool preferSameFound = options.targetType == NPCTargetType.PreferSame && sameTargetAsLastTime; + + // Standard targeting. If the adjusted distance is lower, or this is the first valid target, actually choose the new target. + bool standardTargetingRequirementsMet = !anyTargetAvailable || aggroAdjustedDist < distance; + + // If either targeting method succeeded, then this target is being engaged. + bool engageThisTarget = preferSameFound || standardTargetingRequirementsMet; + if (engageThisTarget) + { + anyTargetAvailable = true; + tankMinionProjectileID = -1; // Reset any Stardust Guardian aggro because a real player was found. + distance = aggroAdjustedDist; + npc.target = p.whoAmI; + + // If PreferSame targeting is active, and the same player was found, cancel further iteration. They are being chosen above all others. + if (preferSameFound) + cancelTargeting = true; + } + + // "Tank pet" accomodation, AKA the 1.4+ Stardust Guardian + // Basically, if the player would be targeted, give a chance to instead target their tank minion + // + // This behavior is not documented on the vanilla wiki. + if (p.tankPet >= 0 && !aggroDisabled && !options.ignoreTankMinions) + { + Projectile tankMinion = Main.projectile[p.tankPet]; + Vector2 tmCenter = tankMinion.Center; + float manhattanDistToTankMinion = Math.Abs(targetCenter.X - tmCenter.X) + Math.Abs(targetCenter.Y - tmCenter.Y); + + // The Stardust Guardian is considered to have a 200 aggro bonus by default. + // In Calamity this is scaled by the aggro ratio specified in options. + manhattanDistToTankMinion -= options.aggroRatio * 200f; + + // The Stardust Guardian only attracts the attention of NPCs within a very short distance + if (manhattanDistToTankMinion < distance && manhattanDistToTankMinion < 200f && Collision.CanHit(npc.Center, 1, 1, tmCenter, 1, 1)) + tankMinionProjectileID = p.tankPet; + } + + // If targeting has been short-circuited for any reason, cancel iteration over players. + if (cancelTargeting) + break; + } + + // If the NPC has been aggroed by a Stardust Guardian instead of an actual player, account for that + if (tankMinionProjectileID >= 0) + { + Projectile tankMinion = Main.projectile[tankMinionProjectileID]; + npc.targetRect = tankMinion.Hitbox; + + // Always set direction to a nonzero value. This NPC has been engaged in combat. + npc.direction = 1; + if (tankMinion.Center.X < npc.Center.X) + npc.direction = -1; + + npc.directionY = 1; + if (tankMinion.Center.Y < npc.Center.Y) + npc.directionY = -1; + } + + // Standard player aggro occurs here + else + { + bool shouldFaceTarget = options.faceTarget; + + // Sanitize targeted player index + if (npc.target < 0 || npc.target >= Main.maxPlayers) + npc.target = 0; + + Player targetPlayer = Main.player[npc.target]; + npc.targetRect = targetPlayer.Hitbox; + + // Do not switch facing to look at dead players. + if (targetPlayer.dead) + shouldFaceTarget = false; + + // If already engaged in combat, do not switch facing to look at players that ignore your aggro. + if (targetPlayer.npcTypeNoAggro[npc.type] && npc.direction != 0) + shouldFaceTarget = false; + + if (shouldFaceTarget) + { + bool oldTargetWasValid = npc.oldTarget >= 0 && npc.oldTarget < Main.maxPlayers; + + bool targetIsLowAggroNotUsingItem = targetPlayer.itemAnimation == 0 && targetPlayer.aggro < 0; + bool willIgnoreStealthedPlayers = !npc.boss && options.ignoreStealthedPlayers; + + // Regular NPCs (not bosses) will voluntarily ignore otherwise-valid player targets with less than zero aggro if they are not actively using an item. + // This ONLY WORKS if they already have another valid target, aka multiplayer. + // As such, having net less than zero aggro enables you to remain "stealthed" to regular enemies if you are not doing anything. + // This is undocumented vanilla behavior. + bool ignoreStealthedPlayer = willIgnoreStealthedPlayers && oldTargetWasValid && targetIsLowAggroNotUsingItem; + if (!ignoreStealthedPlayer) + { + // Always set direction to a nonzero value. This NPC has been engaged in combat. + npc.direction = 1; + if (targetPlayer.Center.X < npc.Center.X) + npc.direction = -1; + + npc.directionY = 1; + if (targetPlayer.Center.Y < npc.Center.Y) + npc.directionY = -1; + } + } + } + + // Confused enemies always run in the exact wrong direction, horizontally at least. + if (npc.confused) + npc.direction *= -1; + + // Apply net updates. + bool directionChange = npc.direction != npc.oldDirection || npc.directionY != npc.oldDirectionY; + bool targetChange = npc.target != npc.oldTarget; + bool shouldNetUpdate = (directionChange || targetChange) && !npc.collideX && !npc.collideY; + if (shouldNetUpdate || options.forceNetUpdate) + npc.netUpdate = true; + + return npc.target; + } + #endregion + + #region Minion Homing /// /// Detects nearby hostile NPCs from a given point /// @@ -329,39 +628,7 @@ namespace CalamityMod } return ClosestNPCAt(origin, maxDistanceToCheck, ignoreTiles); } - - /// - /// Smoother movement for NPCs - /// - /// The NPC getting the movement change. - /// The distance where the NPC should stop moving once it's close enough to its destination. - /// How far the NPC is from its destination. - /// How quickly the NPC moves towards its destination. - /// Whether the NPC should use SimpleFlyMovement to make the movement more affected by acceleration. - public static void SmoothMovement(NPC npc, float movementDistanceGateValue, Vector2 distanceFromDestination, float baseVelocity, float acceleration, bool useSimpleFlyMovement) - { - // Inverse lerp returns the percentage of progress between A and B - float lerpValue = Utils.GetLerpValue(movementDistanceGateValue, 2400f, distanceFromDestination.Length(), true); - - // Min velocity - float minVelocity = distanceFromDestination.Length(); - float minVelocityCap = baseVelocity; - if (minVelocity > minVelocityCap) - minVelocity = minVelocityCap; - - // Max velocity - Vector2 maxVelocity = distanceFromDestination / 24f; - float maxVelocityCap = minVelocityCap * 3f; - if (maxVelocity.Length() > maxVelocityCap) - maxVelocity = distanceFromDestination.SafeNormalize(Vector2.Zero) * maxVelocityCap; - - // Set the velocity - Vector2 desiredVelocity = Vector2.Lerp(distanceFromDestination.SafeNormalize(Vector2.Zero) * minVelocity, maxVelocity, lerpValue); - if (useSimpleFlyMovement) - npc.SimpleFlyMovement(desiredVelocity, acceleration); - else - npc.velocity = desiredVelocity; - } + #endregion ///
/// Check if an NPC is organic @@ -382,24 +649,6 @@ namespace CalamityMod return false; } - /// - /// Shortcut for the generic boss summon message. - /// - /// The whoAmI index of the summoned npc. - public static void BossAwakenMessage(int npcIndex) - { - // TODO -- this should use MiscUtils DisplayLocalizedText. - string typeName = Main.npc[npcIndex].TypeName; - if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName), new Color(175, 75, 255)); - } - else if (Main.netMode == NetmodeID.Server) - { - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] { Main.npc[npcIndex].GetTypeNetName() }), new Color(175, 75, 255)); - } - } - public static void Inflict246DebuffsNPC(NPC target, int buff, float timeBase = 2f) { if (Main.rand.NextBool(4)) @@ -416,8 +665,6 @@ namespace CalamityMod } } - public static T ModNPC(this NPC npc) where T : ModNPC => npc.ModNPC as T; - public static NPCShop AddWithCustomValue(this NPCShop shop, int itemType, int customValue, params Condition[] conditions) { var item = new Item(itemType) @@ -432,6 +679,38 @@ namespace CalamityMod return shop.AddWithCustomValue(ItemType(), customValue, conditions); } + public static void DrawBackglow(this NPC npc, Color backglowColor, float backglowArea, SpriteEffects spriteEffects, Rectangle frame, Vector2 screenPos, Texture2D overrideTexture = null) + { + Texture2D texture = overrideTexture is null ? TextureAssets.Npc[npc.type].Value : overrideTexture; + Vector2 drawPosition = npc.Center - screenPos; + Vector2 origin = frame.Size() * 0.5f; + Color backAfterimageColor = backglowColor * npc.Opacity; + for (int i = 0; i < 10; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * backglowArea; + Main.spriteBatch.Draw(texture, drawPosition + drawOffset, frame, backAfterimageColor, npc.rotation, origin, npc.scale, spriteEffects, 0f); + } + } + + #region Boss Spawning + /// + /// Shortcut for the generic boss summon message. + /// + /// The whoAmI index of the summoned npc. + public static void BossAwakenMessage(int npcIndex) + { + // TODO -- this should use MiscUtils DisplayLocalizedText. + string typeName = Main.npc[npcIndex].TypeName; + if (Main.netMode == NetmodeID.SinglePlayer) + { + Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName), new Color(175, 75, 255)); + } + else if (Main.netMode == NetmodeID.Server) + { + ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] { Main.npc[npcIndex].GetTypeNetName() }), new Color(175, 75, 255)); + } + } + /// /// Summons a boss near a particular area depending on a specific spawn context. /// @@ -465,19 +744,6 @@ namespace CalamityMod return null; } - public static void DrawBackglow(this NPC npc, Color backglowColor, float backglowArea, SpriteEffects spriteEffects, Rectangle frame, Vector2 screenPos, Texture2D overrideTexture = null) - { - Texture2D texture = overrideTexture is null ? TextureAssets.Npc[npc.type].Value : overrideTexture; - Vector2 drawPosition = npc.Center - screenPos; - Vector2 origin = frame.Size() * 0.5f; - Color backAfterimageColor = backglowColor * npc.Opacity; - for (int i = 0; i < 10; i++) - { - Vector2 drawOffset = (MathHelper.TwoPi * i / 10f).ToRotationVector2() * backglowArea; - Main.spriteBatch.Draw(texture, drawPosition + drawOffset, frame, backAfterimageColor, npc.rotation, origin, npc.scale, spriteEffects, 0f); - } - } - /// /// Spawns Old Duke on a player. Only works server side, and only works if the player owns a fishing bobber.
/// Old Duke will spawn above the fishing bobber if one is found. @@ -508,5 +774,6 @@ namespace CalamityMod int oldDuke = NPC.NewNPC(NPC.GetBossSpawnSource(playerIndex), (int)projectile.Center.X, (int)projectile.Center.Y + 100, NPCType()); BossAwakenMessage(oldDuke); } + #endregion } } From 62b8212884caa36e249ae8c9ddb7382e980f7dc3 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 20 May 2024 21:14:36 -0500 Subject: [PATCH 100/177] Fixed non-Rev WoF eyes not firing lasers. --- NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 0a8ab9133b..b9facd07ba 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -1350,6 +1350,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.npc[Main.wofNPCIndex].life > 0) npc.life = Main.npc[Main.wofNPCIndex].life; + // Get a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) + npc.target = Main.npc[Main.wofNPCIndex].target; + // Avoid cheap bullshit npc.damage = 0; From 3bf093d52510f35cdc704dc74168595f53a2904a Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 21 May 2024 03:58:57 -0500 Subject: [PATCH 101/177] 1 - Ruby Jewel projectile spread is larger and 1 less projectile is fired in non-Master. 2 - Sapphire Jewel stays above King Slime now and teleports with him. --- NPCs/NormalNPCs/KingSlimeJewel.cs | 4 +-- NPCs/NormalNPCs/KingSlimeJewel2.cs | 33 ++++++++++--------- .../Bosses/KingSlimeAI.cs | 32 ++++++++++++++++++ 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index a6edbdf1f8..086a89025d 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -152,8 +152,8 @@ namespace CalamityMod.NPCs.NormalNPCs int damage = NPC.GetProjectileDamage(type); if (CalamityWorld.death || BossRushEvent.BossRushActive) { - int numProj = 5; - float rotation = MathHelper.ToRadians(12); + int numProj = Main.masterMode ? 5 : 4; + float rotation = MathHelper.ToRadians(18); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); diff --git a/NPCs/NormalNPCs/KingSlimeJewel2.cs b/NPCs/NormalNPCs/KingSlimeJewel2.cs index d18df61e1d..b2acf064b6 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel2.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel2.cs @@ -71,7 +71,20 @@ namespace CalamityMod.NPCs.NormalNPCs float velocity = 5f; float acceleration = 0.1f; - if (NPC.position.Y > Main.player[NPC.target].position.Y - 300f) + int distanceFromKingSlime = 1; + Vector2 kingSlimeCenter = NPC.Center; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active && Main.npc[i].type == NPCID.KingSlime) + { + distanceFromKingSlime = (int)NPC.Distance(Main.npc[i].Center); + kingSlimeCenter = Main.npc[i].Center; + break; + } + } + + Vector2 movementTarget = kingSlimeCenter == NPC.Center ? Main.player[NPC.target].Center : kingSlimeCenter; + if (NPC.position.Y > movementTarget.Y - 200f) { if (NPC.velocity.Y > 0f) NPC.velocity.Y *= 0.98f; @@ -81,7 +94,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.velocity.Y > velocity) NPC.velocity.Y = velocity; } - else if (NPC.position.Y < Main.player[NPC.target].position.Y - 400f) + else if (NPC.position.Y < movementTarget.Y - 250f) { if (NPC.velocity.Y < 0f) NPC.velocity.Y *= 0.98f; @@ -92,7 +105,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.velocity.Y = -velocity; } - if (NPC.Center.X > Main.player[NPC.target].Center.X + 300f) + if (NPC.Center.X > movementTarget.X + 100f) { if (NPC.velocity.X > 0f) NPC.velocity.X *= 0.98f; @@ -102,7 +115,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.velocity.X > 8f) NPC.velocity.X = 8f; } - if (NPC.Center.X < Main.player[NPC.target].Center.X - 300f) + if (NPC.Center.X < movementTarget.X - 100f) { if (NPC.velocity.X < 0f) NPC.velocity.X *= 0.98f; @@ -121,18 +134,6 @@ namespace CalamityMod.NPCs.NormalNPCs SoundEngine.PlaySound(SoundID.Item8, NPC.Center); - int distanceFromKingSlime = 1; - Vector2 kingSlimeCenter = NPC.Center; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == NPCID.KingSlime) - { - distanceFromKingSlime = (int)NPC.Distance(Main.npc[i].Center); - kingSlimeCenter = Main.npc[i].Center; - break; - } - } - for (int dusty = 0; dusty < 10; dusty++) { Vector2 dustVel = (kingSlimeCenter - NPC.Center).SafeNormalize(Vector2.UnitY) * Main.rand.NextFloat(2f, 4f); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index d2f68c28c4..3b8db5b32a 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -276,6 +276,38 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (masterMode) teleportRate *= 2f; + if (npc.ai[0] == 0f) + { + // Move Blue Crystal + if (blueCrystalAlive) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC blueCrystal = Main.npc[i]; + if (blueCrystal.active && blueCrystal.type == ModContent.NPCType()) + { + blueCrystal.position.X = npc.position.X; + blueCrystal.position.Y = npc.position.Y - 200f; + + for (int dusty = 0; dusty < 10; dusty++) + { + Vector2 dustVel = Main.rand.NextVector2CircularEdge(5f, 5f); + int sapphire = Dust.NewDust(blueCrystal.Center, blueCrystal.width, blueCrystal.height, DustID.GemSapphire, 0f, 0f, 100, default, 2f); + Main.dust[sapphire].velocity = dustVel * Main.rand.NextFloat(1f, 2f); + Main.dust[sapphire].noGravity = true; + if (Main.rand.NextBool()) + { + Main.dust[sapphire].scale = 0.5f; + Main.dust[sapphire].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + + break; + } + } + } + } + npc.ai[0] += teleportRate; teleportScale = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); teleportScale = 0.5f + teleportScale * 0.5f; From 298e14db72dd8853c6c42e43f7b30f64c71e8000 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 21 May 2024 04:53:49 -0500 Subject: [PATCH 102/177] Master Rev+ King Slime spawns Emerald Jewel at 70%, Ruby Jewel at 50%, and Sapphire Jewel at 30%. --- .../Bosses/KingSlimeAI.cs | 126 +++++++++++++----- 1 file changed, 91 insertions(+), 35 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index 3b8db5b32a..c0555e7cae 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -44,21 +44,33 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Higher velocity jumps phase bool phase2 = lifeRatio < 0.75f; - // Spawn Crystal phase + // Spawn Emerald Crystal phase + bool spawnGreenCrystal = lifeRatio < 0.7f; + + // Spawn Ruby Crystal phase bool phase3 = lifeRatio < 0.5f; + // Spawn Sapphire Crystal phase + bool spawnBlueCrystal = lifeRatio < 0.3f; + // Check if the crystals are alive bool crystalAlive = true; bool blueCrystalAlive = false; bool greenCrystalAlive = true; - if (phase3) + + if (spawnGreenCrystal) { - crystalAlive = NPC.AnyNPCs(ModContent.NPCType()); if (masterMode) - { - blueCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); greenCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); - } + } + + if (phase3) + crystalAlive = NPC.AnyNPCs(ModContent.NPCType()); + + if (spawnBlueCrystal) + { + if (masterMode) + blueCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); } // Sapphire Crystal buffs @@ -73,27 +85,63 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Dust color when the blue crystal is alive Color dustColor = Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f); - // Spawn crystal in phase 2 - if (phase3 && npc.Calamity().newAI[0] == 0f) + // Master Mode Crystal spawning + if (masterMode) { - npc.Calamity().newAI[0] = 1f; - npc.SyncExtraAI(); - Vector2 vector = npc.Center + new Vector2(-40f, -(float)npc.height / 2) * npc.scale; - int totalDustPerCrystalSpawn = 20; - for (int i = 0; i < totalDustPerCrystalSpawn; i++) + if (spawnGreenCrystal && npc.Calamity().newAI[0] == 0f) { - int rubyDust = Dust.NewDust(vector, npc.width / 2, npc.height / 2, DustID.GemRuby, 0f, 0f, 100, default, 2f); - Main.dust[rubyDust].velocity *= 2f; - Main.dust[rubyDust].noGravity = true; - if (Main.rand.NextBool()) + npc.Calamity().newAI[0] = 1f; + npc.SyncExtraAI(); + Vector2 vector = npc.Center + new Vector2(-40f, -(float)npc.height / 2) * npc.scale; + int totalDustPerCrystalSpawn = 20; + for (int i = 0; i < totalDustPerCrystalSpawn; i++) { - Main.dust[rubyDust].scale = 0.5f; - Main.dust[rubyDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + int emeraldDust = Dust.NewDust(vector, npc.width / 2, npc.height / 2, DustID.GemEmerald, 0f, 0f, 100, default, 2f); + Main.dust[emeraldDust].velocity *= 2f; + Main.dust[emeraldDust].noGravity = true; + if (Main.rand.NextBool()) + { + Main.dust[emeraldDust].scale = 0.5f; + Main.dust[emeraldDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } } + + SoundEngine.PlaySound(SoundID.Item38, vector); + + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); } - if (masterMode) + if (phase3 && npc.Calamity().newAI[0] == 1f) { + npc.Calamity().newAI[0] = 2f; + npc.SyncExtraAI(); + Vector2 vector = npc.Center + new Vector2(-40f, -(float)npc.height / 2) * npc.scale; + int totalDustPerCrystalSpawn = 20; + for (int i = 0; i < totalDustPerCrystalSpawn; i++) + { + int rubyDust = Dust.NewDust(vector, npc.width / 2, npc.height / 2, DustID.GemRuby, 0f, 0f, 100, default, 2f); + Main.dust[rubyDust].velocity *= 2f; + Main.dust[rubyDust].noGravity = true; + if (Main.rand.NextBool()) + { + Main.dust[rubyDust].scale = 0.5f; + Main.dust[rubyDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + } + } + + SoundEngine.PlaySound(SoundID.Item38, vector); + + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + } + + if (spawnBlueCrystal && npc.Calamity().newAI[0] == 2f) + { + npc.Calamity().newAI[0] = 3f; + npc.SyncExtraAI(); + Vector2 vector = npc.Center + new Vector2(-40f, -(float)npc.height / 2) * npc.scale; + int totalDustPerCrystalSpawn = 20; for (int i = 0; i < totalDustPerCrystalSpawn; i++) { int sapphireDust = Dust.NewDust(vector, npc.width / 2, npc.height / 2, DustID.GemSapphire, 0f, 0f, 100, default, 2f); @@ -106,29 +154,37 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + SoundEngine.PlaySound(SoundID.Item38, vector); + + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + } + } + else + { + // Spawn crystal in phase 2 + if (phase3 && npc.Calamity().newAI[0] == 0f) + { + npc.Calamity().newAI[0] = 1f; + npc.SyncExtraAI(); + Vector2 vector = npc.Center + new Vector2(-40f, -(float)npc.height / 2) * npc.scale; + int totalDustPerCrystalSpawn = 20; for (int i = 0; i < totalDustPerCrystalSpawn; i++) { - int emeraldDust = Dust.NewDust(vector, npc.width / 2, npc.height / 2, DustID.GemEmerald, 0f, 0f, 100, default, 2f); - Main.dust[emeraldDust].velocity *= 2f; - Main.dust[emeraldDust].noGravity = true; + int rubyDust = Dust.NewDust(vector, npc.width / 2, npc.height / 2, DustID.GemRuby, 0f, 0f, 100, default, 2f); + Main.dust[rubyDust].velocity *= 2f; + Main.dust[rubyDust].noGravity = true; if (Main.rand.NextBool()) { - Main.dust[emeraldDust].scale = 0.5f; - Main.dust[emeraldDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; + Main.dust[rubyDust].scale = 0.5f; + Main.dust[rubyDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } - } - SoundEngine.PlaySound(SoundID.Item38, vector); + SoundEngine.PlaySound(SoundID.Item38, vector); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); - if (masterMode) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); - NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); - } + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); } } From 6c0a0e84c0e0ea1a5c25fc07687189245ab42cfb Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 21 May 2024 05:08:19 -0500 Subject: [PATCH 103/177] Fixed Duke's map icon vanish values in Master Mode. --- NPCs/CalamityGlobalNPC.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index f337e08be9..cccd363c25 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3353,7 +3353,9 @@ namespace CalamityMod.NPCs { if (npc.type == NPCID.DukeFishron && (CalamityWorld.death || BossRushEvent.BossRushActive)) { - if (npc.life / (float)npc.lifeMax < 0.4f) + float lifeRatio = npc.life / (float)npc.lifeMax; + float mapIconVanishValue = Main.masterMode ? 0.3f : 0.4f; + if (lifeRatio < mapIconVanishValue || (lifeRatio > 0.9f && Main.masterMode)) index = -1; } } From 80caf7d75d0494c0945a54ba1066fd49d2bf4a29 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 21 May 2024 05:21:12 -0500 Subject: [PATCH 104/177] Decreased King Slime Jewel HP values. --- NPCs/NormalNPCs/KingSlimeJewel.cs | 2 +- NPCs/NormalNPCs/KingSlimeJewel2.cs | 2 +- NPCs/NormalNPCs/KingSlimeJewel3.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewel.cs index 086a89025d..c9eb84f9d6 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 10; NPC.DR_NERD(0.1f); - NPC.lifeMax = 140; + NPC.lifeMax = 120; double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); diff --git a/NPCs/NormalNPCs/KingSlimeJewel2.cs b/NPCs/NormalNPCs/KingSlimeJewel2.cs index b2acf064b6..254ef1471e 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel2.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel2.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 5; NPC.DR_NERD(0.05f); - NPC.lifeMax = 140; + NPC.lifeMax = 120; double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); diff --git a/NPCs/NormalNPCs/KingSlimeJewel3.cs b/NPCs/NormalNPCs/KingSlimeJewel3.cs index 91668e6b70..531da13e74 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel3.cs +++ b/NPCs/NormalNPCs/KingSlimeJewel3.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 15; NPC.DR_NERD(0.15f); - NPC.lifeMax = 280; + NPC.lifeMax = 240; double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); From 10423e03fb49c477c5b9ce4721e7a2dd150e0a30 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 21 May 2024 05:53:36 -0500 Subject: [PATCH 105/177] Adjusted Desert Scourge and Nuisance movements. --- NPCs/DesertScourge/DesertNuisanceHead.cs | 12 ++++++++---- NPCs/DesertScourge/DesertNuisanceHeadYoung.cs | 8 ++++---- NPCs/DesertScourge/DesertScourgeHead.cs | 8 ++++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 453e4e5484..e6de898103 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -138,12 +138,12 @@ namespace CalamityMod.NPCs.DesertScourge // Percent life remaining. float lifeRatio = NPC.life / (float)NPC.lifeMax; - float speed = death ? 0.16f : 0.14f; - float turnSpeed = death ? 0.24f : 0.2f; + float speed = death ? 0.18f : 0.16f; + float turnSpeed = death ? 0.26f : 0.22f; speed += speed * 0.4f * (1f - lifeRatio); turnSpeed += turnSpeed * 0.4f * (1f - lifeRatio); - speed += 0.14f * enrageScale; - turnSpeed += 0.2f * enrageScale; + speed += 0.16f * enrageScale; + turnSpeed += 0.22f * enrageScale; if (Main.getGoodWorld) { @@ -318,7 +318,11 @@ namespace CalamityMod.NPCs.DesertScourge if (!shouldFly) { NPC.TargetClosest(); + NPC.velocity.Y += 0.15f; + if (NPC.velocity.Y > 0f && Math.Abs(NPC.Center.Y - Main.player[NPC.target].Center.Y) > 180f) + NPC.velocity.Y += 0.05f; + if (NPC.velocity.Y > maxChaseSpeed) NPC.velocity.Y = maxChaseSpeed; diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index 9380abd265..fe5a618906 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -134,12 +134,12 @@ namespace CalamityMod.NPCs.DesertScourge // Percent life remaining. float lifeRatio = NPC.life / (float)NPC.lifeMax; - float speed = death ? 0.18f : 0.16f; - float turnSpeed = death ? 0.26f : 0.22f; + float speed = death ? 0.16f : 0.14f; + float turnSpeed = death ? 0.24f : 0.2f; speed += speed * 0.4f * (1f - lifeRatio); turnSpeed += turnSpeed * 0.4f * (1f - lifeRatio); - speed += 0.16f * enrageScale; - turnSpeed += 0.22f * enrageScale; + speed += 0.14f * enrageScale; + turnSpeed += 0.2f * enrageScale; if (Main.getGoodWorld) { diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 5f93dd98ec..8e5a000e83 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -670,7 +670,15 @@ namespace CalamityMod.NPCs.DesertScourge else if (!shouldFly) { NPC.TargetClosest(); + NPC.velocity.Y += 0.15f; + if (NPC.Center.Y - player.Center.Y < -180f) + { + NPC.velocity.Y += 0.05f; + if (NPC.velocity.Y > 0f) + NPC.velocity.Y += 0.05f; + } + if (NPC.velocity.Y > maxChaseSpeed) NPC.velocity.Y = maxChaseSpeed; From b7880ccf60242503865c13bfefa03aa86619a383 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 21 May 2024 07:47:25 -0500 Subject: [PATCH 106/177] Desert Scourge targeting update. --- NPCs/DesertScourge/DesertScourgeHead.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 8e5a000e83..405b9dbe4b 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -183,10 +183,6 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - NPC.TargetClosest(); - Player player = Main.player[NPC.target]; // Enrage @@ -669,8 +665,6 @@ namespace CalamityMod.NPCs.DesertScourge } else if (!shouldFly) { - NPC.TargetClosest(); - NPC.velocity.Y += 0.15f; if (NPC.Center.Y - player.Center.Y < -180f) { From 3aeed67e3e3ed354041d6dd8f550b63bd7655e26 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 21 May 2024 07:49:22 -0500 Subject: [PATCH 107/177] Nuisance targeting updates. --- NPCs/DesertScourge/DesertNuisanceHead.cs | 2 -- NPCs/DesertScourge/DesertNuisanceHeadYoung.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index e6de898103..c9ce5c9e75 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -317,8 +317,6 @@ namespace CalamityMod.NPCs.DesertScourge if (!shouldFly) { - NPC.TargetClosest(); - NPC.velocity.Y += 0.15f; if (NPC.velocity.Y > 0f && Math.Abs(NPC.Center.Y - Main.player[NPC.target].Center.Y) > 180f) NPC.velocity.Y += 0.05f; diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index fe5a618906..c428a92aa0 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -361,7 +361,6 @@ namespace CalamityMod.NPCs.DesertScourge if (!shouldFly) { - NPC.TargetClosest(); NPC.velocity.Y += 0.15f; if (NPC.velocity.Y > maxChaseSpeed) NPC.velocity.Y = maxChaseSpeed; From bdf7fdc2f834c819399cab317991adbe1d53839d Mon Sep 17 00:00:00 2001 From: AquaSG Date: Tue, 21 May 2024 10:26:43 -0400 Subject: [PATCH 108/177] closest npc to angle utility --- Utilities/NPCUtils.cs | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 5617cc237d..baad855704 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -605,6 +605,53 @@ namespace CalamityMod return closestTarget; } + /// + /// Detects the hostile NPC that is closest angle-wise to the rotation vector + /// + /// The position that will be used to find the rotation vector to NPCs + /// The rotation vector that the other rotation vectors to NPCs will be compared to + /// Maximum amount of pixels to check around the origin + /// When the angle between the rotation vector and the vector to the NPC is less than or equal to this, NPCs start getting ranked by distance. Set to 0 or less to ignore + /// Whether or not to ignore tiles when finding a target + /// The NPC that best fits the parameters. Null if no NPC is found + public static NPC ClosestNPCToAngle(this Vector2 origin, Vector2 checkRotationVector, float maxDistanceToCheck, float wantedHalfCone = 0.125f, bool ignoreTiles = true) + { + NPC closestTarget = null; + float distance = maxDistanceToCheck; + float angle = MathHelper.Pi; + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC npc = Main.npc[i]; + if (!npc.CanBeChasedBy(null, false)) + continue; + + float checkDist = origin.Distance(npc.Center); + if (checkDist >= distance) // Immediately disqualify anything beyond the distance that must be beaten + continue; + + float angleBetween = checkRotationVector.AngleBetween(npc.Center - origin); + if (angleBetween > angle) // Narrow down to the closest npc to the angle + continue; + + if (!ignoreTiles && !Collision.CanHit(origin, 1, 1, npc.Center, 1, 1)) // Tile LoS check if wanted + continue; + + if (angle <= wantedHalfCone) + { + angle = wantedHalfCone; + distance = checkDist; // We are within the cone. Now npcs are further narrowed down by distance + closestTarget = npc; + } + else + { + angle = angleBetween; + closestTarget = npc; + } + } + + return closestTarget; + } + /// /// Detects nearby hostile NPCs from a given point with minion support /// From 56eef02d996dafc660ea2682f451a3777794aece Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 11:16:58 -0400 Subject: [PATCH 109/177] Astrum Deus Relic resprite --- .../Furniture/BossRelics/AstrumDeusRelic.png | Bin 1190 -> 1224 bytes .../Furniture/BossRelics/AstrumDeusRelic.png | Bin 1477 -> 1217 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Items/Placeables/Furniture/BossRelics/AstrumDeusRelic.png b/Items/Placeables/Furniture/BossRelics/AstrumDeusRelic.png index beecae5c78915d4c03cdf4c7c1d7c1346c74031a..cfbfe599d30e26ad36b76493341635477523c221 100644 GIT binary patch delta 1191 zcmV;Y1X%l~3CIbMF@J(dL_t(&f$f=FXdG1-$A7b%O>NR`bJJ*wP1Zz{7?Bj)CS)PK zAd3)au_898p!7kZY7x{2gQ!UK!KYRW^&uF@LyGl6g+f>_km3p@DG@O?3Bhb@yEMgI z+9lB@Y1W6cU#92m4A~TfS@r)iGiT1socYcF`_8v#;eV}7mVeucZJ|}KO=WY>!HKmE zNaVY{%l>)g1%t%^1pMm(2<9&WVCCHaAhmSejSK*hZ~*|(*t|5Q0FpNX7C?Eq|T-UYz1_dnFyVN`8wuZeDpocD=|Oix8)bLqVS0OD~) zMo9hm{eX5H313&;V~WV=AH{MjM{**Qpl69$w~So#R%Gjf*73scik#%Fiu*PKP*qh6 zz^C1V0DS(%kYtyd3g`B2*!Ie$V7fZ{@ByP3HqJvz&D51cyv zHUJgXI{@f7_#^^n@;uK^O6Pcb%{HCJPB-hz>5`c|m&j2uT_7wp3wY>|#0}nP>0As%n170R( zddzPH0DridT1-Lq(fRm+7u2!gInhU_)@jEdyt+=iPRNn|ia9~dvF;LY$&4VLG37>1 zJoWNERo}Uh>+ZP%Kvm_Y93v*tB6XI$i4YTyJ@@S0fK5p9)N1NI@-P7HhgF7`FY?Y? zJJt5Rejt~KNfe5g%={!3szjw(rw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j`|Z zrM2yKaqi2VbLLJVtjL9Tb35m6?tJh0-tYU)sYigOWfl6}7bts7sn zJ|EoI;R6f~S%zoJPX_?lw64i7&v;feA0)BKk$1MxCZhu^6jXSun1Ayk$%>aDA^K$_H={^mFOvvIbYa0M~^ZhRX_~qxXP5Bl8zZGAel1=3@JURM3E)x?< z{UAb{xUm1oejtDEuUMWO_lw{dMW8pZi&uTJ|gg)nj}knJ{}XJ75?opJ*&4hJVf+{SFA#OKPL|QpiVc+%!zQ)VSR0 zm#+wCPqhOf6AK%bcmU@+Pg>(*!-&_ktRnCYW5I3P4HNU`*LVPz{_J(?!r#Eg7q z$A6X z1y6fDshyzuMR0Sm`SmkBfacZBk&!xX}juC;}!lS_?- zi_By9o*OfEfAyOvj#nJHO#hjHQ7 z9jdwAenDrvyMi-b?eR6Q8da>GV`s&?_uR1hg&ZI8A!G&&GqGXB(F!( zclUguaZ))qj=48nv1O!S_UqoRHU$?}I^nx|)A-WGOGA;=$dW==kKOM^XfaX9C+>&X zF!ErxEQlI@_)cJy9-&Y z_Bm4_96n^iktcZ6@IOlKPnqeSM9KgF002ovPDHLkV1lB- B&u;(# From c79619302fbd2080016ddc25ea8d59ff72f3927f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 11:18:04 -0400 Subject: [PATCH 110/177] Aerialite Dye resprite --- Items/Dyes/AerialiteDye.png | Bin 309 -> 431 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Items/Dyes/AerialiteDye.png b/Items/Dyes/AerialiteDye.png index 99402471c4d46f1dc364b0e47bd9f5825a99cfe2..d5b2f4c35eef60ca411e78c48d7b19cb554c5b00 100644 GIT binary patch delta 416 zcmV;R0bl;L04Ytt5G=&F$FSUk9Mt z83rIwy92;{c>-W-`%H>gNAOXu0C1nr0}vWVS~t@F31aaL3t(j@0f4`&1AyD|kBAta zloEoAq9@T>(o#a8Ifg?rJHG(H+=LE5aK@l?|WinJ_pMv@KOVsD8Zz(Ayy3 zD0AxR5A^gYB5*sFijM&JAFd>SL4Woo0*9hEK*)lB0bgn&>nm>f0O0000EWmrjOO-%qQ02u%P2mk;800000(o>TF0000< KMNUMnLSTYDDyQcF delta 293 zcmZ3_yp?H!WIZzj1H+NJUOOPgSRCZ;#IWw1%u67LCEd~2k%3`jKlh(RRv_Ovz$e5N zNE>NbzB`@$`~Q;p1qCN(#%P&2t~-4F+QT;!R~^tc4fDyWPn|kz=81#0F4^zCTm`B> zZ5tf{qy$TX{DS|Z0S48z^)r)zvYZ7Tk;M!Qe1|}oQB=dL0VtT~>Ealo5!`zIB44us zM{8oZX6(X8mH(H^nnWk5_5Ppwe0N3)bKLX>8Lyk)AFXX%5%#GlA@A+mt=DXySu>p3 z`~O+ZV}6&A<36?%d6H!2NnYein)h6IM)+&4V;z#}&jjq3NIjpOD#vhQY31AR)oe8k YvySs_-QIIr9cVR!r>mdKI;Vst0K?pUdH?_b From 7adcb005f10d1c2ca564424ad2ad2e637fd3a5f8 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 12:05:38 -0400 Subject: [PATCH 111/177] Fixed Bloodfire Arrows not removing health if you're on lifesteal cooldown, despite it ignoring lifesteal cooldown now --- Projectiles/Ranged/BloodfireArrowProj.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 92725f50c7..69a3118522 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.localAI[0] == 0) { - player.statLife -= Main.player[Main.myPlayer].lifeSteal <= 0f ? 0 : 1; + player.statLife -= 1; if (player.statLife <= 0) { PlayerDeathReason pdr = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BloodFireArrow" + Main.rand.Next(1, 2 + 1)).Format(player.name)); From 2612d3c0448a8f669e599ef9bd0c5a20d040a354 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 21 May 2024 12:11:54 -0400 Subject: [PATCH 112/177] REVERT: Frog Legs stack again. Amphibian Boots is still nerfed. --- Items/CalamityGlobalItem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 10845a70b5..077b34fc84 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1240,6 +1240,9 @@ namespace CalamityMod.Items // The Frog Leg line is prevented from stacking. // Additionally, Amphibian boots are directly nerfed so they aren't the best in slot boots at all times. + // + // 21MAY2024: Ozzatron: Disabled this code. Frog Leg is allowed to stack. Amphibian Boots specific nerf is applied below. + /* switch (item.type) { default: @@ -1260,6 +1263,9 @@ namespace CalamityMod.Items modPlayer.alreadyHasFrogLeg = true; break; } + */ + if (item.type == ItemID.AmphibianBoots) + player.jumpSpeedBoost += BalancingConstants.AmphibianBootsJumpSpeedBoost - BalancingConstants.VanillaFrogLegJumpSpeedBoost; // Feral Claws line melee speed adjustments and nonstacking // First removes all their melee speed so it can be given based on which you wear without stacking From 42f524bc976b533c8192f5dcda2662f74a5c2746 Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Tue, 21 May 2024 10:54:40 -0400 Subject: [PATCH 113/177] Custom use style items and projectiles; Wind Blade swing animations IMPORTANT NOTE - In order to use a projectile that extends BaseCustomUseStyleProjectile, you have to make the item that shoots it extend CustomUseProjItem. --- Items/BaseItems/CustomUseProjItem.cs | 23 ++ Items/Weapons/Melee/WindBlade.cs | 25 +- Items/Weapons/Melee/WindBlade.png | Bin 930 -> 870 bytes .../BaseCustomUseStyleProjectile.cs | 248 ++++++++++++++++++ Projectiles/Melee/WindBladeHoldout.cs | 132 ++++++++++ Projectiles/Melee/WindBladeHoldout.png | Bin 0 -> 870 bytes Projectiles/Melee/{Cyclone.cs => WindBolt.cs} | 11 +- .../Melee/{Cyclone.png => WindBolt.png} | Bin 8 files changed, 415 insertions(+), 24 deletions(-) create mode 100644 Items/BaseItems/CustomUseProjItem.cs create mode 100644 Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs create mode 100644 Projectiles/Melee/WindBladeHoldout.cs create mode 100644 Projectiles/Melee/WindBladeHoldout.png rename Projectiles/Melee/{Cyclone.cs => WindBolt.cs} (93%) rename Projectiles/Melee/{Cyclone.png => WindBolt.png} (100%) diff --git a/Items/BaseItems/CustomUseProjItem.cs b/Items/BaseItems/CustomUseProjItem.cs new file mode 100644 index 0000000000..800d2dfb97 --- /dev/null +++ b/Items/BaseItems/CustomUseProjItem.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.BaseItems +{ + public abstract class CustomUseProjItem : ModItem + { + public override void SetDefaults() + { + Item.channel = true; + } + + public override bool CanShoot(Player player) + { + return player.ownedProjectileCounts[Item.shoot] < 1; + } + } +} diff --git a/Items/Weapons/Melee/WindBlade.cs b/Items/Weapons/Melee/WindBlade.cs index 8676601b68..24f1c6a98b 100644 --- a/Items/Weapons/Melee/WindBlade.cs +++ b/Items/Weapons/Melee/WindBlade.cs @@ -1,4 +1,6 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.BaseItems; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.BaseProjectiles; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -8,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class WindBlade : ModItem, ILocalizedModType + public class WindBlade : CustomUseProjItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() @@ -22,24 +24,15 @@ namespace CalamityMod.Items.Weapons.Melee Item.useTime = 20; Item.useTurn = true; Item.knockBack = 5f; - Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 3f; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - Projectile.NewProjectile(source, position, velocity, type, damage / 2, knockback, player.whoAmI); - return false; - } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if (Main.rand.NextBool(3)) - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.BlueTorch); + Item.channel = true; + Item.shoot = ModContent.ProjectileType(); + Item.noUseGraphic = true; + Item.noMelee = true; + Item.useStyle = ItemUseStyleID.Shoot; } public override void AddRecipes() diff --git a/Items/Weapons/Melee/WindBlade.png b/Items/Weapons/Melee/WindBlade.png index 36d003fbdcbe511f4b0dd3a6f72ea705133b3674..b08f34b7d98f5f3f7a38e51a7dd73f46a2afc898 100644 GIT binary patch literal 870 zcmeAS@N?(olHy`uVBq!ia0vp^UO*he!3-pYE(NXtQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ivoN?Tn$sRP1>73{Jz+6c$H=S?vVfgZT9cb@Cd7$R6cccw!FDxLSBT0 zyhPo^a^CEQ5DSqR)utI%ie|2rN7kfT*6;d#qovuIOG;L?*@-JB!R+;!#^2YQ&0Q
lBSEMj7FnN2rIEF;HpS|8)v|2%cEn(7x1s<_eqCS49`}jBhcDuc;3l-beO!lq% z`npHgZn*nMu*dzh-AfIT>8Z1Mr=7L;z&Zj1Mhn$j_SCl<_!meY-<~1Gabt~Jw$)%X-xA3FCfA<#i^DpqzeXMDyX`&HV zyn)fcc}vv8`@CB+F5B2WIv+FtkP%zhb&c~;TO8*_pT2TgIM17lDlc{~n&_b0_XxaXoxbN=EO?x@za_2I+Iw${SZ| z-cZ=0#})AYea)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rAT~7fjbv5CGz{m6arHUQx^`VuozI@qr+T%` z-8=dLRU50Zs%dkab#1*UluJSVbvnyY{&}^V0V$O%`dKKg)|?E(m}a6@UlfEAy>gyA z7Je=dl1~5AL}I&Hl-cu4^nWj^_L*DRwd}m`OTFF7KR&oa1!YWfJMv7_s*55EZYiC= zNbb&5Eo&Faqf1onGN4U&Yj%@kqH1?x70E->rX4i<4W%ooAtHj_!vFvP07*qoM6N<$ Ef~JAQlK=n! diff --git a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs new file mode 100644 index 0000000000..09eb794278 --- /dev/null +++ b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs @@ -0,0 +1,248 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.Items.Weapons.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Input; +using ReLogic.Content; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameInput; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.BaseProjectiles +{ + public abstract class BaseCustomUseStyleProjectile : ModProjectile + { + + public override void SetDefaults() + { + Projectile.friendly = true; + Projectile.tileCollide = false; + } + + public override void OnSpawn(IEntitySource source) + { + Projectile.timeLeft = Owner.HeldItem.useAnimation + 1; + } + + #region Fields + /// + /// The offset in pixels of the weapon from the projectile owner's center. This works even while using AbsolutePosition. + /// + public Vector2 Offset = Vector2.Zero; + + /// + /// The Player that is using the projectile. + /// + public virtual Player Owner => Main.player[Projectile.owner]; + + /// + /// The amount of pixels out the center of the projectile's hitbox is. + /// + public virtual float HitboxOutset => 30; + + /// + /// The projectile's hitbox size in pixels. + /// + public virtual Vector2 HitboxSize => new Vector2(30, 30); + + /// + /// The number of animations that this projectile has gone through. Useful for things like swing combos. + /// + public int NumberOfAnimations = 0; + + public float Animation = 0; + + /// + /// If true, flips the sprite with a 45-degree sword tilt in mind. + /// + public bool FlipAsSword = false; + + /// + /// The offset in radians of the weapon's rotation from its current rotation. + /// + public float RotationOffset = 0f; + + /// + /// The offset in radians of the rotation of the player's front arm. + /// + public float ArmRotationOffset = 0f; + + /// + /// The offset in radians of the rotation of the player's back arm. + /// + public float ArmRotationOffsetBack = 0f; + + /// + /// The amount of animation frames the projectile has in a vertical sheet. + /// + public virtual int FrameCount => 1; + + /// + /// The individual frame currently being drawn in a vertical sheet. + /// + public int Frame = 0; + + /// + /// The origin of the sprite when drawn on your character. + /// + /// + public virtual Vector2 SpriteOrigin() + { + return Projectile.Size / 2; + } + + /// + /// Helper method for getting the rotation of the sprite plus RotationOffset, without having to make your own local variable every time. + /// + /// + public float FinalRotation() + { + return Projectile.rotation + RotationOffset; + } + + /// + /// Rotation offset for the hitbox that doesn't affect the sprite. + /// Useful for if you have, for instance, a sword sprite at a 45 degree angle, and need that to reflect on the hitbox. + /// + /// + public virtual float HitboxRotationOffset() + { + return 0f; + } + + /// + /// Whether or not the projectile can hit enemies at the current frame. + /// Useful for wind-up animations where you don't want the projectile to deal damage. + /// + public bool CanHit = true; + + /// + /// Overrides the projectile owner's center as the projectile's location, so long as it isn't Vector2.Zero. + /// + public Vector2 AbsolutePosition = Vector2.Zero; + + /// + /// If this field is true, the projectile will draw at all times. Otherwise, it will only draw when its associated item is in use. + /// + public bool DrawUnconditionally = false; + + /// + /// The number of frames that the current use animation has progressed through. + /// + public float AnimationProgress = 0; + #endregion + + #region Use Style + /// + /// Determines the behavior to reset to when the item is not in use. + /// + public virtual void ResetStyle() { } + + /// + /// Determines the behavior of the projectile when the item is in use. + /// + public virtual void UseStyle() { } + + /// + /// Determines the behavior of the projectile when the item use animation begins for the first time in a row. + /// + public virtual void OnBeginUse() { } + + /// + /// Determines the behavior of the projectile when the item use animation ends. + /// + public virtual void OnEndUse() { } + #endregion + + public override void AI() + { + Projectile.penetrate = 100; + + if (Owner.ItemAnimationActive) + { + Animation++; + + UseStyle(); + Owner.heldProj = Projectile.whoAmI; + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffset); + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffsetBack); + } + else + { + Animation = 0; + + if (DrawUnconditionally) + { + Owner.heldProj = Projectile.whoAmI; + Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffset); + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffsetBack); + } + + NumberOfAnimations = 0; + ResetStyle(); + } + + AnimationProgress = Animation % Owner.itemAnimationMax; + + if (AbsolutePosition == Vector2.Zero) + { + Projectile.position = Owner.position + (Owner.Size / 2) - (Projectile.Size / 2) + Offset; + } + else + { + Projectile.position = AbsolutePosition - (Projectile.Size / 2) + Offset; + } + + if (Owner.itemAnimation == 1) + { + OnEndUse(); + NumberOfAnimations++; + } + + if (Owner.ItemAnimationJustStarted) + { + Projectile.timeLeft = Owner.HeldItem.useAnimation + 1; + OnBeginUse(); + } + } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = Owner.direction; + base.ModifyHitNPC(target, ref modifiers); + } + + public override bool? CanDamage() + { + return CanHit ? base.CanDamage() : false; + } + + public override void ModifyDamageHitbox(ref Rectangle hitbox) + { + Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation() + HitboxRotationOffset()); + + hitbox = new Rectangle((int)cen.X - (int)(HitboxSize.X / 2), (int)cen.Y - (int)(HitboxSize.Y / 2), (int)HitboxSize.X, (int)HitboxSize.Y); + + base.ModifyDamageHitbox(ref hitbox); + } + + public override bool PreDraw(ref Color lightColor) + { + // Only draw the projectile if the projectile's owner is currently using the item this projectile is attached to. + if (Owner.itemAnimation > 0 || DrawUnconditionally) + { + Asset tex = ModContent.Request(Texture); + + float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; + + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin().X, SpriteOrigin().Y) : SpriteOrigin(), Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); + } + return false; + } + } +} diff --git a/Projectiles/Melee/WindBladeHoldout.cs b/Projectiles/Melee/WindBladeHoldout.cs new file mode 100644 index 0000000000..d55bf66300 --- /dev/null +++ b/Projectiles/Melee/WindBladeHoldout.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class WindBladeHoldout : BaseCustomUseStyleProjectile, ILocalizedModType + { + public override float HitboxOutset => 60; + + public override Vector2 HitboxSize => new Vector2(70, 70); + + public override float HitboxRotationOffset() + { + return MathHelper.ToRadians(-45); + } + + public override Vector2 SpriteOrigin() + { + return new(0, 80); + } + + public override void OnSpawn(IEntitySource source) + { + Projectile.scale = 0f; + Projectile.ai[1] = 1; + base.OnSpawn(source); + } + + public override void UseStyle() + { + Vector2 mousePos = Main.MouseWorld; + // i don't know how cal handles Main.MouseWorld in netcode. todo: someone fix this up in multiplayer pls + // - ennway + + if (mousePos.X < Owner.Center.X) Owner.direction = -1; + else Owner.direction = 1; + + DrawUnconditionally = true; + + if (NumberOfAnimations % 4 < 2) + { + Projectile.rotation = Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f); + + if (NumberOfAnimations % 4 == 0 && AnimationProgress < 10) + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1f, 0.4f); + + if (AnimationProgress < (Owner.itemAnimationMax / 3)) + { + CanHit = false; + if (AnimationProgress == 0) + { + Projectile.ai[1] = -Projectile.ai[1]; + } + RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(120f * Projectile.ai[1] * Owner.direction), 0.2f); + } + else + { + CanHit = true; + if ((int)AnimationProgress == (int)(Owner.itemAnimationMax / 1.5f)) + { + SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing, Owner.Center); + } + if ((int)AnimationProgress > (int)(Owner.itemAnimationMax / 1.5f)) + { + GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + (new Vector2(Main.rand.Next(30, 100), 0).RotatedBy(FinalRotation() + MathHelper.ToRadians(-45))), new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation() + MathHelper.ToRadians(-45)), Color.LightSkyBlue, 40, 1f, 0.4f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); + } + + float time = (AnimationProgress) - (Owner.itemAnimationMax / 3); + float timeMax = Owner.itemAnimationMax - (Owner.itemAnimationMax / 3); + + RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * Projectile.ai[1] * Owner.direction, 120f * -Projectile.ai[1] * Owner.direction, CalamityUtils.ExpInOutEasing(time / timeMax, 1))), + 0.2f); + } + + FlipAsSword = Owner.direction == -1 ? true : false; + } + else if (NumberOfAnimations % 4 == 3) + { + CanHit = true; + if ((int)AnimationProgress == 1) + { + SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFurySwing, Owner.Center); + SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing.WithPitchOffset(-0.4f), Owner.Center); + } + RotationOffset = 0f; + if (AnimationProgress < Owner.itemAnimationMax / 3) + { + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1.5f, 0.4f); + + float rot = FinalRotation() + MathHelper.ToRadians(-45); + + GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + new Vector2(105 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot + MathHelper.ToRadians(Main.rand.NextFloat(-20, 20))), Color.LightSkyBlue, 30, 2f, 0.3f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); + GeneralParticleHandler.SpawnParticle(new LineParticle(Owner.Center + new Vector2(0, 20).RotatedBy(rot) + new Vector2(45 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot), false, 30, 1f, Color.LightSkyBlue)); + GeneralParticleHandler.SpawnParticle(new LineParticle(Owner.Center + new Vector2(0, -20).RotatedBy(rot) + new Vector2(45 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot), false, 30, 1f, Color.LightSkyBlue)); + } + else + { + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1.5f, -0.2f); + } + } + else + { + CanHit = false; + + RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * -Projectile.ai[1] * Owner.direction, 120f * Projectile.ai[1] * Owner.direction, 0.1f)), + 0.2f); + + Projectile.rotation = Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f); + Projectile.scale = MathHelper.Lerp(Projectile.scale, 0f, 0.2f); + } + + ArmRotationOffset = MathHelper.ToRadians(-90f); + } + + public override void ResetStyle() + { + } + } +} diff --git a/Projectiles/Melee/WindBladeHoldout.png b/Projectiles/Melee/WindBladeHoldout.png new file mode 100644 index 0000000000000000000000000000000000000000..b08f34b7d98f5f3f7a38e51a7dd73f46a2afc898 GIT binary patch literal 870 zcmeAS@N?(olHy`uVBq!ia0vp^UO*he!3-pYE(NXtQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ivoN?Tn$sRP1>73{Jz+6c$H=S?vVfgZT9cb@Cd7$R6cccw!FDxLSBT0 zyhPo^a^CEQ5DSqR)utI%ie|2rN7kfT*6;d#qovuIOG;L?*@-JB!R+;!#^2YQ&0QlBSEMj7FnN2rIEF;HpS|8)v|2%cEn(7x1s<_eqCS49`}jBhcDuc;3l-beO!lq% z`npHgZn*nMu*dzh-AfIT>8Z1Mr=7L;z&Zj1Mhn$j_SCl<_!meY-<~1Gabt~Jw$)%X-xA3FCfA<#i^DpqzeXMDyX`&HV zyn)fcc}vv8`@CB+F5B2WIv+FtkP%zhb&c~;TO8*_pT2TgIM17lDlc{~n&_b0_XxaXoxbN=EO?x@za_2I+Iw${SZ| z-cZ=0#})AYea)ZGM)Qp1U9W8OsjXS?VU?HfLsJg%MUs2o|K7HjWmfwv1({OWY5LPX zepqcRJpYl|gT?Et_v`WtPtS_BdGq1Y;RmUyZ-u9?(s~{swCv}09-+xjk<+(6D)01^ h6mE806j=LTJkb1E_Xp`4e}QR@!PC{xWt~$(697sik}v=O literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/Cyclone.cs b/Projectiles/Melee/WindBolt.cs similarity index 93% rename from Projectiles/Melee/Cyclone.cs rename to Projectiles/Melee/WindBolt.cs index e079ace083..fa7973d544 100644 --- a/Projectiles/Melee/Cyclone.cs +++ b/Projectiles/Melee/WindBolt.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class Cyclone : ModProjectile, ILocalizedModType + public class WindBolt : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; public int dustvortex = 0; @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[0] >= 12) Projectile.tileCollide = true; - Projectile.rotation += 2.5f; + Projectile.rotation += MathHelper.ToRadians(15f); Projectile.alpha -= 5; if (Projectile.alpha < 50) { @@ -95,14 +95,9 @@ namespace CalamityMod.Projectiles.Melee } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(204, 255, 255, Projectile.alpha); - } - public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); return false; } diff --git a/Projectiles/Melee/Cyclone.png b/Projectiles/Melee/WindBolt.png similarity index 100% rename from Projectiles/Melee/Cyclone.png rename to Projectiles/Melee/WindBolt.png From dc4021f826f12a95b9d15f50ba155b4f3d55a20a Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Tue, 21 May 2024 13:54:40 -0400 Subject: [PATCH 114/177] Updated code in accordance with change requests + retooled and re-added Wind Blade cyclone --- .../Mods.CalamityMod.Projectiles.Melee.hjson | 3 +- .../BaseCustomUseStyleProjectile.cs | 47 +++++++++++++ Projectiles/Melee/WindBladeHoldout.cs | 30 ++++++++ Projectiles/Melee/WindBolt.cs | 69 +++++++++++++++++++ en-US.hjson | 1 + 5 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 en-US.hjson diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index f49ed13e17..79a1e7d286 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -76,7 +76,6 @@ CosmicSpiritBomb3.DisplayName: Cosmic Bomb CrescentMoonFlail.DisplayName: Crescent Moon CrescentMoonProj.DisplayName: Crescent Moon CrystylCrusherRay.DisplayName: Crystyl Crusher Ray -Cyclone.DisplayName: Cyclone DarkBall.DisplayName: Dark Ball DarkBeam.DisplayName: Dark Beam DarkIceZero.DisplayName: Dark Ice @@ -311,8 +310,10 @@ Waterfall.DisplayName: Waterfall Beam WhiteBoltAura.DisplayName: White Aura WhiteOrb.DisplayName: White Orb Whiterain.DisplayName: White Rain +WindBolt.DisplayName: Wind Bolt WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YateveoBloomProj.DisplayName: Yateveo Bloom YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard +Cyclone.DisplayName: Cyclone diff --git a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs index 09eb794278..e662a81fae 100644 --- a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs @@ -22,6 +22,10 @@ namespace CalamityMod.Projectiles.BaseProjectiles { Projectile.friendly = true; Projectile.tileCollide = false; +<<<<<<< Updated upstream +======= + Projectile.penetrate = -1; +>>>>>>> Stashed changes } public override void OnSpawn(IEntitySource source) @@ -35,6 +39,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles ///
public Vector2 Offset = Vector2.Zero; +<<<<<<< Updated upstream +======= + public float RestrikeDelay = 0; + +>>>>>>> Stashed changes /// /// The Player that is using the projectile. /// @@ -91,29 +100,41 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// The origin of the sprite when drawn on your character. ///
/// +<<<<<<< Updated upstream public virtual Vector2 SpriteOrigin() { return Projectile.Size / 2; } +======= + public virtual Vector2 SpriteOrigin => Projectile.Size / 2; +>>>>>>> Stashed changes /// /// Helper method for getting the rotation of the sprite plus RotationOffset, without having to make your own local variable every time. /// /// +<<<<<<< Updated upstream public float FinalRotation() { return Projectile.rotation + RotationOffset; } +======= + public float FinalRotation => Projectile.rotation + RotationOffset; +>>>>>>> Stashed changes /// /// Rotation offset for the hitbox that doesn't affect the sprite. /// Useful for if you have, for instance, a sword sprite at a 45 degree angle, and need that to reflect on the hitbox. /// /// +<<<<<<< Updated upstream public virtual float HitboxRotationOffset() { return 0f; } +======= + public virtual float HitboxRotationOffset => 0f; +>>>>>>> Stashed changes /// /// Whether or not the projectile can hit enemies at the current frame. @@ -161,7 +182,13 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void AI() { +<<<<<<< Updated upstream Projectile.penetrate = 100; +======= + Owner.Calamity().mouseWorldListener = true; + + RestrikeDelay--; +>>>>>>> Stashed changes if (Owner.ItemAnimationActive) { @@ -211,6 +238,18 @@ namespace CalamityMod.Projectiles.BaseProjectiles } } +<<<<<<< Updated upstream +======= + public override bool? CanHitNPC(NPC target) + { + bool bb = (target.immune[0] <= 0) && !target.friendly && !target.dontTakeDamage && RestrikeDelay <= 0; + + if (bb) RestrikeDelay = 1; + + return bb; + } + +>>>>>>> Stashed changes public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { modifiers.HitDirectionOverride = Owner.direction; @@ -224,7 +263,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void ModifyDamageHitbox(ref Rectangle hitbox) { +<<<<<<< Updated upstream Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation() + HitboxRotationOffset()); +======= + Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation + HitboxRotationOffset); +>>>>>>> Stashed changes hitbox = new Rectangle((int)cen.X - (int)(HitboxSize.X / 2), (int)cen.Y - (int)(HitboxSize.Y / 2), (int)HitboxSize.X, (int)HitboxSize.Y); @@ -240,7 +283,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; +<<<<<<< Updated upstream Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin().X, SpriteOrigin().Y) : SpriteOrigin(), Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); +======= + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); +>>>>>>> Stashed changes } return false; } diff --git a/Projectiles/Melee/WindBladeHoldout.cs b/Projectiles/Melee/WindBladeHoldout.cs index d55bf66300..3b3127734f 100644 --- a/Projectiles/Melee/WindBladeHoldout.cs +++ b/Projectiles/Melee/WindBladeHoldout.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Melee public override Vector2 HitboxSize => new Vector2(70, 70); +<<<<<<< Updated upstream public override float HitboxRotationOffset() { return MathHelper.ToRadians(-45); @@ -31,6 +32,11 @@ namespace CalamityMod.Projectiles.Melee { return new(0, 80); } +======= + public override float HitboxRotationOffset => MathHelper.ToRadians(-45); + + public override Vector2 SpriteOrigin => new(0, 80); +>>>>>>> Stashed changes public override void OnSpawn(IEntitySource source) { @@ -41,9 +47,13 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { +<<<<<<< Updated upstream Vector2 mousePos = Main.MouseWorld; // i don't know how cal handles Main.MouseWorld in netcode. todo: someone fix this up in multiplayer pls // - ennway +======= + Vector2 mousePos = Owner.Calamity().mouseWorld; +>>>>>>> Stashed changes if (mousePos.X < Owner.Center.X) Owner.direction = -1; else Owner.direction = 1; @@ -75,7 +85,11 @@ namespace CalamityMod.Projectiles.Melee } if ((int)AnimationProgress > (int)(Owner.itemAnimationMax / 1.5f)) { +<<<<<<< Updated upstream GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + (new Vector2(Main.rand.Next(30, 100), 0).RotatedBy(FinalRotation() + MathHelper.ToRadians(-45))), new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation() + MathHelper.ToRadians(-45)), Color.LightSkyBlue, 40, 1f, 0.4f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); +======= + GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + (new Vector2(Main.rand.Next(30, 100), 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))), new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)), Color.LightSkyBlue, 40, 1f, 0.4f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); +>>>>>>> Stashed changes } float time = (AnimationProgress) - (Owner.itemAnimationMax / 3); @@ -89,18 +103,34 @@ namespace CalamityMod.Projectiles.Melee } else if (NumberOfAnimations % 4 == 3) { +<<<<<<< Updated upstream +======= + float ProjectileSpeed = 10; + int ProjectileDamage = 10; + float ProjectileKnockback = Projectile.knockBack; + +>>>>>>> Stashed changes CanHit = true; if ((int)AnimationProgress == 1) { SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFurySwing, Owner.Center); SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing.WithPitchOffset(-0.4f), Owner.Center); +<<<<<<< Updated upstream +======= + + Projectile.NewProjectile(new EntitySource_ItemUse(Owner, Owner.HeldItem), Projectile.Hitbox.Center.ToVector2(), new Vector2(ProjectileSpeed, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)), ModContent.ProjectileType(), ProjectileDamage, ProjectileKnockback, Owner.whoAmI); +>>>>>>> Stashed changes } RotationOffset = 0f; if (AnimationProgress < Owner.itemAnimationMax / 3) { Projectile.scale = MathHelper.Lerp(Projectile.scale, 1.5f, 0.4f); +<<<<<<< Updated upstream float rot = FinalRotation() + MathHelper.ToRadians(-45); +======= + float rot = FinalRotation + MathHelper.ToRadians(-45); +>>>>>>> Stashed changes GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + new Vector2(105 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot + MathHelper.ToRadians(Main.rand.NextFloat(-20, 20))), Color.LightSkyBlue, 30, 2f, 0.3f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); GeneralParticleHandler.SpawnParticle(new LineParticle(Owner.Center + new Vector2(0, 20).RotatedBy(rot) + new Vector2(45 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot), false, 30, 1f, Color.LightSkyBlue)); diff --git a/Projectiles/Melee/WindBolt.cs b/Projectiles/Melee/WindBolt.cs index fa7973d544..e0b442246b 100644 --- a/Projectiles/Melee/WindBolt.cs +++ b/Projectiles/Melee/WindBolt.cs @@ -1,10 +1,22 @@ using System; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +<<<<<<< Updated upstream using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +======= +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent.UI; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Utilities.Terraria.Utilities; +using XPT.Core.Audio.MP3Sharp.Decoding.Decoders.LayerIII; +>>>>>>> Stashed changes namespace CalamityMod.Projectiles.Melee { @@ -12,6 +24,10 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; public int dustvortex = 0; +<<<<<<< Updated upstream +======= + public float scFactor = 0f; +>>>>>>> Stashed changes public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; @@ -27,15 +43,27 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.Melee; Projectile.timeLeft = 300; Projectile.extraUpdates = 2; +<<<<<<< Updated upstream Projectile.penetrate = 2; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; +======= + Projectile.penetrate = -1; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 50; +>>>>>>> Stashed changes Projectile.tileCollide = false; } public override void AI() { +<<<<<<< Updated upstream +======= + Projectile.velocity *= 0.95f; + +>>>>>>> Stashed changes Projectile.ai[0]++; Projectile.ai[1]++; @@ -43,18 +71,32 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[0] >= 12) Projectile.tileCollide = true; +<<<<<<< Updated upstream Projectile.rotation += MathHelper.ToRadians(15f); Projectile.alpha -= 5; if (Projectile.alpha < 50) +======= + Projectile.rotation += MathHelper.ToRadians(1f); + Projectile.alpha -= 5; +>>>>>>> Stashed changes { Projectile.alpha = 50; if (Projectile.ai[1] >= 15) { +<<<<<<< Updated upstream for (int i = 1; i <= 6; i++) { Vector2 dustspeed = new Vector2(3f, 3f).RotatedBy(MathHelper.ToRadians(dustvortex)); int d = Dust.NewDust(Projectile.Center, Projectile.width / 2, Projectile.height / 2, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.3f); +======= + scFactor = MathHelper.Lerp(scFactor, 1f, 0.1f); + for (int i = 1; i <= 6; i++) + { + Vector2 dustpos = new Vector2(48f, 48f).RotatedBy(MathHelper.ToRadians(dustvortex + Main.rand.Next(30))); + Vector2 dustspeed = new Vector2(-5f, -5f).RotatedBy(MathHelper.ToRadians(dustvortex + Main.rand.Next(30))); + int d = Dust.NewDust(Projectile.Center + dustpos, Projectile.width / 2, Projectile.height / 2, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 50), 1.3f); +>>>>>>> Stashed changes Main.dust[d].noGravity = true; Main.dust[d].velocity = dustspeed; dustvortex += 60; @@ -72,6 +114,7 @@ namespace CalamityMod.Projectiles.Melee float npcCenterX = npc.position.X + (float)(npc.width / 2); float npcCenterY = npc.position.Y + (float)(npc.height / 2); float npcDistance = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); +<<<<<<< Updated upstream if (npcDistance < 600f) { if (npc.position.X < projX) @@ -91,13 +134,34 @@ namespace CalamityMod.Projectiles.Melee npc.velocity.Y -= 0.05f; } } +======= + if (npcDistance < 300f) + { + float factor = MathHelper.Lerp(1f,0f,CalamityUtils.SineBumpEasing(npcDistance / 300, 1)); + + npc.velocity += npc.DirectionTo(Projectile.Center) * factor * 0.25f; + } + if (npcDistance < 40) npc.velocity *= 0.75f; +>>>>>>> Stashed changes } } } public override bool PreDraw(ref Color lightColor) { +<<<<<<< Updated upstream CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); +======= + Asset tex = ModContent.Request(Texture); + + for (int i = 5; i >= 0; i--) + { + float c = Math.Max(i, 1); + + Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, tex.Frame(), new Color(1f / c, 1f / c, 1f / c, 1f / c), -Projectile.rotation * c, tex.Size() / 2, (float)MathHelper.Lerp(1f, i, scFactor), SpriteEffects.None); + } + +>>>>>>> Stashed changes return false; } @@ -107,8 +171,13 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i <= 360; i += 3) { +<<<<<<< Updated upstream Vector2 dustspeed = new Vector2(3f, 3f).RotatedBy(MathHelper.ToRadians(i)); int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.4f); +======= + Vector2 dustspeed = new Vector2(12f, 12f).RotatedBy(MathHelper.ToRadians(i)); + int d = Dust.NewDust(Projectile.Center + (dustspeed * 2), Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.4f); +>>>>>>> Stashed changes Main.dust[d].noGravity = true; Main.dust[d].position = Projectile.Center; Main.dust[d].velocity = dustspeed; diff --git a/en-US.hjson b/en-US.hjson new file mode 100644 index 0000000000..a84ffb8057 --- /dev/null +++ b/en-US.hjson @@ -0,0 +1 @@ +Mods.CalamityMod.Projectiles.WindBladeHoldout.DisplayName: Wind Blade Holdout From 358147a561a7074087673eaf523c69097ffa0f11 Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Tue, 21 May 2024 14:01:35 -0400 Subject: [PATCH 115/177] Un-exploded the PR request --- .../BaseCustomUseStyleProjectile.cs | 53 ++----------------- 1 file changed, 4 insertions(+), 49 deletions(-) diff --git a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs index e662a81fae..0b9ec47dfe 100644 --- a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs @@ -22,10 +22,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles { Projectile.friendly = true; Projectile.tileCollide = false; -<<<<<<< Updated upstream -======= Projectile.penetrate = -1; ->>>>>>> Stashed changes } public override void OnSpawn(IEntitySource source) @@ -39,11 +36,6 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// public Vector2 Offset = Vector2.Zero; -<<<<<<< Updated upstream -======= - public float RestrikeDelay = 0; - ->>>>>>> Stashed changes /// /// The Player that is using the projectile. /// @@ -100,41 +92,20 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// The origin of the sprite when drawn on your character. ///
/// -<<<<<<< Updated upstream - public virtual Vector2 SpriteOrigin() - { - return Projectile.Size / 2; - } -======= public virtual Vector2 SpriteOrigin => Projectile.Size / 2; ->>>>>>> Stashed changes /// /// Helper method for getting the rotation of the sprite plus RotationOffset, without having to make your own local variable every time. /// /// -<<<<<<< Updated upstream - public float FinalRotation() - { - return Projectile.rotation + RotationOffset; - } -======= public float FinalRotation => Projectile.rotation + RotationOffset; ->>>>>>> Stashed changes /// /// Rotation offset for the hitbox that doesn't affect the sprite. /// Useful for if you have, for instance, a sword sprite at a 45 degree angle, and need that to reflect on the hitbox. /// /// -<<<<<<< Updated upstream - public virtual float HitboxRotationOffset() - { - return 0f; - } -======= public virtual float HitboxRotationOffset => 0f; ->>>>>>> Stashed changes /// /// Whether or not the projectile can hit enemies at the current frame. @@ -182,14 +153,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void AI() { -<<<<<<< Updated upstream - Projectile.penetrate = 100; -======= Owner.Calamity().mouseWorldListener = true; - RestrikeDelay--; ->>>>>>> Stashed changes - if (Owner.ItemAnimationActive) { Animation++; @@ -238,18 +203,14 @@ namespace CalamityMod.Projectiles.BaseProjectiles } } -<<<<<<< Updated upstream -======= public override bool? CanHitNPC(NPC target) { - bool bb = (target.immune[0] <= 0) && !target.friendly && !target.dontTakeDamage && RestrikeDelay <= 0; - - if (bb) RestrikeDelay = 1; + bool bb = (target.immune[0] <= 0) && !target.friendly && !target.dontTakeDamage; return bb; } ->>>>>>> Stashed changes + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { modifiers.HitDirectionOverride = Owner.direction; @@ -263,11 +224,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void ModifyDamageHitbox(ref Rectangle hitbox) { -<<<<<<< Updated upstream - Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation() + HitboxRotationOffset()); -======= Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation + HitboxRotationOffset); ->>>>>>> Stashed changes + hitbox = new Rectangle((int)cen.X - (int)(HitboxSize.X / 2), (int)cen.Y - (int)(HitboxSize.Y / 2), (int)HitboxSize.X, (int)HitboxSize.Y); @@ -283,11 +241,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; -<<<<<<< Updated upstream - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin().X, SpriteOrigin().Y) : SpriteOrigin(), Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); -======= Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); ->>>>>>> Stashed changes + } return false; } From 6461ec1b6e8cac4b1131f260fe967a9c43c3b292 Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Tue, 21 May 2024 14:04:34 -0400 Subject: [PATCH 116/177] Un-exploded the actual Wind Blade holdout and cyclone --- Projectiles/Melee/WindBladeHoldout.cs | 34 --------------- Projectiles/Melee/WindBolt.cs | 62 +-------------------------- 2 files changed, 1 insertion(+), 95 deletions(-) diff --git a/Projectiles/Melee/WindBladeHoldout.cs b/Projectiles/Melee/WindBladeHoldout.cs index 3b3127734f..03c8776d65 100644 --- a/Projectiles/Melee/WindBladeHoldout.cs +++ b/Projectiles/Melee/WindBladeHoldout.cs @@ -21,22 +21,9 @@ namespace CalamityMod.Projectiles.Melee public override float HitboxOutset => 60; public override Vector2 HitboxSize => new Vector2(70, 70); - -<<<<<<< Updated upstream - public override float HitboxRotationOffset() - { - return MathHelper.ToRadians(-45); - } - - public override Vector2 SpriteOrigin() - { - return new(0, 80); - } -======= public override float HitboxRotationOffset => MathHelper.ToRadians(-45); public override Vector2 SpriteOrigin => new(0, 80); ->>>>>>> Stashed changes public override void OnSpawn(IEntitySource source) { @@ -47,13 +34,7 @@ namespace CalamityMod.Projectiles.Melee public override void UseStyle() { -<<<<<<< Updated upstream - Vector2 mousePos = Main.MouseWorld; - // i don't know how cal handles Main.MouseWorld in netcode. todo: someone fix this up in multiplayer pls - // - ennway -======= Vector2 mousePos = Owner.Calamity().mouseWorld; ->>>>>>> Stashed changes if (mousePos.X < Owner.Center.X) Owner.direction = -1; else Owner.direction = 1; @@ -85,11 +66,7 @@ namespace CalamityMod.Projectiles.Melee } if ((int)AnimationProgress > (int)(Owner.itemAnimationMax / 1.5f)) { -<<<<<<< Updated upstream - GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + (new Vector2(Main.rand.Next(30, 100), 0).RotatedBy(FinalRotation() + MathHelper.ToRadians(-45))), new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation() + MathHelper.ToRadians(-45)), Color.LightSkyBlue, 40, 1f, 0.4f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); -======= GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + (new Vector2(Main.rand.Next(30, 100), 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))), new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)), Color.LightSkyBlue, 40, 1f, 0.4f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); ->>>>>>> Stashed changes } float time = (AnimationProgress) - (Owner.itemAnimationMax / 3); @@ -103,34 +80,23 @@ namespace CalamityMod.Projectiles.Melee } else if (NumberOfAnimations % 4 == 3) { -<<<<<<< Updated upstream -======= float ProjectileSpeed = 10; int ProjectileDamage = 10; float ProjectileKnockback = Projectile.knockBack; - ->>>>>>> Stashed changes CanHit = true; if ((int)AnimationProgress == 1) { SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFurySwing, Owner.Center); SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing.WithPitchOffset(-0.4f), Owner.Center); -<<<<<<< Updated upstream -======= Projectile.NewProjectile(new EntitySource_ItemUse(Owner, Owner.HeldItem), Projectile.Hitbox.Center.ToVector2(), new Vector2(ProjectileSpeed, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)), ModContent.ProjectileType(), ProjectileDamage, ProjectileKnockback, Owner.whoAmI); ->>>>>>> Stashed changes } RotationOffset = 0f; if (AnimationProgress < Owner.itemAnimationMax / 3) { Projectile.scale = MathHelper.Lerp(Projectile.scale, 1.5f, 0.4f); -<<<<<<< Updated upstream - float rot = FinalRotation() + MathHelper.ToRadians(-45); -======= float rot = FinalRotation + MathHelper.ToRadians(-45); ->>>>>>> Stashed changes GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + new Vector2(105 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot + MathHelper.ToRadians(Main.rand.NextFloat(-20, 20))), Color.LightSkyBlue, 30, 2f, 0.3f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); GeneralParticleHandler.SpawnParticle(new LineParticle(Owner.Center + new Vector2(0, 20).RotatedBy(rot) + new Vector2(45 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot), false, 30, 1f, Color.LightSkyBlue)); diff --git a/Projectiles/Melee/WindBolt.cs b/Projectiles/Melee/WindBolt.cs index e0b442246b..7c4eb7a110 100644 --- a/Projectiles/Melee/WindBolt.cs +++ b/Projectiles/Melee/WindBolt.cs @@ -1,12 +1,10 @@ using System; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; -<<<<<<< Updated upstream using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -======= using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; @@ -16,7 +14,6 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Utilities.Terraria.Utilities; using XPT.Core.Audio.MP3Sharp.Decoding.Decoders.LayerIII; ->>>>>>> Stashed changes namespace CalamityMod.Projectiles.Melee { @@ -24,10 +21,7 @@ namespace CalamityMod.Projectiles.Melee { public new string LocalizationCategory => "Projectiles.Melee"; public int dustvortex = 0; -<<<<<<< Updated upstream -======= public float scFactor = 0f; ->>>>>>> Stashed changes public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; @@ -43,27 +37,17 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.Melee; Projectile.timeLeft = 300; Projectile.extraUpdates = 2; -<<<<<<< Updated upstream - Projectile.penetrate = 2; - Projectile.ignoreWater = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; -======= Projectile.penetrate = -1; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 50; ->>>>>>> Stashed changes Projectile.tileCollide = false; } public override void AI() { -<<<<<<< Updated upstream -======= Projectile.velocity *= 0.95f; ->>>>>>> Stashed changes Projectile.ai[0]++; Projectile.ai[1]++; @@ -71,32 +55,19 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.ai[0] >= 12) Projectile.tileCollide = true; -<<<<<<< Updated upstream - Projectile.rotation += MathHelper.ToRadians(15f); - Projectile.alpha -= 5; - if (Projectile.alpha < 50) -======= Projectile.rotation += MathHelper.ToRadians(1f); Projectile.alpha -= 5; ->>>>>>> Stashed changes { Projectile.alpha = 50; if (Projectile.ai[1] >= 15) { -<<<<<<< Updated upstream - - for (int i = 1; i <= 6; i++) - { - Vector2 dustspeed = new Vector2(3f, 3f).RotatedBy(MathHelper.ToRadians(dustvortex)); - int d = Dust.NewDust(Projectile.Center, Projectile.width / 2, Projectile.height / 2, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.3f); -======= scFactor = MathHelper.Lerp(scFactor, 1f, 0.1f); for (int i = 1; i <= 6; i++) { Vector2 dustpos = new Vector2(48f, 48f).RotatedBy(MathHelper.ToRadians(dustvortex + Main.rand.Next(30))); Vector2 dustspeed = new Vector2(-5f, -5f).RotatedBy(MathHelper.ToRadians(dustvortex + Main.rand.Next(30))); int d = Dust.NewDust(Projectile.Center + dustpos, Projectile.width / 2, Projectile.height / 2, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 50), 1.3f); ->>>>>>> Stashed changes + Main.dust[d].noGravity = true; Main.dust[d].velocity = dustspeed; dustvortex += 60; @@ -114,27 +85,6 @@ namespace CalamityMod.Projectiles.Melee float npcCenterX = npc.position.X + (float)(npc.width / 2); float npcCenterY = npc.position.Y + (float)(npc.height / 2); float npcDistance = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); -<<<<<<< Updated upstream - if (npcDistance < 600f) - { - if (npc.position.X < projX) - { - npc.velocity.X += 0.05f; - } - else - { - npc.velocity.X -= 0.05f; - } - if (npc.position.Y < projY) - { - npc.velocity.Y += 0.05f; - } - else - { - npc.velocity.Y -= 0.05f; - } - } -======= if (npcDistance < 300f) { float factor = MathHelper.Lerp(1f,0f,CalamityUtils.SineBumpEasing(npcDistance / 300, 1)); @@ -142,16 +92,12 @@ namespace CalamityMod.Projectiles.Melee npc.velocity += npc.DirectionTo(Projectile.Center) * factor * 0.25f; } if (npcDistance < 40) npc.velocity *= 0.75f; ->>>>>>> Stashed changes } } } public override bool PreDraw(ref Color lightColor) { -<<<<<<< Updated upstream - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor); -======= Asset tex = ModContent.Request(Texture); for (int i = 5; i >= 0; i--) @@ -161,7 +107,6 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, tex.Frame(), new Color(1f / c, 1f / c, 1f / c, 1f / c), -Projectile.rotation * c, tex.Size() / 2, (float)MathHelper.Lerp(1f, i, scFactor), SpriteEffects.None); } ->>>>>>> Stashed changes return false; } @@ -171,13 +116,8 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i <= 360; i += 3) { -<<<<<<< Updated upstream - Vector2 dustspeed = new Vector2(3f, 3f).RotatedBy(MathHelper.ToRadians(i)); - int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.4f); -======= Vector2 dustspeed = new Vector2(12f, 12f).RotatedBy(MathHelper.ToRadians(i)); int d = Dust.NewDust(Projectile.Center + (dustspeed * 2), Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.4f); ->>>>>>> Stashed changes Main.dust[d].noGravity = true; Main.dust[d].position = Projectile.Center; Main.dust[d].velocity = dustspeed; From a413e0af9c16cc3facd86bdaf548d1601de0e70d Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Tue, 21 May 2024 14:31:47 -0400 Subject: [PATCH 117/177] Fix localization bleed in Wind Blade rework --- .../en-US/Mods.CalamityMod.Projectiles.Melee.hjson | 1 - Projectiles/Melee/WindBladeHoldout.cs | 11 ++++------- en-US.hjson | 1 - 3 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 en-US.hjson diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 79a1e7d286..701a9c1703 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -316,4 +316,3 @@ WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YateveoBloomProj.DisplayName: Yateveo Bloom YinYoDark.DisplayName: Dark Shard YinYoLight.DisplayName: Light Shard -Cyclone.DisplayName: Cyclone diff --git a/Projectiles/Melee/WindBladeHoldout.cs b/Projectiles/Melee/WindBladeHoldout.cs index 03c8776d65..03f7c67d49 100644 --- a/Projectiles/Melee/WindBladeHoldout.cs +++ b/Projectiles/Melee/WindBladeHoldout.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.CalPlayer; -using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; @@ -12,12 +6,15 @@ using Terraria; using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { public class WindBladeHoldout : BaseCustomUseStyleProjectile, ILocalizedModType { + public override LocalizedText DisplayName => CalamityUtils.GetItemName(); + public override float HitboxOutset => 60; public override Vector2 HitboxSize => new Vector2(70, 70); diff --git a/en-US.hjson b/en-US.hjson deleted file mode 100644 index a84ffb8057..0000000000 --- a/en-US.hjson +++ /dev/null @@ -1 +0,0 @@ -Mods.CalamityMod.Projectiles.WindBladeHoldout.DisplayName: Wind Blade Holdout From 982d89cc47c8dc934c8fbb97b1a83316e1945860 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 17:43:03 -0400 Subject: [PATCH 118/177] Wind Blade "balance" and tooltip Trying to balance this thing on a tier with two very true melee-unfriendly bosses is genuine torture, it'd be great if other testers could help me with this --- Items/Weapons/Melee/WindBlade.cs | 6 +-- ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 7 ++- Projectiles/Melee/WindBladeHoldout.cs | 11 ++++- Projectiles/Melee/WindBolt.cs | 43 +++++++++++++------ 4 files changed, 49 insertions(+), 18 deletions(-) diff --git a/Items/Weapons/Melee/WindBlade.cs b/Items/Weapons/Melee/WindBlade.cs index 24f1c6a98b..2f9aa92a91 100644 --- a/Items/Weapons/Melee/WindBlade.cs +++ b/Items/Weapons/Melee/WindBlade.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 58; Item.height = 58; - Item.damage = 41; + Item.damage = 42; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 20; + Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 20; + Item.useTime = 18; Item.useTurn = true; Item.knockBack = 5f; Item.autoReuse = true; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index afeab0b76b..7fb4b0572d 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -1390,7 +1390,12 @@ VulcaniteLance: { WindBlade: { DisplayName: Wind Blade - Tooltip: Fires cyclones that suck enemies in + Tooltip: + ''' + Perform a three swing combo which ends by thrusting the blade forwards + Thrusting the blade launches an expanding cyclone that lingers + Cyclones pull enemies in, or pulls itself towards bosses + ''' } WulfrumScrewdriver: { diff --git a/Projectiles/Melee/WindBladeHoldout.cs b/Projectiles/Melee/WindBladeHoldout.cs index 03f7c67d49..50d4a88d50 100644 --- a/Projectiles/Melee/WindBladeHoldout.cs +++ b/Projectiles/Melee/WindBladeHoldout.cs @@ -22,6 +22,13 @@ namespace CalamityMod.Projectiles.Melee public override Vector2 SpriteOrigin => new(0, 80); + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + } + public override void OnSpawn(IEntitySource source) { Projectile.scale = 0f; @@ -78,8 +85,8 @@ namespace CalamityMod.Projectiles.Melee else if (NumberOfAnimations % 4 == 3) { float ProjectileSpeed = 10; - int ProjectileDamage = 10; - float ProjectileKnockback = Projectile.knockBack; + int ProjectileDamage = (int)(Projectile.damage * 0.3f); + float ProjectileKnockback = (int)(Projectile.knockBack * 0.5f); CanHit = true; if ((int)AnimationProgress == 1) { diff --git a/Projectiles/Melee/WindBolt.cs b/Projectiles/Melee/WindBolt.cs index 7c4eb7a110..08ec3d63f3 100644 --- a/Projectiles/Melee/WindBolt.cs +++ b/Projectiles/Melee/WindBolt.cs @@ -30,8 +30,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 36; - Projectile.height = 36; + Projectile.width = 40; + Projectile.height = 40; Projectile.alpha = 255; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; @@ -40,13 +40,13 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 50; + Projectile.localNPCHitCooldown = 8 * Projectile.MaxUpdates; Projectile.tileCollide = false; } public override void AI() { - Projectile.velocity *= 0.95f; + Projectile.velocity *= 0.98f; Projectile.ai[0]++; Projectile.ai[1]++; @@ -80,18 +80,27 @@ namespace CalamityMod.Projectiles.Melee float projY = Projectile.Center.Y; foreach (var npc in Main.ActiveNPCs) { - if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1)) { - float npcCenterX = npc.position.X + (float)(npc.width / 2); - float npcCenterY = npc.position.Y + (float)(npc.height / 2); - float npcDistance = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); - if (npcDistance < 300f) + if (!CalamityPlayer.areThereAnyDamnBosses) // Pulls enemies in while no boss is alive { - float factor = MathHelper.Lerp(1f,0f,CalamityUtils.SineBumpEasing(npcDistance / 300, 1)); + float npcCenterX = npc.position.X + (float)(npc.width / 2); + float npcCenterY = npc.position.Y + (float)(npc.height / 2); + float npcDistance = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); + if (npcDistance < 320f) + { + float factor = MathHelper.Lerp(1f, 0f, CalamityUtils.SineBumpEasing(npcDistance / 300, 1)); - npc.velocity += npc.DirectionTo(Projectile.Center) * factor * 0.25f; + npc.velocity += npc.DirectionTo(Projectile.Center) * factor * 0.25f; + } + if (npcDistance < 40) + npc.velocity *= 0.75f; + } + else // Pulls itself toward enemies while a boss is alive so that the gimmick isn't entirely lost + { + if (Math.Abs(Projectile.velocity.X) < 1.5f && Math.Abs(Projectile.velocity.Y) < 1.5f) + CalamityUtils.HomeInOnNPC(Projectile, false, 320f, 1.5f, 20f); } - if (npcDistance < 40) npc.velocity *= 0.75f; } } } @@ -110,6 +119,16 @@ namespace CalamityMod.Projectiles.Melee return false; } + public override void ModifyDamageHitbox(ref Rectangle hitbox) + { + // The hitbox gets bigger over time, because the vortex visually grows + int sizeIncrease = (int)(Projectile.ai[0] * 0.3f); + hitbox.Inflate(sizeIncrease, sizeIncrease); + } + + // The vortex slows down on enemies hits, so that it is easier for it to linger on top of stuff + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Projectile.velocity *= 0.5f; + public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.Item60 with { Volume = SoundID.Item60.Volume * 0.6f }, Projectile.Center); From ba33686eafda84dc7f9fdb22b7f9880516fb3c15 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 17:44:50 -0400 Subject: [PATCH 119/177] Killing localization files with my mind --- Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 7fb4b0572d..cebfe4bd20 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -1394,7 +1394,7 @@ WindBlade: { ''' Perform a three swing combo which ends by thrusting the blade forwards Thrusting the blade launches an expanding cyclone that lingers - Cyclones pull enemies in, or pulls itself towards bosses + Cyclones pull enemies in, or pulls itself towards bosses ''' } From 26d3a24de7702fb7b64bb25c28fa8fb7bc9be09d Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 18:03:45 -0400 Subject: [PATCH 120/177] Sulphurous armor nerf --- CalPlayer/CalamityPlayerHitHurt.cs | 4 ++-- CalPlayer/CalamityPlayerOnHit.cs | 2 +- Items/Armor/Sulphurous/SulphurousBreastplate.cs | 4 ++-- Items/Armor/Sulphurous/SulphurousHelmet.cs | 2 +- .../en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson | 4 ++-- NPCs/CalamityGlobalNPC.cs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 30b3177ccb..16e9b7e6a8 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1233,13 +1233,13 @@ namespace CalamityMod.CalPlayer if (Main.player[proj.owner] is null) { if (!Main.npc[proj.owner].friendly) - Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 120); + Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 90); } else { Player p = Main.player[proj.owner]; if (p.hostile && Player.hostile && (Player.team != p.team || p.team == 0)) - p.AddBuff(BuffID.Poisoned, 120); + p.AddBuff(BuffID.Poisoned, 90); } } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 42a6b1c2af..3122d55209 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1266,7 +1266,7 @@ namespace CalamityMod.CalPlayer if (omegaBlueChestplate) target.AddBuff(BuffType(), 180); if (sulphurSet) - target.AddBuff(BuffID.Poisoned, 120); + target.AddBuff(BuffID.Poisoned, 90); if (abyssalAmulet) { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); diff --git a/Items/Armor/Sulphurous/SulphurousBreastplate.cs b/Items/Armor/Sulphurous/SulphurousBreastplate.cs index ee6c63df21..6848c2825b 100644 --- a/Items/Armor/Sulphurous/SulphurousBreastplate.cs +++ b/Items/Armor/Sulphurous/SulphurousBreastplate.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Armor.Sulphurous public override void UpdateEquip(Player player) { - player.GetDamage() += 0.08f; - player.GetCritChance() += 5; + player.GetDamage() += 0.06f; + player.GetCritChance() += 4; } public override void AddRecipes() diff --git a/Items/Armor/Sulphurous/SulphurousHelmet.cs b/Items/Armor/Sulphurous/SulphurousHelmet.cs index b2b6e7b765..f7375d88c0 100644 --- a/Items/Armor/Sulphurous/SulphurousHelmet.cs +++ b/Items/Armor/Sulphurous/SulphurousHelmet.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Armor.Sulphurous var modPlayer = player.Calamity(); modPlayer.sulphurSet = true; player.GetJumpState().Enable(); - modPlayer.rogueStealthMax += 0.7f; + modPlayer.rogueStealthMax += 0.65f; modPlayer.wearingRogueArmor = true; player.ignoreWater = true; } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson index b1f4f411f9..ab21fcb087 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -186,7 +186,7 @@ StatigelHeadSummon: { SulphurousBreastplate: { DisplayName: Sulphurous Breastplate - Tooltip: 8% increased rogue damage and 5% increased rogue critical strike chance + Tooltip: 6% increased rogue damage and 4% increased rogue critical strike chance } SulphurousHelmet: { @@ -199,7 +199,7 @@ SulphurousHelmet: { ''' SetBonus: ''' - +70 maximum stealth + +65 maximum stealth Attacking and being attacked by enemies inflicts poison Grants an additional jump that summons a sulphurous bubble Provides increased underwater mobility and reduces the severity of the sulphuric waters diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index cccd363c25..5cb59af057 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5255,7 +5255,7 @@ namespace CalamityMod.NPCs return; if (target.Calamity().sulphurSet) - npc.AddBuff(BuffID.Poisoned, 120); + npc.AddBuff(BuffID.Poisoned, 90); if (target.Calamity().snowman) { From 44c8a2d6f3b63295edfa054939d00db44f881067 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 18:17:16 -0400 Subject: [PATCH 121/177] Fixed Hardened Honeycomb spawning twice as many projectiles as intended when hitting enemies --- Projectiles/Rogue/Honeycomb.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Projectiles/Rogue/Honeycomb.cs b/Projectiles/Rogue/Honeycomb.cs index 5e3ca0a392..657b228b40 100644 --- a/Projectiles/Rogue/Honeycomb.cs +++ b/Projectiles/Rogue/Honeycomb.cs @@ -71,6 +71,11 @@ namespace CalamityMod.Projectiles.Rogue public void SpawnProjectiles() { + // If it's already spawned projectiles, don't do anything. Prevents it from spawning double the projectile amount when hitting enemies. + if (Projectile.ai[1] == 1f) + return; + + Projectile.ai[1] = 1f; Player player = Main.player[Main.myPlayer]; int fragAmt = 2; for (int i = 0; i < fragAmt; i++) From ae165825770384696cf444f764b1d6e0ba2ed286 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 18:41:23 -0400 Subject: [PATCH 122/177] Per old community suggestion, Guardians no longer enrage outside the Hallow or Underworld --- .../ProfanedGuardianCommander.cs | 56 +++++++------------ .../ProfanedGuardianDefender.cs | 34 +++-------- .../ProfanedGuardianHealer.cs | 26 ++------- 3 files changed, 31 insertions(+), 85 deletions(-) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index d85a7326d6..a4279922e8 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -33,7 +33,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians { private int spearType = 0; private int healTimer = 0; - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; private const float TimeForShieldDespawn = 120f; public static readonly SoundStyle HolyRaySound = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianRay") { Volume = 1.25f }; public static readonly SoundStyle DashSound = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianDash"); @@ -105,7 +104,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians { writer.Write(spearType); writer.Write(healTimer); - writer.Write(biomeEnrageTimer); writer.Write(NPC.chaseable); writer.Write(NPC.localAI[0]); writer.Write(NPC.localAI[1]); @@ -119,7 +117,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians { spearType = reader.ReadInt32(); healTimer = reader.ReadInt32(); - biomeEnrageTimer = reader.ReadInt32(); NPC.chaseable = reader.ReadBoolean(); NPC.localAI[0] = reader.ReadSingle(); NPC.localAI[1] = reader.ReadSingle(); @@ -334,21 +331,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[3] < 0f) NPC.ai[3] = 0f; - // Become immune over time if target isn't in hell or hallow - bool isHoly = player.ZoneHallow; - bool isHell = player.ZoneUnderworldHeight; - if (!isHoly && !isHell && !bossRush) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - else - NPC.Calamity().CurrentlyEnraged = true; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; - bool phase1 = healerAlive || defenderAlive; NPC.chaseable = !phase1; @@ -373,7 +355,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float goLowOrHighDistance = 540f; // Side swap variables for Phase 2 - float defenderCommanderGuardPhase2Duration = (bossRush || biomeEnraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float defenderCommanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float moveToOtherSideInPhase2GateValue = defenderCommanderGuardPhase2Duration - 120f; float timeBeforeMoveToOtherSideInPhase2Reset = moveToOtherSideInPhase2GateValue * 2f; float totalGoLowDurationPhase2 = 210f; @@ -381,13 +363,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = (bossRush || biomeEnraged) ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; + float maxChargeVelocity = bossRush ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; if (CalamityWorld.LegendaryMode && revenge) maxChargeVelocity *= 2f; - float inertia = (bossRush || biomeEnraged) ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; + float inertia = bossRush ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (!phase1) @@ -470,7 +452,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (!goLow && !goLowPhase2 && !goHigh) calamityGlobalNPC.newAI[0] = -NPC.direction; - float velocity = (bossRush || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) velocity *= 1.25f; if (healerAlive) @@ -507,7 +489,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 targetVector = destination - NPC.Center; Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; - float phaseGateValue = (bossRush || biomeEnraged) ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; + float phaseGateValue = bossRush ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; bool continueShootingProjectiles = phase1 || (NPC.ai[2] < (phaseGateValue * 5f)); if (continueShootingProjectiles) @@ -521,7 +503,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Alternate between firing profaned spears and holy fire // Shoot holy blasts in final phase NPC.ai[2] += 1f; - float projectileShootGateValue = (bossRush || biomeEnraged) ? 40f : death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; + float projectileShootGateValue = bossRush ? 40f : death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; if (NPC.ai[2] % projectileShootGateValue == 0f) { if (phase1) @@ -535,7 +517,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool shootSpear = NPC.ai[2] % (projectileShootGateValue * 2f) == 0f; - float projectileVelocity = (bossRush || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float projectileVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; Vector2 finalProjectileVelocity = Vector2.Normalize(player.Center - shootFrom) * projectileVelocity; int type = shootSpear ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -548,8 +530,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (fireExtraProjectiles && shootSpear) { - int baseProjectileAmt = (bossRush || biomeEnraged) ? 4 : 2; - int spread = (bossRush || biomeEnraged) ? 18 : 10; + int baseProjectileAmt = bossRush ? 4 : 2; + int spread = bossRush ? 18 : 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -568,7 +550,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else { // Shoot holy blasts - float holyBlastVelocity = (bossRush || biomeEnraged) ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; + float holyBlastVelocity = bossRush ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; int projTimeLeft = (int)(2000f / holyBlastVelocity); Vector2 finalHolyBlastVelocity = Vector2.Normalize(player.Center - shootFrom) * holyBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -681,7 +663,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = (bossRush || biomeEnraged) ? 90f : death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; + float phaseGateValue = bossRush ? 90f : death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -702,7 +684,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = (bossRush || biomeEnraged) ? 1.053333f : death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; + float velocityMult = bossRush ? 1.053333f : death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -790,7 +772,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool targetRanAwayAndWillNowBeFucked = NPC.ai[2] == 1f; bool boostVelocityToCatchUp = NPC.ai[1] == 0f || targetRanAwayAndWillNowBeFucked; - float velocity = (bossRush || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) velocity *= 1.25f; if (boostVelocityToCatchUp) @@ -802,7 +784,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; float totalSpears = 12f; - float shootDuration = (bossRush || biomeEnraged) ? 240f : death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; + float shootDuration = bossRush ? 240f : death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; float dontShootTime = shootDuration * 0.3f; float phaseGateValue = dontShootTime + shootDuration; @@ -847,7 +829,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } else if (NPC.ai[1] % spearShootDivisor == 0f) { - float spearVelocity = (bossRush || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float spearVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) spearVelocity *= 1.25f; if (boostVelocityToCatchUp) @@ -865,8 +847,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] % (spearShootDivisor * 3) == 0f || targetRanAwayAndWillNowBeFucked) { knockbackVelocity *= 2f; - int baseProjectileAmt = (bossRush || biomeEnraged) ? 8 : expertMode ? 6 : 4; - int spread = (bossRush || biomeEnraged) ? 60 : expertMode ? 50 : 40; + int baseProjectileAmt = bossRush ? 8 : expertMode ? 6 : 4; + int spread = bossRush ? 60 : expertMode ? 50 : 40; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -902,7 +884,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } float laserGateValue = 120f; - float velocity = (bossRush || biomeEnraged) ? 4.5f : death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; + float velocity = bossRush ? 4.5f : death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; if (NPC.ai[1] < laserGateValue) velocity *= 6f; if (Main.getGoodWorld) @@ -958,7 +940,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { if (NPC.ai[2] == laserGateValue) { - float rotation = (bossRush || biomeEnraged) ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; + float rotation = bossRush ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < 2800f) SoundEngine.PlaySound(HolyRaySound, Main.LocalPlayer.Center); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index dc0fba164b..8a4f75cfb1 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -24,7 +24,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians public class ProfanedGuardianDefender : ModNPC { private int healTimer = 0; - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; private const float TimeForShieldDespawn = 120f; public static readonly SoundStyle DashSound = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianDash"); public static readonly SoundStyle RockShieldSpawnSound = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianRockShieldActivate"); @@ -100,7 +99,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void SendExtraAI(BinaryWriter writer) { writer.Write(healTimer); - writer.Write(biomeEnrageTimer); writer.Write(NPC.chaseable); writer.Write(NPC.localAI[0]); writer.Write(NPC.localAI[1]); @@ -111,7 +109,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void ReceiveExtraAI(BinaryReader reader) { healTimer = reader.ReadInt32(); - biomeEnrageTimer = reader.ReadInt32(); NPC.chaseable = reader.ReadBoolean(); NPC.localAI[0] = reader.ReadSingle(); NPC.localAI[1] = reader.ReadSingle(); @@ -250,28 +247,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool expertMode = Main.expertMode || bossRush; bool revenge = CalamityWorld.revenge || bossRush; bool death = CalamityWorld.death || bossRush; - bool isHoly = player.ZoneHallow; - bool isHell = player.ZoneUnderworldHeight; - - // Become immune over time if target isn't in hell or hallow - if (!isHoly && !isHell && !bossRush) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - else - NPC.Calamity().CurrentlyEnraged = true; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; bool phase1 = healerAlive; NPC.chaseable = !phase1; // Phase durations - float commanderGuardPhase2Duration = (bossRush || biomeEnraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float commanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float timeBeforeRocksRespawnInPhase2 = 90f; float throwRocksGateValue = 60f; @@ -280,7 +262,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = (bossRush || biomeEnraged) ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; + float maxChargeVelocity = bossRush ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; @@ -400,7 +382,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - float moveVelocity = (bossRush || biomeEnraged) ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; + float moveVelocity = bossRush ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; if (Main.getGoodWorld) moveVelocity *= 1.25f; if (healerAlive) @@ -450,7 +432,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Lay a holy bomb every once in a while in phase 1 and while not doing the laser attack if (!commanderUsingLaser) { - float projectileShootGateValue = (bossRush || biomeEnraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float projectileShootGateValue = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; NPC.ai[1] += 1f; if (NPC.ai[1] >= projectileShootGateValue) { @@ -520,7 +502,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float shootMoltenBlastsGateValue = commanderGuardPhase2Duration / moltenBlastsDivisor; if (NPC.ai[1] % shootMoltenBlastsGateValue == 0f && !commanderGoingLowOrHighInPhase2) { - float moltenBlastVelocity = (bossRush || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float moltenBlastVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; int projTimeLeft = (int)(2400f / moltenBlastVelocity); Vector2 velocity = Vector2.Normalize(player.Center - shootFrom) * moltenBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -627,7 +609,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = (bossRush || biomeEnraged) ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; + float phaseGateValue = bossRush ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -648,7 +630,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = (bossRush || biomeEnraged) ? 1.04f : death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; + float velocityMult = bossRush ? 1.04f : death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -660,7 +642,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else { // Charge towards target - float inertia = (bossRush || biomeEnraged) ? 57f : death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; + float inertia = bossRush ? 57f : death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; NPC.velocity = (NPC.velocity * (inertia - 1f) + targetVector * (NPC.velocity.Length() + (0.111111117f * inertia))) / inertia; } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index cfc275078d..a59ec9f297 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -39,7 +39,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians set => NPC.ai[3] = value; } - private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; public static Asset Texture_Glow; public static Asset Texture_Glow2; @@ -116,13 +115,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void SendExtraAI(BinaryWriter writer) { - writer.Write(biomeEnrageTimer); writer.Write(NPC.localAI[0]); } public override void ReceiveExtraAI(BinaryReader reader) { - biomeEnrageTimer = reader.ReadInt32(); NPC.localAI[0] = reader.ReadSingle(); } @@ -172,8 +169,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool expertMode = Main.expertMode || bossRush; bool revenge = CalamityWorld.revenge || bossRush; bool death = CalamityWorld.death || bossRush; - bool isHoly = player.ZoneHallow; - bool isHell = player.ZoneUnderworldHeight; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -183,19 +178,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[0] >= 300f) NPC.ai[1] = 1f; - // Become immune over time if target isn't in hell or hallow - if (!isHoly && !isHell && !BossRushEvent.BossRushActive) - { - if (biomeEnrageTimer > 0) - biomeEnrageTimer--; - else - NPC.Calamity().CurrentlyEnraged = true; - } - else - biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = biomeEnrageTimer <= 0; - // Direction if (Math.Abs(NPC.Center.X - player.Center.X) > 10f) { @@ -235,7 +217,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool useCrystalShards = AIState == (float)Phase.CrystalShards; - float velocity = useCrystalShards ? ((bossRush || biomeEnraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); + float velocity = useCrystalShards ? (bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); if (Main.getGoodWorld) velocity *= 1.25f; @@ -323,7 +305,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = biomeEnraged ? 18 : death ? 16 : revenge ? 14 : expertMode ? 12 : 10; + int totalProjectiles = bossRush ? 18 : death ? 16 : revenge ? 14 : expertMode ? 12 : 10; float speedX = -12f; float speedAdjustment = Math.Abs(speedX * 2f / (totalProjectiles - 1)); float speedY = -4f; @@ -362,7 +344,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, shootFrom); - int totalFlameProjectiles = biomeEnraged ? 20 : 16; + int totalFlameProjectiles = bossRush ? 20 : 16; int totalRings = revenge ? 3 : 2; int healingStarChance = revenge ? 8 : expertMode ? 6 : 4; double radians = MathHelper.TwoPi / totalFlameProjectiles; @@ -423,7 +405,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Move towards a location above the player if (distanceFromDestination.Length() > idealDistanceFromDestination) { - float inertia = (bossRush || biomeEnraged) ? 28f : death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; + float inertia = bossRush ? 28f : death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (Main.getGoodWorld) From 4da9f34375a82c9e250c8be13368cee6a8bc3336 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 21 May 2024 18:57:59 -0500 Subject: [PATCH 123/177] Fixed Brimstone Elemental's Brimstone Ray split shots dealing full Ray damage. --- DataStructures/NPCStats.cs | 2 +- Projectiles/Boss/BrimstoneRay.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs index 4c0a22518d..70bc44c14e 100644 --- a/DataStructures/NPCStats.cs +++ b/DataStructures/NPCStats.cs @@ -656,7 +656,7 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 240, 280, 420 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 240, 280, 420 } }, // Split shots: 72, 120, 144, 168, 252 { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 4630d227b5..7e18a2f859 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 fireFrom = new Vector2(Main.npc[(int)Projectile.ai[1]].Center.X + (Main.npc[(int)Projectile.ai[1]].spriteDirection > 0 ? 34f : -34f), Main.npc[(int)Projectile.ai[1]].Center.Y - 74f) + velocity * distanceBetweenProjectiles; int projectileAmt = (int)(Projectile.localAI[1] / distanceBetweenProjectiles); int type = ModContent.ProjectileType(); - int damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + int damage = (int)Math.Round(Projectile.damage * 0.6); float projectileVelocityToPass = 12f; for (int i = 0; i < projectileAmt; i++) From a572ebb4c71b1239be0799113e45f9a84661d8f1 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 21:36:35 -0400 Subject: [PATCH 124/177] Ballistic Poison Bomb --- Balancing/BalancingChangesManager.cs | 3 +++ Projectiles/Rogue/BallisticPoisonBombProj.cs | 2 +- Projectiles/Rogue/BallisticPoisonCloud.cs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 3daca26a39..c36cc58ade 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -264,6 +264,9 @@ namespace CalamityMod.Balancing // 50% resist to true melee. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(ResistTrueMelee(0.5f)))); + // 35% resist to Ballistic Poison Bomb's clouds. + NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); + // 35% resist to Icicle Arrows. NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType())))); diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 1085f9f558..6ef3ba74cc 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner); } - int cloudAmt = Projectile.Calamity().stealthStrike ? Main.rand.Next(8, 12+1) : Main.rand.Next(3, 5+1); + int cloudAmt = Projectile.Calamity().stealthStrike ? Main.rand.Next(7, 10+1) : Main.rand.Next(3, 5+1); for (int c = 0; c < cloudAmt; c++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 10f, 200f, 0.01f); diff --git a/Projectiles/Rogue/BallisticPoisonCloud.cs b/Projectiles/Rogue/BallisticPoisonCloud.cs index 47f612c1ef..df259e395b 100644 --- a/Projectiles/Rogue/BallisticPoisonCloud.cs +++ b/Projectiles/Rogue/BallisticPoisonCloud.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.height = 34; Projectile.friendly = true; Projectile.alpha = 255; - Projectile.penetrate = -1; + Projectile.penetrate = 5; Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.timeLeft = 600; From 091bd9453e0fbdd0bec59bb5544ac06d846ee577 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 21 May 2024 23:29:20 -0400 Subject: [PATCH 125/177] 1 - Several ammo rebalances 2 - Remove Astrum Deus Relic tooltip --- Items/Ammo/VeriumBolt.cs | 2 +- Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson | 2 +- Projectiles/Ranged/CinderArrowProj.cs | 4 ++-- Projectiles/Ranged/DryadsTearMain.cs | 5 ++++- Projectiles/Ranged/IcicleArrowProj.cs | 6 +++--- Projectiles/Ranged/SproutingArrowMain.cs | 6 +++--- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Items/Ammo/VeriumBolt.cs b/Items/Ammo/VeriumBolt.cs index b2a1adb08a..bbc4756fe6 100644 --- a/Items/Ammo/VeriumBolt.cs +++ b/Items/Ammo/VeriumBolt.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 8; Item.height = 8; - Item.damage = 7; + Item.damage = 11; Item.DamageType = DamageClass.Ranged; Item.maxStack = 9999; Item.consumable = true; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 15755848c2..c07939ffdc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -360,7 +360,7 @@ AstrumAureusRelic: { AstrumDeusRelic: { DisplayName: Astrum Deus Relic - Tooltip: A glimpse into what could have been... + Tooltip: "" } BrimstoneElementalRelic: { diff --git a/Projectiles/Ranged/CinderArrowProj.cs b/Projectiles/Ranged/CinderArrowProj.cs index 1933630860..cfd82c1257 100644 --- a/Projectiles/Ranged/CinderArrowProj.cs +++ b/Projectiles/Ranged/CinderArrowProj.cs @@ -102,13 +102,13 @@ namespace CalamityMod.Projectiles.Ranged for (int b = 0; b < 3; b++) { Vector2 velocity = Vector2.UnitY.RotatedByRandom(0.8f) * Main.rand.NextFloat(-3.5f, -3f); - Projectile shrapnel = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1f), 0f, Projectile.owner, ai2: 1f); + Projectile shrapnel = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.06f), 0f, Projectile.owner, ai2: 1f); shrapnel.timeLeft = 300; shrapnel.arrow = false; shrapnel.MaxUpdates = 4; } - Projectile.damage = (int)(Projectile.damage * 0.5f); + Projectile.damage = (int)(Projectile.damage * 0.4f); Projectile.penetrate = -1; Projectile.ExpandHitboxBy(110); Projectile.Damage(); diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 5676aded04..8c6d8cf7a7 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -34,6 +34,9 @@ namespace CalamityMod.Projectiles.Ranged { Lighting.AddLight(Projectile.Center, Color.LimeGreen.ToVector3() * 0.25f); + if (Projectile.localAI[0] == 0f) + Projectile.damage = (int)(Projectile.damage * 0.75f); + Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { @@ -60,7 +63,7 @@ namespace CalamityMod.Projectiles.Ranged for (int b = 0; b < 2; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3), 0f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), 0f, Projectile.owner, 0f, 0f); } for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index 45dc5b612d..dea42703d3 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.extraUpdates = 6; Projectile.timeLeft = 1000; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15 * Projectile.extraUpdates; + Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration; } @@ -119,10 +119,10 @@ namespace CalamityMod.Projectiles.Ranged public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (falling) - modifiers.SourceDamage *= 1.35f; + modifiers.SourceDamage *= 1.1f; if (Projectile.numHits > 1 && falling) - Projectile.damage = (int)(Projectile.damage * 0.6f); + Projectile.damage = (int)(Projectile.damage * 0.5f); if (Projectile.damage < 1) Projectile.damage = 1; } diff --git a/Projectiles/Ranged/SproutingArrowMain.cs b/Projectiles/Ranged/SproutingArrowMain.cs index 93fbb6180f..c67de8f3a6 100644 --- a/Projectiles/Ranged/SproutingArrowMain.cs +++ b/Projectiles/Ranged/SproutingArrowMain.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.ai[0] == 0) { - Projectile.damage = (int)(Projectile.damage * 0.18f); + Projectile.damage = (int)(Projectile.damage * 0.3f); Projectile.velocity *= 0.25f; LineParticle spark = new LineParticle(Projectile.Center + Projectile.velocity * 4, Projectile.velocity * 4.95f, false, 9, 2.4f, Color.LimeGreen); GeneralParticleHandler.SpawnParticle(spark); @@ -51,8 +51,8 @@ namespace CalamityMod.Projectiles.Ranged Vector2 vel1 = (Projectile.velocity * 0.4f).RotatedBy(Main.rand.NextFloat(0.015f, 0.04f)); Vector2 vel2 = (Projectile.velocity * 0.4f).RotatedBy(Main.rand.NextFloat(-0.015f, -0.04f)); - int split1 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vel1 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType(), (int)(Projectile.damage * 3), 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f); - int split2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vel2 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType(), (int)(Projectile.damage * 3), 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f); + int split1 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vel1 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType(), (int)(Projectile.damage * 2), 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f); + int split2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vel2 * Main.rand.NextFloat(0.95f, 1.05f), ModContent.ProjectileType(), (int)(Projectile.damage * 2), 0f, Projectile.owner, 0f, hitDirect ? 1f : 0f); if (Projectile.Calamity().allProjectilesHome) // Allows the split arrows to home when using Arterial Assault as well { Main.projectile[split1].Calamity().allProjectilesHome = true; From 154484a946895a113501b762bd6f1ed2fb2273e7 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 22 May 2024 02:57:46 -0500 Subject: [PATCH 126/177] Fixed Deerclops Ice Spikes not dealing damage in Rev. --- Projectiles/CalamityGlobalProjectile.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 45f9f892d1..0cb47d3729 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2153,8 +2153,8 @@ namespace CalamityMod.Projectiles int numDust = 5; int numDust2 = 5; int fadeInTime = 10; - int fadeOutGateValue = masterMode ? 80 : death ? 50 : 10; - float killGateValue = masterMode ? 90f : death ? 60f : 20f; + int fadeOutGateValue = masterMode ? 80 : death ? 50 : 25; + float killGateValue = masterMode ? 90f : death ? 60f : 35f; int maxFrames = 5; bool fadeIn = projectile.ai[0] < (float)fadeInTime; @@ -4280,7 +4280,7 @@ namespace CalamityMod.Projectiles if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { float fadeInTime = 10f; - float fadeOutGateValue = masterMode ? 80f : death ? 50f : 10f; + float fadeOutGateValue = masterMode ? 80f : death ? 50f : 25f; return (projectile.ai[0] >= fadeInTime && projectile.ai[0] < fadeOutGateValue); } break; @@ -4444,8 +4444,8 @@ namespace CalamityMod.Projectiles Vector2 origin12 = new Vector2(16f, value26.Height / 2); Color alpha5 = projectile.GetAlpha(lightColor); Vector2 vector39 = new Vector2(projectile.scale); - float fadeOutGateValue = masterMode ? 80f : death ? 50f : 10f; - float killGateValue = masterMode ? 90f : death ? 60f : 20f; + float fadeOutGateValue = masterMode ? 80f : death ? 50f : 25f; + float killGateValue = masterMode ? 90f : death ? 60f : 35f; float lerpValue5 = Utils.GetLerpValue(killGateValue, killGateValue - 10f, projectile.ai[0], clamped: true); vector39.Y *= lerpValue5; Vector4 vector40 = lightColor.ToVector4(); From a71a874be159a1867caa815662c8a72d6f74d408 Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 22 May 2024 00:58:53 -0700 Subject: [PATCH 127/177] Craw Carapace and Baroclaw buffs Craw Carapace: damage 5% -> 8%, now deals 50 flat damage on top of spikes damage to enemies that hit you Baroclaw: Now also has 5% dr, now deals 250 flat damage on top of spikes damage to enemies that hit you Absorber also got the flat damage for consistency's sake but it's not very high since its common knowledge absorber is a top tier accessory already. --- CalPlayer/CalamityPlayerHitHurt.cs | 6 ++++++ CalPlayer/CalamityPlayerMiscEffects.cs | 5 ++++- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 16e9b7e6a8..5dce1a0a3e 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1172,6 +1172,8 @@ namespace CalamityMod.CalPlayer if (crawCarapace) { npc.AddBuff(ModContent.BuffType(), 900); + int onHitDamage = Player.CalcIntDamage(50); + Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center); } @@ -1179,6 +1181,8 @@ namespace CalamityMod.CalPlayer { npc.AddBuff(ModContent.BuffType(), 900); npc.AddBuff(ModContent.BuffType(), 900); + int onHitDamage = Player.CalcIntDamage(250); + Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); SoundEngine.PlaySound(BaroclawHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); @@ -1198,6 +1202,8 @@ namespace CalamityMod.CalPlayer if (absorber) { npc.AddBuff(ModContent.BuffType(), 900); + int onHitDamage = Player.CalcIntDamage(350); + Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); SoundEngine.PlaySound(AbsorberHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 4da98a113f..0a1bbeb77e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2581,10 +2581,13 @@ namespace CalamityMod.CalPlayer } if (crawCarapace) - Player.GetDamage() += 0.05f; + Player.GetDamage() += 0.08f; if (baroclaw) + { + Player.endurance += 0.05f; Player.GetDamage() += 0.1f; + } if (aeroStone && !Player.slowFall && Player.wingTime < Player.wingTimeMax) { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 5726d7ac9a..522ee30e39 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -428,7 +428,7 @@ CrawCarapace: { DisplayName: Craw Carapace Tooltip: ''' - 5% increased damage + 8% increased damage Enemies that hit you take damage and are inflicted with Crumbling ''' } @@ -437,7 +437,7 @@ Baroclaw: { DisplayName: Baroclaw Tooltip: ''' - 10% increased damage + 10% increased damage and 5% increased damage reduction Enemies that hit you take high damage and are inflicted with Armor Crunch and Crush Depth ''' } From b92ca9ceb27fc67d3763ce932ef8329ec9fca8a0 Mon Sep 17 00:00:00 2001 From: Xyk Date: Wed, 22 May 2024 01:09:52 -0700 Subject: [PATCH 128/177] fixed icicle arrow tile insanity --- Projectiles/Ranged/IcicleArrowProj.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Projectiles/Ranged/IcicleArrowProj.cs b/Projectiles/Ranged/IcicleArrowProj.cs index dea42703d3..8e49752c80 100644 --- a/Projectiles/Ranged/IcicleArrowProj.cs +++ b/Projectiles/Ranged/IcicleArrowProj.cs @@ -149,6 +149,7 @@ namespace CalamityMod.Projectiles.Ranged dust2.noGravity = false; } Projectile.velocity = new Vector2(0, -6.5f).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.75f, 1.1f); + Projectile.tileCollide = false; return false; } else From 09f97cdfd8b75ab05246061684fdb7f12d4045f9 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Wed, 22 May 2024 03:28:43 -0500 Subject: [PATCH 129/177] Why were these set to die on contact with water given they spawn in water biomes? --- Tiles/Abyss/AbyssAmbient/AbyssKelp.cs | 2 +- Tiles/Abyss/AbyssAmbient/PhoviamareHalm.cs | 2 +- Tiles/Abyss/AbyssAmbient/TenebrisRemnant.cs | 2 +- Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs | 2 +- Tiles/SunkenSea/SmallCorals.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs b/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs index 780c4f5224..5685b37c6e 100644 --- a/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs +++ b/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient Main.tileNoAttach[Type] = true; Main.tileNoFail[Type] = true; Main.tileLavaDeath[Type] = true; - Main.tileWaterDeath[Type] = true; + Main.tileWaterDeath[Type] = false; Main.tileFrameImportant[Type] = true; TileID.Sets.ReplaceTileBreakUp[Type] = true; TileID.Sets.SwaysInWindBasic[Type] = true; diff --git a/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.cs b/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.cs index df321133ff..4e4ed2bf49 100644 --- a/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.cs +++ b/Tiles/Abyss/AbyssAmbient/PhoviamareHalm.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient Main.tileNoAttach[Type] = true; Main.tileNoFail[Type] = true; Main.tileLavaDeath[Type] = true; - Main.tileWaterDeath[Type] = true; + Main.tileWaterDeath[Type] = false; Main.tileFrameImportant[Type] = true; TileID.Sets.ReplaceTileBreakUp[Type] = true; TileID.Sets.SwaysInWindBasic[Type] = true; diff --git a/Tiles/Abyss/AbyssAmbient/TenebrisRemnant.cs b/Tiles/Abyss/AbyssAmbient/TenebrisRemnant.cs index a5a676ba0f..6d10d5c19c 100644 --- a/Tiles/Abyss/AbyssAmbient/TenebrisRemnant.cs +++ b/Tiles/Abyss/AbyssAmbient/TenebrisRemnant.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient Main.tileNoAttach[Type] = true; Main.tileNoFail[Type] = true; Main.tileLavaDeath[Type] = true; - Main.tileWaterDeath[Type] = true; + Main.tileWaterDeath[Type] = false; Main.tileFrameImportant[Type] = true; TileID.Sets.ReplaceTileBreakUp[Type] = true; TileID.Sets.SwaysInWindBasic[Type] = true; diff --git a/Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs b/Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs index 65c88d8234..099fc82862 100644 --- a/Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/SmallCoralsEcho.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Tiles.Rubblemaker.SunkenSea Main.tileNoAttach[Type] = true; Main.tileNoFail[Type] = true; Main.tileLavaDeath[Type] = true; - Main.tileWaterDeath[Type] = true; + Main.tileWaterDeath[Type] = false; Main.tileFrameImportant[Type] = true; TileID.Sets.ReplaceTileBreakUp[Type] = true; TileID.Sets.SwaysInWindBasic[Type] = false; diff --git a/Tiles/SunkenSea/SmallCorals.cs b/Tiles/SunkenSea/SmallCorals.cs index 6848dccbca..84237a5d3e 100644 --- a/Tiles/SunkenSea/SmallCorals.cs +++ b/Tiles/SunkenSea/SmallCorals.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileNoAttach[Type] = true; Main.tileNoFail[Type] = true; Main.tileLavaDeath[Type] = true; - Main.tileWaterDeath[Type] = true; + Main.tileWaterDeath[Type] = false; Main.tileFrameImportant[Type] = true; TileID.Sets.ReplaceTileBreakUp[Type] = true; TileID.Sets.SwaysInWindBasic[Type] = false; From 2b6eee0fdff69fe94d030b5539b76e55912249ec Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Wed, 22 May 2024 15:42:52 -0400 Subject: [PATCH 130/177] Removed Wind Blade rework from main branch Hi to people who snoop around in the source I guess --- Items/BaseItems/CustomUseProjItem.cs | 23 -- Items/Weapons/Melee/WindBlade.cs | 31 ++- Items/Weapons/Melee/WindBlade.png | Bin 870 -> 930 bytes ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 7 +- .../Mods.CalamityMod.Projectiles.Melee.hjson | 2 +- .../BaseCustomUseStyleProjectile.cs | 250 ------------------ Projectiles/Melee/Cyclone.cs | 125 +++++++++ .../Melee/{WindBolt.png => Cyclone.png} | Bin Projectiles/Melee/WindBladeHoldout.cs | 132 --------- Projectiles/Melee/WindBladeHoldout.png | Bin 870 -> 0 bytes Projectiles/Melee/WindBolt.cs | 146 ---------- 11 files changed, 146 insertions(+), 570 deletions(-) delete mode 100644 Items/BaseItems/CustomUseProjItem.cs delete mode 100644 Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs create mode 100644 Projectiles/Melee/Cyclone.cs rename Projectiles/Melee/{WindBolt.png => Cyclone.png} (100%) delete mode 100644 Projectiles/Melee/WindBladeHoldout.cs delete mode 100644 Projectiles/Melee/WindBladeHoldout.png delete mode 100644 Projectiles/Melee/WindBolt.cs diff --git a/Items/BaseItems/CustomUseProjItem.cs b/Items/BaseItems/CustomUseProjItem.cs deleted file mode 100644 index 800d2dfb97..0000000000 --- a/Items/BaseItems/CustomUseProjItem.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Items.BaseItems -{ - public abstract class CustomUseProjItem : ModItem - { - public override void SetDefaults() - { - Item.channel = true; - } - - public override bool CanShoot(Player player) - { - return player.ownedProjectileCounts[Item.shoot] < 1; - } - } -} diff --git a/Items/Weapons/Melee/WindBlade.cs b/Items/Weapons/Melee/WindBlade.cs index 2f9aa92a91..8676601b68 100644 --- a/Items/Weapons/Melee/WindBlade.cs +++ b/Items/Weapons/Melee/WindBlade.cs @@ -1,6 +1,4 @@ -using CalamityMod.Items.BaseItems; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -10,29 +8,38 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class WindBlade : CustomUseProjItem, ILocalizedModType + public class WindBlade : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { Item.width = 58; Item.height = 58; - Item.damage = 42; + Item.damage = 41; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 18; + Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 18; + Item.useTime = 20; Item.useTurn = true; Item.knockBack = 5f; + Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 3f; + } - Item.channel = true; - Item.shoot = ModContent.ProjectileType(); - Item.noUseGraphic = true; - Item.noMelee = true; - Item.useStyle = ItemUseStyleID.Shoot; + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Projectile.NewProjectile(source, position, velocity, type, damage / 2, knockback, player.whoAmI); + return false; + } + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.NextBool(3)) + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.BlueTorch); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/WindBlade.png b/Items/Weapons/Melee/WindBlade.png index b08f34b7d98f5f3f7a38e51a7dd73f46a2afc898..36d003fbdcbe511f4b0dd3a6f72ea705133b3674 100644 GIT binary patch literal 930 zcmV;T16}-yP)XhFzSdcT!?*u#N@&VB$=WD5d}B3h-lF&5QK&lBFMfr zMudbQA_hu|UlT%pq^Ju^7m6^nQiFnf-`_a5_eRU-^Qq@7=5X(Q%y8%T&N=^cT-qVA z+@dSLVx7CRBVw+DPV9s`MfmK>eBlcV&XDuR^-q|nqwQ>{+>o4Vqhnt=MjaiS4dFVm zuF6Xm{_U659g$?BPBoPz*07p8?ZT(#dW4^TKQ8>lNP8R;by95he|%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N7kfT*6;d#qovuIOG;L?*@-JB!R+;!#^2YQ&0QlBSEMj7FnN2rIEF;HpS|8)v|2%cEn(7x1s<_eqCS49`}jBhcDuc;3l-beO!lq% z`npHgZn*nMu*dzh-AfIT>8Z1Mr=7L;z&Zj1Mhn$j_SCl<_!meY-<~1Gabt~Jw$)%X-xA3FCfA<#i^DpqzeXMDyX`&HV zyn)fcc}vv8`@CB+F5B2WIv+FtkP%zhb&c~;TO8*_pT2TgIM17lDlc{~n&_b0_XxaXoxbN=EO?x@za_2I+Iw${SZ| z-cZ=0#})AYea)ZGM)Qp1U9W8OsjXS?VU?HfLsJg%MUs2o|K7HjWmfwv1({OWY5LPX zepqcRJpYl|gT?Et_v`WtPtS_BdGq1Y;RmUyZ-u9?(s~{swCv}09-+xjk<+(6D)01^ h6mE806j=LTJkb1E_Xp`4e}QR@!PC{xWt~$(697sik}v=O diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index cebfe4bd20..afeab0b76b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -1390,12 +1390,7 @@ VulcaniteLance: { WindBlade: { DisplayName: Wind Blade - Tooltip: - ''' - Perform a three swing combo which ends by thrusting the blade forwards - Thrusting the blade launches an expanding cyclone that lingers - Cyclones pull enemies in, or pulls itself towards bosses - ''' + Tooltip: Fires cyclones that suck enemies in } WulfrumScrewdriver: { diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 701a9c1703..f49ed13e17 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -76,6 +76,7 @@ CosmicSpiritBomb3.DisplayName: Cosmic Bomb CrescentMoonFlail.DisplayName: Crescent Moon CrescentMoonProj.DisplayName: Crescent Moon CrystylCrusherRay.DisplayName: Crystyl Crusher Ray +Cyclone.DisplayName: Cyclone DarkBall.DisplayName: Dark Ball DarkBeam.DisplayName: Dark Beam DarkIceZero.DisplayName: Dark Ice @@ -310,7 +311,6 @@ Waterfall.DisplayName: Waterfall Beam WhiteBoltAura.DisplayName: White Aura WhiteOrb.DisplayName: White Orb Whiterain.DisplayName: White Rain -WindBolt.DisplayName: Wind Bolt WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YateveoBloomProj.DisplayName: Yateveo Bloom diff --git a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs deleted file mode 100644 index 0b9ec47dfe..0000000000 --- a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs +++ /dev/null @@ -1,250 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.Items.Weapons.Melee; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Input; -using ReLogic.Content; -using Terraria; -using Terraria.DataStructures; -using Terraria.GameInput; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.BaseProjectiles -{ - public abstract class BaseCustomUseStyleProjectile : ModProjectile - { - - public override void SetDefaults() - { - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - } - - public override void OnSpawn(IEntitySource source) - { - Projectile.timeLeft = Owner.HeldItem.useAnimation + 1; - } - - #region Fields - /// - /// The offset in pixels of the weapon from the projectile owner's center. This works even while using AbsolutePosition. - /// - public Vector2 Offset = Vector2.Zero; - - /// - /// The Player that is using the projectile. - /// - public virtual Player Owner => Main.player[Projectile.owner]; - - /// - /// The amount of pixels out the center of the projectile's hitbox is. - /// - public virtual float HitboxOutset => 30; - - /// - /// The projectile's hitbox size in pixels. - /// - public virtual Vector2 HitboxSize => new Vector2(30, 30); - - /// - /// The number of animations that this projectile has gone through. Useful for things like swing combos. - /// - public int NumberOfAnimations = 0; - - public float Animation = 0; - - /// - /// If true, flips the sprite with a 45-degree sword tilt in mind. - /// - public bool FlipAsSword = false; - - /// - /// The offset in radians of the weapon's rotation from its current rotation. - /// - public float RotationOffset = 0f; - - /// - /// The offset in radians of the rotation of the player's front arm. - /// - public float ArmRotationOffset = 0f; - - /// - /// The offset in radians of the rotation of the player's back arm. - /// - public float ArmRotationOffsetBack = 0f; - - /// - /// The amount of animation frames the projectile has in a vertical sheet. - /// - public virtual int FrameCount => 1; - - /// - /// The individual frame currently being drawn in a vertical sheet. - /// - public int Frame = 0; - - /// - /// The origin of the sprite when drawn on your character. - /// - /// - public virtual Vector2 SpriteOrigin => Projectile.Size / 2; - - /// - /// Helper method for getting the rotation of the sprite plus RotationOffset, without having to make your own local variable every time. - /// - /// - public float FinalRotation => Projectile.rotation + RotationOffset; - - /// - /// Rotation offset for the hitbox that doesn't affect the sprite. - /// Useful for if you have, for instance, a sword sprite at a 45 degree angle, and need that to reflect on the hitbox. - /// - /// - public virtual float HitboxRotationOffset => 0f; - - /// - /// Whether or not the projectile can hit enemies at the current frame. - /// Useful for wind-up animations where you don't want the projectile to deal damage. - /// - public bool CanHit = true; - - /// - /// Overrides the projectile owner's center as the projectile's location, so long as it isn't Vector2.Zero. - /// - public Vector2 AbsolutePosition = Vector2.Zero; - - /// - /// If this field is true, the projectile will draw at all times. Otherwise, it will only draw when its associated item is in use. - /// - public bool DrawUnconditionally = false; - - /// - /// The number of frames that the current use animation has progressed through. - /// - public float AnimationProgress = 0; - #endregion - - #region Use Style - /// - /// Determines the behavior to reset to when the item is not in use. - /// - public virtual void ResetStyle() { } - - /// - /// Determines the behavior of the projectile when the item is in use. - /// - public virtual void UseStyle() { } - - /// - /// Determines the behavior of the projectile when the item use animation begins for the first time in a row. - /// - public virtual void OnBeginUse() { } - - /// - /// Determines the behavior of the projectile when the item use animation ends. - /// - public virtual void OnEndUse() { } - #endregion - - public override void AI() - { - Owner.Calamity().mouseWorldListener = true; - - if (Owner.ItemAnimationActive) - { - Animation++; - - UseStyle(); - Owner.heldProj = Projectile.whoAmI; - Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffset); - Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffsetBack); - } - else - { - Animation = 0; - - if (DrawUnconditionally) - { - Owner.heldProj = Projectile.whoAmI; - Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffset); - Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, Projectile.rotation + RotationOffset + ArmRotationOffsetBack); - } - - NumberOfAnimations = 0; - ResetStyle(); - } - - AnimationProgress = Animation % Owner.itemAnimationMax; - - if (AbsolutePosition == Vector2.Zero) - { - Projectile.position = Owner.position + (Owner.Size / 2) - (Projectile.Size / 2) + Offset; - } - else - { - Projectile.position = AbsolutePosition - (Projectile.Size / 2) + Offset; - } - - if (Owner.itemAnimation == 1) - { - OnEndUse(); - NumberOfAnimations++; - } - - if (Owner.ItemAnimationJustStarted) - { - Projectile.timeLeft = Owner.HeldItem.useAnimation + 1; - OnBeginUse(); - } - } - - public override bool? CanHitNPC(NPC target) - { - bool bb = (target.immune[0] <= 0) && !target.friendly && !target.dontTakeDamage; - - return bb; - } - - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.HitDirectionOverride = Owner.direction; - base.ModifyHitNPC(target, ref modifiers); - } - - public override bool? CanDamage() - { - return CanHit ? base.CanDamage() : false; - } - - public override void ModifyDamageHitbox(ref Rectangle hitbox) - { - Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation + HitboxRotationOffset); - - - hitbox = new Rectangle((int)cen.X - (int)(HitboxSize.X / 2), (int)cen.Y - (int)(HitboxSize.Y / 2), (int)HitboxSize.X, (int)HitboxSize.Y); - - base.ModifyDamageHitbox(ref hitbox); - } - - public override bool PreDraw(ref Color lightColor) - { - // Only draw the projectile if the projectile's owner is currently using the item this projectile is attached to. - if (Owner.itemAnimation > 0 || DrawUnconditionally) - { - Asset tex = ModContent.Request(Texture); - - float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; - - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); - - } - return false; - } - } -} diff --git a/Projectiles/Melee/Cyclone.cs b/Projectiles/Melee/Cyclone.cs new file mode 100644 index 0000000000..0a14bde12d --- /dev/null +++ b/Projectiles/Melee/Cyclone.cs @@ -0,0 +1,125 @@ +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; + +namespace CalamityMod.Projectiles.Melee +{ + public class Cyclone : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public int dustvortex = 0; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 56; + Projectile.height = 56; + Projectile.alpha = 255; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.timeLeft = 300; + Projectile.extraUpdates = 2; + Projectile.penetrate = 2; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.tileCollide = false; + } + + public override void AI() + { + Projectile.ai[0]++; + Projectile.ai[1]++; + + //Code so it doesnt collide on tiles instantly + if (Projectile.ai[0] >= 12) + Projectile.tileCollide = true; + + Projectile.rotation += 2.5f; + Projectile.alpha -= 5; + if (Projectile.alpha < 50) + { + Projectile.alpha = 50; + if (Projectile.ai[1] >= 15) + { + + for (int i = 1; i <= 6; i++) + { + Vector2 dustspeed = new Vector2(3f, 3f).RotatedBy(MathHelper.ToRadians(dustvortex)); + int d = Dust.NewDust(Projectile.Center, Projectile.width / 2, Projectile.height / 2, 31, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.3f); + Main.dust[d].noGravity = true; + Main.dust[d].velocity = dustspeed; + dustvortex += 60; + } + dustvortex -= 355; + Projectile.ai[1] = 0; + } + } + float num472 = Projectile.Center.X; + float num473 = Projectile.Center.Y; + float num474 = 600f; + for (int num475 = 0; num475 < Main.maxNPCs; num475++) + { + NPC npc = Main.npc[num475]; + if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + { + float npcCenterX = npc.position.X + (float)(npc.width / 2); + float npcCenterY = npc.position.Y + (float)(npc.height / 2); + float num478 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); + if (num478 < num474) + { + if (npc.position.X < num472) + { + npc.velocity.X += 0.05f; + } + else + { + npc.velocity.X -= 0.05f; + } + if (npc.position.Y < num473) + { + npc.velocity.Y += 0.05f; + } + else + { + npc.velocity.Y -= 0.05f; + } + } + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(204, 255, 255, Projectile.alpha); + } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + return false; + } + + public override void OnKill(int timeLeft) + { + SoundEngine.PlaySound(SoundID.Item60 with { Volume = SoundID.Item60.Volume * 0.6f }, Projectile.Center); + + for (int i = 0; i <= 360; i += 3) + { + Vector2 dustspeed = new Vector2(3f, 3f).RotatedBy(MathHelper.ToRadians(i)); + int d = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, 31, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.4f); + Main.dust[d].noGravity = true; + Main.dust[d].position = Projectile.Center; + Main.dust[d].velocity = dustspeed; + } + } + } +} diff --git a/Projectiles/Melee/WindBolt.png b/Projectiles/Melee/Cyclone.png similarity index 100% rename from Projectiles/Melee/WindBolt.png rename to Projectiles/Melee/Cyclone.png diff --git a/Projectiles/Melee/WindBladeHoldout.cs b/Projectiles/Melee/WindBladeHoldout.cs deleted file mode 100644 index 50d4a88d50..0000000000 --- a/Projectiles/Melee/WindBladeHoldout.cs +++ /dev/null @@ -1,132 +0,0 @@ -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Particles; -using CalamityMod.Projectiles.BaseProjectiles; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class WindBladeHoldout : BaseCustomUseStyleProjectile, ILocalizedModType - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - - public override float HitboxOutset => 60; - - public override Vector2 HitboxSize => new Vector2(70, 70); - public override float HitboxRotationOffset => MathHelper.ToRadians(-45); - - public override Vector2 SpriteOrigin => new(0, 80); - - public override void SetDefaults() - { - base.SetDefaults(); - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - } - - public override void OnSpawn(IEntitySource source) - { - Projectile.scale = 0f; - Projectile.ai[1] = 1; - base.OnSpawn(source); - } - - public override void UseStyle() - { - Vector2 mousePos = Owner.Calamity().mouseWorld; - - if (mousePos.X < Owner.Center.X) Owner.direction = -1; - else Owner.direction = 1; - - DrawUnconditionally = true; - - if (NumberOfAnimations % 4 < 2) - { - Projectile.rotation = Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f); - - if (NumberOfAnimations % 4 == 0 && AnimationProgress < 10) - Projectile.scale = MathHelper.Lerp(Projectile.scale, 1f, 0.4f); - - if (AnimationProgress < (Owner.itemAnimationMax / 3)) - { - CanHit = false; - if (AnimationProgress == 0) - { - Projectile.ai[1] = -Projectile.ai[1]; - } - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(120f * Projectile.ai[1] * Owner.direction), 0.2f); - } - else - { - CanHit = true; - if ((int)AnimationProgress == (int)(Owner.itemAnimationMax / 1.5f)) - { - SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing, Owner.Center); - } - if ((int)AnimationProgress > (int)(Owner.itemAnimationMax / 1.5f)) - { - GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + (new Vector2(Main.rand.Next(30, 100), 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))), new Vector2(0, 10 * -Projectile.ai[1] * Owner.direction).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)), Color.LightSkyBlue, 40, 1f, 0.4f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); - } - - float time = (AnimationProgress) - (Owner.itemAnimationMax / 3); - float timeMax = Owner.itemAnimationMax - (Owner.itemAnimationMax / 3); - - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * Projectile.ai[1] * Owner.direction, 120f * -Projectile.ai[1] * Owner.direction, CalamityUtils.ExpInOutEasing(time / timeMax, 1))), - 0.2f); - } - - FlipAsSword = Owner.direction == -1 ? true : false; - } - else if (NumberOfAnimations % 4 == 3) - { - float ProjectileSpeed = 10; - int ProjectileDamage = (int)(Projectile.damage * 0.3f); - float ProjectileKnockback = (int)(Projectile.knockBack * 0.5f); - CanHit = true; - if ((int)AnimationProgress == 1) - { - SoundEngine.PlaySound(SoundID.DD2_SkyDragonsFurySwing, Owner.Center); - SoundEngine.PlaySound(SoundID.DD2_MonkStaffSwing.WithPitchOffset(-0.4f), Owner.Center); - - Projectile.NewProjectile(new EntitySource_ItemUse(Owner, Owner.HeldItem), Projectile.Hitbox.Center.ToVector2(), new Vector2(ProjectileSpeed, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)), ModContent.ProjectileType(), ProjectileDamage, ProjectileKnockback, Owner.whoAmI); - } - RotationOffset = 0f; - if (AnimationProgress < Owner.itemAnimationMax / 3) - { - Projectile.scale = MathHelper.Lerp(Projectile.scale, 1.5f, 0.4f); - - float rot = FinalRotation + MathHelper.ToRadians(-45); - - GeneralParticleHandler.SpawnParticle(new HeavySmokeParticle(Owner.Center + new Vector2(105 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot + MathHelper.ToRadians(Main.rand.NextFloat(-20, 20))), Color.LightSkyBlue, 30, 2f, 0.3f, MathHelper.ToRadians(Main.rand.NextFloat(-10f, 10f)), true)); - GeneralParticleHandler.SpawnParticle(new LineParticle(Owner.Center + new Vector2(0, 20).RotatedBy(rot) + new Vector2(45 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot), false, 30, 1f, Color.LightSkyBlue)); - GeneralParticleHandler.SpawnParticle(new LineParticle(Owner.Center + new Vector2(0, -20).RotatedBy(rot) + new Vector2(45 * Projectile.scale, 0).RotatedBy(rot), new Vector2(5, 0).RotatedBy(rot), false, 30, 1f, Color.LightSkyBlue)); - } - else - { - Projectile.scale = MathHelper.Lerp(Projectile.scale, 1.5f, -0.2f); - } - } - else - { - CanHit = false; - - RotationOffset = MathHelper.Lerp(RotationOffset, MathHelper.ToRadians(MathHelper.Lerp(150f * -Projectile.ai[1] * Owner.direction, 120f * Projectile.ai[1] * Owner.direction, 0.1f)), - 0.2f); - - Projectile.rotation = Owner.AngleTo(mousePos) + MathHelper.ToRadians(45f); - Projectile.scale = MathHelper.Lerp(Projectile.scale, 0f, 0.2f); - } - - ArmRotationOffset = MathHelper.ToRadians(-90f); - } - - public override void ResetStyle() - { - } - } -} diff --git a/Projectiles/Melee/WindBladeHoldout.png b/Projectiles/Melee/WindBladeHoldout.png deleted file mode 100644 index b08f34b7d98f5f3f7a38e51a7dd73f46a2afc898..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 870 zcmeAS@N?(olHy`uVBq!ia0vp^UO*he!3-pYE(NXtQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ivoN?Tn$sRP1>73{Jz+6c$H=S?vVfgZT9cb@Cd7$R6cccw!FDxLSBT0 zyhPo^a^CEQ5DSqR)utI%ie|2rN7kfT*6;d#qovuIOG;L?*@-JB!R+;!#^2YQ&0QlBSEMj7FnN2rIEF;HpS|8)v|2%cEn(7x1s<_eqCS49`}jBhcDuc;3l-beO!lq% z`npHgZn*nMu*dzh-AfIT>8Z1Mr=7L;z&Zj1Mhn$j_SCl<_!meY-<~1Gabt~Jw$)%X-xA3FCfA<#i^DpqzeXMDyX`&HV zyn)fcc}vv8`@CB+F5B2WIv+FtkP%zhb&c~;TO8*_pT2TgIM17lDlc{~n&_b0_XxaXoxbN=EO?x@za_2I+Iw${SZ| z-cZ=0#})AYea)ZGM)Qp1U9W8OsjXS?VU?HfLsJg%MUs2o|K7HjWmfwv1({OWY5LPX zepqcRJpYl|gT?Et_v`WtPtS_BdGq1Y;RmUyZ-u9?(s~{swCv}09-+xjk<+(6D)01^ h6mE806j=LTJkb1E_Xp`4e}QR@!PC{xWt~$(697sik}v=O diff --git a/Projectiles/Melee/WindBolt.cs b/Projectiles/Melee/WindBolt.cs deleted file mode 100644 index 08ec3d63f3..0000000000 --- a/Projectiles/Melee/WindBolt.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent.UI; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.Utilities.Terraria.Utilities; -using XPT.Core.Audio.MP3Sharp.Decoding.Decoders.LayerIII; - -namespace CalamityMod.Projectiles.Melee -{ - public class WindBolt : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public int dustvortex = 0; - public float scFactor = 0f; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 40; - Projectile.height = 40; - Projectile.alpha = 255; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 2; - Projectile.penetrate = -1; - Projectile.ignoreWater = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8 * Projectile.MaxUpdates; - Projectile.tileCollide = false; - } - - public override void AI() - { - Projectile.velocity *= 0.98f; - - Projectile.ai[0]++; - Projectile.ai[1]++; - - //Code so it doesnt collide on tiles instantly - if (Projectile.ai[0] >= 12) - Projectile.tileCollide = true; - - Projectile.rotation += MathHelper.ToRadians(1f); - Projectile.alpha -= 5; - { - Projectile.alpha = 50; - if (Projectile.ai[1] >= 15) - { - scFactor = MathHelper.Lerp(scFactor, 1f, 0.1f); - for (int i = 1; i <= 6; i++) - { - Vector2 dustpos = new Vector2(48f, 48f).RotatedBy(MathHelper.ToRadians(dustvortex + Main.rand.Next(30))); - Vector2 dustspeed = new Vector2(-5f, -5f).RotatedBy(MathHelper.ToRadians(dustvortex + Main.rand.Next(30))); - int d = Dust.NewDust(Projectile.Center + dustpos, Projectile.width / 2, Projectile.height / 2, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 50), 1.3f); - - Main.dust[d].noGravity = true; - Main.dust[d].velocity = dustspeed; - dustvortex += 60; - } - dustvortex -= 355; - Projectile.ai[1] = 0; - } - } - float projX = Projectile.Center.X; - float projY = Projectile.Center.Y; - foreach (var npc in Main.ActiveNPCs) - { - if (npc.CanBeChasedBy(Projectile, false) && Collision.CanHit(Projectile.Center, 1, 1, npc.Center, 1, 1)) - { - if (!CalamityPlayer.areThereAnyDamnBosses) // Pulls enemies in while no boss is alive - { - float npcCenterX = npc.position.X + (float)(npc.width / 2); - float npcCenterY = npc.position.Y + (float)(npc.height / 2); - float npcDistance = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - npcCenterX) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - npcCenterY); - if (npcDistance < 320f) - { - float factor = MathHelper.Lerp(1f, 0f, CalamityUtils.SineBumpEasing(npcDistance / 300, 1)); - - npc.velocity += npc.DirectionTo(Projectile.Center) * factor * 0.25f; - } - if (npcDistance < 40) - npc.velocity *= 0.75f; - } - else // Pulls itself toward enemies while a boss is alive so that the gimmick isn't entirely lost - { - if (Math.Abs(Projectile.velocity.X) < 1.5f && Math.Abs(Projectile.velocity.Y) < 1.5f) - CalamityUtils.HomeInOnNPC(Projectile, false, 320f, 1.5f, 20f); - } - } - } - } - - public override bool PreDraw(ref Color lightColor) - { - Asset tex = ModContent.Request(Texture); - - for (int i = 5; i >= 0; i--) - { - float c = Math.Max(i, 1); - - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, tex.Frame(), new Color(1f / c, 1f / c, 1f / c, 1f / c), -Projectile.rotation * c, tex.Size() / 2, (float)MathHelper.Lerp(1f, i, scFactor), SpriteEffects.None); - } - - return false; - } - - public override void ModifyDamageHitbox(ref Rectangle hitbox) - { - // The hitbox gets bigger over time, because the vortex visually grows - int sizeIncrease = (int)(Projectile.ai[0] * 0.3f); - hitbox.Inflate(sizeIncrease, sizeIncrease); - } - - // The vortex slows down on enemies hits, so that it is easier for it to linger on top of stuff - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Projectile.velocity *= 0.5f; - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item60 with { Volume = SoundID.Item60.Volume * 0.6f }, Projectile.Center); - - for (int i = 0; i <= 360; i += 3) - { - Vector2 dustspeed = new Vector2(12f, 12f).RotatedBy(MathHelper.ToRadians(i)); - int d = Dust.NewDust(Projectile.Center + (dustspeed * 2), Projectile.width, Projectile.height, DustID.Smoke, dustspeed.X, dustspeed.Y, 200, new Color(232, 251, 250, 200), 1.4f); - Main.dust[d].noGravity = true; - Main.dust[d].position = Projectile.Center; - Main.dust[d].velocity = dustspeed; - } - } - } -} From 715f5bf6385538fac62a5e3d8f1f54d8947e7330 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Wed, 22 May 2024 18:24:49 -0700 Subject: [PATCH 131/177] you can now place lab crates on each other this does NOT make them count as tables for crafting --- Tiles/DraedonStructures/AgedReinforcedCrate.cs | 1 + Tiles/DraedonStructures/ReinforcedCrate.cs | 1 + Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/Tiles/DraedonStructures/AgedReinforcedCrate.cs b/Tiles/DraedonStructures/AgedReinforcedCrate.cs index 6ff4190e16..826777407f 100644 --- a/Tiles/DraedonStructures/AgedReinforcedCrate.cs +++ b/Tiles/DraedonStructures/AgedReinforcedCrate.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Tiles.DraedonStructures Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = false; Main.tileWaterDeath[Type] = false; + Main.tileTable[Type] = true; Main.tileSolidTop[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = false; diff --git a/Tiles/DraedonStructures/ReinforcedCrate.cs b/Tiles/DraedonStructures/ReinforcedCrate.cs index 114871a032..06b9c32ffe 100644 --- a/Tiles/DraedonStructures/ReinforcedCrate.cs +++ b/Tiles/DraedonStructures/ReinforcedCrate.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Tiles.DraedonStructures Main.tileNoAttach[Type] = true; Main.tileLavaDeath[Type] = false; Main.tileWaterDeath[Type] = false; + Main.tileTable[Type] = true; Main.tileSolidTop[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = false; diff --git a/Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs b/Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs index 5c8fa7fa53..6fcdd98125 100644 --- a/Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs +++ b/Tiles/FurnitureAuric/AuricReinforcedCrateTile.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Tiles.FurnitureAuric Main.tileLavaDeath[Type] = false; Main.tileWaterDeath[Type] = false; Main.tileSolidTop[Type] = true; + Main.tileTable[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = false; TileObjectData.addTile(Type); From 05bb27cc032a9482387ba664b296faf2a22a997f Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Thu, 23 May 2024 08:48:21 -0500 Subject: [PATCH 132/177] Desert Scourge vomit spam fix? --- NPCs/DesertScourge/DesertScourgeHead.cs | 47 +++---------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 405b9dbe4b..4cd787ab44 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -258,47 +258,6 @@ namespace CalamityMod.NPCs.DesertScourge turnSpeed *= 1.2f; } - // Projectile spit (unused, for now) - /*if ((phase2 || death) && revenge && NPC.Distance(Main.player[NPC.target].Center) > 400f && (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) - { - if (NPC.Calamity().newAI[0] % (death ? SpitGateValue_Death : SpitGateValue) == 0f) - { - SoundEngine.PlaySound(SoundID.NPCDeath11, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * (masterMode ? 10f : 8f); - int numProj = death ? 9 : 6; - int spread = masterMode ? 49 : 35; - if (masterMode) - { - numProj += 3; - spread += 14; - } - - float rotation = MathHelper.ToRadians(spread); - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - - for (int k = 0; k < 10; k++) - { - int dust = Dust.NewDust(NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, 10, 10, (int)CalamityDusts.SulphurousSeaAcid); - Main.dust[dust].velocity = perturbedSpeed; - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].aiStyle = -1; - Main.projectile[proj].netUpdate = true; - } - } - } - } - }*/ - // Sand splash if (!quickFall) { @@ -591,7 +550,7 @@ namespace CalamityMod.NPCs.DesertScourge float targetDistance = (float)Math.Sqrt((double)(playerX * playerX + targettingPosition * targettingPosition)); // Lunge up towards target - if (burrow && NPC.Center.Y >= burrowTarget - 16f) + if (burrow && NPC.Center.Y >= burrowTarget - 16f && !lungeUpward && !quickFall) { NPC.Calamity().newAI[1] = 1f; NPC.localAI[3] = 0f; @@ -603,7 +562,7 @@ namespace CalamityMod.NPCs.DesertScourge } // Quickly fall back down once above target - if (lungeUpward && NPC.Center.Y <= NPC.Calamity().newAI[3] + LungeUpwardDistanceOffset - LungeUpwardCutoffDistance && Math.Abs(NPC.Center.X - player.Center.X) < 480f) + if (lungeUpward && NPC.Center.Y <= NPC.Calamity().newAI[3] + LungeUpwardDistanceOffset - LungeUpwardCutoffDistance && Math.Abs(NPC.Center.X - player.Center.X) < 480f && !quickFall) { // Spit a huge spread of sand upwards that falls down SoundEngine.PlaySound(SoundID.NPCDeath13, NPC.Center); @@ -656,7 +615,9 @@ namespace CalamityMod.NPCs.DesertScourge { NPC.Calamity().newAI[0] = 0f; NPC.Calamity().newAI[1] = 0f; + NPC.Calamity().newAI[3] = 0f; NPC.localAI[3] = 0f; + playRoarSound = false; } if (hide && !player.dead) From d7d2edb649975b3c7fc99144a20df02b91971b8e Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 23 May 2024 12:02:34 -0400 Subject: [PATCH 133/177] Internally renamed King Slime's jewels --- CalamityLists.cs | 12 ++++++------ DataStructures/NPCStats.cs | 4 ++-- Events/BossRushEvent.cs | 4 ++-- Localization/en-US/Mods.CalamityMod.NPCs.hjson | 4 ++++ ModSupport/WeakReferenceSupport.cs | 6 +++--- NPCs/CalamityGlobalNPC.cs | 2 +- ...ngSlimeJewel3.cs => KingSlimeJewelEmerald.cs} | 2 +- .../{KingSlimeJewel.cs => KingSlimeJewelRuby.cs} | 4 +++- ...gSlimeJewel2.cs => KingSlimeJewelSapphire.cs} | 2 +- NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs | 16 ++++++++-------- Utilities/NPCDebuffs.cs | 6 +++--- 11 files changed, 34 insertions(+), 28 deletions(-) rename NPCs/NormalNPCs/{KingSlimeJewel3.cs => KingSlimeJewelEmerald.cs} (99%) rename NPCs/NormalNPCs/{KingSlimeJewel.cs => KingSlimeJewelRuby.cs} (98%) rename NPCs/NormalNPCs/{KingSlimeJewel2.cs => KingSlimeJewelSapphire.cs} (99%) diff --git a/CalamityLists.cs b/CalamityLists.cs index 0e29515d35..b8ebd102e5 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -901,9 +901,9 @@ namespace CalamityMod enemyImmunityList = new List() { NPCID.KingSlime, - NPCType(), - NPCType(), - NPCType(), + NPCType(), + NPCType(), + NPCType(), NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, @@ -2428,9 +2428,9 @@ namespace CalamityMod { NPCID.UmbrellaSlime, 5400 }, { NPCID.RainbowSlime, 30000 }, { NPCID.Pinky, 15000 }, - { NPCType(), 21000 }, - { NPCType(), 18000 }, - { NPCType(), 24000 }, + { NPCType(), 21000 }, + { NPCType(), 18000 }, + { NPCType(), 24000 }, { NPCID.EyeofCthulhu, 450000 }, // 30 seconds { NPCID.ServantofCthulhu, 6000 }, diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs index 70bc44c14e..0aec9726b2 100644 --- a/DataStructures/NPCStats.cs +++ b/DataStructures/NPCStats.cs @@ -295,7 +295,7 @@ namespace CalamityMod EnemyStats.ContactDamageValues = new SortedDictionary { { NPCID.KingSlime, new int[] { 40, 64, 80, 96, 144 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 76, 114 } }, + { ModContent.NPCType(), new int[] { 30, 44, 60, 76, 114 } }, { ModContent.NPCType(), new int[] { 45, 66, 88, 110, 165 } }, { ModContent.NPCType(), new int[] { 24, 32, 40, 48, 72 } }, @@ -561,7 +561,7 @@ namespace CalamityMod EnemyStats.ProjectileDamageValues = new SortedDictionary, int[]> { - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 6da1815a4d..5c8491e682 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -150,8 +150,8 @@ namespace CalamityMod.Events DownedBossSystem.startedBossRushAtLeastOnce = true; }, permittedNPCs: new int[] { NPCID.BlueSlime, NPCID.YellowSlime, NPCID.PurpleSlime, NPCID.RedSlime, NPCID.GreenSlime, NPCID.RedSlime, - NPCID.IceSlime, NPCID.UmbrellaSlime, NPCID.Pinky, NPCID.SlimeSpiked, NPCID.RainbowSlime, ModContent.NPCType(), - ModContent.NPCType(), ModContent.NPCType() }), + NPCID.IceSlime, NPCID.UmbrellaSlime, NPCID.Pinky, NPCID.SlimeSpiked, NPCID.RainbowSlime, ModContent.NPCType(), + ModContent.NPCType(), ModContent.NPCType() }), new Boss(ModContent.NPCType(), spawnContext: type => { diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 1d7421b644..42d943f37f 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -623,3 +623,7 @@ WITCH: { Princess_LovesNPC: "{NPCName} is always lonely, it's why I want to hang out with her, no one should be left alone like that!" } } + +KingSlimeJewelEmerald.DisplayName: King Slime Jewel Emerald +KingSlimeJewelRuby.DisplayName: King Slime Jewel Ruby +KingSlimeJewelSapphire.DisplayName: King Slime Jewel Sapphire diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 086ae693e4..16293e26d9 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -296,9 +296,9 @@ namespace CalamityMod // Enemies EnemyRedirect(NPCType(), "Hive (enemy)"); - EnemyRedirect(NPCType(), "Ruby Jewel (enemy)"); - EnemyRedirect(NPCType(), "Sapphire Jewel (enemy)"); - EnemyRedirect(NPCType(), "Emerald Jewel (enemy)"); + EnemyRedirect(NPCType(), "Crown Jewels"); + EnemyRedirect(NPCType(), "Crown Jewels"); + EnemyRedirect(NPCType(), "Crown Jewels"); EnemyRedirect(NPCType(), "Tooth Ball (Old Duke)"); EnemyRedirect(NPCType(), "Enchantment"); EnemyRedirect(NPCType(), "%3F%3F%3F"); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 5cb59af057..3ae1aabefa 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -6474,7 +6474,7 @@ namespace CalamityMod.NPCs return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); if (npc.type == NPCID.KingSlime && Main.masterMode && CalamityWorld.revenge) - return NPC.AnyNPCs(ModContent.NPCType()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null; + return NPC.AnyNPCs(ModContent.NPCType()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null; if (npc.type == NPCID.QueenBee && Main.zenithWorld) { diff --git a/NPCs/NormalNPCs/KingSlimeJewel3.cs b/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs similarity index 99% rename from NPCs/NormalNPCs/KingSlimeJewel3.cs rename to NPCs/NormalNPCs/KingSlimeJewelEmerald.cs index 531da13e74..5d5160792f 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel3.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class KingSlimeJewel3 : ModNPC + public class KingSlimeJewelEmerald : ModNPC { public override string Texture => "CalamityMod/NPCs/NormalNPCs/KingSlimeJewel"; diff --git a/NPCs/NormalNPCs/KingSlimeJewel.cs b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs similarity index 98% rename from NPCs/NormalNPCs/KingSlimeJewel.cs rename to NPCs/NormalNPCs/KingSlimeJewelRuby.cs index c9eb84f9d6..327d1d0054 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs @@ -10,8 +10,10 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class KingSlimeJewel : ModNPC + public class KingSlimeJewelRuby : ModNPC { + public override string Texture => "CalamityMod/NPCs/NormalNPCs/KingSlimeJewel"; + private const int BoltShootGateValue = 60; private const int BoltShootGateValue_Death = 75; private const int BoltShootGateValue_BossRush = 45; diff --git a/NPCs/NormalNPCs/KingSlimeJewel2.cs b/NPCs/NormalNPCs/KingSlimeJewelSapphire.cs similarity index 99% rename from NPCs/NormalNPCs/KingSlimeJewel2.cs rename to NPCs/NormalNPCs/KingSlimeJewelSapphire.cs index 254ef1471e..a41db05782 100644 --- a/NPCs/NormalNPCs/KingSlimeJewel2.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelSapphire.cs @@ -11,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { - public class KingSlimeJewel2 : ModNPC + public class KingSlimeJewelSapphire : ModNPC { public override string Texture => "CalamityMod/NPCs/NormalNPCs/KingSlimeJewel"; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index c0555e7cae..15bd1a8e83 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -61,16 +61,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (spawnGreenCrystal) { if (masterMode) - greenCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); + greenCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); } if (phase3) - crystalAlive = NPC.AnyNPCs(ModContent.NPCType()); + crystalAlive = NPC.AnyNPCs(ModContent.NPCType()); if (spawnBlueCrystal) { if (masterMode) - blueCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); + blueCrystalAlive = NPC.AnyNPCs(ModContent.NPCType()); } // Sapphire Crystal buffs @@ -109,7 +109,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item38, vector); if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); } if (phase3 && npc.Calamity().newAI[0] == 1f) @@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item38, vector); if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); } if (spawnBlueCrystal && npc.Calamity().newAI[0] == 2f) @@ -157,7 +157,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item38, vector); if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); } } else @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item38, vector); if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); } } @@ -340,7 +340,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < Main.maxNPCs; i++) { NPC blueCrystal = Main.npc[i]; - if (blueCrystal.active && blueCrystal.type == ModContent.NPCType()) + if (blueCrystal.active && blueCrystal.type == ModContent.NPCType()) { blueCrystal.position.X = npc.position.X; blueCrystal.position.Y = npc.position.Y - 200f; diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index c66dbc74d2..ff965a1105 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -168,9 +168,9 @@ namespace CalamityMod // Is this sorted... like... at all?? EnemyStats.DebuffImmunities = new SortedDictionary> { - { ModContent.NPCType(), immuneToEverything }, - { ModContent.NPCType(), immuneToEverything }, - { ModContent.NPCType(), immuneToEverything }, + { ModContent.NPCType(), immuneToEverything }, + { ModContent.NPCType(), immuneToEverything }, + { ModContent.NPCType(), immuneToEverything }, { NPCID.Deerclops, ice }, From 04245b6e3b5d7cd39316b0b1bd4dc5a949f620cd Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 23 May 2024 12:04:49 -0400 Subject: [PATCH 134/177] Slightly decreased the Craw Carapace buff --- CalPlayer/CalamityPlayerHitHurt.cs | 2 +- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 5dce1a0a3e..fe44174ba9 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1172,7 +1172,7 @@ namespace CalamityMod.CalPlayer if (crawCarapace) { npc.AddBuff(ModContent.BuffType(), 900); - int onHitDamage = Player.CalcIntDamage(50); + int onHitDamage = Player.CalcIntDamage(40); Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center); } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 0a1bbeb77e..4209e88ed4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2581,7 +2581,7 @@ namespace CalamityMod.CalPlayer } if (crawCarapace) - Player.GetDamage() += 0.08f; + Player.GetDamage() += 0.07f; if (baroclaw) { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 522ee30e39..0e08965505 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -428,7 +428,7 @@ CrawCarapace: { DisplayName: Craw Carapace Tooltip: ''' - 8% increased damage + 7% increased damage Enemies that hit you take damage and are inflicted with Crumbling ''' } From 749b18cfd05cb6ac17329a8413cf0e6ce3f2410e Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 23 May 2024 15:05:37 -0400 Subject: [PATCH 135/177] Clock Gatlignum resprite --- Items/Weapons/Ranged/ClockGatlignum.cs | 2 +- Items/Weapons/Ranged/ClockGatlignum.png | Bin 1071 -> 1214 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/ClockGatlignum.cs b/Items/Weapons/Ranged/ClockGatlignum.cs index 47e81821e0..4e4c895e55 100644 --- a/Items/Weapons/Ranged/ClockGatlignum.cs +++ b/Items/Weapons/Ranged/ClockGatlignum.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/ClockGatlignum.png b/Items/Weapons/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)f}e_Jh(`86bWS0|+}JzX4TPWMDbUnaltH002ovPDHLkV1lRi=N13} From 0c2fdd85c5400f53fd9e3535d27864c3c8256c2f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 23 May 2024 23:21:10 -0400 Subject: [PATCH 136/177] Desert Nuisances can no longer pick up money --- NPCs/DesertScourge/DesertNuisanceBody.cs | 1 + NPCs/DesertScourge/DesertNuisanceBodyYoung.cs | 1 + NPCs/DesertScourge/DesertNuisanceHead.cs | 1 + NPCs/DesertScourge/DesertNuisanceHeadYoung.cs | 1 + NPCs/DesertScourge/DesertNuisanceTail.cs | 1 + NPCs/DesertScourge/DesertNuisanceTailYoung.cs | 1 + 6 files changed, 6 insertions(+) diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index d61794d229..3498f8fe14 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.DesertScourge BodyTexture3 = ModContent.Request(Texture + "3", AssetRequestMode.AsyncLoad); BodyTexture4 = ModContent.Request(Texture + "4", AssetRequestMode.AsyncLoad); } + NPCID.Sets.CantTakeLunchMoney[Type] = true; } public override void SetDefaults() diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index c1086817cc..5e9f85ba16 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.DesertScourge BodyTexture3 = ModContent.Request(Texture + "3", AssetRequestMode.AsyncLoad); BodyTexture4 = ModContent.Request(Texture + "4", AssetRequestMode.AsyncLoad); } + NPCID.Sets.CantTakeLunchMoney[Type] = true; } public override void SetDefaults() diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index c9ce5c9e75..71e547d8f9 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -45,6 +45,7 @@ namespace CalamityMod.NPCs.DesertScourge value.Position.Y += 30; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; NPCID.Sets.MPAllowedEnemies[Type] = true; + NPCID.Sets.CantTakeLunchMoney[Type] = true; } public override void SetDefaults() diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index c428a92aa0..e984be408c 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -37,6 +37,7 @@ namespace CalamityMod.NPCs.DesertScourge Main.npcFrameCount[NPC.type] = 7; this.HideFromBestiary(); NPCID.Sets.MPAllowedEnemies[Type] = true; + NPCID.Sets.CantTakeLunchMoney[Type] = true; } public override void SetDefaults() diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index 860e56f7b0..709710af2f 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -15,6 +15,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetStaticDefaults() { this.HideFromBestiary(); + NPCID.Sets.CantTakeLunchMoney[Type] = true; } public override void SetDefaults() diff --git a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs index df82733592..c2b49d23c3 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -15,6 +15,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetStaticDefaults() { this.HideFromBestiary(); + NPCID.Sets.CantTakeLunchMoney[Type] = true; } public override void SetDefaults() From 6eb4c587981d14b2f2629baf8e84e5eac31537f2 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 24 May 2024 02:54:37 -0500 Subject: [PATCH 137/177] Rev+ Eye of Cthulhu cannot do its horizontal charge unless it is within a 10 block radius of its charge position, it also increases its velocity to move to that position if it's taking too long to reach it. --- .../Bosses/EyeOfCthulhuAI.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index 535d6b48c8..ef469adf25 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -736,6 +736,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float accelerationBoost = death ? 0.425f * (phase3LifeRatio - lifeRatio) : 0.125f * (phase3LifeRatio - lifeRatio); float hoverSpeed = 8f + speedBoost; float hoverAcceleration = 0.25f + accelerationBoost; + + bool horizontalCharge = calamityGlobalNPC.newAI[0] == 1f || calamityGlobalNPC.newAI[0] == 3f; + float timeGateValue = horizontalCharge ? (100f - (death ? 80f * (phase3LifeRatio - lifeRatio) : 0f)) : (85f - (death ? 70f * (phase3LifeRatio - lifeRatio) : 0f)); + if (npc.ai[2] > timeGateValue) + { + float velocityScalar = npc.ai[2] - timeGateValue; + hoverSpeed += velocityScalar * 0.05f; + hoverAcceleration += velocityScalar * 0.0025f; + } + hoverSpeed += enrageScale * 4f; hoverAcceleration += enrageScale * 0.125f; @@ -744,7 +754,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lineUpChargeTargetY = Main.player[npc.target].Center.Y + offset - eyeLineUpChargeDirection.Y; Vector2 hoverDestination = Main.player[npc.target].Center + Vector2.UnitY * offset; - bool horizontalCharge = calamityGlobalNPC.newAI[0] == 1f || calamityGlobalNPC.newAI[0] == 3f; if (horizontalCharge) { float horizontalChargeOffset = death ? 450f : 500f; @@ -757,7 +766,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 idealHoverVelocity = npc.SafeDirectionTo(hoverDestination) * hoverSpeed; npc.SimpleFlyMovement(idealHoverVelocity, hoverAcceleration); - float timeGateValue = horizontalCharge ? (100f - (death ? 80f * (phase3LifeRatio - lifeRatio) : 0f)) : (85f - (death ? 70f * (phase3LifeRatio - lifeRatio) : 0f)); float servantSpawnGateValue = horizontalCharge ? (death ? 23f : 35f) : (death ? 17f : 27f); float maxServantSpawnsPerAttack = 2f; @@ -837,7 +845,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (npc.ai[2] >= timeGateValue) + float requiredDistanceForHorizontalCharge = 160f; + if (npc.ai[2] >= timeGateValue && (npc.Distance(hoverDestination) < requiredDistanceForHorizontalCharge || !horizontalCharge)) { switch ((int)calamityGlobalNPC.newAI[0]) { From e53a27660b5aa6f7b47c6db4aab5ea52b6b7c3f9 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 24 May 2024 03:00:42 -0500 Subject: [PATCH 138/177] Cut Blood Nautilus Shot projectile blood trail distance in half. --- Projectiles/CalamityGlobalProjectile.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 0cb47d3729..27d65eacbf 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -603,7 +603,8 @@ namespace CalamityMod.Projectiles blood2.scale = 1.2f; blood2.position = projectile.Center + Main.rand.NextFloat() * projectile.velocity * 2f; - for (int j = 1; j < projectile.oldPos.Length && !(projectile.oldPos[j] == Vector2.Zero); j++) + int trailLength = projectile.oldPos.Length / 2; + for (int j = 1; j < trailLength && !(projectile.oldPos[j] == Vector2.Zero); j++) { if (Main.rand.NextBool(3)) { From 26b99c61f4cc8dcf67cef414c3c460ba13ef5242 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 24 May 2024 03:02:35 -0500 Subject: [PATCH 139/177] Made Bloodletting Servants a bit lighter in terms of their base draw color and their charge telegraph. --- NPCs/NormalNPCs/BloodlettingServant.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/NormalNPCs/BloodlettingServant.cs b/NPCs/NormalNPCs/BloodlettingServant.cs index 3ec7e710f1..879a389f03 100644 --- a/NPCs/NormalNPCs/BloodlettingServant.cs +++ b/NPCs/NormalNPCs/BloodlettingServant.cs @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Texture2D npcTexture = TextureAssets.Npc[NPC.type].Value; Color originalColor = NPC.GetAlpha(drawColor); - Color newColor = new Color(255, 128, 128, 255 - NPC.alpha); + Color newColor = new Color(255, 192, 192, 255 - NPC.alpha); Vector2 drawPosition = NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY); Vector2 origin = NPC.frame.Size() / 2; @@ -284,7 +284,7 @@ namespace CalamityMod.NPCs.NormalNPCs return true; } - public override Color? GetAlpha(Color drawColor) => new Color(128, 0, 0, 255 - NPC.alpha); + public override Color? GetAlpha(Color drawColor) => new Color(192, 0, 0, 255 - NPC.alpha); public override void HitEffect(NPC.HitInfo hit) { From 2dd311a1adb940932422451c72939c54244bf34e Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 24 May 2024 03:15:47 -0500 Subject: [PATCH 140/177] Fixed an Eye of Cthulhu blood shot damage issue. --- NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index ef469adf25..3c41eb2737 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -481,13 +481,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.BloodNautilusShot; + int damage = npc.GetProjectileDamage(type); int numProj = masterMode ? Main.rand.Next(4, 6) : 3; int spread = masterMode ? numProj * 3 : 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, 15, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; } } From 0bfe9a1802a4490ad7cc9dfaf48185ca11660929 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Fri, 24 May 2024 05:30:36 -0500 Subject: [PATCH 141/177] Adjusted Brain of Cthulhu Creeper aggression scaling to take enrage into account, this makes them far less aggressive while in the underground crimson. --- .../Bosses/BrainOfCthulhuAI.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index 78bf26e4cb..e8c7ecd7a2 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -874,11 +874,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); - float enrageScale = bossRush ? 1.5f : masterMode ? 0.5f : 0f; - if ((npc.position.Y / 16f) < Main.worldSurface || bossRush) + float enrageScaleMax = 2f; + float enrageScale = bossRush ? enrageScaleMax : masterMode ? 0.5f : 0f; + if ((npc.position.Y / 16f) < Main.worldSurface) enrageScale += 0.5f; - if (!Main.player[npc.target].ZoneCrimson || bossRush) - enrageScale += 2f; + if (!Main.player[npc.target].ZoneCrimson) + enrageScale += 1f; + + if (enrageScale > enrageScaleMax) + enrageScale = enrageScaleMax; bool brainIsNotTeleportingOrCharging = Main.npc[NPC.crimsonBoss].ai[0] == 0f || Main.npc[NPC.crimsonBoss].ai[0] == -1f || Main.npc[NPC.crimsonBoss].ai[0] == -6f; bool brainIsInPhase2 = Main.npc[NPC.crimsonBoss].ai[0] < 0f; @@ -901,7 +905,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses creeperRatio = creeperCount / (float)GetBrainOfCthuluCreepersCountRevDeath(); // Scale the aggressiveness of the charges with amount of Creepers remaining - float chargeAggressionScale = creeperRatio <= 0.1f ? 3.5f : creeperRatio <= 0.2f ? 2.5f : creeperRatio <= 0.4f ? 1.75f : creeperRatio <= 0.6f ? 1f : creeperRatio <= 0.8f ? 0.5f : 0f; + float chargeAggressionScale = creeperRatio <= 0.1f ? 1.75f : creeperRatio <= 0.2f ? 1.25f : creeperRatio <= 0.4f ? 0.875f : creeperRatio <= 0.6f ? 0.5f : creeperRatio <= 0.8f ? 0.25f : 0f; + if (enrageScale > 0f) + chargeAggressionScale *= 1f + enrageScale; if (death) chargeAggressionScale *= 1.25f; From 82c1492c406f79c01bfff17c017b56c3a2bdec05 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 25 May 2024 02:45:39 +0700 Subject: [PATCH 142/177] profaned shard tooltip update --- Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson | 1 - 1 file changed, 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 09de1c4991..3d32178f39 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -231,7 +231,6 @@ ProfanedShard: { Tooltip: ''' [SPAWN] - Enrage when not in the Hallow or Underworld Not consumable 'Her Guardians seek the holder of such vast stolen power.' ''' From 86994e8cf25d8fdd19360040ad226a76edcbc2ae Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 24 May 2024 16:11:15 -0400 Subject: [PATCH 143/177] Some post-Plantera gun + ammo balancing Call me a dryad the way Dryad's Tear balancing makes me cry --- Items/Ammo/DryadsTear.cs | 2 +- Items/CalamityGlobalItemTweaks.cs | 6 +++--- Projectiles/Ranged/DryadsTearMain.cs | 5 +---- Projectiles/Ranged/DryadsTearSplit.cs | 1 + 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Items/Ammo/DryadsTear.cs b/Items/Ammo/DryadsTear.cs index 657029031b..24866b5488 100644 --- a/Items/Ammo/DryadsTear.cs +++ b/Items/Ammo/DryadsTear.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 8; Item.height = 8; - Item.damage = 8; + Item.damage = 10; Item.DamageType = DamageClass.Ranged; Item.maxStack = 9999; Item.consumable = true; diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 33eba91d0c..9c5b58366e 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -225,6 +225,7 @@ namespace CalamityMod.Items { ItemID.SkyFracture, Do(DamageExact(54), ShootSpeedExact(30f)) }, { ItemID.SlapHand, Do(UseTurn, DamageExact(120)) }, { ItemID.Smolstar, Do(DamageExact(9), AutoReuse, UseExact(25)) }, // Blade Staff + { ItemID.SniperRifle, Do(PointBlank, DamageExact(215)) }, { ItemID.SolarEruption, Do(DamageExact(157)) }, { ItemID.SoulDrain, Do(DamageExact(38)) }, // Life Drain { ItemID.SpaceGun, Do(DamageExact(25)) }, @@ -238,7 +239,7 @@ namespace CalamityMod.Items { ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(18)) }, // Stylish Scissors { ItemID.Stynger, Do(DamageExact(75)) }, { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, - { ItemID.TacticalShotgun, Do(PointBlank, DamageExact(34)) }, + { ItemID.TacticalShotgun, Do(PointBlank, DamageExact(41)) }, { ItemID.TaxCollectorsStickOfDoom, Do(AutoReuse, UseTurn, UseRatio(0.8f), DamageExact(70)) }, // Classy Cane { ItemID.TendonBow, Do(PointBlank, DamageExact(17), AutoReuse) }, { ItemID.TerraBlade, Do(DamageExact(122)) }, @@ -267,6 +268,7 @@ namespace CalamityMod.Items { ItemID.VampireKnives, Do(DamageExact(38)) }, { ItemID.ValkyrieYoyo, Do(AutoReuse, DamageExact(48)) }, // Red's Throw and Valkyrie Yoyo have the same stats { ItemID.VenomStaff, Do(DamageExact(55)) }, + { ItemID.VenusMagnum, Do(PointBlank, DamageExact(65)) }, { ItemID.WaspGun, Do(UseExact(11), DamageExact(58)) }, { ItemID.WaterBolt, Do(DamageExact(23)) }, { ItemID.WhitePhaseblade, Do(AutoReuse, UseTurn, DamageExact(32)) }, @@ -456,13 +458,11 @@ namespace CalamityMod.Items { ItemID.RichMahoganyBow, pointBlank }, { ItemID.ShadewoodBow, pointBlank }, { ItemID.SilverBow, pointBlank }, - { ItemID.SniperRifle, pointBlank }, { ItemID.SnowballCannon, pointBlank }, { ItemID.StakeLauncher, pointBlank }, { ItemID.TinBow, pointBlank }, { ItemID.TungstenBow, pointBlank }, { ItemID.Uzi, pointBlank }, - { ItemID.VenusMagnum, pointBlank }, { ItemID.VortexBeater, pointBlank }, { ItemID.WoodenBow, pointBlank }, #endregion diff --git a/Projectiles/Ranged/DryadsTearMain.cs b/Projectiles/Ranged/DryadsTearMain.cs index 8c6d8cf7a7..2002b27fe6 100644 --- a/Projectiles/Ranged/DryadsTearMain.cs +++ b/Projectiles/Ranged/DryadsTearMain.cs @@ -34,9 +34,6 @@ namespace CalamityMod.Projectiles.Ranged { Lighting.AddLight(Projectile.Center, Color.LimeGreen.ToVector3() * 0.25f); - if (Projectile.localAI[0] == 0f) - Projectile.damage = (int)(Projectile.damage * 0.75f); - Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { @@ -63,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged for (int b = 0; b < 2; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4), 0f, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, 0f); } for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Ranged/DryadsTearSplit.cs b/Projectiles/Ranged/DryadsTearSplit.cs index 92d247019b..6b712b70a2 100644 --- a/Projectiles/Ranged/DryadsTearSplit.cs +++ b/Projectiles/Ranged/DryadsTearSplit.cs @@ -27,6 +27,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.timeLeft = 210; Projectile.extraUpdates = 1; Projectile.tileCollide = false; + Projectile.ArmorPenetration = 10; AIType = ProjectileID.Bullet; } From 5c4143c5953d8c2b5fa2be585851f1256f0b4728 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 24 May 2024 16:12:19 -0400 Subject: [PATCH 144/177] Updated Dryad's Tear tooltip --- Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index ee6be6c217..35b9c32329 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -50,6 +50,11 @@ CinderArrow: { Tooltip: Explosive arrows that burst into weak flaming shards that inflict Brimstone Flames } +DryadsTear: { + DisplayName: Dryad's Tear + Tooltip: Splits into homing nature shards on impact which ignore enemy defense +} + ElysianArrow: { DisplayName: Elysian Arrow Tooltip: @@ -159,11 +164,6 @@ SproutingArrow: { ''' } -DryadsTear: { - DisplayName: Dryad's Tear - Tooltip: Explodes and splits into homing nature shards on impact -} - VanquisherArrow: { DisplayName: Vanquisher Arrow Tooltip: From 5a52bb0c63935c55d3316871a29d1705eeeff386 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 25 May 2024 03:26:30 +0700 Subject: [PATCH 145/177] unified guardians boss bar --- .../ProfanedGuardianCommander.cs | 2 + UI/VanillaBossBars/ProfanedGuardianBossBar.cs | 60 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 UI/VanillaBossBars/ProfanedGuardianBossBar.cs diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index a4279922e8..d9682a401f 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -13,6 +13,7 @@ using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Typeless; using CalamityMod.Projectiles.Boss; +using CalamityMod.UI.VanillaBossBars; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -81,6 +82,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.noTileCollide = true; AIType = -1; NPC.boss = true; + NPC.BossBar = ModContent.GetInstance(); NPC.value = Item.buyPrice(1, 0, 0, 0); NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; diff --git a/UI/VanillaBossBars/ProfanedGuardianBossBar.cs b/UI/VanillaBossBars/ProfanedGuardianBossBar.cs new file mode 100644 index 0000000000..35afbb34b6 --- /dev/null +++ b/UI/VanillaBossBars/ProfanedGuardianBossBar.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using CalamityMod.NPCs.ProfanedGuardians; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent; +using Terraria.GameContent.UI.BigProgressBar; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.UI.VanillaBossBars +{ + public class ProfanedGuardianBossBar : ModBossBar + { + // Used to determine the max health of a multi-segmented boss + public NPC FalseNPCSegment; + + public override Asset GetIconTexture(ref Rectangle? iconFrame) + { + // Icons are based on whoever should die first + if (NPC.AnyNPCs(NPCType())) + return TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[NPCType()]]; + + if (NPC.AnyNPCs(NPCType())) + return TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[NPCType()]]; + + return TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[NPCType()]]; + } + + public override bool? ModifyInfo(ref BigProgressBarInfo info, ref float life, ref float lifeMax, ref float shield, ref float shieldMax) + { + NPC target = Main.npc[info.npcIndexToAimAt]; + + if (!target.active) + return false; + + // Get the commander's health + life = target.life; + lifeMax = target.lifeMax; + + // Add max health by feeding the data of false NPCs + FalseNPCSegment = new NPC(); + FalseNPCSegment.SetDefaults(NPCType(), target.GetMatchingSpawnParams()); + lifeMax += FalseNPCSegment.lifeMax; + FalseNPCSegment.SetDefaults(NPCType(), target.GetMatchingSpawnParams()); + lifeMax += FalseNPCSegment.lifeMax; + + // Determine the current health of all guardians + foreach (NPC guardian in Main.ActiveNPCs) + { + if (guardian.type == NPCType() || guardian.type == NPCType()) + life += guardian.life; + } + return true; + } + } +} From 0694d1fd32fc0563d7b2a98847c2ef8ed131949a Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 25 May 2024 04:55:39 +0700 Subject: [PATCH 146/177] quickfire suggestions also fixed sorting priorities AGAIN urngiudrgnju --- Items/Fishing/EnchantedStarfish.cs | 3 ++- Items/SummonItems/AstralChunk.cs | 2 +- Items/SummonItems/CharredIdol.cs | 2 +- Items/SummonItems/CryoKey.cs | 2 +- Items/SummonItems/EyeofDesolation.cs | 2 +- Items/SummonItems/OldPowerCell.cs | 2 +- Items/SummonItems/Portabulb.cs | 2 +- Items/SummonItems/SandstormsCore.cs | 2 +- Items/SummonItems/Seafood.cs | 2 +- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 3 +-- Projectiles/Healing/ManaPolarizerHealOrb.cs | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Items/Fishing/EnchantedStarfish.cs b/Items/Fishing/EnchantedStarfish.cs index 2109fcecc4..8102c4c1c9 100644 --- a/Items/Fishing/EnchantedStarfish.cs +++ b/Items/Fishing/EnchantedStarfish.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.Fishing Item.ResearchUnlockCount = 10; ItemID.Sets.CanBePlacedOnWeaponRacks[Item.type] = true; // For some reason Life/Mana boosting items are in this set (along with Magic Mirror+) - ItemID.Sets.SortingPriorityBossSpawns[Type] = 19; // Mana Crystal + ItemID.Sets.SortingPriorityBossSpawns[Type] = 21; // Mana Crystal + ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.ArcaneCrystal; } public override void SetDefaults() diff --git a/Items/SummonItems/AstralChunk.cs b/Items/SummonItems/AstralChunk.cs index c5094efa77..4a0116a906 100644 --- a/Items/SummonItems/AstralChunk.cs +++ b/Items/SummonItems/AstralChunk.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.SummonItems public new string LocalizationCategory => "Items.SummonItems"; public override void SetStaticDefaults() { - ItemID.Sets.SortingPriorityBossSpawns[Type] = 14; // Frost Moon + ItemID.Sets.SortingPriorityBossSpawns[Type] = 12; // Truffle Worm } public override void SetDefaults() diff --git a/Items/SummonItems/CharredIdol.cs b/Items/SummonItems/CharredIdol.cs index 69c33b9bfc..152bac38b9 100644 --- a/Items/SummonItems/CharredIdol.cs +++ b/Items/SummonItems/CharredIdol.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.SummonItems public new string LocalizationCategory => "Items.SummonItems"; public override void SetStaticDefaults() { - ItemID.Sets.SortingPriorityBossSpawns[Type] = 9; // Mechanical Skull + ItemID.Sets.SortingPriorityBossSpawns[Type] = 10; // Mechanical Skull } public override void SetDefaults() diff --git a/Items/SummonItems/CryoKey.cs b/Items/SummonItems/CryoKey.cs index 6fee06e1f8..a128adc1a4 100644 --- a/Items/SummonItems/CryoKey.cs +++ b/Items/SummonItems/CryoKey.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.SummonItems public new string LocalizationCategory => "Items.SummonItems"; public override void SetStaticDefaults() { - ItemID.Sets.SortingPriorityBossSpawns[Type] = 7; // Mechanical Eye + ItemID.Sets.SortingPriorityBossSpawns[Type] = 7; // Ocram's Razor (1 below Mechanical Eye) } public override void SetDefaults() diff --git a/Items/SummonItems/EyeofDesolation.cs b/Items/SummonItems/EyeofDesolation.cs index 7e66341a3c..f8e683b1bf 100644 --- a/Items/SummonItems/EyeofDesolation.cs +++ b/Items/SummonItems/EyeofDesolation.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.SummonItems public int spawnYAdd = 0; public override void SetStaticDefaults() { - ItemID.Sets.SortingPriorityBossSpawns[Type] = 10; // Pirate Map + ItemID.Sets.SortingPriorityBossSpawns[Type] = 11; // Pirate Map (1 above Mechanical Skull) } public override void SetDefaults() diff --git a/Items/SummonItems/OldPowerCell.cs b/Items/SummonItems/OldPowerCell.cs index 29ac9bf111..02c26ef26e 100644 --- a/Items/SummonItems/OldPowerCell.cs +++ b/Items/SummonItems/OldPowerCell.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { NPCID.Sets.MPAllowedEnemies[NPCID.Golem] = true; - ItemID.Sets.SortingPriorityBossSpawns[Type] = 15; // Lihzahrd Power Cell + ItemID.Sets.SortingPriorityBossSpawns[Type] = 16; // Lihzahrd Power Cell } public override void SetDefaults() diff --git a/Items/SummonItems/Portabulb.cs b/Items/SummonItems/Portabulb.cs index 0217cd7379..2f239988b5 100644 --- a/Items/SummonItems/Portabulb.cs +++ b/Items/SummonItems/Portabulb.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { NPCID.Sets.MPAllowedEnemies[NPCID.Plantera] = true; - ItemID.Sets.SortingPriorityBossSpawns[Type] = 11; // Truffle Worm + ItemID.Sets.SortingPriorityBossSpawns[Type] = 11; // Pirate Map (1 above Mechanical Skull) } public override void SetDefaults() diff --git a/Items/SummonItems/SandstormsCore.cs b/Items/SummonItems/SandstormsCore.cs index 1426db53d5..32dba4f830 100644 --- a/Items/SummonItems/SandstormsCore.cs +++ b/Items/SummonItems/SandstormsCore.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.SummonItems public new string LocalizationCategory => "Items.SummonItems"; public override void SetStaticDefaults() { - ItemID.Sets.SortingPriorityBossSpawns[Type] = 12; // Frost Legion + ItemID.Sets.SortingPriorityBossSpawns[Type] = 13; // Frost Legion } public override void SetDefaults() diff --git a/Items/SummonItems/Seafood.cs b/Items/SummonItems/Seafood.cs index f6618275c1..4d780eb9e0 100644 --- a/Items/SummonItems/Seafood.cs +++ b/Items/SummonItems/Seafood.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.SummonItems public new string LocalizationCategory => "Items.SummonItems"; public override void SetStaticDefaults() { - ItemID.Sets.SortingPriorityBossSpawns[Type] = 8; // Mechanical Worm + ItemID.Sets.SortingPriorityBossSpawns[Type] = 9; // Mechanical Worm } public override void SetDefaults() diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 0e08965505..a2f6e3f0a6 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -1064,8 +1064,7 @@ ManaPolarizer: { ''' Increases max mana by 50 and magic damage by 6% -1.5 HP/s life regen if mana is above 50% of its maximum - Grants spectre healing, the amount healed scales with your mana - The healing only works while holding a magic weapon + Magic projectiles give lifesteal while holding a magic weapon The more mana you have, the more you heal ''' } diff --git a/Projectiles/Healing/ManaPolarizerHealOrb.cs b/Projectiles/Healing/ManaPolarizerHealOrb.cs index 373c1b9518..c2dbdacf55 100644 --- a/Projectiles/Healing/ManaPolarizerHealOrb.cs +++ b/Projectiles/Healing/ManaPolarizerHealOrb.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Healing public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 3f, 15f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 4f, 15f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.SpectreStaff, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; From 8b6be9e6bce3f453e4fe3128c260d1bb2dd119fc Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Sat, 25 May 2024 05:42:51 +0700 Subject: [PATCH 147/177] some gun offsets --- Items/Weapons/Ranged/ClockGatlignum.cs | 2 +- Items/Weapons/Ranged/FrostbiteBlaster.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/ClockGatlignum.cs b/Items/Weapons/Ranged/ClockGatlignum.cs index 4e4c895e55..422f865ff1 100644 --- a/Items/Weapons/Ranged/ClockGatlignum.cs +++ b/Items/Weapons/Ranged/ClockGatlignum.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + public override Vector2? HoldoutOffset() => new Vector2(-14, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/FrostbiteBlaster.cs b/Items/Weapons/Ranged/FrostbiteBlaster.cs index 470c62ed7a..38f5f1dca7 100644 --- a/Items/Weapons/Ranged/FrostbiteBlaster.cs +++ b/Items/Weapons/Ranged/FrostbiteBlaster.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } + public override Vector2? HoldoutOffset() => new Vector2(-14, 0); + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { SoundEngine.PlaySound(SoundID.Item36, position); From 9ef6d056342074dce12a9c8d67487437eca50d1b Mon Sep 17 00:00:00 2001 From: mochi-angel Date: Fri, 24 May 2024 22:49:49 -0700 Subject: [PATCH 148/177] Harvest Staff buff --- Items/Weapons/Summon/HarvestStaff.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Summon/HarvestStaff.cs b/Items/Weapons/Summon/HarvestStaff.cs index f16756177b..96da01b29c 100644 --- a/Items/Weapons/Summon/HarvestStaff.cs +++ b/Items/Weapons/Summon/HarvestStaff.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - Item.damage = 26; + Item.damage = 27; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); Item.knockBack = 5f; From efb4ded73a9077bfa4f76119405d8cfcc8977173 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 25 May 2024 01:59:09 -0400 Subject: [PATCH 149/177] Post-Golem gun + ammo balancing --- Items/Ammo/HyperiusBullet.cs | 2 +- Items/Weapons/Ranged/Leviatitan.cs | 6 +++--- Items/Weapons/Ranged/RealmRavager.cs | 8 ++++---- Projectiles/Ranged/HailstormBulletProj.cs | 4 ++-- Projectiles/Ranged/HyperiusBulletProj.cs | 4 ++-- Projectiles/Ranged/RealmRavagerBullet.cs | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Items/Ammo/HyperiusBullet.cs b/Items/Ammo/HyperiusBullet.cs index 39653cceb2..6812c127eb 100644 --- a/Items/Ammo/HyperiusBullet.cs +++ b/Items/Ammo/HyperiusBullet.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Ammo { public new string LocalizationCategory => "Items.Ammo"; - public static int SplitBulletBonusDamage = 10; + public static int SplitBulletBonusDamage = 16; public override void SetStaticDefaults() { diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 2e83fff9d7..2130046725 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -14,10 +14,10 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 82; Item.height = 28; - Item.damage = 80; + Item.damage = 77; Item.DamageType = DamageClass.Ranged; - Item.useTime = 9; - Item.useAnimation = 9; + Item.useTime = 10; + Item.useAnimation = 10; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Ranged/RealmRavager.cs b/Items/Weapons/Ranged/RealmRavager.cs index 2f0bbf6805..baaed6a188 100644 --- a/Items/Weapons/Ranged/RealmRavager.cs +++ b/Items/Weapons/Ranged/RealmRavager.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 76; Item.height = 32; - Item.damage = 50; + Item.damage = 54; Item.DamageType = DamageClass.Ranged; Item.useTime = 22; Item.useAnimation = 22; @@ -35,11 +35,11 @@ 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) { - int numBullets = Main.rand.NextBool() ? 4 : 3; + int numBullets = 4; for (int index = 0; index < numBullets; ++index) { - float SpeedX = velocity.X + Main.rand.Next(-75, 76) * 0.05f; - float SpeedY = velocity.Y + Main.rand.Next(-75, 76) * 0.05f; + float SpeedX = velocity.X + (index == 0 ? 0 : Main.rand.Next(-75, 76) * 0.05f); + float SpeedY = velocity.Y + (index == 0 ? 0 : Main.rand.Next(-75, 76) * 0.05f); if (type == ProjectileID.Bullet) Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockback, player.whoAmI); diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 66721fffd5..9da488161b 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged rotIncrease += 0.1f * (rotDirection ? -1 : 1); - Projectile.velocity *= 0.982f; + Projectile.velocity *= 0.984f; if (Projectile.localAI[0] > 100f && Projectile.localAI[0] < 300 && Projectile.localAI[0] % 9 == 0) { @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged WaterFlavoredParticle subTrail = new WaterFlavoredParticle(Projectile.Center + velocity * 4.5f + addedPlacement, velocity * 7, false, 6, 0.65f, Color.SkyBlue); GeneralParticleHandler.SpawnParticle(subTrail); } - int onHitDamage = Owner.CalcIntDamage(0.36f * Projectile.damage); + int onHitDamage = (int)(Projectile.damage * 0.5f); Owner.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false); } } diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 8a5405821b..0399e05bd4 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Ranged { for (int b = 0; b < 3; b++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -oldVelocity.RotatedByRandom(0.5f) * 0.7f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.35), 0f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -oldVelocity.RotatedByRandom(0.5f) * 0.7f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); } } return true; @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Ranged for (int b = 0; b < 3; b++) { Vector2 velocity = Projectile.velocity.RotatedByRandom(0.5f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity * 0.7f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.15), Projectile.knockBack * 2f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity * 0.7f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack * 2f, Projectile.owner, 0f, 0f, Main.rand.Next(0, 4 + 1)); } } } diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index f0dc66f4ef..64d52761a0 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; - Projectile.damage /= 2; + Projectile.damage /= 3; Projectile.Damage(); } } From 920071b35bd8f31232d2b8b5f0133d0bfb2b6109 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sat, 25 May 2024 07:11:54 -0500 Subject: [PATCH 150/177] Improved Rev+ Skeletron's moving away before charging, it's slower and smoother now. --- .../Bosses/SkeletronAI.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index 68e01972b2..d8e4856b6b 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -205,6 +205,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) headSpinVelocityMult *= 1.2f; + // Velocity used to move Skeletron away from the target before charging + float moveAwayVelocity = headSpinVelocityMult; + if (!phase3) + moveAwayVelocity *= (bossRush ? 1.5f : 2f); + // Hand DR, scale DR up if the hands are still alive as Skeletron's HP lowers npc.chaseable = handsDead; float minDR = 0.05f; @@ -484,23 +489,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (!canCharge || !hasMovedForcedDistance) { - float maxAcceleration = headXAcceleration + headYAcceleration + (npc.ai[2] - moveAwayGateValue) * (phase5 ? 0.006f : 0.004f); - float maxAccelerationCap = (headXAcceleration + headYAcceleration) * 5f; - if (maxAcceleration > maxAccelerationCap) - maxAcceleration = maxAccelerationCap; + float phase5Multiplier = 1.5f; + float maxVelocity = (npc.ai[2] - moveAwayGateValue) * (moveAwayVelocity * 0.008f); + if (phase5) + maxVelocity *= phase5Multiplier; - npc.velocity += (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * -maxAcceleration; - - float maxVelocity = headSpinVelocityMult + (npc.ai[2] - moveAwayGateValue) * (phase5 ? 0.12f : 0.08f); - float maxVelocityCap = headSpinVelocityMult * 2.5f; + float maxVelocityCap = moveAwayVelocity; + if (phase5) + maxVelocityCap *= phase5Multiplier; if (maxVelocity > maxVelocityCap) maxVelocity = maxVelocityCap; - if (npc.velocity.Length() > maxVelocity) - { - npc.velocity = npc.velocity.SafeNormalize(Vector2.UnitY); - npc.velocity *= maxVelocity; - } + npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * -maxVelocity; } // New charge attack From dad3136eb26ab25ebcf5759263ae0d3679108689 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 25 May 2024 13:50:36 -0400 Subject: [PATCH 151/177] Slagsplitter Pauldron nerf --- CalPlayer/CalamityPlayerMiscEffects.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 4209e88ed4..eb85228a17 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -310,9 +310,9 @@ namespace CalamityMod.CalPlayer SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed); GeneralParticleHandler.SpawnParticle(spark2); - if (Player.miscCounter % 5 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox + if (Player.miscCounter % 9 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox { - int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(175)); + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(170)); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 10f, Player.whoAmI); } } From 1bd5084781d3dd24e021d5ee379341649fa35286 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 25 May 2024 11:28:19 -0700 Subject: [PATCH 152/177] Plague on kill improvement --- Buffs/DamageOverTime/Plague.cs | 4 ++-- NPCs/CalamityGlobalNPC.cs | 39 ++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Buffs/DamageOverTime/Plague.cs b/Buffs/DamageOverTime/Plague.cs index defe20c5b8..747e25e7aa 100644 --- a/Buffs/DamageOverTime/Plague.cs +++ b/Buffs/DamageOverTime/Plague.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Buffs.DamageOverTime { for (int i = 0; i < 2; i++) { - DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.18f), 0f, 35); + DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.18f), 0f, 20); GeneralParticleHandler.SpawnParticle(pulse); } @@ -62,7 +62,7 @@ namespace CalamityMod.Buffs.DamageOverTime Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2)); if (Main.rand.NextBool(3)) { - DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.18f) + (0.0000007f * npc.width * npc.height), 0f, 35); + DirectionalPulseRing pulse = new DirectionalPulseRing(npcSize, Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.18f) + (0.0000007f * npc.width * npc.height), 0f, 15); GeneralParticleHandler.SpawnParticle(pulse); for (int i = 0; i < 4; i++) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3ae1aabefa..c916f8802f 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5818,24 +5818,37 @@ namespace CalamityMod.NPCs } } + // Plague debuff on kill effect if (pFlames > 0 && npc.life <= 0) { - Rectangle hitbox = npc.Hitbox; - for (int i = 0; i < 20; i++) - { - int idx = Dust.NewDust(hitbox.TopLeft(), npc.width, npc.height, DustID.GemEmerald, 0f, -2.5f); - Dust dust = Main.dust[idx]; - dust.alpha = 200; - dust.velocity *= 1.4f; - dust.scale += Main.rand.NextFloat(); - } - if (Main.netMode != NetmodeID.MultiplayerClient) { - foreach (NPC nPC in Main.ActiveNPCs) + for (int i = 0; i < 10; i++) { - if (!nPC.buffImmune[BuffType()] && npc.Distance(nPC.Center) < 100f && !nPC.dontTakeDamage && nPC.lifeMax > 5 && !nPC.friendly && !nPC.townNPC) - nPC.AddBuff(BuffType(), 300); + int DustID = 220; + Dust dust2 = Dust.NewDustDirect(npc.Center, npc.width, npc.height, DustID); + dust2.scale = Main.rand.NextFloat(0.6f, 0.75f); + dust2.velocity = new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 0.8f); + dust2.noGravity = true; + } + + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC target = Main.npc[i]; + + if (target != null && target.IsAnEnemy(true, true) && !target.buffImmune[BuffType()] && Vector2.Distance(target.Center, npc.Center) < 400) + { + if (target.HasBuff() || target.life <= 0) + { + target.AddBuff(BuffType(), 300); + } + else + { + target.AddBuff(BuffType(), 300); + DirectionalPulseRing pulse = new DirectionalPulseRing(target.Center, Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.18f) * 3, 0f, 15); + GeneralParticleHandler.SpawnParticle(pulse); + } + } } } } From 34153af7f03c6777b89fa98c0b6725eec068b699 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 25 May 2024 11:55:29 -0700 Subject: [PATCH 153/177] Pauldron re-nerf Pauldron hit can no longer hit the same enemy once spawned as there's a delay of 22 frames before they can hit again --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Projectiles/Typeless/PauldronDash.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index eb85228a17..fc0de93d70 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -310,7 +310,7 @@ namespace CalamityMod.CalPlayer SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed); GeneralParticleHandler.SpawnParticle(spark2); - if (Player.miscCounter % 9 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox + if (Player.miscCounter % 6 == 0 && Player.velocity != Vector2.Zero) { int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(170)); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 10f, Player.whoAmI); diff --git a/Projectiles/Typeless/PauldronDash.cs b/Projectiles/Typeless/PauldronDash.cs index 6a17b3d5f8..04613c3e65 100644 --- a/Projectiles/Typeless/PauldronDash.cs +++ b/Projectiles/Typeless/PauldronDash.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Projectiles.Typeless Projectile.tileCollide = false; Projectile.penetrate = 1; Projectile.timeLeft = 4; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 22; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) From b8acbca46b3b1bff34351bb5fb37d5c93f4c66f7 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 25 May 2024 17:24:23 -0400 Subject: [PATCH 154/177] Post-Moon Lord and Provi gun + ammo balance --- Items/Ammo/HolyFireBullet.cs | 4 ++-- Items/CalamityGlobalItemTweaks.cs | 3 ++- Items/Weapons/Ranged/AngelicShotgun.cs | 10 +++++----- Items/Weapons/Ranged/Disseminator.cs | 6 +++--- Projectiles/Ranged/BloodfireBulletProj.cs | 17 +++++++++-------- Projectiles/Ranged/HolyFireBulletProj.cs | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Items/Ammo/HolyFireBullet.cs b/Items/Ammo/HolyFireBullet.cs index 9135150910..9c54ed0152 100644 --- a/Items/Ammo/HolyFireBullet.cs +++ b/Items/Ammo/HolyFireBullet.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Ammo public class HolyFireBullet : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Ammo"; - internal const float ExplosionMultiplier = 0.33f; + internal const float ExplosionMultiplier = 0.275f; public static readonly SoundStyle Explosion = new("CalamityMod/Sounds/Item/HolyFireBulletExplosion") { PitchVariance = 0.2f, Volume = 0.6f }; public override void SetStaticDefaults() { @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 22; Item.height = 22; - Item.damage = 22; + Item.damage = 20; Item.DamageType = DamageClass.Ranged; Item.maxStack = 9999; Item.consumable = true; diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 9c5b58366e..7cb2d01cd2 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -162,6 +162,7 @@ namespace CalamityMod.Items { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod { ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageExact(90)) }, // Ghastly Glaive { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury + { ItemID.MoonlordBullet, Do(DamageExact(19)) }, // Luminite Bullet { ItemID.MoonlordTurretStaff, Do(DamageExact(50), UseExact(15)) }, //Lunar Portal Staff { ItemID.Muramasa, Do(CritDelta(+20)) }, { ItemID.MushroomSpear, Do(AutoReuse, TrueMelee, UseRatio(0.8f), DamageExact(100)) }, @@ -211,7 +212,6 @@ namespace CalamityMod.Items { ItemID.RocketLauncher, Do(DamageExact(70)) }, { ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) }, { ItemID.SapphireStaff, Do(DamageExact(25)) }, - { ItemID.SDMG, Do(PointBlank, DamageExact(80)) }, { ItemID.Seedler, Do(UseMeleeSpeed, DamageExact(74), ShootSpeedDelta(+4f)) }, { ItemID.ShadowbeamStaff, Do(DamageExact(100)) }, { ItemID.ShadowFlameBow, Do(PointBlank, DamageExact(55)) }, @@ -456,6 +456,7 @@ namespace CalamityMod.Items { ItemID.PulseBow, pointBlank }, { ItemID.Revolver, Do(PointBlank, AutoReuse) }, { ItemID.RichMahoganyBow, pointBlank }, + { ItemID.SDMG, pointBlank }, { ItemID.ShadewoodBow, pointBlank }, { ItemID.SilverBow, pointBlank }, { ItemID.SnowballCannon, pointBlank }, diff --git a/Items/Weapons/Ranged/AngelicShotgun.cs b/Items/Weapons/Ranged/AngelicShotgun.cs index d2fce9bbca..bd1547fa45 100644 --- a/Items/Weapons/Ranged/AngelicShotgun.cs +++ b/Items/Weapons/Ranged/AngelicShotgun.cs @@ -21,14 +21,14 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 86; Item.height = 38; - Item.damage = 96; + Item.damage = 92; Item.knockBack = 3f; Item.DamageType = DamageClass.Ranged; Item.noMelee = true; Item.autoReuse = true; - Item.useTime = 24; - Item.useAnimation = 24; + Item.useTime = 26; + Item.useAnimation = 26; Item.UseSound = SoundID.Item38; Item.useStyle = ItemUseStyleID.Shoot; @@ -49,7 +49,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) { - int NumBullets = Main.rand.Next(5, 8); + int NumBullets = Main.rand.Next(5, 6+1); Vector2 baseVelocity = velocity.SafeNormalize(Vector2.Zero) * BulletSpeed; // If Musket Balls are used, damage is set to match Hallow-Point Rounds for both bullets and lasers @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Weapons.Ranged // Spawn a beam from the sky ala Deathhail Staff or Lunar Flare float laserSpeed = 8f; - int laserDamage = 3 * damage; + int laserDamage = (int)(damage * 2.5f); float laserKB = 5f; Vector2 rrp = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Items/Weapons/Ranged/Disseminator.cs b/Items/Weapons/Ranged/Disseminator.cs index a777199c5a..255bbf4bc3 100644 --- a/Items/Weapons/Ranged/Disseminator.cs +++ b/Items/Weapons/Ranged/Disseminator.cs @@ -14,10 +14,10 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 66; Item.height = 24; - Item.damage = 58; + Item.damage = 61; Item.DamageType = DamageClass.Ranged; - Item.useTime = 35; - Item.useAnimation = 35; + Item.useTime = 32; + Item.useAnimation = 32; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4.5f; diff --git a/Projectiles/Ranged/BloodfireBulletProj.cs b/Projectiles/Ranged/BloodfireBulletProj.cs index e4373bbc82..e45df960a2 100644 --- a/Projectiles/Ranged/BloodfireBulletProj.cs +++ b/Projectiles/Ranged/BloodfireBulletProj.cs @@ -81,8 +81,8 @@ namespace CalamityMod.Projectiles.Ranged // Returns the amount of bonus damage that should be dealt. Boosts life regeneration appropriately as a side effect. private int OnHitEffect(Player owner) { - // Adds 2 frames to lifeRegenTime on every hit. This increased value is used for the damage calculation. - owner.lifeRegenTime += 2; + // Adds 3 frames to lifeRegenTime on every hit. This increased value is used for the damage calculation. + owner.lifeRegenTime += 3; // Deals (1.00 + (0.1 * current lifeRegen))% of current lifeRegenTime as flat bonus damage on hit. // For example, at 0 life regen, you get 1% of lifeRegenTime as bonus damage. @@ -91,15 +91,16 @@ namespace CalamityMod.Projectiles.Ranged int regenForCalc = owner.lifeRegen > 0 ? owner.lifeRegen : 0; float regenDamageRatio = (1f + 0.1f * regenForCalc) / 100f; - // For the sake of bonus damage, life regen time caps at 3600, aka 60 seconds. This is its natural cap in vanilla. This then gets divided by 2 for computing final damage. - int regenTimeForCalc = (int)MathHelper.Clamp(owner.lifeRegenTime, 0f, 3600f) / 2; + // For the sake of bonus damage, life regen time caps at 3600, aka 60 seconds. This is its natural cap in vanilla. 75% of this is taken for computing the final damage. + int regenTimeForCalc = (int)(MathHelper.Clamp(owner.lifeRegenTime, 0f, 3600f) * 0.75f); int finalDamageBoost = (int)(regenDamageRatio * regenTimeForCalc); - // Damage boost has a cap of 25 to prevent it from getting too crazy. - if (finalDamageBoost > 25) - finalDamageBoost = 25; + // Damage boost has a cap of 35 to prevent it from getting too crazy. + int damageCap = 35; + if (finalDamageBoost > damageCap) + finalDamageBoost = damageCap; - if (finalDamageBoost == 25) // Special hit visual if youre at max bonus damage + if (finalDamageBoost == damageCap) // Special hit visual if the bonus damage is at the cap. { for (int k = 0; k < 3; k++) { diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index 97da541fc2..d02a941194 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnKill(int timeLeft) { - // Spawn an on-hit explosion which deals 75% of the projectile's damage. + // Spawn an on-hit explosion which deals 30% of the projectile's damage. if (Projectile.owner == Main.myPlayer) { Projectile.damage = (int)(Projectile.damage * HolyFireBullet.ExplosionMultiplier); From a0cb26eb1fe2916add91c2072660a92254d9ba7e Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 25 May 2024 17:42:54 -0400 Subject: [PATCH 155/177] Weak Petrification now only reduces flight time and disables extra jumps --- CalPlayer/CalamityPlayer.cs | 6 ------ CalPlayer/CalamityPlayerLifeRegen.cs | 7 ------- 2 files changed, 13 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 70989c1168..c61fbf50db 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4395,13 +4395,7 @@ namespace CalamityMod.CalPlayer Player.blockExtraJumps = true; Player.rocketBoots = 0; - Player.jumpBoost = false; - Player.slowFall = false; - Player.gravControl = false; - Player.gravControl2 = false; - Player.jumpSpeedBoost = 0f; Player.wingTimeMax = (int)(Player.wingTimeMax * 0.5); - Player.balloon = -1; } #endregion diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 73a7ec8f66..761aaf2ceb 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -585,13 +585,6 @@ namespace CalamityMod.CalPlayer } } } - - // TODO -- Why is this here? - if (weakPetrification) - { - if (Player.mount.Active) - Player.mount.Dismount(Player); - } #endregion // Chalice of the Blood God bleedout From 993ab7545d18a686742bfedd97510063745afb58 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 25 May 2024 15:20:12 -0700 Subject: [PATCH 156/177] Nerfs for Ambrosial and Radiance --- CalPlayer/CalamityPlayerLifeRegen.cs | 4 ++-- Items/Accessories/AmbrosialAmpoule.cs | 2 +- Items/Accessories/Radiance.cs | 2 +- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 761aaf2ceb..834104e3e4 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -422,8 +422,8 @@ namespace CalamityMod.CalPlayer if (rOoze || aAmpoule || purity) { float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / Player.statLifeMax2; - //Ambrosial Ampule and ooze give between 2 and 6 hp/s, Purity gives between 3 and 7 hp/s - float lifeRegenToGive = MathHelper.Lerp(purity ? 6f : 4f, purity ? 14f : 12f, missingLifeRatio); + //Ambrosial Ampule and ooze give between 2 and 6 hp/s + float lifeRegenToGive = MathHelper.Lerp(4f, 12f, missingLifeRatio); Player.lifeRegen += (int)lifeRegenToGive; } diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index ae0904ba07..6d42653934 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - player.statLifeMax2 += 70; + player.statLifeMax2 += 50; // bool left in for abyss light purposes and life regen effects modPlayer.aAmpoule = true; diff --git a/Items/Accessories/Radiance.cs b/Items/Accessories/Radiance.cs index b8f71335c4..68b3b5836c 100644 --- a/Items/Accessories/Radiance.cs +++ b/Items/Accessories/Radiance.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - player.statLifeMax2 += 100; + player.statLifeMax2 += 70; // Abyss light, debuff near-immunity, life regen effects, and massively enhances debuff halving modPlayer.purity = true; diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index a2f6e3f0a6..d0131bd3cc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -136,7 +136,7 @@ AmbrosialAmpoule: { DisplayName: Ambrosial Ampoule Tooltip: ''' - +70 max life + +50 max life Grants +2 to +6 HP/s life regen based on missing health Provides life regeneration equivalent to standing in Honey Standing still grants extremely powerful regen @@ -1330,8 +1330,8 @@ Radiance: { DisplayName: Radiance Tooltip: ''' - +100 max life - Grants +3 to +7 HP/s life regen based on missing health + +70 max life + Grants +2 to +6 HP/s life regen based on missing health Provides life regeneration equivalent to standing in Honey Standing still grants extremely powerful regen Grants 20 defense and continuous healing while afflicted with any debuff From da5af58bab3c6c176cdc27952dd208742f56070c Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 25 May 2024 18:36:03 -0400 Subject: [PATCH 157/177] Actually Sulphurous Poisoned duration further nerf --- CalPlayer/CalamityPlayerHitHurt.cs | 4 ++-- CalPlayer/CalamityPlayerOnHit.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index fe44174ba9..7430951616 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1239,13 +1239,13 @@ namespace CalamityMod.CalPlayer if (Main.player[proj.owner] is null) { if (!Main.npc[proj.owner].friendly) - Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 90); + Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60); } else { Player p = Main.player[proj.owner]; if (p.hostile && Player.hostile && (Player.team != p.team || p.team == 0)) - p.AddBuff(BuffID.Poisoned, 90); + p.AddBuff(BuffID.Poisoned, 60); } } diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 3122d55209..d4463c46bd 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1266,7 +1266,7 @@ namespace CalamityMod.CalPlayer if (omegaBlueChestplate) target.AddBuff(BuffType(), 180); if (sulphurSet) - target.AddBuff(BuffID.Poisoned, 90); + target.AddBuff(BuffID.Poisoned, 60); if (abyssalAmulet) { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index c916f8802f..33a3d3ed2f 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5255,7 +5255,7 @@ namespace CalamityMod.NPCs return; if (target.Calamity().sulphurSet) - npc.AddBuff(BuffID.Poisoned, 90); + npc.AddBuff(BuffID.Poisoned, 60); if (target.Calamity().snowman) { From 5399bd6e24bc4cd1d84cf63dee0956ceb6301e3f Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sat, 25 May 2024 17:52:06 -0500 Subject: [PATCH 158/177] Increased Elemental Lance use time, increased damage (untested). --- Items/Weapons/Melee/ElementalLance.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Melee/ElementalLance.cs b/Items/Weapons/Melee/ElementalLance.cs index 899b8a5f36..a4cf059a36 100644 --- a/Items/Weapons/Melee/ElementalLance.cs +++ b/Items/Weapons/Melee/ElementalLance.cs @@ -19,14 +19,14 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 88; Item.height = 88; - Item.damage = 160; + Item.damage = 240; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; Item.noUseGraphic = true; - Item.useAnimation = 30; + Item.useAnimation = 45; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = 30; + Item.useTime = 45; Item.knockBack = 9.5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; From 3c5d649611d44e337acb9201a015c220a8bf16c6 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 25 May 2024 19:46:23 -0700 Subject: [PATCH 159/177] fixed sandsteam explosion dealing rogue damage --- Projectiles/Magic/SandstreamScepterExplosion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Magic/SandstreamScepterExplosion.cs b/Projectiles/Magic/SandstreamScepterExplosion.cs index 6e5e86bd99..9b6ecb208e 100644 --- a/Projectiles/Magic/SandstreamScepterExplosion.cs +++ b/Projectiles/Magic/SandstreamScepterExplosion.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 112; Projectile.height = 112; Projectile.friendly = true; - Projectile.DamageType = RogueDamageClass.Instance; + Projectile.DamageType = DamageClass.Magic; Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.penetrate = -1; From 392961d6cbe2768d70422eb23d7c036e8d31036a Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 25 May 2024 23:10:35 -0400 Subject: [PATCH 160/177] 1 - Profaned Guardians now enrage at night instead of despawning 2 - Guardians now use their cyan glowmask at night instead of in Remix World, and glowmasks are now rainbow in GFB 3 - Guardians projectiles and shields now draw cyan at night 4 - Fixed Providence always being enraged in Remix world instead of never enraging --- Items/SummonItems/ProfanedShard.cs | 2 +- .../Mods.CalamityMod.Items.SummonItems.hjson | 6 +- .../ProfanedGuardianCommander.cs | 65 +++++++++++------- .../ProfanedGuardianDefender.cs | 41 +++++++---- .../ProfanedGuardianHealer.cs | 27 ++++++-- NPCs/Providence/Providence.cs | 2 +- Projectiles/Boss/HolyBlast.cs | 10 +++ Projectiles/Boss/HolyBomb.cs | 10 +++ Projectiles/Boss/HolyBurnOrb.cs | 10 +++ Projectiles/Boss/HolyFire.cs | 10 +++ Projectiles/Boss/HolyFire2.cs | 10 +++ Projectiles/Boss/HolyFlare.cs | 10 +++ Projectiles/Boss/HolySpear.cs | 10 +++ Projectiles/Boss/MoltenBlast.cs | 10 +++ Projectiles/Boss/MoltenBlob.cs | 10 +++ Projectiles/Boss/ProfanedSpear.cs | 19 ++++- Projectiles/Boss/ProfanedSpearNight.png | Bin 0 -> 465 bytes Projectiles/Boss/ProvidenceHolyRay.cs | 10 +++ 18 files changed, 211 insertions(+), 51 deletions(-) create mode 100644 Projectiles/Boss/ProfanedSpearNight.png diff --git a/Items/SummonItems/ProfanedShard.cs b/Items/SummonItems/ProfanedShard.cs index f5e1076208..e65cceda1b 100644 --- a/Items/SummonItems/ProfanedShard.cs +++ b/Items/SummonItems/ProfanedShard.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return !NPC.AnyNPCs(ModContent.NPCType()) && (Main.dayTime || Main.remixWorld) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index 3d32178f39..ef8f23c883 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -234,7 +234,11 @@ ProfanedShard: { Not consumable 'Her Guardians seek the holder of such vast stolen power.' ''' - SpawnNormal: Summons the Profaned Guardians when used in the Hallow or Underworld during daytime + SpawnNormal: + ''' + Summons the Profaned Guardians when used in the Hallow or Underworld + Enrages when fought during nighttime + ''' SpawnRemix: Summons the Profaned Guardians when used in the Hallow or Underworld } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index d9682a401f..a98ab63273 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -296,11 +296,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians Player player = Main.player[NPC.target]; - if ((!Main.dayTime && !Main.remixWorld) || !player.active || player.dead || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + if (!player.active || player.dead || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) { NPC.TargetClosest(false); player = Main.player[NPC.target]; - if ((!Main.dayTime && !Main.remixWorld) || !player.active || player.dead || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + if (!player.active || player.dead || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) { if (NPC.velocity.Y > 3f) NPC.velocity.Y = 3f; @@ -333,6 +333,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[3] < 0f) NPC.ai[3] = 0f; + // Enrage at nighttime + bool enraged = false; + if (!Main.dayTime && !Main.remixWorld) + { + enraged = true; + NPC.Calamity().CurrentlyEnraged = true; + } + bool phase1 = healerAlive || defenderAlive; NPC.chaseable = !phase1; @@ -357,7 +365,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float goLowOrHighDistance = 540f; // Side swap variables for Phase 2 - float defenderCommanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float defenderCommanderGuardPhase2Duration = (bossRush || enraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float moveToOtherSideInPhase2GateValue = defenderCommanderGuardPhase2Duration - 120f; float timeBeforeMoveToOtherSideInPhase2Reset = moveToOtherSideInPhase2GateValue * 2f; float totalGoLowDurationPhase2 = 210f; @@ -365,13 +373,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = bossRush ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; + float maxChargeVelocity = (bossRush || enraged) ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; if (CalamityWorld.LegendaryMode && revenge) maxChargeVelocity *= 2f; - float inertia = bossRush ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; + float inertia = (bossRush || enraged) ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (!phase1) @@ -454,7 +462,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (!goLow && !goLowPhase2 && !goHigh) calamityGlobalNPC.newAI[0] = -NPC.direction; - float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float velocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) velocity *= 1.25f; if (healerAlive) @@ -491,7 +499,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 targetVector = destination - NPC.Center; Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; - float phaseGateValue = bossRush ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; + float phaseGateValue = (bossRush || enraged) ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; bool continueShootingProjectiles = phase1 || (NPC.ai[2] < (phaseGateValue * 5f)); if (continueShootingProjectiles) @@ -505,7 +513,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Alternate between firing profaned spears and holy fire // Shoot holy blasts in final phase NPC.ai[2] += 1f; - float projectileShootGateValue = bossRush ? 40f : death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; + float projectileShootGateValue = (bossRush || enraged) ? 40f : death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; if (NPC.ai[2] % projectileShootGateValue == 0f) { if (phase1) @@ -519,7 +527,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool shootSpear = NPC.ai[2] % (projectileShootGateValue * 2f) == 0f; - float projectileVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float projectileVelocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; Vector2 finalProjectileVelocity = Vector2.Normalize(player.Center - shootFrom) * projectileVelocity; int type = shootSpear ? ModContent.ProjectileType() : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -532,8 +540,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (fireExtraProjectiles && shootSpear) { - int baseProjectileAmt = bossRush ? 4 : 2; - int spread = bossRush ? 18 : 10; + int baseProjectileAmt = (bossRush || enraged) ? 4 : 2; + int spread = (bossRush || enraged) ? 18 : 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -552,7 +560,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else { // Shoot holy blasts - float holyBlastVelocity = bossRush ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; + float holyBlastVelocity = (bossRush || enraged) ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; int projTimeLeft = (int)(2000f / holyBlastVelocity); Vector2 finalHolyBlastVelocity = Vector2.Normalize(player.Center - shootFrom) * holyBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -665,7 +673,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = bossRush ? 90f : death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; + float phaseGateValue = (bossRush || enraged) ? 90f : death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -686,7 +694,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = bossRush ? 1.053333f : death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; + float velocityMult = (bossRush || enraged) ? 1.053333f : death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -774,7 +782,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool targetRanAwayAndWillNowBeFucked = NPC.ai[2] == 1f; bool boostVelocityToCatchUp = NPC.ai[1] == 0f || targetRanAwayAndWillNowBeFucked; - float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float velocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) velocity *= 1.25f; if (boostVelocityToCatchUp) @@ -786,7 +794,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; float totalSpears = 12f; - float shootDuration = bossRush ? 240f : death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; + float shootDuration = (bossRush || enraged) ? 240f : death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; float dontShootTime = shootDuration * 0.3f; float phaseGateValue = dontShootTime + shootDuration; @@ -831,7 +839,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } else if (NPC.ai[1] % spearShootDivisor == 0f) { - float spearVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float spearVelocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; if (Main.getGoodWorld) spearVelocity *= 1.25f; if (boostVelocityToCatchUp) @@ -849,8 +857,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] % (spearShootDivisor * 3) == 0f || targetRanAwayAndWillNowBeFucked) { knockbackVelocity *= 2f; - int baseProjectileAmt = bossRush ? 8 : expertMode ? 6 : 4; - int spread = bossRush ? 60 : expertMode ? 50 : 40; + int baseProjectileAmt = (bossRush || enraged) ? 8 : expertMode ? 6 : 4; + int spread = (bossRush || enraged) ? 60 : expertMode ? 50 : 40; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -886,7 +894,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } float laserGateValue = 120f; - float velocity = bossRush ? 4.5f : death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; + float velocity = (bossRush || enraged) ? 4.5f : death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; if (NPC.ai[1] < laserGateValue) velocity *= 6f; if (Main.getGoodWorld) @@ -942,7 +950,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { if (NPC.ai[2] == laserGateValue) { - float rotation = bossRush ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; + float rotation = (bossRush || enraged) ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < 2800f) SoundEngine.PlaySound(HolyRaySound, Main.LocalPlayer.Center); @@ -1032,10 +1040,15 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = Texture_Glow.Value; Color timeBasedColorLerp = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (Main.remixWorld) + if (NPC.Calamity().CurrentlyEnraged) { texture2D15 = TextureNight_Glow.Value; - timeBasedColorLerp = Color.Cyan; + timeBasedColorLerp = Color.Lerp(Color.White, Color.Cyan, 0.75f); + } + if (Main.zenithWorld) + { + texture2D15 = TextureNight_Glow.Value; + timeBasedColorLerp = Main.DiscoColor; } if (colorOverride != null) timeBasedColorLerp = colorOverride.Value; @@ -1134,14 +1147,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 shieldDrawPos = NPC.Center - screenPos; shieldDrawPos -= new Vector2(shieldTexture.Width, shieldTexture.Height) * NPC.scale / 2f; shieldDrawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - float minHue = (defenderAlive && healerAlive) ? 0.18f : 0.06f; + float minHue = NPC.Calamity().CurrentlyEnraged ? 0.4f : (defenderAlive && healerAlive) ? 0.18f : 0.06f; float maxHue = minHue + 0.12f; float opacityScaleDuringShieldDespawn = (TimeForShieldDespawn - NPC.localAI[1]) / TimeForShieldDespawn; float scaleDuringShieldDespawnScale = 1.8f; float scaleDuringShieldDespawn = (1f - opacityScaleDuringShieldDespawn) * scaleDuringShieldDespawnScale; float colorScale = MathHelper.Lerp(0f, shieldOpacity, opacityScaleDuringShieldDespawn); - Color color = Main.hslToRgb(MathHelper.Lerp(maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * colorScale; - Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * colorScale; + Color color = Main.hslToRgb(MathHelper.Lerp(NPC.Calamity().CurrentlyEnraged ? minHue : maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * colorScale; + Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, NPC.Calamity().CurrentlyEnraged ? maxHue : maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * colorScale; color2.A = 0; color *= 0.6f; color2 *= 0.6f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index 8a4f75cfb1..b4033cedc5 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -248,12 +248,20 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool revenge = CalamityWorld.revenge || bossRush; bool death = CalamityWorld.death || bossRush; + // Enrage at nighttime + bool enraged = false; + if (!Main.dayTime && !Main.remixWorld) + { + enraged = true; + NPC.Calamity().CurrentlyEnraged = true; + } + bool phase1 = healerAlive; NPC.chaseable = !phase1; // Phase durations - float commanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float commanderGuardPhase2Duration = (bossRush || enraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float timeBeforeRocksRespawnInPhase2 = 90f; float throwRocksGateValue = 60f; @@ -262,7 +270,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = bossRush ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; + float maxChargeVelocity = (bossRush || enraged) ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; @@ -382,7 +390,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - float moveVelocity = bossRush ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; + float moveVelocity = (bossRush || enraged) ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; if (Main.getGoodWorld) moveVelocity *= 1.25f; if (healerAlive) @@ -432,7 +440,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Lay a holy bomb every once in a while in phase 1 and while not doing the laser attack if (!commanderUsingLaser) { - float projectileShootGateValue = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float projectileShootGateValue = (bossRush || enraged) ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; NPC.ai[1] += 1f; if (NPC.ai[1] >= projectileShootGateValue) { @@ -502,7 +510,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float shootMoltenBlastsGateValue = commanderGuardPhase2Duration / moltenBlastsDivisor; if (NPC.ai[1] % shootMoltenBlastsGateValue == 0f && !commanderGoingLowOrHighInPhase2) { - float moltenBlastVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float moltenBlastVelocity = (bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; int projTimeLeft = (int)(2400f / moltenBlastVelocity); Vector2 velocity = Vector2.Normalize(player.Center - shootFrom) * moltenBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -609,7 +617,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = bossRush ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; + float phaseGateValue = (bossRush || enraged) ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -630,7 +638,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = bossRush ? 1.04f : death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; + float velocityMult = (bossRush || enraged) ? 1.04f : death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -642,7 +650,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else { // Charge towards target - float inertia = bossRush ? 57f : death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; + float inertia = (bossRush || enraged) ? 57f : death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; NPC.velocity = (NPC.velocity * (inertia - 1f) + targetVector * (NPC.velocity.Length() + (0.111111117f * inertia))) / inertia; } @@ -755,10 +763,15 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = Texture_Glow.Value; Color timeBasedGlowColor = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (Main.remixWorld) + if (NPC.Calamity().CurrentlyEnraged) { texture2D15 = TextureNight_Glow.Value; - timeBasedGlowColor = Color.Cyan; + timeBasedGlowColor = Color.Lerp(Color.White, Color.Cyan, 0.75f); + } + if (Main.zenithWorld) + { + texture2D15 = TextureNight_Glow.Value; + timeBasedGlowColor = Main.DiscoColor; } if (colorOverride != null) timeBasedGlowColor = colorOverride.Value; @@ -849,14 +862,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 shieldDrawPos = NPC.Center - screenPos; shieldDrawPos -= new Vector2(shieldTexture.Width, shieldTexture.Height) * NPC.scale / 2f; shieldDrawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - float minHue = 0.06f; - float maxHue = 0.18f; + float minHue = NPC.Calamity().CurrentlyEnraged ? 0.4f : 0.06f; + float maxHue = minHue + 0.12f; float opacityScaleDuringShieldDespawn = (TimeForShieldDespawn - NPC.localAI[1]) / TimeForShieldDespawn; float scaleDuringShieldDespawnScale = 1.8f; float scaleDuringShieldDespawn = (1f - opacityScaleDuringShieldDespawn) * scaleDuringShieldDespawnScale; float colorScale = MathHelper.Lerp(0f, shieldOpacity, opacityScaleDuringShieldDespawn); - Color color = Main.hslToRgb(MathHelper.Lerp(maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * colorScale; - Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * colorScale; + Color color = Main.hslToRgb(MathHelper.Lerp(NPC.Calamity().CurrentlyEnraged ? minHue : maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * colorScale; + Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, NPC.Calamity().CurrentlyEnraged ? maxHue : maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * colorScale; color2.A = 0; color *= 0.6f; color2 *= 0.6f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index a59ec9f297..03ed34ed59 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -178,6 +178,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[0] >= 300f) NPC.ai[1] = 1f; + // Enrage at nighttime + bool enraged = false; + if (!Main.dayTime && !Main.remixWorld) + { + enraged = true; + NPC.Calamity().CurrentlyEnraged = true; + } + // Direction if (Math.Abs(NPC.Center.X - player.Center.X) > 10f) { @@ -217,7 +225,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool useCrystalShards = AIState == (float)Phase.CrystalShards; - float velocity = useCrystalShards ? (bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); + float velocity = useCrystalShards ? ((bossRush || enraged) ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); if (Main.getGoodWorld) velocity *= 1.25f; @@ -305,7 +313,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = bossRush ? 18 : death ? 16 : revenge ? 14 : expertMode ? 12 : 10; + int totalProjectiles = (bossRush || enraged) ? 18 : death ? 16 : revenge ? 14 : expertMode ? 12 : 10; float speedX = -12f; float speedAdjustment = Math.Abs(speedX * 2f / (totalProjectiles - 1)); float speedY = -4f; @@ -344,7 +352,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, shootFrom); - int totalFlameProjectiles = bossRush ? 20 : 16; + int totalFlameProjectiles = (bossRush || enraged) ? 20 : 16; int totalRings = revenge ? 3 : 2; int healingStarChance = revenge ? 8 : expertMode ? 6 : 4; double radians = MathHelper.TwoPi / totalFlameProjectiles; @@ -362,7 +370,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians int type = ModContent.ProjectileType(); int dmgAmt = NPC.GetProjectileDamage(type); - if (Main.rand.NextBool(healingStarChance) && !death) + if (Main.rand.NextBool(healingStarChance) && !enraged && !death) { type = ModContent.ProjectileType(); dmgAmt = NPC.GetProjectileDamageNoScaling(type); @@ -405,7 +413,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Move towards a location above the player if (distanceFromDestination.Length() > idealDistanceFromDestination) { - float inertia = bossRush ? 28f : death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; + float inertia = (bossRush || enraged) ? 28f : death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (Main.getGoodWorld) @@ -460,10 +468,15 @@ namespace CalamityMod.NPCs.ProfanedGuardians texture2D15 = Texture_Glow.Value; Color timeBasedDrawColor = Color.Lerp(Color.White, Color.Yellow, 0.5f); - if (Main.remixWorld) + if (NPC.Calamity().CurrentlyEnraged) { texture2D15 = TextureNight_Glow.Value; - timeBasedDrawColor = Color.Cyan; + timeBasedDrawColor = Color.Lerp(Color.White, Color.Cyan, 0.75f); + } + if (Main.zenithWorld) + { + texture2D15 = TextureNight_Glow.Value; + timeBasedDrawColor = Main.DiscoColor; } Color overrideColor = Color.Lerp(Color.White, Color.Violet, 0.5f); if (colorOverride != null) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7f0bbfabc3..aeb2b7d136 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -366,7 +366,7 @@ namespace CalamityMod.NPCs.Providence colorShiftTimer = 0; } } - else if (!Main.IsItDay() || bossRush) //Normal Night time activity + else if ((!Main.dayTime && !Main.remixWorld) || bossRush) //Normal Night time activity NPC.localAI[1] = (float)BossMode.Night; else NPC.localAI[1] = (float)BossMode.Day; diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 6736fc4ea1..d6e09c41fd 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -58,6 +58,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index 7bdb4af478..15ff7a1b48 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -47,6 +47,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 7509889518..b7bdb2c51b 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -41,6 +41,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 72a76cb870..0a19097430 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -42,6 +42,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index d694d1753f..8e8c50642e 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -42,6 +42,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index ce8b652245..1208b849ad 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -42,6 +42,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 03116c57ea..697dfa6c2a 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -61,6 +61,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index f80225ae09..18ee564f3b 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -58,6 +58,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 2ff2619640..f0516d1376 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -39,6 +39,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index 7187932d5e..f716020d87 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -1,6 +1,9 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs; +using CalamityMod.NPCs.Providence; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,6 +35,17 @@ namespace CalamityMod.Projectiles.Boss { Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); + if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } + if (Projectile.timeLeft < 510) Projectile.tileCollide = true; @@ -56,11 +70,14 @@ namespace CalamityMod.Projectiles.Boss public override Color? GetAlpha(Color lightColor) { - return new Color(250, 150, 0, Projectile.alpha); + return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha); } public override bool PreDraw(ref Color lightColor) { + Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/ProfanedSpearNight").Value; + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha, true), 4f, texture); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); return false; } diff --git a/Projectiles/Boss/ProfanedSpearNight.png b/Projectiles/Boss/ProfanedSpearNight.png new file mode 100644 index 0000000000000000000000000000000000000000..712ed5b89df3f3c726a3275468b1c0e75a890548 GIT binary patch literal 465 zcmV;?0WSWDP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0cJ@=K~z{r-IhUa zgD?<9X%E5*wr~M%!48SDAWpz7*l`Ok09#mbkv5+8N8zg@Q#C1O-ezLiLGjBUo44pB znx^@1wQbuUf5R{gGXE~4fO(q1s;Xqiec$h%2@_zRXQ^zC*Og@{^Y#rMH3uWix~{u* zNs{c=1#j@rxNby8I(Y2E8Dxu(*w3JLo^b{NvWR&tn|Q8WgXms>E@pFio_~M(VwxtY zK6Cg->>Je1KQ_l`COMn-3>HNpI~>Px_gxsh?OevcHOSeuYmkA_IF4nEOrjg>x_0Fb z%mFrtF|gmo$Q-ztkgA=F0H(B?2-q{InZuiMmSs}Au9FHlqZ)j^+B1mE0AvR{Pt(+u zJIk_2g^{D{fL(*!b=nOBU=H}Q2<#c;n*(gyCY25P%=);#L0{Kt=AOlM4I(?>Rfc>7 zZ}2eAC|msxu9rbR@n7AgKCWXB=FT?8gx|$yb>~q6HyA~q&9>&Au4kb^00000NkvXX Hu0mjfkgLlp literal 0 HcmV?d00001 diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index 0a5609302b..fff9c36e64 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -55,6 +55,16 @@ namespace CalamityMod.Projectiles.Boss if (Main.npc[CalamityGlobalNPC.holyBoss].active) Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1]; } + else if (CalamityGlobalNPC.doughnutBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].active) + { + if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged) + Projectile.maxPenetrate = (int)Providence.BossMode.Night; + else + Projectile.maxPenetrate = (int)Providence.BossMode.Day; + } + } else Projectile.maxPenetrate = (int)Providence.BossMode.Day; From d25b7eb16bb5a7b0ca862b1d5ac6914ec2ade533 Mon Sep 17 00:00:00 2001 From: Xyk Date: Sat, 25 May 2024 20:26:40 -0700 Subject: [PATCH 161/177] Hailstorm freeze reinstatement --- Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson | 2 +- Projectiles/Ranged/HailstormBulletProj.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson index 35b9c32329..e582fd1bcc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Ammo.hjson @@ -103,7 +103,7 @@ HailstormBullet: { ''' Bullets imbued with potent ice magic These bullets rapidly decelerate after being fired - Critical hits cause a flash freeze, dealing additional damage + Critical hits cause a flash freeze, dealing additional damage and freezing normal enemies ''' } diff --git a/Projectiles/Ranged/HailstormBulletProj.cs b/Projectiles/Ranged/HailstormBulletProj.cs index 9da488161b..ac240f4e5d 100644 --- a/Projectiles/Ranged/HailstormBulletProj.cs +++ b/Projectiles/Ranged/HailstormBulletProj.cs @@ -1,4 +1,5 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; @@ -71,12 +72,15 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Player Owner = Main.player[Projectile.owner]; - target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.Frostburn2, 120); if (hit.Crit) { SoundStyle crit = new("CalamityMod/Sounds/NPCHit/CryogenPhaseTransitionCrack"); SoundEngine.PlaySound(crit with { Volume = 0.35f, Pitch = 1f }, Projectile.Center); - target.AddBuff(BuffID.Frostburn2, 300); + + if (!target.boss) + target.AddBuff(ModContent.BuffType(), 120); + int points = 6; float radians = MathHelper.TwoPi / points; Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f)); From 612087ac98744ac82dfda85dcef5a2aef6e7946f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 25 May 2024 23:31:06 -0400 Subject: [PATCH 162/177] Disabled the custom tile merging system again, because it was repeatedly causing the mod to crash with an out of memory exception --- Tiles/MergeableTile.cs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Tiles/MergeableTile.cs b/Tiles/MergeableTile.cs index 9f5742457a..86d6438fc6 100644 --- a/Tiles/MergeableTile.cs +++ b/Tiles/MergeableTile.cs @@ -7,9 +7,12 @@ namespace CalamityMod.Tiles { internal static class MergeableTile { + // CIT 25MAY2024: This custom tile merging system was repeatedly crashing the mod with an out of memory exception. + // Because the person who made this system is no longer on the dev team, I am just going to disable it again. + private sealed class MergeableTileGlobalTile : GlobalTile { - public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) + /*public override void PostDraw(int i, int j, int type, SpriteBatch spriteBatch) { TileFraming.DrawUniversalMergeFrames(i, j, GetOrCreateTileAdjacencies(type)); } @@ -20,38 +23,38 @@ namespace CalamityMod.Tiles TileFraming.GetAdjacencyData(i, j, adjacency); return base.TileFrame(i, j, type, ref resetFrame, ref noBreak); - } + }*/ } private sealed class MergeableTileSystem : ModSystem { - public override void PostSetupContent() + /*public override void PostSetupContent() { // Tomat: @heartplusup, you can add vanilla merges like so: // RegisterUniversalMerge(TileID.Dirt, TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); - Already-merged tiles look weird; needs changes by someone else. // RegisterUniversalMerge(TileID.WoodBlock, TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); - } + }*/ } private static readonly Dictionary> tileAdjacencyMap = []; public static void RegisterUniversalMerge(this ModTile tile, int mergeType, string blendSheetPath) { - RegisterUniversalMerge(tile.Type, mergeType, blendSheetPath); + // RegisterUniversalMerge(tile.Type, mergeType, blendSheetPath); } public static void RegisterUniversalMerge(int tileId, int mergeType, string blendSheetPath) { - TileFraming.SetUpUniversalMerge(tileId, mergeType, blendSheetPath, out var data); - GetOrCreateTileAdjacencies(tileId).Add(data); + // TileFraming.SetUpUniversalMerge(tileId, mergeType, blendSheetPath, out var data); + // GetOrCreateTileAdjacencies(tileId).Add(data); } - private static List GetOrCreateTileAdjacencies(int tileId) + /*private static List GetOrCreateTileAdjacencies(int tileId) { - if (!tileAdjacencyMap.TryGetValue(tileId, out var adjacencies)) + /*if (!tileAdjacencyMap.TryGetValue(tileId, out var adjacencies)) tileAdjacencyMap[tileId] = adjacencies = []; return adjacencies; - } + }*/ } } From ee75286510ce6cf412a873d24f1d4807dea69726 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 25 May 2024 23:31:55 -0400 Subject: [PATCH 163/177] Realm Ravager tooltip fix --- Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 5b6a9163a6..f12bbcfdce 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -994,7 +994,7 @@ RealmRavager: { DisplayName: Realm Ravager Tooltip: ''' - Shoots a burst of 3 to 4 bullets + Shoots a burst of 4 bullets Converts musket balls into explosive bullets ''' } From 1bd1d3ab1cadc0c2dd49eb2ce9fe5a8192f59665 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 25 May 2024 23:29:23 -0700 Subject: [PATCH 164/177] yharon now counts as an organic enemy --- Utilities/NPCUtils.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index baad855704..719631c115 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -9,6 +9,7 @@ using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -689,7 +690,7 @@ namespace CalamityMod target.HitSound != SoundID.NPCHit34 && target.HitSound != SoundID.NPCHit36 && target.HitSound != SoundID.NPCHit42 && target.HitSound != SoundID.NPCHit49 && target.HitSound != SoundID.NPCHit52 && target.HitSound != SoundID.NPCHit53 && target.HitSound != SoundID.NPCHit54 && target.HitSound != null) || target.type == NPCType() || - target.type == NPCType()) + target.type == NPCType() || target.type == NPCType()) { return true; } From 229a021bf5e7e5459c29053719cef2d5630897bd Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 26 May 2024 02:50:56 -0500 Subject: [PATCH 165/177] Decreased Rev+ Skeletron Hand HP --- NPCs/CalamityGlobalNPC.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 33a3d3ed2f..45176c2362 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1458,9 +1458,9 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.SkeletronHand) { if (CalamityWorld.death) - npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.65); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.5); else - npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.9); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.75); } else if (npc.type == NPCID.QueenBee) { From c704685dbef8cb67d654b9cb6c1f1d3bb69d8645 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 26 May 2024 13:06:47 -0400 Subject: [PATCH 166/177] Boss Rush no longer disables wiring --- Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson | 6 +----- Tiles/CalamityGlobalTile.cs | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson index ef8f23c883..9329498724 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.SummonItems.hjson @@ -305,11 +305,7 @@ Teratoma: { Terminus: { DisplayName: Terminus GFBName: Ogscule - Tooltip: - ''' - Activates Boss Rush Mode, using it again will deactivate Boss Rush Mode - During the Boss Rush, all wires and wired devices will be disabled - ''' + Tooltip: Activates Boss Rush Mode, using it again will deactivate Boss Rush Mode } YharonEgg: { diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index d3bdbfd406..bccfbf26c0 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -63,11 +63,6 @@ namespace CalamityMod.Tiles Main.tileOreFinderPriority[TileID.LunarOre] = 900; } - public override bool PreHitWire(int i, int j, int type) - { - return !BossRushEvent.BossRushActive; - } - public override bool TileFrame(int i, int j, int type, ref bool resetFrame, ref bool noBreak) { // Custom plant framing From bef320219a460e55e203c8024ad317fa02c6f472 Mon Sep 17 00:00:00 2001 From: AquaSG Date: Sun, 26 May 2024 21:48:33 -0400 Subject: [PATCH 167/177] bordernado shader bleeding into other things fixed --- Projectiles/Boss/InfernadoRevenge.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index dfb8a4e429..bfc028fc5b 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -72,6 +72,8 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { + Main.spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:Bordernado"].UseSaturation(-0.2f); GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.Request("Terraria/Images/Misc/Perlin")); Vector2[] drawPoints = new Vector2[5]; @@ -86,6 +88,8 @@ namespace CalamityMod.Projectiles.Boss drawPoints[drawPoints.Length - 1] = bottom; PrimitiveRenderer.RenderTrail(drawPoints, new((_) => Projectile.width * 0.5f + 16f, ColorFunction, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 85); + Main.spriteBatch.ExitShaderRegion(); + Texture2D vortexTexture = ModContent.Request("CalamityMod/Projectiles/Boss/OldDukeVortex").Value; for (int i = 0; i < 110; i++) { From 29c35185e1553c1e317c2f9676ece81b1c32a998 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Mon, 27 May 2024 10:53:29 +0700 Subject: [PATCH 168/177] Melee reforge fixes Collateral: Light is no longer a T0 tool reforge --- Utilities/ItemUtils.cs | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 88bb34ef06..2a1911dd9e 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -136,7 +136,7 @@ namespace CalamityMod { // Terrarian (has its own special "Legendary" for marketing reasons) // Other items that want to use Legendary2 are also compatible - if (item.type == ItemID.Terrarian || PrefixLegacy.ItemSets.ItemsThatCanHaveLegendary2[item.type]) + if (PrefixLegacy.ItemSets.ItemsThatCanHaveLegendary2[item.type]) { int[][] terrarianReforgeTiers = new int[][] { @@ -148,26 +148,8 @@ namespace CalamityMod prefix = IteratePrefix(rand, terrarianReforgeTiers, currentPrefix); } - // Yoyos, Flails, Spears, etc. - // Spears actually work fine with Legendary, but vanilla doesn't give it to them, so we won't either. - // Rapiers, whips, and other specific vanilla weapons (ie. Zenith or Excalibur) are specifically excluded from this, so they get broadsword reforges despite not scaling with melee speed. - // - // 18FEB2024: Ozzatron: removed the (item.channel || item.noMelee) because vanilla lets Burning Sky get Legendary - // 12MAY2024: Shade: added item.useStyle != ItemUseStyleID.Shoot because vanilla lets Sahara Slicers and Death's Ascension get Legendary - else if (item.channel && item.useStyle != ItemUseStyleID.Rapier && !item.CountsAsClass() && !PrefixLegacy.ItemSets.SwordsHammersAxesPicks[item.type] && item.useStyle != ItemUseStyleID.Shoot) - { - int[][] meleeNoSpeedReforgeTiers = new int[][] - { - /* 0 */ new int[] { PrefixID.Keen, PrefixID.Forceful, PrefixID.Strong }, - /* 1 */ new int[] { PrefixID.Hurtful, PrefixID.Ruthless, PrefixID.Zealous }, - /* 2 */ new int[] { PrefixID.Superior, PrefixID.Demonic }, - /* 3 */ new int[] { PrefixID.Godly } - }; - prefix = IteratePrefix(rand, meleeNoSpeedReforgeTiers, currentPrefix); - } - - // All other melee weapons - else + // Swords, Whips, Tools, other items that support the Legendary modifier + else if (PrefixLegacy.ItemSets.SwordsHammersAxesPicks[item.type] || (item.ModItem != null && item.ModItem.MeleePrefix())) { int[][] meleeReforgeTiers = new int[][] { @@ -180,7 +162,7 @@ namespace CalamityMod }; int[][] toolReforgeTiers = new int[][] { - /* 0 */ new int[] { PrefixID.Keen, PrefixID.Nimble, PrefixID.Nasty, PrefixID.Heavy, PrefixID.Light, PrefixID.Forceful, PrefixID.Strong }, + /* 0 */ new int[] { PrefixID.Keen, PrefixID.Nimble, PrefixID.Nasty, PrefixID.Heavy, PrefixID.Forceful, PrefixID.Strong }, /* 1 */ new int[] { PrefixID.Hurtful, PrefixID.Ruthless, PrefixID.Zealous, PrefixID.Quick, PrefixID.Pointy, PrefixID.Bulky }, /* 2 */ new int[] { PrefixID.Murderous, PrefixID.Agile, PrefixID.Large, PrefixID.Dangerous, PrefixID.Sharp }, /* 3 */ new int[] { PrefixID.Massive, PrefixID.Unpleasant, PrefixID.Savage, PrefixID.Superior }, @@ -191,6 +173,20 @@ namespace CalamityMod var tierListToUse = (item.pick > 0 || item.axe > 0 || item.hammer > 0) ? toolReforgeTiers : meleeReforgeTiers; prefix = IteratePrefix(rand, tierListToUse, currentPrefix); } + + // Yoyos, Flails, Spears, etc. + // Spears actually work fine with Legendary, but vanilla doesn't give it to them, so we won't either. + else + { + int[][] meleeNoSpeedReforgeTiers = new int[][] + { + /* 0 */ new int[] { PrefixID.Keen, PrefixID.Forceful, PrefixID.Strong }, + /* 1 */ new int[] { PrefixID.Hurtful, PrefixID.Ruthless, PrefixID.Zealous }, + /* 2 */ new int[] { PrefixID.Superior, PrefixID.Demonic }, + /* 3 */ new int[] { PrefixID.Godly } + }; + prefix = IteratePrefix(rand, meleeNoSpeedReforgeTiers, currentPrefix); + } } // RANGED From f119b6787cf55548ad7a5abb4594621e8b7c963c Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Mon, 27 May 2024 11:33:45 +0700 Subject: [PATCH 169/177] flamethrower tweaks buffed gel efficiency on early ones (spark spreader stats net buffed accordingly to slower uses) fixed havocs breath fire not fading properly and use anim stopgap --- Items/Weapons/Ranged/HavocsBreath.cs | 1 + Items/Weapons/Ranged/Shadethrower.cs | 2 +- Items/Weapons/Ranged/SparkSpreader.cs | 6 ++++-- Projectiles/Ranged/BrimstoneFireFriendly.cs | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Ranged/HavocsBreath.cs b/Items/Weapons/Ranged/HavocsBreath.cs index efad9edd1e..fa23d2cd9b 100644 --- a/Items/Weapons/Ranged/HavocsBreath.cs +++ b/Items/Weapons/Ranged/HavocsBreath.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.useTime = 5; Item.useAnimation = 35; Item.reuseDelay = 20; + Item.useLimitPerAnimation = 7; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Ranged/Shadethrower.cs b/Items/Weapons/Ranged/Shadethrower.cs index a212cfe9d1..ddb3786745 100644 --- a/Items/Weapons/Ranged/Shadethrower.cs +++ b/Items/Weapons/Ranged/Shadethrower.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 23; Item.DamageType = DamageClass.Ranged; Item.useTime = 10; - Item.useAnimation = 30; + Item.useAnimation = 40; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Ranged/SparkSpreader.cs b/Items/Weapons/Ranged/SparkSpreader.cs index 8b292401c2..8ff1657262 100644 --- a/Items/Weapons/Ranged/SparkSpreader.cs +++ b/Items/Weapons/Ranged/SparkSpreader.cs @@ -13,12 +13,14 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 56; Item.height = 26; - Item.damage = 10; + Item.damage = 16; Item.knockBack = 1f; Item.DamageType = DamageClass.Ranged; Item.autoReuse = true; Item.useTime = 12; - Item.useAnimation = 36; + Item.useAnimation = 48; + Item.reuseDelay = 12; + Item.useLimitPerAnimation = 4; Item.useAmmo = AmmoID.Gel; Item.consumeAmmoOnFirstShotOnly = true; Item.shootSpeed = 6f; diff --git a/Projectiles/Ranged/BrimstoneFireFriendly.cs b/Projectiles/Ranged/BrimstoneFireFriendly.cs index 60828b0eef..e419809b56 100644 --- a/Projectiles/Ranged/BrimstoneFireFriendly.cs +++ b/Projectiles/Ranged/BrimstoneFireFriendly.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Ranged public override string Texture => "CalamityMod/Projectiles/FireProj"; public static int Lifetime => 60; - public static int Fadetime => 80; + public static int Fadetime => 50; public ref float Time => ref Projectile.ai[0]; public int MistType = -1; From 6143a4b52fbb9446dcf728a99f5d6450cad30bb8 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 27 May 2024 01:05:58 -0400 Subject: [PATCH 170/177] Added even more missing HP/s life regen tooltips --- Items/CalamityGlobalItemTooltip.cs | 37 ++++++++++++++++++- .../Mods.CalamityMod.Items.Accessories.hjson | 32 ++++++++-------- ...CalamityMod.Items.Armor.PostMoonLord.hjson | 2 +- .../Mods.CalamityMod.Items.Fishing.hjson | 4 +- .../Mods.CalamityMod.Items.Potions.hjson | 5 ++- ...Mods.CalamityMod.Items.Weapons.Melee.hjson | 4 +- ...Mods.CalamityMod.Items.Weapons.Rogue.hjson | 2 +- ...ods.CalamityMod.Items.Weapons.Summon.hjson | 2 +- 8 files changed, 62 insertions(+), 26 deletions(-) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index d2fa8e249d..3cff630860 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -292,6 +292,37 @@ namespace CalamityMod.Items EditTooltipByNum(0, (line) => line.Text += "\nDemon Altars now drop Souls of Night instead of generating ores when destroyed" + "\nHardmode ores now generate after defeating Mechanical Bosses for the first time"); + // Exact life regen descriptions + bool isCampfire = item.type == ItemID.Campfire || item.type == ItemID.CursedCampfire || item.type == ItemID.DemonCampfire || item.type == ItemID.FrozenCampfire || item.type == ItemID.IchorCampfire || item.type == ItemID.RainbowCampfire || item.type == ItemID.UltraBrightCampfire || item.type == ItemID.BoneCampfire || item.type == ItemID.DesertCampfire || item.type == ItemID.CoralCampfire || item.type == ItemID.CorruptCampfire || item.type == ItemID.CrimsonCampfire || item.type == ItemID.HallowedCampfire || item.type == ItemID.JungleCampfire || item.type == ItemID.MushroomCampfire || item.type == ItemID.ShimmerCampfire; + if (isCampfire) + EditTooltipByNum(0, (line) => line.Text = "Life regen is increased by 0.5 HP/s when near a campfire"); + + if (item.type == ItemID.HeartLantern) + EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration when placed nearby"); + + if (item.type == ItemID.BottledHoney) + EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regen for a short time" + + "\nGrants an additional +1 HP/s life regen while inflicted with a damaging debuff"); + + if (item.type == ItemID.ShinyStone) + EditTooltipByNum(0, (line) => line.Text = "Grants +2 HP/s life regen and accelerates natural life regen when not moving"); + + if (item.type == ItemID.BandofRegeneration) + EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration"); + + if (item.type == ItemID.CharmofMyths) + EditTooltipByNum(0, (line) => line.Text = "Grants +1 HP/s life regeneration and reduces the cooldown of healing potions by 25%"); + + if (item.type == ItemID.RegenerationPotion) + EditTooltipByNum(0, (line) => line.Text = "Provides +2 HP/s life regeneration"); + + if (item.type == ItemID.SoulDrain) + EditTooltipByNum(0, (line) => line.Text += "\nThis grants +1.5 HP/s life regen and accelerates natural life regen" + + "\nLife drain stacks based on the number of enemies being hit"); + + if (item.type == ItemID.HamBat) + EditTooltipByNum(1, (line) => line.Text = "Defeating enemies temporarily grants +3 HP/s life regen"); + // Warmth Potion provides debuff immunities if (item.type == ItemID.WarmthPotion) { @@ -900,8 +931,10 @@ namespace CalamityMod.Items // DD2 armor tooltip edits #region DD2 Armor - // Reduce DD2 armor piece bonuses because they're overpowered + // Reduce DD2 armor piece bonuses because they're overpowered, and clarify life regen boosts // Squire armor + if (item.type == ItemID.SquireGreatHelm) + EditTooltipByNum(0, (line) => line.Text = "Increases your max number of sentries by 1 and grants +2 HP/s life regen"); if (item.type == ItemID.SquirePlating) EditTooltipByNum(0, (line) => line.Text = "10% increased minion and melee damage"); if (item.type == ItemID.SquireGreaves) @@ -931,7 +964,7 @@ namespace CalamityMod.Items // Valhalla Knight armor if (item.type == ItemID.SquireAltShirt) - EditTooltipByNum(0, (line) => line.Text = "30% increased minion damage and increased life regeneration"); + EditTooltipByNum(0, (line) => line.Text = "30% increased minion damage and grants +4 HP/s life regen"); if (item.type == ItemID.SquireAltPants) EditTooltipByNum(0, (line) => line.Text = "10% increased minion damage and melee critical strike chance"); diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index d0131bd3cc..a59c1a9563 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -138,8 +138,8 @@ AmbrosialAmpoule: { ''' +50 max life Grants +2 to +6 HP/s life regen based on missing health - Provides life regeneration equivalent to standing in Honey - Standing still grants extremely powerful regen + Grants +1 HP/s life regen and an additional 1 HP/s life regen when inflicted with a damage debuff + Standing still grants +1.5 HP/s life regen Halves how long you are afflicted with fire and sickness debuffs You emit yellow light if visibility is enabled ''' @@ -885,8 +885,9 @@ HallowedRune: { Tooltip: ''' Whenever your minions hit an enemy you will gain a random buff, does not stack with downgrades - These buffs will either boost your defense, summon damage, or life regen for a while - If you have the offensive boost, enemies hit by minions will sometimes be hit by stars + Hallowed Power increases summon damage by 10% and makes enemy hits from minions rain stars + Hallowed Defense increases defense by 8 and DR by 4% + Hallowed Regen grants +1.5 HP/s life regeneration ''' } @@ -935,8 +936,8 @@ HoneyDew: { Tooltip: ''' +30 max life - Provides life regeneration equivalent to standing in Honey - Standing still in Honey grants extremely powerful regen + Grants +1 HP/s life regen and an additional 1 HP/s life regen when inflicted with a damage debuff + Standing still in Honey grants +1.5 HP/s life regen Halves how long you are afflicted with sickness debuffs ''' } @@ -1023,8 +1024,8 @@ LivingDew: { Tooltip: ''' +50 max life - Provides life regeneration equivalent to standing in Honey - Standing still in Honey grants extremely powerful regen + Grants +1 HP/s life regen and an additional 1 HP/s life regen when inflicted with a damage debuff + Standing still in Honey grants +1.5 HP/s life regen Halves how long you are afflicted with fire and sickness debuffs ''' } @@ -1242,10 +1243,9 @@ PhantomicArtifact: { Tooltip: ''' Whenever your minions hit an enemy you will gain a random phantomic buff, does not stack with downgrades - These buffs will either boost your defense, summon damage, or life regen for a while - If you have the offensive boost, enemies hit by minions will sometimes be hit by phantomic knives - If you have the regenerative boost, a phantomic heart will occasionally materialise granting massive health regen - If you have the defensive boost, a phantomic bulwark will absorb 20% of the next projectile's damage that hits the bulwark, shattering it + Phantomic Empowerment increases summon damage by 10% and makes minion hits spawn phantomic knives + Phantomic Shield increases defense by 10 and DR by 5% and spawns a phantomic bulwark which absorbs 20% of the next projectile's damage that touches it + Phantomic Regen grants +2 HP/s life regen and spawns a phantomic heart which grants an additional 2 HP/s life regen when touched ''' } @@ -1332,8 +1332,8 @@ Radiance: { ''' +70 max life Grants +2 to +6 HP/s life regen based on missing health - Provides life regeneration equivalent to standing in Honey - Standing still grants extremely powerful regen + Grants +1 HP/s life regen and an additional 1 HP/s life regen when inflicted with a damage debuff + Standing still grants +2 HP/s life regen Grants 20 defense and continuous healing while afflicted with any debuff The healing eventually slows down if debuffed for an extended period of time Massively boosts natural life regen while afflicted with any debuff @@ -1586,7 +1586,9 @@ SpiritGlyph: { Tooltip: ''' Whenever your minions hit an enemy you will gain a random buff - These buffs will either boost your defense, summon damage, or life regen for a while + Spirit Power increases summon damage by 10% + Spirit Defense increases defense by 6 and DR by 3% + Spirit Regen grants +1 HP/s life regeneration ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 06272e4042..f4e3ddf84b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -527,7 +527,7 @@ TarragonHeadMelee: { ''' 15% increased melee speed Enemies are more likely to target you - You gain a life regen buff when you take damage + Taking damage gives the Tarra Life buff, which grants +1.5 HP/s life regen Press {0} to cloak yourself in life energy that heavily reduces enemy contact damage for 10 seconds This has a 30 second cooldown ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 8e96193a93..433e0e4d83 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -54,8 +54,8 @@ Bloodfin: { DisplayName: Bloodfin Tooltip: ''' - Grants a buff that boosts life regen for 10 seconds - The life regen boost is stronger if below 75% health + Grants a buff that grants +2.5 HP/s life regen + This buff directly restores HP if below 75% health 10 second duration 'The wonders of angiogenesis' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 0c7a8a0250..94bfd6c74c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -18,7 +18,7 @@ Baguette: { Tooltip: ''' {$CommonItemTooltip.MinorStats} - Boosts the effects of Red Wine + Red Wine heals 250 HP, but reduces life regen by 2 HP/s [c/FCE391:'je suis Monte'] ''' } @@ -104,7 +104,8 @@ PhotosynthesisPotion: { DisplayName: Photosynthesis Potion Tooltip: ''' - You regen life quickly while not moving, this effect is five times as strong during daytime + Grants +0.5 HP/s life regen and accelerates natural life regen while not moving + This natural life regen effect is five times as strong during daytime Dropped hearts heal more HP ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index afeab0b76b..88b9e92839 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -287,7 +287,7 @@ CosmicDischarge: { Tooltip: ''' Striking an enemy with the whip causes glacial explosions and grants the player the cosmic freeze buff - This buff gives the player increased life regen while standing still and freezes enemies near the player + This buff gives the player +2 HP/s life regen while standing still and freezes enemies near the player ''' } @@ -707,7 +707,7 @@ Lacerator: { DisplayName: Lacerator Tooltip: ''' - Enemies that are hit by the yoyo will have their life drained + Accelerates natural life regeneration on hits with the yoyo An exceptionally agile yoyo [GFB] ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index abd9755e31..69ed27ce98 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -193,7 +193,7 @@ CorpusAvertor: { Attacks grant lifesteal based on damage dealt The lower your HP the more damage this weapon does and heals the player on enemy hits Stealth strikes throw a single rainbow outlined dagger - On enemy hits, this dagger boosts the damage and life regen of all members of your team + On enemy hits, this dagger grants 10% damage and +2 HP/s life regen to all members of your team However, there is a small chance it will cut your health in half instead 'Seems like it has worn down over time' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index 0b7073c368..2fa9a00315 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -789,7 +789,7 @@ WulfrumController: { Summons a wulfrum droid to fight for you Hold right click while holding the remote to switch all of your drones into supercharge mode Supercharged droids will stop attacking and focus wulfrum energy onto you - The beam provides extra regeneration and defense + Supercharged droids provide +0.5 HP/s life regen and 3 defense per droid Can also be used to heal other players by keeping your mouse cursor close enough to them ''' } From 5457c6e432f2d50edd5dd5fb21c5170fae099d2b Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 27 May 2024 01:32:35 -0400 Subject: [PATCH 171/177] Altar of the Accursed outdated tooltip fix --- Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson | 1 - 1 file changed, 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index c07939ffdc..ddb61fbc36 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -523,7 +523,6 @@ AltarOfTheAccursedItem: { ''' Offer Ashes of Calamity at this altar to summon the Witch Doing so will create a square arena of blocks, with the altar at its center - During the battle, heart pickups only heal for half as much The Witch enrages while you are outside of the arena {$CommonItemTooltip.SpecialCrafting} ''' From 02d49a0d87a3b590f834d7459132029d5c1bd479 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 27 May 2024 00:00:38 -0700 Subject: [PATCH 172/177] Old Dukes Scales Buff Recovery time reduced by half a second, stamina recovers faster and instead of requiring you to stand still for the stronger bonus, you can get it if you press no movement keys. --- Items/Accessories/OldDukeScales.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Items/Accessories/OldDukeScales.cs b/Items/Accessories/OldDukeScales.cs index 43a9746187..94816ec2a7 100644 --- a/Items/Accessories/OldDukeScales.cs +++ b/Items/Accessories/OldDukeScales.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; - public static int RecoverTime = 120; + public static int RecoverTime = 90; public static int DashFatigueIncrease = 240; public static int MaxFatigue = 1200; // This is also the time that it takes the player to recover from the loss of all stamina. @@ -128,8 +128,9 @@ namespace CalamityMod.Items.Accessories RecoverTimer--; // If the player has recovered, start decreasing the fatigue. + bool PressingMoveKeys = Player.controlLeft || Player.controlRight || Player.controlDown || Player.controlJump; if (Fatigue > 0 && RecoverTimer <= 0) - Fatigue -= Player.StandingStill() ? 2 : 1; + Fatigue -= PressingMoveKeys ? 3 : 5; // The fatigue cannot go higher than the max. if (Fatigue >= OldDukeScales.MaxFatigue) From ab780018e212d62689090965015e113abf3796e2 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 27 May 2024 09:24:16 -0500 Subject: [PATCH 173/177] Nerfed Mythril Armor set flare damage cap from 50 to 40 and damage mult from 0.4 to 0.3 (untested, but this should help balance it more). --- Items/VanillaArmorChanges/MythrilArmorSetChange.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs index c92a58262a..772fad8a35 100644 --- a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public const int MaxManaBoost = 20; public const int FlareFrameSpawnDelay = 12; - public const int FlareDamageSoftcap = 50; + public const int FlareDamageSoftcap = 40; public override void UpdateSetBonusText(ref string setBonusText) { @@ -51,7 +51,7 @@ namespace CalamityMod.Items.VanillaArmorChanges // Reset the spawn delay. owner.Calamity().MythrilFlareSpawnCountdown = FlareFrameSpawnDelay; - int flareDamage = CalamityUtils.DamageSoftCap(originalDamage * 0.4, FlareDamageSoftcap); + int flareDamage = CalamityUtils.DamageSoftCap(originalDamage * 0.3, FlareDamageSoftcap); flareDamage = owner.ApplyArmorAccDamageBonusesTo(flareDamage); Vector2 flareSpawnPosition = victim.Center + Main.rand.NextVector2Circular(10f, 10f); From 954174d7f9fe8040e08adc1c6b0bffff17410c50 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 27 May 2024 11:57:01 -0400 Subject: [PATCH 174/177] 1 - Alch Flask now reduces Plague damage instead of granting full immunity 2 - Reduced several debuff damage reducing effects --- Buffs/DamageOverTime/Plague.cs | 9 ++++++--- CalPlayer/CalamityPlayerLifeRegen.cs | 2 +- CalPlayer/CalamityPlayerMiscEffects.cs | 10 ++++++---- Items/Accessories/AlchemicalFlask.cs | 1 - .../en-US/Mods.CalamityMod.Items.Accessories.hjson | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Buffs/DamageOverTime/Plague.cs b/Buffs/DamageOverTime/Plague.cs index 747e25e7aa..f776337e36 100644 --- a/Buffs/DamageOverTime/Plague.cs +++ b/Buffs/DamageOverTime/Plague.cs @@ -36,15 +36,18 @@ namespace CalamityMod.Buffs.DamageOverTime float numberOfDusts = 2f; float rotFactor = 360f / numberOfDusts; + int particleAmt = Player.Calamity().alchFlask ? 1 : 2; + int dustSpawnAmt = Player.Calamity().alchFlask ? 4 : 7; if (Player.miscCounter % 4 == 0) { - for (int i = 0; i < 2; i++) + for (int i = 0; i < particleAmt; i++) { - DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.18f), 0f, 20); + float pulseScale = Main.rand.NextFloat(Player.Calamity().alchFlask ? 0.04f : 0.07f, Player.Calamity().alchFlask ? 0.12f : 0.18f); + DirectionalPulseRing pulse = new DirectionalPulseRing(Player.Calamity().RandomDebuffVisualSpot, Vector2.Zero, Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green, Vector2.One, 0, pulseScale, 0f, 20); GeneralParticleHandler.SpawnParticle(pulse); } - for (int i = 0; i < 7; i++) + for (int i = 0; i < dustSpawnAmt; i++) { int DustID = Main.rand.NextBool(30) ? 220 : 89; float rot = MathHelper.ToRadians(i * rotFactor); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 834104e3e4..b3a4716447 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -106,7 +106,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(vHex, 35); ApplyDoTDebuff(cDepth, 18, purity); ApplyDoTDebuff(astralInfection, 24, infectedJewel || purity); - ApplyDoTDebuff(pFlames, 30, purity); + ApplyDoTDebuff(pFlames, alchFlask ? 15 : 30, purity); ApplyDoTDebuff(cragsLava, 30); ApplyDoTDebuff(shadowflame, 30, purity); // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index fc0de93d70..03434292cc 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2918,15 +2918,17 @@ namespace CalamityMod.CalPlayer } if (wDeath && !purity) - Player.GetDamage() -= 0.25f; + Player.GetDamage() -= 0.2f; if (astralInfection && !(infectedJewel || purity)) - Player.GetDamage() -= 0.15f; + Player.GetDamage() -= 0.1f; if (pFlames && !purity) { - Player.blind = true; - Player.GetDamage() -= 0.15f; + if (!alchFlask) + Player.blind = true; + + Player.GetDamage() -= 0.1f; } if (aCrunch && !laudanum && !purity) diff --git a/Items/Accessories/AlchemicalFlask.cs b/Items/Accessories/AlchemicalFlask.cs index 909aa4106f..86d4aa1de4 100644 --- a/Items/Accessories/AlchemicalFlask.cs +++ b/Items/Accessories/AlchemicalFlask.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.alchFlask = true; - player.buffImmune[ModContent.BuffType()] = true; } public override void AddRecipes() diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index a59c1a9563..6da5c57dca 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -102,7 +102,7 @@ AlchemicalFlask: { DisplayName: Alchemical Flask Tooltip: ''' - All attacks inflict the Plague and grants immunity to the Plague + All attacks inflict the Plague and reduces damage taken from the Plague Projectiles spawn plague seekers on enemy hits ''' } From 837e7a8d148e56b06eb15f8448a561fbccf2b318 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 27 May 2024 12:02:20 -0400 Subject: [PATCH 175/177] Actually was gonna make it reduce to this --- CalPlayer/CalamityPlayerLifeRegen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index b3a4716447..97262ff6c1 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -106,7 +106,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(vHex, 35); ApplyDoTDebuff(cDepth, 18, purity); ApplyDoTDebuff(astralInfection, 24, infectedJewel || purity); - ApplyDoTDebuff(pFlames, alchFlask ? 15 : 30, purity); + ApplyDoTDebuff(pFlames, alchFlask ? 10 : 30, purity); ApplyDoTDebuff(cragsLava, 30); ApplyDoTDebuff(shadowflame, 30, purity); // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno From 19a712e363545b8e241b660d64c9d88cb7ce1400 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 27 May 2024 12:07:06 -0500 Subject: [PATCH 176/177] Fixed King Slime out of bounds errors. --- .../Bosses/KingSlimeAI.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index 15bd1a8e83..3e40e48be0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -975,6 +975,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 randomDefault = Main.rand.NextBool() ? Vector2.UnitX : -Vector2.UnitX; Vector2 vectorAimedAheadOfTarget = Main.player[npc.target].Center + new Vector2((float)Math.Round(Main.player[npc.target].velocity.X), 0f).SafeNormalize(randomDefault) * distanceAhead; Point predictiveTeleportPoint = vectorAimedAheadOfTarget.ToTileCoordinates(); + if (predictiveTeleportPoint.X < 10) + predictiveTeleportPoint.X = 10; + if (predictiveTeleportPoint.X > Main.maxTilesX - 10) + predictiveTeleportPoint.X = Main.maxTilesX - 10; + if (predictiveTeleportPoint.Y < 10) + predictiveTeleportPoint.Y = 10; + if (predictiveTeleportPoint.Y > Main.maxTilesY - 10) + predictiveTeleportPoint.Y = Main.maxTilesY - 10; + int randomPredictiveTeleportOffset = 5; int teleportTries = 0; while (teleportTries < 100) @@ -998,10 +1007,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } else + { predictiveTeleportPoint.X += predictiveTeleportPoint.X < 0f ? 1 : -1; + if (predictiveTeleportPoint.X < 10) + predictiveTeleportPoint.X = 10; + if (predictiveTeleportPoint.X > Main.maxTilesX - 10) + predictiveTeleportPoint.X = Main.maxTilesX - 10; + } } else + { predictiveTeleportPoint.X += predictiveTeleportPoint.X < 0f ? 1 : -1; + if (predictiveTeleportPoint.X < 10) + predictiveTeleportPoint.X = 10; + if (predictiveTeleportPoint.X > Main.maxTilesX - 10) + predictiveTeleportPoint.X = Main.maxTilesX - 10; + } } // Default teleport if the above conditions aren't met in 100 iterations From 941ad97305d57be46641129af14d533155f85028 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 27 May 2024 13:30:58 -0400 Subject: [PATCH 177/177] Small Hallowed Rune tooltip wording change --- Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 6da5c57dca..3404dbabe0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -885,7 +885,7 @@ HallowedRune: { Tooltip: ''' Whenever your minions hit an enemy you will gain a random buff, does not stack with downgrades - Hallowed Power increases summon damage by 10% and makes enemy hits from minions rain stars + Hallowed Power increases summon damage by 10% and makes minion hits rain stars Hallowed Defense increases defense by 8 and DR by 4% Hallowed Regen grants +1.5 HP/s life regeneration '''