From b85903c435529f06d69fddbf758535da9765ef04 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Fri, 15 Nov 2024 18:28:14 -0500 Subject: [PATCH] Phoenix's Pride sword throw spawn a flame pillar on hit Reduced visual clutter of Phoenix's Pride spin I had started balancing stuff before realizing I wasn't fully satisfied with the actual functionalities thus the Andromeda's Stride nerf; Polaris' Gaze's current effect needs to be shot in a ditch --- Effects/BordernadoFire.fx | 1 + Effects/BordernadoFire.xnb | Bin 3228 -> 3308 bytes Items/Weapons/Melee/FourSeasonsGalaxia.cs | 4 +- .../en-US/Mods.CalamityMod.Attunement.hjson | 3 +- .../Mods.CalamityMod.Projectiles.Melee.hjson | 1 + Projectiles/Melee/Galaxia_PhoenixsPride.cs | 35 +++--- .../Melee/Galaxia_PhoenixsPrideFirewall.cs | 104 ++++++++++++++++++ 7 files changed, 126 insertions(+), 22 deletions(-) create mode 100644 Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs diff --git a/Effects/BordernadoFire.fx b/Effects/BordernadoFire.fx index 44d9e2dec8..057d5b1112 100644 --- a/Effects/BordernadoFire.fx +++ b/Effects/BordernadoFire.fx @@ -58,6 +58,7 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 opacity *= pow(sin(coords.y * 3.141), lerp(1, 4, pow(coords.x, 2))); opacity *= fadeMapColor.r * 1.5 + 1; opacity *= lerp(0.4, 0.9, fadeMapColor.r); + opacity *= uOpacity; float3 transformColor = lerp(float3(1, 205 / 255.0, 119 / 255.0), float3(1, 76 / 255.0, 79 / 255.0), fadeMapColor.r); color.rgb = lerp(color.rgb, transformColor, fadeMapColor.r); diff --git a/Effects/BordernadoFire.xnb b/Effects/BordernadoFire.xnb index 053e44de327d28d73627842665a4073aac315e64..4b38ad5eb06bace1e20ba6ee69f58a652fa0f45a 100644 GIT binary patch delta 495 zcmYL`KS&%w6vp41{eKrRuozhs&c;GT#4ZxJ^ce6Jda?~Dh;KgJKH+P3+bOPdxEsb=$EbCAYnM@Bob+=aBK@X>3Gt}4Pf zWDw)AX-c~opCFyb&=RyR{dPxNWv0BaxV*YSX_~&&upAogwF&zzTRNF!#qp)=n9Ndf z?%9-*>j#QjW3XRPSihbs{@l9=OGK6-U)=V<%;@kiQ4|tgBI7!vmK=lH8I8i5`gHjG z^i;$iq-z~%fV!aEa(lXvKRZv8-Va;V>X4?Mw0L8zq~sMQ70tyak$xi-M+Q-B!1J>+ zYA=aic>| j7G{2c8Jg;y<{*l3Q;Nxn9J$K*Y|C9PWV6kbALo7XgFdxEo`*V!XhHc<zi@Bp_cM(vg?) zda_a0hY*2kMv`^Ycw${O<1WHrz#%ObztdjMp4M*sH2_V}t(kCTpXPD^$_KdPh<2aG z=$)z7r^CowH_J63%GD`lC0v6k4m>uuoU7}LaBAVGT%M1pNhPbuGgd8c31K6M z0Yp!6vJwD+U|*aE`}2kBpNGst=DlE&A%ftXP#N$VnDlLVn&fOrDcj@OGWIn0*tI<^ o>VZ_TXPAe~?`=(); + Item.rare = RarityType(); Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 24f; Item.reuseDelay = 30; diff --git a/Localization/en-US/Mods.CalamityMod.Attunement.hjson b/Localization/en-US/Mods.CalamityMod.Attunement.hjson index 0511293d38..4c3f673701 100644 --- a/Localization/en-US/Mods.CalamityMod.Attunement.hjson +++ b/Localization/en-US/Mods.CalamityMod.Attunement.hjson @@ -90,7 +90,7 @@ WhirlwindAttunement: { Hold to swing the sword around you, accelerating and dealing more damage over time Homing astral energies are wildly fired around you while swinging Once swung for long enough, releasing hurls the sword towards your cursor - Once pulled back, the hurled sword erupts into astral monoliths + The hurled sword erupts into astral monoliths on enemy hits ''' PassiveDesc: Striking enemies occasionally spawns homing astral bombers that spread the Astral Infection } @@ -137,6 +137,7 @@ PhoenixAttunement: { Swing the sword around you, accelerating over time The swirling nebula constantly emits homing cosmic bolts Release to hurl the sword toward the cursor alongside 6 gigantic cosmic bolts + The hurled sword erupts into a blazing flame pillar on enemy hits ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 5650ecf3c0..ea186d9779 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -188,6 +188,7 @@ Orbacle.DisplayName: Auric Orb OrderbringerBeam.DisplayName: Orderbringer Beam OrderbringerWaveProj.DisplayName: Order-bringing Wave PhoenixsPride.DisplayName: Phoenix's Pride +PhoenixsPrideFirewall.DisplayName: Phoenix's Pride Flame Pillar PhosphorescentGauntletPunches.DisplayName: Gauntlet Punch PhotonRipperProjectile.DisplayName: Extraordinarily Cost-Inefficient Chainsaw PlagueSeeker.DisplayName: Plague Seeker diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index d76dde0d6f..5da374be95 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.Item80, Projectile.Center); direction = Owner.SafeDirectionTo(Owner.Calamity().mouseWorld, Vector2.Zero); - //PARTICLES LOTS OF PARTICLES LOTS OF SPARKLES YES YES MH YES YES + // PARTICLES LOTS OF PARTICLES LOTS OF SPARKLES for (int i = 0; i <= 8; i++) { float variation = Main.rand.NextFloat(-MathHelper.PiOver4, MathHelper.PiOver4); @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(Sparkle); } - //Actually do projectiles now + // Actually do projectiles now if (Owner.whoAmI == Main.myPlayer) { for (int i = 0; i <= 5; i++) @@ -154,23 +154,14 @@ namespace CalamityMod.Projectiles.Melee if (Main.rand.NextBool(2)) { - - float Opacity = MathHelper.Clamp((Empowerment / maxEmpowerment - 0.5f) * 3f, 0, 1) * 0.75f; + float Opacity = MathHelper.Clamp((Empowerment / maxEmpowerment - 0.5f) * 3f, 0, 1) * 0.5f; float scaleFactor = MathHelper.Clamp((Empowerment / maxEmpowerment - 0.5f) * 3f, 0, 1); - for (float i = 0f; i <= 1; i += 0.5f) + for (float i = 0f; i < 2; i++) { - Vector2 smokepos = Projectile.Center + (direction * (60 + 40 * i) * Projectile.scale) + direction.RotatedBy(-MathHelper.PiOver2) * 30f * scaleFactor * Main.rand.NextFloat(); - - + Vector2 smokepos = Projectile.Center + (direction * (60 + 20 * i) * Projectile.scale) + direction.RotatedBy(-MathHelper.PiOver2) * 30f * scaleFactor * Main.rand.NextFloat(); Particle smoke = new HeavySmokeParticle(smokepos, direction.RotatedBy(-MathHelper.PiOver2) * 20f * scaleFactor + Owner.velocity, Color.Lerp(Color.MidnightBlue, Color.Indigo, i), 10 + Main.rand.Next(5), scaleFactor * Main.rand.NextFloat(2.8f, 3.1f), Opacity + Main.rand.NextFloat(0f, 0.2f), 0f, false, 0, true); GeneralParticleHandler.SpawnParticle(smoke); - - if (Main.rand.NextBool(3)) - { - Particle smokeGlow = new HeavySmokeParticle(smokepos, direction.RotatedBy(-MathHelper.PiOver2) * 20f * scaleFactor + Owner.velocity, Color.OrangeRed, 7, scaleFactor * Main.rand.NextFloat(2f, 2.4f), Opacity * 2, 0f, true, 0.001f, true); - GeneralParticleHandler.SpawnParticle(smokeGlow); - } } } @@ -261,6 +252,16 @@ namespace CalamityMod.Projectiles.Melee Owner.itemAnimation = 2; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (CurrentState == 1f && Main.myPlayer == Projectile.owner && !AnyProjectiles(ProjectileType())) + { + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), Projectile.damage, 0f, Projectile.owner, target.whoAmI); + if (proj.ModProjectile is PhoenixsPrideFirewall fire) + fire.Scale = MathHelper.Clamp(target.width / 100f, 0.3f, 1.25f); + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (CurrentState == 1f) @@ -269,11 +270,7 @@ namespace CalamityMod.Projectiles.Melee modifiers.SourceDamage *= FourSeasonsGalaxia.PhoenixAttunement_BaseDamageReduction + (FourSeasonsGalaxia.PhoenixAttunement_FullChargeDamageBoost * Empowerment / maxEmpowerment); } - public override void OnKill(int timeLeft) - { - if (smear != null) - smear.Kill(); - } + public override void OnKill(int timeLeft) => smear?.Kill(); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs b/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs new file mode 100644 index 0000000000..c520ea02a3 --- /dev/null +++ b/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs @@ -0,0 +1,104 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Graphics.Primitives; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.IO; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class PhoenixsPrideFirewall : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public const int TornadoHeight = 480; + + public float Scale; // Size of the firewall, scales with NPC width + public float fadeOut = 0.75f; // Used to control the firewall fading out at the end of its lifespan + public NPC Target => Main.npc[(int)Projectile.ai[0]]; + public override void SetStaticDefaults() => ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; + + public override void SetDefaults() + { + Projectile.width = 408; + Projectile.height = 102; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.alpha = 255; + Projectile.scale = Scale; + Projectile.timeLeft = 150; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + // Constantly follow its target + // Die if the target is no longer active + if (!Target.active) + { + Projectile.Kill(); + return; + } + else + Projectile.Center = Target.Center + Target.velocity; + + // Fade out at the end of its lifespan + if (Projectile.timeLeft < 15) + fadeOut -= 0.05f; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float _ = 0f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), + targetHitbox.Size(), + Projectile.Bottom, + Projectile.Bottom - Vector2.UnitY * TornadoHeight, + 72, + ref _); + } + + public float WidthFunction(float completionRatio) => 50f * Scale * (completionRatio > 0.5f ? 1f : completionRatio * 2f); + + public override bool PreDraw(ref Color lightColor) + { + Main.spriteBatch.EnterShaderRegion(); + + GameShaders.Misc["CalamityMod:Bordernado"].UseSaturation(-0.2f); + GameShaders.Misc["CalamityMod:Bordernado"].UseOpacity(fadeOut); + GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.Request("Terraria/Images/Misc/Perlin")); + Vector2[] drawPoints = new Vector2[5]; + Vector2 upwardAscent = Vector2.UnitY * TornadoHeight; + + Vector2 bottom = Projectile.Center; + Vector2 top = bottom - upwardAscent; + for (int i = 0; i < drawPoints.Length - 1; i++) + drawPoints[i] = Vector2.Lerp(top, bottom, i / (float)(drawPoints.Length - 1)); + + drawPoints[drawPoints.Length - 1] = bottom; + PrimitiveRenderer.RenderTrail(drawPoints, new(WidthFunction, (_) => Color.Orange, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 80); + + Main.spriteBatch.ExitShaderRegion(); + + Texture2D vortexTexture = ModContent.Request("CalamityMod/Projectiles/Boss/OldDukeVortex").Value; + for (int i = 0; i < 90; i++) + { + float angle = MathHelper.TwoPi * i / (25f * Scale) + Main.GlobalTimeWrappedHourly * MathHelper.TwoPi; + Color drawColor = Color.White * 0.04f; + drawColor.A = 0; + Vector2 drawPosition = bottom + angle.ToRotationVector2() * 4f - Main.screenPosition; + + drawPosition += (angle + Main.GlobalTimeWrappedHourly * i / 16f).ToRotationVector2() * 6f; + Main.EntitySpriteDraw(vortexTexture, drawPosition, null, drawColor * fadeOut, angle + MathHelper.PiOver2, vortexTexture.Size() * 0.5f, 0.2f * Scale, SpriteEffects.None, 0); + } + + return false; + } + } +}