diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 308c120b31..102141adc6 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -46,7 +46,6 @@ namespace CalamityMod.Items.Weapons.Melee public static int PolarisAttunement_LocalIFrames = 30; //Be warned its got one extra update so all the iframes should be divided in 2 public static int PolarisAttunement_LocalIFramesCharged = 16; public static float PolarisAttunement_SlashDamageBoost = 6f; //Keep in mind the slice always crits - public static int PolarisAttunement_SlashBoltsDamage = 1300; public static int PolarisAttunement_SlashIFrames = 20; public static float PolarisAttunement_ShotDamageBoost = 0.8f; //The shots fired if the dash connects public static float PolarisAttunement_ShredChargeupGain = 1f; //How much charge is gainted per second. diff --git a/Localization/en-US/Mods.CalamityMod.Attunement.hjson b/Localization/en-US/Mods.CalamityMod.Attunement.hjson index 4c3f673701..aadaea93ac 100644 --- a/Localization/en-US/Mods.CalamityMod.Attunement.hjson +++ b/Localization/en-US/Mods.CalamityMod.Attunement.hjson @@ -156,7 +156,7 @@ PolarisAttunement: { ''' Channel Galaxia's power into a vortex of celestial energies The vortex powers up over time and while hitting enemies - Release to fire a powerful star directly at your cursor + Release to fire a powerful star directly on your cursor that bombards nearby enemies with bolts Attacking immediately after firing the star launches you toward it, damaging enemies ''' } diff --git a/Projectiles/Melee/GalaxiaBolt.cs b/Projectiles/Melee/GalaxiaBolt.cs index ae0a519b2d..23478acb09 100644 --- a/Projectiles/Melee/GalaxiaBolt.cs +++ b/Projectiles/Melee/GalaxiaBolt.cs @@ -15,8 +15,9 @@ namespace CalamityMod.Projectiles.Melee public Player Owner => Main.player[Projectile.owner]; public ref float Hue => ref Projectile.ai[0]; - public ref float HomingStrenght => ref Projectile.ai[1]; + public ref float HomingStrength => ref Projectile.ai[1]; public ref float ShouldDelayHoming => ref Projectile.ai[2]; + public bool StrongerHoming = false; Particle Head; @@ -57,10 +58,10 @@ namespace CalamityMod.Projectiles.Melee if (target == null) target = Projectile.Center.ClosestNPCAt(812f, true); - else if (CalamityUtils.AngleBetween(Projectile.velocity, target.Center - Projectile.Center) < MathHelper.PiOver2 && (ShouldDelayHoming != 1f || Projectile.timeLeft < 60)) //Home in + else if ((CalamityUtils.AngleBetween(Projectile.velocity, target.Center - Projectile.Center) < MathHelper.PiOver2 || StrongerHoming) && (ShouldDelayHoming != 1f || Projectile.timeLeft < 60)) //Home in { float idealDirection = Projectile.AngleTo(target.Center); - float updatedDirection = Projectile.velocity.ToRotation().AngleTowards(idealDirection, HomingStrenght); + float updatedDirection = Projectile.velocity.ToRotation().AngleTowards(idealDirection, HomingStrength); Projectile.velocity = updatedDirection.ToRotationVector2() * Projectile.velocity.Length() * 0.995f; } diff --git a/Projectiles/Melee/Galaxia_PolarisGaze.cs b/Projectiles/Melee/Galaxia_PolarisGaze.cs index c676136f38..bcb136aa46 100644 --- a/Projectiles/Melee/Galaxia_PolarisGaze.cs +++ b/Projectiles/Melee/Galaxia_PolarisGaze.cs @@ -72,12 +72,6 @@ namespace CalamityMod.Projectiles.Melee { if (proj.active && proj.type == ProjectileType() && proj.owner == Owner.whoAmI) { - if (CalamityUtils.AngleBetween(Owner.Center - Main.MouseWorld, Owner.Center - proj.Center) > MathHelper.PiOver4) - { - proj.Kill(); - break; - } - Wheel = proj; Dashing = true; DashStart = Owner.Center; @@ -170,14 +164,6 @@ namespace CalamityMod.Projectiles.Melee if (Owner.whoAmI == Main.myPlayer) { - int blastDamage = Owner.CalcIntDamage(FourSeasonsGalaxia.PolarisAttunement_SlashBoltsDamage); - for (int i = 0; i < 5; i++) - { - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Main.rand.NextVector2CircularEdge(15, 15), ProjectileType(), blastDamage, 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.02f); - blast.timeLeft = 100; - } - - Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center - DashStart / 2f, Vector2.Zero, ProjectileType(), (int)(Projectile.damage * FourSeasonsGalaxia.PolarisAttunement_SlashDamageBoost), 0, Owner.whoAmI); if (proj.ModProjectile is PolarisGazeDash dash) { @@ -237,7 +223,7 @@ namespace CalamityMod.Projectiles.Melee { float maxMultiplier = FourSeasonsGalaxia.PolarisAttunement_FullChargeDamage / (float)FourSeasonsGalaxia.PolarisAttunement_BaseDamage; float damageMultiplier = MathHelper.Lerp(1f, maxMultiplier, ShredRatio); - //Adjust the damage to make it constant based on the local iframes + // Adjust the damage to make it constant based on the local iframes float damageReduction = Projectile.localNPCHitCooldown / (float)FourSeasonsGalaxia.PolarisAttunement_LocalIFrames; modifiers.SourceDamage *= damageMultiplier * damageReduction; @@ -247,14 +233,12 @@ namespace CalamityMod.Projectiles.Melee { float maxMultiplier = FourSeasonsGalaxia.PolarisAttunement_FullChargeDamage / (float)FourSeasonsGalaxia.PolarisAttunement_BaseDamage; float damageMultiplier = MathHelper.Lerp(1f, maxMultiplier, ShredRatio); - //Adjust the damage to make it constant based on the local iframes + // Adjust the damage to make it constant based on the local iframes float damageReduction = Projectile.localNPCHitCooldown / (float)FourSeasonsGalaxia.PolarisAttunement_LocalIFrames; modifiers.SourceDamage *= damageMultiplier * damageReduction; } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => ShredTarget(); public override void OnHitPlayer(Player target, Player.HurtInfo info) => ShredTarget(); @@ -267,10 +251,8 @@ namespace CalamityMod.Projectiles.Melee // get lifted up if (HitChargeCooldown <= 0) { - SoundEngine.PlaySound(SoundID.NPCHit30, Projectile.Center); //Sizzle - Shred += 80; //Augment the shredspeed - if (Owner.velocity.Y > 0) - Owner.velocity.Y = -2f; //Get "stuck" into the enemy partly + SoundEngine.PlaySound(SoundID.NPCHit30, Projectile.Center); // Sizzle + Shred += 80; // Augment the shredspeed // 17APR2024: Ozzatron: Galaxia's pogo gives iframes when striking enemies in a similar manner to a bonk dash. // This is a fixed and intentionally very low number of iframes, and is not boosted by Cross Necklace. @@ -285,7 +267,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(SoundID.NPCHit43, Projectile.Center); if (ShredRatio > 0.85 && Owner.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, direction * 36f, ProjectileType(), (int)(Projectile.damage * FourSeasonsGalaxia.PolarisAttunement_ShotDamageBoost), Projectile.knockBack, Owner.whoAmI, Shred); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.ClampedMouseWorld(), Vector2.Zero, ProjectileType(), (int)(Projectile.damage * FourSeasonsGalaxia.PolarisAttunement_ShotDamageBoost), Projectile.knockBack, Owner.whoAmI, Shred); } if (Dashing) { diff --git a/Projectiles/Melee/Galaxia_PolarisGazeDash.cs b/Projectiles/Melee/Galaxia_PolarisGazeDash.cs index aa04d60b0b..8d25d0320a 100644 --- a/Projectiles/Melee/Galaxia_PolarisGazeDash.cs +++ b/Projectiles/Melee/Galaxia_PolarisGazeDash.cs @@ -19,9 +19,6 @@ namespace CalamityMod.Projectiles.Melee public Vector2 DashStart; public Vector2 DashEnd; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -52,21 +49,10 @@ namespace CalamityMod.Projectiles.Melee Particle Spark = new CritSpark(target.Center, sparkSpeed, Color.White, Color.CornflowerBlue, 1f + Main.rand.NextFloat(0, 1f), 30, 0.4f, 0.6f); GeneralParticleHandler.SpawnParticle(Spark); } - - //Explode into cosmic bolts - int blastDamage = Owner.CalcIntDamage(FourSeasonsGalaxia.PolarisAttunement_SlashBoltsDamage); - for (int i = 0; i < 3; i++) - { - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.SafeDirectionTo(target.Center, Vector2.Zero).RotatedByRandom(MathHelper.PiOver4) * 30f, ProjectileType(), blastDamage, 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.01f); - blast.timeLeft = 100; - } } - - - public override bool PreDraw(ref Color lightColor) //OMw to reuse way too much code from the entangling vines + public override bool PreDraw(ref Color lightColor) // omw to reuse way too much code from the entangling vines { - Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); @@ -84,7 +70,7 @@ namespace CalamityMod.Projectiles.Melee Texture2D sparkTexture = Request("CalamityMod/Particles/ThinSparkle").Value; Texture2D bloomTexture = Request("CalamityMod/Particles/BloomCircle").Value; - //Ajust the bloom's texture to be the same size as the star's + // Adjust the bloom's texture to be the same size as the star's float properBloomSize = (float)sparkTexture.Width / (float)bloomTexture.Height; @@ -93,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(bloomTexture, DashEnd - Main.screenPosition, null, Color.CornflowerBlue * bump * 0.5f, 0, bloomTexture.Size() / 2f, bump * 6f * properBloomSize, SpriteEffects.None, 0); Main.EntitySpriteDraw(sparkTexture, DashEnd - Main.screenPosition, frame, Color.Lerp(Color.White, Color.CornflowerBlue, raise) * bump, raise * MathHelper.TwoPi, frame.Size() / 2f, bump * 3f, SpriteEffects.None, 0); - //Back to normal + // Back to normal Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); return false; diff --git a/Projectiles/Melee/Galaxia_PolarisGazeStar.cs b/Projectiles/Melee/Galaxia_PolarisGazeStar.cs index b3b897d19e..dea6c234cf 100644 --- a/Projectiles/Melee/Galaxia_PolarisGazeStar.cs +++ b/Projectiles/Melee/Galaxia_PolarisGazeStar.cs @@ -21,34 +21,24 @@ namespace CalamityMod.Projectiles.Melee public Player Owner => Main.player[Projectile.owner]; public float Timer => MaxTime - Projectile.timeLeft; + public const int MaxTime = 120; - public const float MaxTime = 120; + public Particle PolarStar; // Using a particle on top of it since the smoke particles would otherwise go over it - public Particle PolarStar; //Using a particle ontop of it since the smoke particles would otherwise go over it - - - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; Projectile.width = Projectile.height = 45; - Projectile.tileCollide = true; + Projectile.tileCollide = false; Projectile.ignoreWater = true; Projectile.friendly = true; Projectile.penetrate = -1; - Projectile.extraUpdates = 3; - + Projectile.MaxUpdates = 4; + Projectile.timeLeft = MaxTime; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 60; + Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; } - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.velocity *= 0.95f; - return false; - } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; @@ -68,23 +58,17 @@ namespace CalamityMod.Projectiles.Melee direction = Owner.SafeDirectionTo(Owner.Calamity().mouseWorld, Vector2.Zero); direction.Normalize(); Projectile.rotation = direction.ToRotation(); - - Projectile.timeLeft = (int)MaxTime; - Projectile.velocity = direction * 16f; - Projectile.scale = 1f + ShredRatio; //SWAGGER Projectile.netUpdate = true; - } - Projectile.velocity *= 0.96f; - Projectile.position += Projectile.velocity; - - if (PolarStar == null) { PolarStar = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.White, Color.CornflowerBlue, Projectile.scale * 2f, 2, 0.1f, 5f, true); GeneralParticleHandler.SpawnParticle(PolarStar); + + CustomPulse poof = new(Projectile.Center, Vector2.Zero, Color.Indigo, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.1f, 0.2f, 10); + GeneralParticleHandler.SpawnParticle(poof); } else { @@ -93,7 +77,6 @@ namespace CalamityMod.Projectiles.Melee PolarStar.Scale = Projectile.scale * 2f; } - Vector2 smokeSpeed = Main.rand.NextVector2Circular(10f, 10f); Particle smoke = new HeavySmokeParticle(Projectile.Center, smokeSpeed + Projectile.velocity / 2, Color.Lerp(Color.Purple, Color.Indigo, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 6f)), 30, Main.rand.NextFloat(0.6f, 1.2f), 0.8f, 0, false, 0, true); GeneralParticleHandler.SpawnParticle(smoke); @@ -104,6 +87,13 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(smokeGlow); } + if (Timer % (MaxTime / 6) == 0 && Main.myPlayer == Projectile.owner) + { + Vector2 starVel = Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * 25f; + Projectile star = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, starVel, ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f, MathHelper.Pi / 20f); + if (star.ModProjectile is GalaxiaBolt bolt) + bolt.StrongerHoming = true; + } } public override bool PreDraw(ref Color lightColor) @@ -144,6 +134,5 @@ namespace CalamityMod.Projectiles.Melee } } } - } }