Slight revamp of Polaris' Gaze

No longer fires out the star towards your cursor, which is dashed to and releases a burst of stars from the player at the end of the dash
Now places the star directly on the cursor, which fires a barrage of 6 stars before disappearing; the star can still be dashed to, but this just deals the dash damage
This commit is contained in:
CongratsIsTrash committed 2024-11-15 20:48:51 -05:00
1 parent b85903c435
commit 602babea57
6 files changed
+29 -72

No files matched your search

@@ -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.
@@ -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
'''
}
+4 -3
View File
@@ -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;
}
+5 -23
View File
@@ -72,12 +72,6 @@ namespace CalamityMod.Projectiles.Melee
{
if (proj.active && proj.type == ProjectileType<PolarisGazeStar>() && 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<MeleeDamageClass>(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<GalaxiaBolt>(), 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<PolarisGazeDash>(), (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<PolarisGazeStar>(), (int)(Projectile.damage * FourSeasonsGalaxia.PolarisAttunement_ShotDamageBoost), Projectile.knockBack, Owner.whoAmI, Shred);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.ClampedMouseWorld(), Vector2.Zero, ProjectileType<PolarisGazeStar>(), (int)(Projectile.damage * FourSeasonsGalaxia.PolarisAttunement_ShotDamageBoost), Projectile.knockBack, Owner.whoAmI, Shred);
}
if (Dashing)
{
+3 -17
View File
@@ -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<MeleeDamageClass>(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<GalaxiaBolt>(), 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<Texture2D>("CalamityMod/Particles/ThinSparkle").Value;
Texture2D bloomTexture = Request<Texture2D>("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;
+16 -27
View File
@@ -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<GalaxiaBolt>(), 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
}
}
}
}
}