From b36c8a5f144fce466a169066694f985e850330a5 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 2 Aug 2024 18:25:57 -0400 Subject: [PATCH] Gruesome Eminence and Rancor no longer self-damage Removed Rancor Burn, turning the variable into an "ashesOnDeath" variable that also causes other visual effects --- Buffs/DamageOverTime/RancorBurn.cs | 25 ---------------- Buffs/DamageOverTime/RancorBurn.png | Bin 358 -> 0 bytes ...Mods.CalamityMod.Items.Weapons.Magic.hjson | 7 ++--- NPCs/CalamityGlobalNPC.cs | 27 +++++++++++++----- Projectiles/Magic/RancorArm.cs | 21 ++++---------- Projectiles/Magic/RancorFog.cs | 2 +- Projectiles/Magic/RancorLargeCinder.cs | 7 ----- Projectiles/Magic/RancorLaserbeam.cs | 7 ++--- Projectiles/Magic/SmallSpirit.cs | 4 --- Projectiles/Magic/SpiritCongregation.cs | 21 -------------- 10 files changed, 31 insertions(+), 90 deletions(-) delete mode 100644 Buffs/DamageOverTime/RancorBurn.cs delete mode 100644 Buffs/DamageOverTime/RancorBurn.png diff --git a/Buffs/DamageOverTime/RancorBurn.cs b/Buffs/DamageOverTime/RancorBurn.cs deleted file mode 100644 index cab69f7bf8..0000000000 --- a/Buffs/DamageOverTime/RancorBurn.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.DamageOverTime -{ - public class RancorBurn : ModBuff - { - public override void SetStaticDefaults() - { - Main.debuff[Type] = true; - Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; - BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; - } - - public override void Update(NPC npc, ref int buffIndex) - { - if (npc.Calamity().RancorBurnTime < npc.buffTime[buffIndex]) - npc.Calamity().RancorBurnTime = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; - } - } -} diff --git a/Buffs/DamageOverTime/RancorBurn.png b/Buffs/DamageOverTime/RancorBurn.png deleted file mode 100644 index f7e99e7e26cef18d2148c3ad51b16ff887c861f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 358 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijS1AIbUfwZrso2`cJS`)X&{{Bw#u8CrnX@O}P5(Zrg20+=4$WzHcin}Dp zFZe$kFnIYhegX<}7I;J!GcfQS24TkI`72U@g4;b^978Ppmrf4kJFLLtoY-Qp~Z5+Ujlf?)i8>gi9dl+U}XVXP$~|I4QCF466+r ze=1|hYBBa3hMO4@Gd7fem&-aU`#|`U*ad;vMoHRx*6Z~hFg_wCx9G&&u#d$JZPJb| zQ>L?aG_PIodq&+Z3#O=^rItBN=QtbYvl^svF!+47IndHkyehC)#DxFEB}e8L^Vsh& me(S!Z-aMW8-=E#rs~GJL@TRtRzS{!y0)wZkpUXO@geCxKg@lv< diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index ac617a0f5e..c01c75ba6c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -391,9 +391,8 @@ GruesomeEminence: { DisplayName: Gruesome Eminence Tooltip: ''' - Summons a gaseous conglomeration of spirits near the cursor - At first, the spirits will fly wildly. This can hurt enemies and players - However, over time they will begin to accumulate to create a single, controllable monstrosity + Summons a gaseous conglomeration of spirits near the cursor that fly around wildly + Over time, the spirits accumulate to create a single, controllable monstrosity [c/C61B40:'The spirits of the amalgam could never pass on to their desired afterlife,] [c/C61B40:Tainted and melded by rage as they were.'] ''' @@ -682,7 +681,7 @@ Rancor: { Tooltip: ''' Casts a magic circle that charges energy and eventually releases a powerful laser burst of controlled maleficent magic - The laser causes arms and searing lava to appear on surfaces it touches which harm both you and enemies + The laser causes arms and searing lava to appear on surfaces it touches [c/C61B40:'Forgiveness can only heal so much,] [c/C61B40:If the recipient has not yet forgiven themselves.'] ''' diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index f3371ba6e6..70d09800df 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5,12 +5,12 @@ using System.Reflection; using CalamityMod.Balancing; using CalamityMod.Buffs; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.Placeables; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon.Whips; using CalamityMod.CalPlayer; using CalamityMod.Events; +using CalamityMod.Graphics.Metaballs; using CalamityMod.Graphics.Renderers.CalamityRenderers; using CalamityMod.Items.Accessories; using CalamityMod.Items.Tools; @@ -299,7 +299,7 @@ namespace CalamityMod.NPCs public int vulnerabilityHex = 0; public int banishingFire = 0; public int wither = 0; - public int RancorBurnTime = 0; + public int ashesOnDeath = 0; // whoAmI Variables public static int[] bobbitWormBottom = new int[5]; @@ -523,7 +523,7 @@ namespace CalamityMod.NPCs myClone.vulnerabilityHex = vulnerabilityHex; myClone.banishingFire = banishingFire; myClone.wither = wither; - myClone.RancorBurnTime = RancorBurnTime; + myClone.ashesOnDeath = ashesOnDeath; // This gets set up as needed. myClone.VulnerabilityHexFireDrawer = null; @@ -5291,8 +5291,8 @@ namespace CalamityMod.NPCs banishingFire--; if (wither > 0) wither--; - if (RancorBurnTime > 0) - RancorBurnTime--; + if (ashesOnDeath > 0) + ashesOnDeath--; if (cobaltNerfTimer > 0) cobaltNerfTimer--; @@ -6020,7 +6020,7 @@ namespace CalamityMod.NPCs #region Hit Effect public override void HitEffect(NPC npc, NPC.HitInfo hit) { - if (npc.life <= 0 && npc.Organic() && RancorBurnTime > 0) + if (npc.life <= 0 && npc.Organic() && ashesOnDeath > 0) DeathAshParticle.CreateAshesFromNPC(npc); // Cultist shield flicker @@ -6594,6 +6594,20 @@ namespace CalamityMod.NPCs if (absorberAffliction > 0) AbsorberAffliction.DrawEffects(npc, ref drawColor); + // Rancor's burn effect + if (ashesOnDeath > 0) + { + if (Main.rand.NextBool(4)) + { + Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Main.rand.NextVector2Circular(2.75f, 6.5f), ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0.475f); + } + if (Main.rand.NextBool(6)) + { + Vector2 randomPosition = new(npc.position.X + Main.rand.NextFloat(-10f, npc.width + 10f), npc.position.Y + Main.rand.NextFloat(-10f, npc.height + 10f)); + RancorLavaMetaball.SpawnParticle(randomPosition, Main.rand.NextFloat(30f, 37f)); + } + } + if (astralInfection > 0) AstralInfectionDebuff.DrawEffects(npc, ref drawColor); @@ -6858,7 +6872,6 @@ namespace CalamityMod.NPCs ("CalamityMod/Buffs/DamageOverTime/MiracleBlight", NPC => NPC.Calamity().miracleBlight > 0), ("CalamityMod/Buffs/DamageOverTime/Nightwither", NPC => NPC.Calamity().nightwither > 0), ("CalamityMod/Buffs/DamageOverTime/Plague", NPC => NPC.Calamity().pFlames > 0), - ("CalamityMod/Buffs/DamageOverTime/RancorBurn", NPC => NPC.Calamity().RancorBurnTime > 0), ("CalamityMod/Buffs/DamageOverTime/RiptideDebuff", NPC => NPC.Calamity().rTide > 0), ("CalamityMod/Buffs/DamageOverTime/SagePoison", NPC => NPC.Calamity().sagePoisonTime > 0), ("CalamityMod/Buffs/DamageOverTime/ShellfishClaps", NPC => NPC.Calamity().shellfishVore > 0), diff --git a/Projectiles/Magic/RancorArm.cs b/Projectiles/Magic/RancorArm.cs index e9247e6092..2f3c7a281c 100644 --- a/Projectiles/Magic/RancorArm.cs +++ b/Projectiles/Magic/RancorArm.cs @@ -1,9 +1,10 @@ -using System; -using System.Collections.Generic; -using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.IO; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -28,7 +29,6 @@ namespace CalamityMod.Projectiles.Magic { Projectile.width = Projectile.height = 4; Projectile.friendly = true; - Projectile.hostile = true; Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic // Decide a frame to use and adjust the hitbox based on it. if (Projectile.localAI[0] == 0f) { - // Play a wraith death sound by default, play a generic flame sound when spawned by gfb Orthoceras + // Play a wraith death sound by default, play a generic flame sound when spawned by GFB Orthoceras SoundStyle sound = Time == 0 ? SoundID.NPCDeath52 : SoundID.Item20; SoundEngine.PlaySound(sound, Projectile.Center); @@ -135,17 +135,6 @@ namespace CalamityMod.Projectiles.Magic behindNPCsAndTiles.Add(index); } - public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) - { - if (Projectile.friendly) - { - modifiers.SourceDamage *= 0f; - if (Main.masterMode) modifiers.SourceDamage.Flat += 450f; - else if (Main.expertMode) modifiers.SourceDamage.Flat += 375f; - else modifiers.SourceDamage.Flat += 300f; - } - } - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; diff --git a/Projectiles/Magic/RancorFog.cs b/Projectiles/Magic/RancorFog.cs index cc971a645e..caa7e8cfb2 100644 --- a/Projectiles/Magic/RancorFog.cs +++ b/Projectiles/Magic/RancorFog.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic // Decide scale and initial rotation on the first frame this projectile exists. if (Projectile.localAI[0] == 0f) { - Projectile.scale = Main.rand.NextFloat(1f, 1.7f); + Projectile.scale = Main.rand.NextFloat(1f, 1.7f) * Projectile.ai[1]; Projectile.rotation = Main.rand.NextFloat(MathHelper.TwoPi); Projectile.localAI[0] = 1f; } diff --git a/Projectiles/Magic/RancorLargeCinder.cs b/Projectiles/Magic/RancorLargeCinder.cs index 45e9a59036..a27ef75db1 100644 --- a/Projectiles/Magic/RancorLargeCinder.cs +++ b/Projectiles/Magic/RancorLargeCinder.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; Projectile.friendly = true; - Projectile.hostile = true; Projectile.timeLeft = 300; Projectile.ignoreWater = true; } @@ -49,12 +48,6 @@ namespace CalamityMod.Projectiles.Magic Time++; } - public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) - { - modifiers.SourceDamage *= 0f; - modifiers.SourceDamage.Flat += Main.rand.Next(80, 90); - } - public override Color? GetAlpha(Color lightColor) => Color.White * Projectile.Opacity; } } diff --git a/Projectiles/Magic/RancorLaserbeam.cs b/Projectiles/Magic/RancorLaserbeam.cs index b2d907be0d..195f7e0446 100644 --- a/Projectiles/Magic/RancorLaserbeam.cs +++ b/Projectiles/Magic/RancorLaserbeam.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Magic public void CreateTileHitEffects() { Vector2 endOfLaser = Projectile.Center + Projectile.velocity * (LaserLength - Main.rand.NextFloat(12f, 72f)); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), endOfLaser, Main.rand.NextVector2Circular(4f, 8f), ModContent.ProjectileType(), 0, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), endOfLaser, Main.rand.NextVector2Circular(4f, 8f), ModContent.ProjectileType(), 0, 0f, Projectile.owner, 0f, 1f); if (Main.rand.NextBool()) { @@ -182,10 +182,7 @@ namespace CalamityMod.Projectiles.Magic overWiresUI.Add(index); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 150); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.Calamity().ashesOnDeath = 10; public override bool ShouldUpdatePosition() => false; } diff --git a/Projectiles/Magic/SmallSpirit.cs b/Projectiles/Magic/SmallSpirit.cs index ef1d961c19..495e8611b2 100644 --- a/Projectiles/Magic/SmallSpirit.cs +++ b/Projectiles/Magic/SmallSpirit.cs @@ -61,12 +61,8 @@ namespace CalamityMod.Projectiles.Magic float flySpeed = 8f; float flyInertia = 54f; - Projectile.hostile = true; - Projectile.friendly = false; if (ProjectileOwner != null && (ProjectileOwner.ModProjectile().CurrentPower > 0.97f || Projectile.timeLeft < 95)) { - Projectile.hostile = false; - radius += 36f; target = ProjectileOwner; diff --git a/Projectiles/Magic/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index 71f1e234be..2af7ed9e9d 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -140,11 +140,6 @@ namespace CalamityMod.Projectiles.Magic HoverOffset = Vector2.Zero; } - // Previously, Gruesome Eminence stopped being able to hurt you when fully charged. - // This has been changed so that its threat is everpresent. - Projectile.hostile = Time > 75f; - // Projectile.hostile = !tame && Time > 75f; - // Explode into a burst of spirit dust and gas clouds when a bigger face appears. if (!WasStrongBefore && CurrentPower > LargeMouthPowerLowerBound) { @@ -304,22 +299,6 @@ namespace CalamityMod.Projectiles.Magic DrawHead(backTexture, 1.04f); } - // Damage scales up over time as it grows. - public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) - { - float damageFactor = 0.25f + 0.75f * CurrentPower; - int fullPowerDamage; - if (Main.masterMode) - fullPowerDamage = 540; - else if (Main.expertMode) - fullPowerDamage = 450; - else - fullPowerDamage = 360; - - modifiers.SourceDamage *= 0f; - modifiers.SourceDamage.Flat += (int)(damageFactor * fullPowerDamage); - } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { for (int i = 0; i < Projectile.oldPos.Length; i++)