diff --git a/Effects/PixelatedSightLine.fx b/Effects/PixelatedSightLine.fx index 702c3677f8..103c80cd3d 100644 --- a/Effects/PixelatedSightLine.fx +++ b/Effects/PixelatedSightLine.fx @@ -43,7 +43,7 @@ float mod(float a, float n) ( float2 origin, float angle, float2 plot, float plotAngle) { - //If the angle between the line's angle and the plot's angle is less than 90° (aka , not BEHIND the half-line), return the distance from the line + //If the angle between the line's angle and the plot's angle is less than 90� (aka , not BEHIND the half-line), return the distance from the line if (abs(mod(angle - plotAngle + 3.1415926, 6.2831853) - 3.1415926) < 1.5707) return distanceFromLine(origin, angle, plot); @@ -75,7 +75,7 @@ float4 main(float2 uv : TEXCOORD) : COLOR //Grabs the distance of the point from the edge line. float distanceFromLine = distanceFromLineCropped(float2(0, 0), laserAngle, mappedUv, angle); - //If we are further from the line than the bloom's blending lenght, just don't. + //If we are further from the line than the bloom's blending length, just don't. if (distanceFromLine > bloomSize + halfLaserWidth) return float4(0, 0, 0, 0); diff --git a/Effects/SpreadTelegraph.fx b/Effects/SpreadTelegraph.fx index eea200f02a..2b59bf9ed7 100644 --- a/Effects/SpreadTelegraph.fx +++ b/Effects/SpreadTelegraph.fx @@ -1,7 +1,7 @@ float3 edgeColor; float3 centerColor; -float edgeBlendLenght; +float edgeBlendLength; float edgeBlendStrength; float mainOpacity; @@ -27,7 +27,7 @@ float distanceFromLine(float2 origin, float angle, float2 plot) //Gets the distance of a plot from a line with a specified origin and angle, but crops the line so it only expands towards the angle float distanceFromLineCropped(float2 origin, float angle, float2 plot, float plotAngle) { - //If the angle between the line's angle and the plot's angle is less than 90° (aka , not BEHIND the half-line), return the distance from the line + //If the angle between the line's angle and the plot's angle is less than 90� (aka , not BEHIND the half-line), return the distance from the line if (abs(angle - plotAngle) < 1.5707) return distanceFromLine(origin, angle, plot); @@ -68,12 +68,12 @@ float4 main(float2 uv : TEXCOORD) : COLOR opacity = centerOpacity * pow(1 - distanceFromCenter, 2); } - //If we are further from the line than the edge's blending lenght, just don't even do the blending. - if (distanceFromLine > edgeBlendLenght) + //If we are further from the line than the edge's blending length, just don't even do the blending. + if (distanceFromLine > edgeBlendLength) return float4(colour * opacity * mainOpacity, opacity * mainOpacity); //The higher this value is, the more we blend with the edge's opacity & color. - float edgeBlendFactor = pow(1 - distanceFromLine / edgeBlendLenght, edgeBlendStrength); + float edgeBlendFactor = pow(1 - distanceFromLine / edgeBlendLength, edgeBlendStrength); colour = lerp(colour, edgeColor, edgeBlendFactor); opacity = lerp(opacity, 1 * pow(1 - distanceFromCenter, 3), edgeBlendFactor) * mainOpacity; diff --git a/Effects/SwingSprite.fx b/Effects/SwingSprite.fx index 62e1157275..f66e28e90a 100644 --- a/Effects/SwingSprite.fx +++ b/Effects/SwingSprite.fx @@ -1,6 +1,6 @@ float rotation; // The rotation of the sword sprite. //float2 spriteDimensions; //The size of the sprite (necessary as the shader only gives us a map between 0 and 1). -float pommelToOriginPercent; //I have no idea for a better variable name. This is the perccentage of the full lenght between the rotation origin and the sword's tip that is an empty gap between it and the bottom left of the sword. +float pommelToOriginPercent; //I have no idea for a better variable name. This is the perccentage of the full length between the rotation origin and the sword's tip that is an empty gap between it and the bottom left of the sword. float4 color; texture sampleTexture; diff --git a/Effects/WulfrumTilePing.fx b/Effects/WulfrumTilePing.fx index fc44e3ecc8..76db6a0a2e 100644 --- a/Effects/WulfrumTilePing.fx +++ b/Effects/WulfrumTilePing.fx @@ -8,7 +8,7 @@ float pingProgress; //How far along the ping progressed float pingTravelTime; //Percent of the ping's duration during which the ping expands to reach its full radius. float pingFadePoint; //Percent of the ping's duration at which to start fading away. float edgeBlendStrength; //How starkly should the ping's edge fade off. -float edgeBlendOutLenght; //Small lenght at the edge of the wave to blend away smoothly. +float edgeBlendOutLength; //Small length at the edge of the wave to blend away smoothly. float tileEdgeBlendStrenght; //How hard the border of a tile should get blended away. float4 baseTintColor; //Color of the tile's overlay @@ -175,7 +175,7 @@ float4 main(float2 uv : TEXCOORD) : COLOR return float4(0, 0, 0, 0); float waveEdgeDistanceFromCenter = max(currentPingRadius - pingWaveThickness, 0); - float edgeBlendFactor = pow(min(max((distanceFromPingOrigin - (waveEdgeDistanceFromCenter)), 0) / (pingWaveThickness - edgeBlendOutLenght), 1), edgeBlendStrength); + float edgeBlendFactor = pow(min(max((distanceFromPingOrigin - (waveEdgeDistanceFromCenter)), 0) / (pingWaveThickness - edgeBlendOutLength), 1), edgeBlendStrength); float3 ColorTotal = lerp(baseTintColor.rgb, waveColor.rgb, edgeBlendFactor); float OpacityTotal = lerp(baseTintColor.a, waveColor.a, edgeBlendFactor); @@ -193,8 +193,8 @@ float4 main(float2 uv : TEXCOORD) : COLOR } //Fade away the border - if (realPingRadius - distanceFromPingOrigin < edgeBlendOutLenght) - OpacityTotal *= (realPingRadius - distanceFromPingOrigin) / edgeBlendOutLenght; + if (realPingRadius - distanceFromPingOrigin < edgeBlendOutLength) + OpacityTotal *= (realPingRadius - distanceFromPingOrigin) / edgeBlendOutLength; //General fade out at the end. OpacityTotal *= 1 - max(pingProgress - pingFadePoint, 0) / (1 - pingFadePoint); diff --git a/Items/Accessories/WulfrumAcrobaticsPack.cs b/Items/Accessories/WulfrumAcrobaticsPack.cs index 3991b4f766..210549b135 100644 --- a/Items/Accessories/WulfrumAcrobaticsPack.cs +++ b/Items/Accessories/WulfrumAcrobaticsPack.cs @@ -120,9 +120,9 @@ namespace CalamityMod.Items.Accessories /// public int Grapple = 0; /// - /// The lenght of the current rope. Determined when the grapple lands. + /// The length of the current rope. Determined when the grapple lands. /// - public float SwingLenght = 0f; + public float SwingLength = 0f; /// /// Used when we need to store the hook between instructions. /// @@ -145,7 +145,7 @@ namespace CalamityMod.Items.Accessories if (!PlayerOnGround) return false; - if ((Player.Center - Main.projectile[Grapple].Center).Length() > SwingLenght) + if ((Player.Center - Main.projectile[Grapple].Center).Length() > SwingLength) return false; return true; @@ -223,7 +223,7 @@ namespace CalamityMod.Items.Accessories if (Grappled) { - if ((Main.projectile[Grapple].Center - Player.Center).Length() > SwingLenght + 80f) + if ((Main.projectile[Grapple].Center - Player.Center).Length() > SwingLength + 80f) { SoundEngine.PlaySound(WulfrumAcrobaticsPack.ReleaseSound, Main.projectile[Grapple].Center); Main.projectile[Grapple].Kill(); @@ -235,7 +235,7 @@ namespace CalamityMod.Items.Accessories public void SimulateMovement(Projectile grapple) { - Segments = VerletSimulatedSegment.SimpleSimulation(Segments, SwingLenght / SimulationResolution, 50, 0.3f * Player.gravDir); + Segments = VerletSimulatedSegment.SimpleSimulation(Segments, SwingLength / SimulationResolution, 50, 0.3f * Player.gravDir); Vector2 CurrentPosition; diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index a85ef0f5e5..dba6012edf 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public float Combo = 0f; public float Charge = 0f; - public const float ComboLenght = 4f; //How many regular swings before the long throw happens + public const float ComboLength = 4f; //How many regular swings before the long throw happens public static float snapDamageMultiplier = 1.2f; //Extra damage from making the scissors snap public static float chargeDamageMultiplier = 1.2f; //Extra damage from charge @@ -146,12 +146,12 @@ namespace CalamityMod.Items.Weapons.Melee if (Charge > 0) damage = (int)(chargeDamageMultiplier * damage); - float scissorState = Combo == ComboLenght ? 2 : Combo % 2; + float scissorState = Combo == ComboLength ? 2 : Combo % 2; Projectile.NewProjectile(source, player.Center, velocity, ProjectileType(), damage, knockback, player.whoAmI, scissorState, Charge); Combo += 1; - if (Combo > ComboLenght) + if (Combo > ComboLength) Combo = 0; diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index 8e190b21d1..411ddcf7b0 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -55,10 +55,10 @@ namespace CalamityMod.Items.Weapons.Ranged Rectangle targetHitbox = target.Hitbox; float collisionPoint = 0f; - float gunLenght = 66f; + float gunLength = 66f; float gunHeight = 15; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), player.MountedCenter, player.MountedCenter + ((player.itemRotation + (player.direction < 0 ? MathHelper.Pi : 0f)).ToRotationVector2() * gunLenght), gunHeight, ref collisionPoint) ? null : false; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), player.MountedCenter, player.MountedCenter + ((player.itemRotation + (player.direction < 0 ? MathHelper.Pi : 0f)).ToRotationVector2() * gunLength), gunHeight, ref collisionPoint) ? null : false; } 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/Helstorm.cs b/Items/Weapons/Ranged/Helstorm.cs index 759a1283eb..db9e17aa8c 100644 --- a/Items/Weapons/Ranged/Helstorm.cs +++ b/Items/Weapons/Ranged/Helstorm.cs @@ -48,10 +48,10 @@ namespace CalamityMod.Items.Weapons.Ranged Rectangle targetHitbox = target.Hitbox; float collisionPoint = 0f; - float gunLenght = 60f; + float gunLength = 60f; float gunHeight = 26f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), player.MountedCenter, player.MountedCenter + ((player.itemRotation + (player.direction < 0 ? MathHelper.Pi : 0f)).ToRotationVector2() * gunLenght), gunHeight, ref collisionPoint) ? null : false; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), player.MountedCenter, player.MountedCenter + ((player.itemRotation + (player.direction < 0 ? MathHelper.Pi : 0f)).ToRotationVector2() * gunLength), gunHeight, ref collisionPoint) ? null : false; } 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/WulfrumBlunderbuss.cs b/Items/Weapons/Ranged/WulfrumBlunderbuss.cs index 38eaf88a45..9ffe57c102 100644 --- a/Items/Weapons/Ranged/WulfrumBlunderbuss.cs +++ b/Items/Weapons/Ranged/WulfrumBlunderbuss.cs @@ -106,8 +106,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { - float aimLenght = (Main.MouseWorld - player.MountedCenter).Length(); - float damageMult = MathHelper.Lerp(1f, MaxDamageFalloff, Math.Clamp(aimLenght - MaxSpreadDistance, 0, MinSpreadDistance - MaxSpreadDistance) / (MinSpreadDistance - MaxSpreadDistance)); + float aimLength = (Main.MouseWorld - player.MountedCenter).Length(); + float damageMult = MathHelper.Lerp(1f, MaxDamageFalloff, Math.Clamp(aimLength - MaxSpreadDistance, 0, MinSpreadDistance - MaxSpreadDistance) / (MinSpreadDistance - MaxSpreadDistance)); damage = (int)(damage * damageMult); } @@ -116,8 +116,8 @@ namespace CalamityMod.Items.Weapons.Ranged if (player.Calamity().GeneralScreenShakePower < 3f) player.Calamity().GeneralScreenShakePower = 3f; - float aimLenght = (Main.MouseWorld - player.MountedCenter).Length(); - float spreadDistance = Math.Clamp(aimLenght - MaxSpreadDistance, 0, MinSpreadDistance - MaxSpreadDistance) / (MinSpreadDistance - MaxSpreadDistance); + float aimLength = (Main.MouseWorld - player.MountedCenter).Length(); + float spreadDistance = Math.Clamp(aimLength - MaxSpreadDistance, 0, MinSpreadDistance - MaxSpreadDistance) / (MinSpreadDistance - MaxSpreadDistance); float spread = MathHelper.Lerp(MaxSpread, MinSpread, spreadDistance); Vector2 nuzzleDir = velocity.SafeNormalize(Vector2.Zero); diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 80a942bf07..ce7558d782 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -918,7 +918,7 @@ namespace CalamityMod.NPCs.ExoMechs effect.Parameters["halfSpreadAngle"].SetValue(MathHelper.PiOver4); effect.Parameters["edgeColor"].SetValue(Color.DarkCyan.ToVector3()); effect.Parameters["centerColor"].SetValue(Color.Cyan.ToVector3()); - effect.Parameters["edgeBlendLenght"].SetValue(0.07f); + effect.Parameters["edgeBlendLength"].SetValue(0.07f); effect.Parameters["edgeBlendStrength"].SetValue(8f); Main.spriteBatch.End(); diff --git a/Particles/ChargeUpLineVFX.cs b/Particles/ChargeUpLineVFX.cs index b57e12064a..1b3a6f9d7f 100644 --- a/Particles/ChargeUpLineVFX.cs +++ b/Particles/ChargeUpLineVFX.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Particles public float BaseScale; public float Opacity; public float LineDirection; - public float LineLenght = 0f; + public float LineLength = 0f; private Vector2 PrevOffset = Vector2.Zero; private Vector2 BasePosition; public bool Telegraph; //Denotes if the line is used as an enemy telegraph. In that case, it'll be marked as important @@ -63,7 +63,7 @@ namespace CalamityMod.Particles RelativeOffset = offsetPosition() * LineDirection.ToRotationVector2() * BasePosition.Length(); - LineLenght = (BasePosition - RelativeOffset).Length(); + LineLength = (BasePosition - RelativeOffset).Length(); RelativeOffset = RelativeOffset.RotatedBy(MathHelper.PiOver4 / 16f); //LineDirection -= MathHelper.PiOver4 / 16f; diff --git a/Particles/ManaDrainStreak.cs b/Particles/ManaDrainStreak.cs index e282a0713c..2a297a788a 100644 --- a/Particles/ManaDrainStreak.cs +++ b/Particles/ManaDrainStreak.cs @@ -50,8 +50,8 @@ namespace CalamityMod.Particles float currentDisplace = MathHelper.Lerp(StartDistanceFromPlayer, FinalDistanceFromPlayer, (float)Math.Pow(LifetimeCompletion, 2)); float earlierDisplace = MathHelper.Lerp(StartDistanceFromPlayer, FinalDistanceFromPlayer, (float)Math.Pow(Math.Clamp(LifetimeCompletion - 0.2f, 0f, 1f), 2)); - float lenght = (currentDisplace - earlierDisplace) / tex.Height; - Vector2 scale = new Vector2(Scale, lenght); + float Length = (currentDisplace - earlierDisplace) / tex.Height; + Vector2 scale = new Vector2(Scale, Length); Vector2 origin = new Vector2(tex.Width / 2f, tex.Height); diff --git a/Projectiles/BaseProjectiles/BaseShortswordProjectile.cs b/Projectiles/BaseProjectiles/BaseShortswordProjectile.cs index 7f0e3de2ce..55f326c03d 100644 --- a/Projectiles/BaseProjectiles/BaseShortswordProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseShortswordProjectile.cs @@ -122,8 +122,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 12f * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.MountedCenter + OffsetFromPlayer, Owner.MountedCenter + OffsetFromPlayer + (Projectile.velocity * bladeLenght), 24, ref collisionPoint); + float bladeLength = 12f * Projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.MountedCenter + OffsetFromPlayer, Owner.MountedCenter + OffsetFromPlayer + (Projectile.velocity * bladeLength), 24, ref collisionPoint); } } } diff --git a/Projectiles/Magic/CoralSpoutHoldout.cs b/Projectiles/Magic/CoralSpoutHoldout.cs index 25e6d8bcde..7dd7bc6f17 100644 --- a/Projectiles/Magic/CoralSpoutHoldout.cs +++ b/Projectiles/Magic/CoralSpoutHoldout.cs @@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Magic effect.Parameters["halfSpreadAngle"].SetValue(Spread / 2f); effect.Parameters["edgeColor"].SetValue(Color.Lerp(Color.DeepSkyBlue, Color.Coral, blinkage ).ToVector3()); effect.Parameters["centerColor"].SetValue(Color.Lerp(Color.DodgerBlue, Color.Coral, blinkage).ToVector3()); - effect.Parameters["edgeBlendLenght"].SetValue(0.07f); + effect.Parameters["edgeBlendLength"].SetValue(0.07f); effect.Parameters["edgeBlendStrength"].SetValue(8f); Main.spriteBatch.End(); diff --git a/Projectiles/Melee/AncientBeam.cs b/Projectiles/Melee/AncientBeam.cs index a19e0b3596..557e72ab54 100644 --- a/Projectiles/Melee/AncientBeam.cs +++ b/Projectiles/Melee/AncientBeam.cs @@ -37,10 +37,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 34f * Projectile.scale; + float bladeLength = 34f * Projectile.scale; Vector2 start = -Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * 8.5f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + start, Projectile.Center + start + Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + start, Projectile.Center + start + Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * bladeLength, 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs index b165eb0d7f..18818eeb51 100644 --- a/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheAncients_ParryHoldout.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 80f * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLenght), 24, ref collisionPoint); + float bladeLength = 80f * Projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLength), 24, ref collisionPoint); } public void GeneralParryEffects() @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Melee if (AlreadyParried == 0) { float collisionPoint = 0f; - float bladeLenght = 80f * Projectile.scale; + float bladeLength = 80f * Projectile.scale; for (int k = 0; k < Main.maxProjectiles; k++) { @@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Melee if (proj.active && proj.hostile && proj.damage > 1 && //Only parry harmful projectiles proj.velocity.Length() * (proj.extraUpdates + 1) > 1f && //Only parry projectiles that move semi-quickly proj.Size.Length() < 300 && //Only parry projectiles that aren't too large - Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLenght), 24, ref collisionPoint)) + Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLength), 24, ref collisionPoint)) { GeneralParryEffects(); diff --git a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs index 9e36f276d6..c39a5cfbdb 100644 --- a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs @@ -54,10 +54,10 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 78f * Projectile.scale; + float bladeLength = 78f * Projectile.scale; Vector2 holdPoint = DistanceFromPlayer.Length() * Projectile.rotation.ToRotationVector2(); - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + Projectile.rotation.ToRotationVector2() * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + Projectile.rotation.ToRotationVector2() * bladeLength, 24, ref collisionPoint); } diff --git a/Projectiles/Melee/ArkOfTheCosmos_BlastAttack.cs b/Projectiles/Melee/ArkOfTheCosmos_BlastAttack.cs index 4fa1f38d2b..d472980cef 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_BlastAttack.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_BlastAttack.cs @@ -89,8 +89,8 @@ namespace CalamityMod.Projectiles.Melee //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = ThrustDisplaceRatio() * 242f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (Projectile.velocity * bladeLenght), 30, ref collisionPoint); + float bladeLength = ThrustDisplaceRatio() * 242f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (Projectile.velocity * bladeLength), 30, ref collisionPoint); } public override bool ShouldUpdatePosition() => false; @@ -319,13 +319,13 @@ namespace CalamityMod.Projectiles.Melee rot = Projectile.rotation + MathHelper.PiOver2 + StitchRotations[i]; origin = new Vector2(lineTex.Width / 2f, lineTex.Height / 2f); - float stitchLenght = (float)Math.Sin(i / (float)(maxStitches - 1) * MathHelper.Pi) * 0.5f + 0.5f; + float stitchLength = (float)Math.Sin(i / (float)(maxStitches - 1) * MathHelper.Pi) * 0.5f + 0.5f; float stitchScale = (1f + (float)Math.Sin(MathHelper.Clamp(StitchLifetimes[i] / 7f, 0f, 1f) * MathHelper.Pi) * 0.3f) * 0.85f; if (CurrentStitches == maxStitches) { stitchScale *= 1 - ((StitchTimer - (MaxTime - SnapTime - HoldTime * 0.5f) * 0.3f) / (MaxTime - SnapTime - HoldTime * 0.5f) * 0.7f) * 0.8f; } - scale = new Vector2(0.2f, stitchLenght) * stitchScale; + scale = new Vector2(0.2f, stitchLength) * stitchScale; Color stitchColor = Color.Lerp(Color.White, Color.CornflowerBlue * 0.7f, (float)Math.Sin(MathHelper.Clamp(StitchLifetimes[i] / 7f, 0f, 1f) * MathHelper.PiOver2)); diff --git a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs index fb19cee00d..08b8bf4147 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs @@ -49,8 +49,8 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 142f * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLenght), 44, ref collisionPoint); + float bladeLength = 142f * Projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLength), 44, ref collisionPoint); } public void GeneralParryEffects() @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Melee return; float collisionPoint = 0f; - float bladeLenght = 142f * Projectile.scale; + float bladeLength = 142f * Projectile.scale; for (int k = 0; k < Main.maxProjectiles; k++) { @@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Melee if (proj.active && proj.hostile && proj.damage > 1 && //Only parry harmful projectiles proj.velocity.Length() * (proj.extraUpdates + 1) > 1f && //Only parry projectiles that move semi-quickly proj.Size.Length() < 300 && //Only parry projectiles that aren't too large - Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLenght), 24, ref collisionPoint)) + Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLength), 24, ref collisionPoint)) { if (AlreadyParried == 0) { diff --git a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs index 7b6f906dc4..f9ec4937d1 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs @@ -94,18 +94,18 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { - float bladeLenght = 172f * Projectile.scale; + float bladeLength = 172f * Projectile.scale; if (Thrown) { - bool mainCollision = Collision.CheckAABBvAABBCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - Vector2.One * bladeLenght / 2f, Vector2.One * bladeLenght); + bool mainCollision = Collision.CheckAABBvAABBCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - Vector2.One * bladeLength / 2f, Vector2.One * bladeLength); if (Combo == 2f) return mainCollision; else { Vector2 thrownBladeStart = Vector2.SmoothStep(Owner.Center, Projectile.Center, MathHelper.Clamp(SnapEndCompletion + 0.25f, 0f, 1f)); - bool thrownScissorCollision = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), thrownBladeStart, thrownBladeStart + direction * bladeLenght); + bool thrownScissorCollision = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), thrownBladeStart, thrownBladeStart + direction * bladeLength); return mainCollision || thrownScissorCollision; } } @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Melee float collisionPoint = 0f; Vector2 holdPoint = DistanceFromPlayer.Length() * Projectile.rotation.ToRotationVector2(); - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + Projectile.rotation.ToRotationVector2() * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + Projectile.rotation.ToRotationVector2() * bladeLength, 24, ref collisionPoint); } //Swing animation keys diff --git a/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs index 641e655b59..c608283ac9 100644 --- a/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheElements_ParryHoldout.cs @@ -48,8 +48,8 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 142f * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLenght), 44, ref collisionPoint); + float bladeLength = 142f * Projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLength), 44, ref collisionPoint); } public void GeneralParryEffects() @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Melee return; float collisionPoint = 0f; - float bladeLenght = 142f * Projectile.scale; + float bladeLength = 142f * Projectile.scale; for (int k = 0; k < Main.maxProjectiles; k++) { @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Melee if (proj.active && proj.hostile && proj.damage > 1 && //Only parry harmful projectiles proj.velocity.Length() * (proj.extraUpdates + 1) > 1f && //Only parry projectiles that move semi-quickly proj.Size.Length() < 300 && //Only parry projectiles that aren't too large - Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLenght), 24, ref collisionPoint)) + Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLength), 24, ref collisionPoint)) { if (AlreadyParried == 0) { diff --git a/Projectiles/Melee/ArkOfTheElements_SnapBlast.cs b/Projectiles/Melee/ArkOfTheElements_SnapBlast.cs index 170a089cc2..623e2e3092 100644 --- a/Projectiles/Melee/ArkOfTheElements_SnapBlast.cs +++ b/Projectiles/Melee/ArkOfTheElements_SnapBlast.cs @@ -70,8 +70,8 @@ namespace CalamityMod.Projectiles.Melee //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = ThrustDisplaceRatio() * 242f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (Projectile.velocity * bladeLenght), 30, ref collisionPoint); + float bladeLength = ThrustDisplaceRatio() * 242f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (Projectile.velocity * bladeLength), 30, ref collisionPoint); } public override bool ShouldUpdatePosition() => false; @@ -241,13 +241,13 @@ namespace CalamityMod.Projectiles.Melee rot = Projectile.rotation + MathHelper.PiOver2 + StitchRotations[i]; origin = new Vector2(lineTex.Width / 2f, lineTex.Height / 2f); - float stitchLenght = (float)Math.Sin(i / (float)(maxStitches - 1) * MathHelper.Pi) * 0.5f + 0.5f; + float stitchLength = (float)Math.Sin(i / (float)(maxStitches - 1) * MathHelper.Pi) * 0.5f + 0.5f; float stitchScale = (1f + (float)Math.Sin(MathHelper.Clamp(StitchLifetimes[i] / 7f, 0f, 1f) * MathHelper.Pi) * 0.3f) * 0.85f; if (CurrentStitches == maxStitches) { stitchScale *= 1 - ((StitchTimer - (MaxTime - SnapTime - HoldTime * 0.5f) * 0.3f) / (MaxTime - SnapTime - HoldTime * 0.5f) * 0.7f) * 0.8f; } - scale = new Vector2(0.2f, stitchLenght) * stitchScale; + scale = new Vector2(0.2f, stitchLength) * stitchScale; Color stitchColor = Color.Lerp(Color.White, Color.CornflowerBlue * 0.7f, (float)Math.Sin(MathHelper.Clamp(StitchLifetimes[i] / 7f, 0f, 1f) * MathHelper.PiOver2)); diff --git a/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs b/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs index 5c4dd557ff..9a2b2f4bdc 100644 --- a/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs @@ -92,18 +92,18 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { - float bladeLenght = 142f * Projectile.scale; + float bladeLength = 142f * Projectile.scale; if (Thrown) { - bool mainCollision = Collision.CheckAABBvAABBCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - Vector2.One * bladeLenght / 2f, Vector2.One * bladeLenght); + bool mainCollision = Collision.CheckAABBvAABBCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - Vector2.One * bladeLength / 2f, Vector2.One * bladeLength); if (Combo == 2f) return mainCollision; else { Vector2 thrownBladeStart = Vector2.SmoothStep(Owner.Center, Projectile.Center, MathHelper.Clamp(SnapEndCompletion + 0.25f, 0f, 1f)); - bool thrownScissorCollision = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), thrownBladeStart, thrownBladeStart + direction * bladeLenght); + bool thrownScissorCollision = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), thrownBladeStart, thrownBladeStart + direction * bladeLength); return mainCollision || thrownScissorCollision; } } @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Melee float collisionPoint = 0f; Vector2 holdPoint = DistanceFromPlayer.Length() * Projectile.rotation.ToRotationVector2(); - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + Projectile.rotation.ToRotationVector2() * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + Projectile.rotation.ToRotationVector2() * bladeLength, 24, ref collisionPoint); } //Swing animation keys diff --git a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs index 21a9600b0d..dfda19ec43 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_AridGrandeur.cs @@ -53,10 +53,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 94 * Projectile.scale; + float bladeLength = 94 * Projectile.scale; float bladeWidth = 76 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } public void Pogo() diff --git a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs index cb42030743..01bd827a9e 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_BitingEmbrace.cs @@ -78,24 +78,24 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 0f; + float bladeLength = 0f; Vector2 displace = Vector2.Zero; switch (SwingMode) { case 0: - bladeLenght = 90f * Projectile.scale; + bladeLength = 90f * Projectile.scale; break; case 1: - bladeLenght = 110f * Projectile.scale; + bladeLength = 110f * Projectile.scale; break; case 2: - bladeLenght = Projectile.frame <= 2 ? 85f : 150f; //Only use the extended hitbox after the blade actually extends. For realism. - bladeLenght *= Projectile.scale; + bladeLength = Projectile.frame <= 2 ? 85f : 150f; //Only use the extended hitbox after the blade actually extends. For realism. + bladeLength *= Projectile.scale; displace = direction * ThrustDisplaceRatio() * 60f; break; } - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + displace, Owner.Center + displace + (rotation.ToRotationVector2() * bladeLenght), 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + displace, Owner.Center + displace + (rotation.ToRotationVector2() * bladeLength), 24, ref collisionPoint); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs index a8d63e0d82..5202c852de 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs @@ -42,10 +42,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 120f * Projectile.scale; + float bladeLength = 120f * Projectile.scale; Vector2 displace = direction * ((float)Math.Sin(Timer / MaxTime * 3.14f) * 60); - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + displace, Owner.Center + displace + (direction * bladeLenght), 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + displace, Owner.Center + displace + (direction * bladeLength), 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/BrokenBiomeBlade_GrovetendersTouch.cs b/Projectiles/Melee/BrokenBiomeBlade_GrovetendersTouch.cs index a3493bd109..3de3c051d0 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_GrovetendersTouch.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_GrovetendersTouch.cs @@ -74,10 +74,10 @@ namespace CalamityMod.Projectiles.Melee public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { base.ModifyHitNPC(target, ref damage, ref knockback, ref crit, ref hitDirection); - Vector2 projectileHalfLenght = (Projectile.Size / 2f) * Projectile.rotation.ToRotationVector2(); + Vector2 projectileHalfLength = (Projectile.Size / 2f) * Projectile.rotation.ToRotationVector2(); float collisionPoint = 0; //If you hit the enemy during the coyote time with the blade of the whip, guarantee a crit & get some bonus damage - if (Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), Projectile.Center - projectileHalfLenght, Projectile.Center + projectileHalfLenght, 32, ref collisionPoint)) + if (Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), Projectile.Center - projectileHalfLength, Projectile.Center + projectileHalfLength, 32, ref collisionPoint)) { if (SnapCoyoteTime > 0f) { diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index b4999caab7..3a9e2bda14 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee public PrimitiveTrail PierceAfterimageDrawer = null; - const float BladeLenght = 180; + const float BladeLength = 180; public int GetSwingTime { @@ -223,7 +223,7 @@ namespace CalamityMod.Projectiles.Melee { float _ = 0f; Vector2 start = Projectile.Center; - Vector2 end = start + SwordDirection * BladeLenght * Projectile.scale; + Vector2 end = start + SwordDirection * BladeLength * Projectile.scale; return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, end, Projectile.scale * 30f, ref _); } @@ -317,7 +317,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.rand.NextFloat() * 3f < RiskOfDust) { - Dust auricDust = Dust.NewDustPerfect(Owner.MountedCenter + SwordDirection * BladeLenght * Projectile.scale * (float)Math.Pow(Main.rand.NextFloat(0.5f, 1f), 0.5f), ModContent.DustType(), SwordDirection.RotatedBy(-MathHelper.PiOver2 * Direction) * 2f); + Dust auricDust = Dust.NewDustPerfect(Owner.MountedCenter + SwordDirection * BladeLength * Projectile.scale * (float)Math.Pow(Main.rand.NextFloat(0.5f, 1f), 0.5f), ModContent.DustType(), SwordDirection.RotatedBy(-MathHelper.PiOver2 * Direction) * 2f); auricDust.noGravity = true; auricDust.alpha = 10; auricDust.scale = 0.5f; @@ -326,7 +326,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.rand.NextFloat() < RiskOfDust) { Color dustColor = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.9f); - Dust must = Dust.NewDustPerfect(Owner.MountedCenter + SwordDirection * BladeLenght * Projectile.scale * (float)Math.Pow(Main.rand.NextFloat(0.2f, 1f), 0.5f), 267, SwordDirection.RotatedBy(MathHelper.PiOver2 * Direction) * 2.6f, 0, dustColor); + Dust must = Dust.NewDustPerfect(Owner.MountedCenter + SwordDirection * BladeLength * Projectile.scale * (float)Math.Pow(Main.rand.NextFloat(0.2f, 1f), 0.5f), 267, SwordDirection.RotatedBy(MathHelper.PiOver2 * Direction) * 2.6f, 0, dustColor); must.scale = 0.3f; must.fadeIn = Main.rand.NextFloat() * 1.2f; @@ -442,7 +442,7 @@ namespace CalamityMod.Projectiles.Melee { float progress = MathHelper.Lerp(Progression, TrailEndProgression, i / 40f); - result.Add(DirectionAtProgressScuffed(progress) * (BladeLenght - 50f) * Projectile.scale); + result.Add(DirectionAtProgressScuffed(progress) * (BladeLength - 50f) * Projectile.scale); } return result; @@ -555,7 +555,7 @@ namespace CalamityMod.Projectiles.Melee float lensFlareOpacity = (Progression < 0.3f ? 0f : 0.2f + 0.8f * (float)Math.Sin(MathHelper.Pi * (Progression - 0.3f) / 0.7f)) * 0.6f; Color lensFlareColor = Color.Lerp(Color.LimeGreen, Color.Plum, (float)Math.Pow(Progression, 3)); lensFlareColor.A = 0; - Main.EntitySpriteDraw(shineTex, Owner.MountedCenter + DirectionAtProgressScuffed(Progression) * Projectile.scale * BladeLenght - Main.screenPosition, null, lensFlareColor * lensFlareOpacity, MathHelper.PiOver2, shineTex.Size() / 2f, shineScale * Projectile.scale, 0, 0); + Main.EntitySpriteDraw(shineTex, Owner.MountedCenter + DirectionAtProgressScuffed(Progression) * Projectile.scale * BladeLength - Main.screenPosition, null, lensFlareColor * lensFlareOpacity, MathHelper.PiOver2, shineTex.Size() / 2f, shineScale * Projectile.scale, 0, 0); } else diff --git a/Projectiles/Melee/Galaxia_AndromedasStride.cs b/Projectiles/Melee/Galaxia_AndromedasStride.cs index 0599a3be40..6c9e5083f5 100644 --- a/Projectiles/Melee/Galaxia_AndromedasStride.cs +++ b/Projectiles/Melee/Galaxia_AndromedasStride.cs @@ -56,10 +56,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 145 * Projectile.scale; + float bladeLength = 145 * Projectile.scale; float bladeWidth = 25 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } public CurveSegment QuickOut = new CurveSegment(EasingType.PolyIn, 0f, 0f, 0.2f, 3); diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index 8b6371ea98..fe57968b63 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -63,9 +63,9 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 145 * Projectile.scale; + float bladeLength = 145 * Projectile.scale; float bladeWidth = 25 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } diff --git a/Projectiles/Melee/Galaxia_PolarisGaze.cs b/Projectiles/Melee/Galaxia_PolarisGaze.cs index 63898b0946..360529614b 100644 --- a/Projectiles/Melee/Galaxia_PolarisGaze.cs +++ b/Projectiles/Melee/Galaxia_PolarisGaze.cs @@ -60,10 +60,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 145 * Projectile.scale; + float bladeLength = 145 * Projectile.scale; float bladeWidth = 86 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } public override void AI() @@ -102,18 +102,18 @@ namespace CalamityMod.Projectiles.Melee #region sparkles and particles - float bladeLenght = 120 * Projectile.scale; + float bladeLength = 120 * Projectile.scale; for (int i = 0; i < 3; i++) { if (Rings[i] == null) { - Rings[i] = new ConstellationRingVFX(Owner.Center + (direction * (25 + bladeLenght * 0.33f * i)), Color.DarkOrchid, direction.ToRotation(), Projectile.scale * 0.25f * i, new Vector2(0.5f, 1f), spinSpeed: 7, starAmount: 3 + i, important: true); + Rings[i] = new ConstellationRingVFX(Owner.Center + (direction * (25 + bladeLength * 0.33f * i)), Color.DarkOrchid, direction.ToRotation(), Projectile.scale * 0.25f * i, new Vector2(0.5f, 1f), spinSpeed: 7, starAmount: 3 + i, important: true); GeneralParticleHandler.SpawnParticle(Rings[i]); } else { Rings[i].Time = 0; - Rings[i].Position = Owner.Center + Vector2.Lerp(Vector2.Zero, ((0.9f + 0.1f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 10f - i * 0.5f)) * direction * (25 + bladeLenght * 0.33f * (i + 1))), Bounce(MathHelper.Clamp(Shred - 30 * i, 0, maxShred))); + Rings[i].Position = Owner.Center + Vector2.Lerp(Vector2.Zero, ((0.9f + 0.1f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 10f - i * 0.5f)) * direction * (25 + bladeLength * 0.33f * (i + 1))), Bounce(MathHelper.Clamp(Shred - 30 * i, 0, maxShred))); Rings[i].Rotation = direction.ToRotation(); Rings[i].Scale = Projectile.scale * 0.25f * (i + 1); (Rings[i] as ConstellationRingVFX).Opacity = 0.5f + 0.5f * ShredRatio; diff --git a/Projectiles/Melee/Galaxia_PolarisGazeStar.cs b/Projectiles/Melee/Galaxia_PolarisGazeStar.cs index 63e0fe101c..deb11d8d5e 100644 --- a/Projectiles/Melee/Galaxia_PolarisGazeStar.cs +++ b/Projectiles/Melee/Galaxia_PolarisGazeStar.cs @@ -52,10 +52,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 84 * Projectile.scale; + float bladeLength = 84 * Projectile.scale; float bladeWidth = 76 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - direction * bladeLenght / 2, Projectile.Center + direction * bladeLenght / 2, bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - direction * bladeLength / 2, Projectile.Center + direction * bladeLength / 2, bladeWidth, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/IllustriousKnife.cs b/Projectiles/Melee/IllustriousKnife.cs index 0e930aa032..5ee4bcfe53 100644 --- a/Projectiles/Melee/IllustriousKnife.cs +++ b/Projectiles/Melee/IllustriousKnife.cs @@ -52,12 +52,12 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeHalfLenght = 25f * Projectile.scale / 2f; + float bladeHalfLength = 25f * Projectile.scale / 2f; float bladeWidth = 14f * Projectile.scale; Vector2 direction = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2(); - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - direction * bladeHalfLenght, Projectile.Center + direction * bladeHalfLenght, bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - direction * bladeHalfLength, Projectile.Center + direction * bladeHalfLength, bladeWidth, ref collisionPoint); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs b/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs index 03f0f69fc6..b5b63b5cda 100644 --- a/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs +++ b/Projectiles/Melee/MendedBiomeBlade_ExtantAbhorrence.cs @@ -57,10 +57,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 120 * Projectile.scale; + float bladeLength = 120 * Projectile.scale; float bladeWidth = 20 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } public CurveSegment QuickOut = new CurveSegment(EasingType.PolyIn, 0f, 0f, 0.2f, 3); diff --git a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs index fcf1271921..a31cebb3c2 100644 --- a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs +++ b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs @@ -69,8 +69,8 @@ namespace CalamityMod.Projectiles.Melee if (!WaterMode) return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Bottom, Projectile.Bottom - (Vector2.UnitY * scaleY * 110), scaleX * 40, ref collisionPoint); - float halfLenght = 66f * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + Utils.SafeNormalize(Projectile.velocity.RotatedBy(MathHelper.PiOver2), Vector2.Zero) * halfLenght, Projectile.Center - Utils.SafeNormalize(Projectile.velocity.RotatedBy(MathHelper.PiOver2), Vector2.Zero) * halfLenght, 40f, ref collisionPoint); + float halfLength = 66f * Projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + Utils.SafeNormalize(Projectile.velocity.RotatedBy(MathHelper.PiOver2), Vector2.Zero) * halfLength, Projectile.Center - Utils.SafeNormalize(Projectile.velocity.RotatedBy(MathHelper.PiOver2), Vector2.Zero) * halfLength, 40f, ref collisionPoint); } public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs index 8305ac13c7..bb5d22da1c 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 100 * Projectile.scale; + float bladeLength = 100 * Projectile.scale; float bladeWidth = 20 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs index 22bde2f805..ec11243411 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeur.cs @@ -54,10 +54,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 120 * Projectile.scale; + float bladeLength = 120 * Projectile.scale; float bladeWidth = 76 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } public void Pogo() diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeurShot.cs b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeurShot.cs index 33c3214c80..cb9470eb32 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeurShot.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueAridGrandeurShot.cs @@ -41,10 +41,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 84 * Projectile.scale; + float bladeLength = 84 * Projectile.scale; float bladeWidth = 76 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - direction * bladeLenght / 2, Projectile.Center + direction * bladeLenght / 2, bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - direction * bladeLength / 2, Projectile.Center + direction * bladeLength / 2, bladeWidth, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs index 988ada6635..bd70aa1730 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueBitingEmbrace.cs @@ -76,22 +76,22 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 0f; + float bladeLength = 0f; Vector2 displace = Vector2.Zero; switch (SwingMode) { case 0: case 1: - bladeLenght = 150 * Projectile.scale; + bladeLength = 150 * Projectile.scale; break; case 2: - bladeLenght = 225f; //In awe e - bladeLenght *= Projectile.scale; + bladeLength = 225f; //In awe e + bladeLength *= Projectile.scale; displace = direction * ThrustDisplaceRatio() * 60f; break; } - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + displace, Owner.Center + displace + (rotation.ToRotationVector2() * bladeLenght), 26, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + displace, Owner.Center + displace + (rotation.ToRotationVector2() * bladeLength), 26, ref collisionPoint); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs index 7698a46699..338a02fdea 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs @@ -47,10 +47,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 140f * Projectile.scale; + float bladeLength = 140f * Projectile.scale; Vector2 displace = direction * ((float)Math.Sin(Timer / MaxTime * 3.14f) * 60); - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + displace, Owner.Center + displace + (direction * bladeLenght), 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + displace, Owner.Center + displace + (direction * bladeLength), 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs b/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs index 697f916a12..b9d709c4b5 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueGrovetendersTouch.cs @@ -72,10 +72,10 @@ namespace CalamityMod.Projectiles.Melee Vector2 previousPosition = chainPositions[i - 1]; if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), position, previousPosition, 6, ref collisionPoint)) return true; - if (i == numPoints - 1) //Extra lenght collision for the blade itself + if (i == numPoints - 1) //Extra length collision for the blade itself { - Vector2 projectileHalfLenght = 85 * Projectile.rotation.ToRotationVector2(); - return (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - projectileHalfLenght, Projectile.Center + projectileHalfLenght, 32, ref collisionPoint)); + Vector2 projectileHalfLength = 85 * Projectile.rotation.ToRotationVector2(); + return (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - projectileHalfLength, Projectile.Center + projectileHalfLength, 32, ref collisionPoint)); } } @@ -85,10 +85,10 @@ namespace CalamityMod.Projectiles.Melee public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - Vector2 projectileHalfLenght = 85f * Projectile.rotation.ToRotationVector2(); + Vector2 projectileHalfLength = 85f * Projectile.rotation.ToRotationVector2(); float collisionPoint = 0; //If you hit the enemy during the coyote time with the blade of the whip, guarantee a crit & get some bonus damage - if (Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), Projectile.Center - projectileHalfLenght, Projectile.Center + projectileHalfLenght, 32, ref collisionPoint)) + if (Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), Projectile.Center - projectileHalfLength, Projectile.Center + projectileHalfLength, 32, ref collisionPoint)) { if (SnapCoyoteTime > 0f) { diff --git a/Projectiles/Melee/RendingNeedle.cs b/Projectiles/Melee/RendingNeedle.cs index cbbdacbca3..32f632dc45 100644 --- a/Projectiles/Melee/RendingNeedle.cs +++ b/Projectiles/Melee/RendingNeedle.cs @@ -39,10 +39,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 44f * Projectile.scale; + float bladeLength = 44f * Projectile.scale; Vector2 start = -Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * 16f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + start, Projectile.Center + start + Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + start, Projectile.Center + start + Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * bladeLength, 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/SolarNeedle.cs b/Projectiles/Melee/SolarNeedle.cs index 56f273c3c0..a5c1fb6b9e 100644 --- a/Projectiles/Melee/SolarNeedle.cs +++ b/Projectiles/Melee/SolarNeedle.cs @@ -39,10 +39,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 44f * Projectile.scale; + float bladeLength = 44f * Projectile.scale; Vector2 start = -Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * 16f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + start, Projectile.Center + start + Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + start, Projectile.Center + start + Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * bladeLength, 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/Spears/RedtideSpearProjectile.cs b/Projectiles/Melee/Spears/RedtideSpearProjectile.cs index e14d02f134..e09f18e860 100644 --- a/Projectiles/Melee/Spears/RedtideSpearProjectile.cs +++ b/Projectiles/Melee/Spears/RedtideSpearProjectile.cs @@ -186,9 +186,9 @@ namespace CalamityMod.Projectiles.Melee.Spears public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 85 * Projectile.scale; + float bladeLength = 85 * Projectile.scale; float bladeWidth = 20 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + AppropriateRotation.ToRotationVector2() * bladeLenght * -0.5f, Projectile.Center + ThrustRotation.ToRotationVector2() * bladeLenght * 0.5f, bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + AppropriateRotation.ToRotationVector2() * bladeLength * -0.5f, Projectile.Center + ThrustRotation.ToRotationVector2() * bladeLength * 0.5f, bladeWidth, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/TrueAncientBeam.cs b/Projectiles/Melee/TrueAncientBeam.cs index 56517aee68..7f04c07bfb 100644 --- a/Projectiles/Melee/TrueAncientBeam.cs +++ b/Projectiles/Melee/TrueAncientBeam.cs @@ -39,10 +39,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 44f * Projectile.scale; + float bladeLength = 44f * Projectile.scale; Vector2 start = -Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * 16f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + start, Projectile.Center + start + Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center + start, Projectile.Center + start + Utils.SafeNormalize(Projectile.velocity, Vector2.Zero) * bladeLength, 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs b/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs index 06c2a55ac8..f829fd48bc 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_ParryHoldout.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 100f * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLenght), 24, ref collisionPoint); + float bladeLength = 100f * Projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLength), 24, ref collisionPoint); } public void GeneralParryEffects() @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Melee if (AlreadyParried == 0) { float collisionPoint = 0f; - float bladeLenght = 100f * Projectile.scale; + float bladeLength = 100f * Projectile.scale; for (int k = 0; k < Main.maxProjectiles; k++) { @@ -118,7 +118,7 @@ namespace CalamityMod.Projectiles.Melee if (proj.active && proj.hostile && proj.damage > 1 && //Only parry harmful projectiles proj.velocity.Length() * (proj.extraUpdates + 1) > 1f && //Only parry projectiles that move semi-quickly proj.Size.Length() < 300 && //Only parry projectiles that aren't too large - Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLenght), 24, ref collisionPoint)) + Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + DistanceFromPlayer, Owner.Center + DistanceFromPlayer + (Projectile.velocity * bladeLength), 24, ref collisionPoint)) { GeneralParryEffects(); diff --git a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs index 4f6b5104e0..ccd06eb9d8 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs @@ -54,10 +54,10 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 88f * Projectile.scale; + float bladeLength = 88f * Projectile.scale; Vector2 holdPoint = DistanceFromPlayer.Length() * Projectile.rotation.ToRotationVector2(); - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + Projectile.rotation.ToRotationVector2() * bladeLenght, 24, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center + holdPoint, Owner.Center + holdPoint + Projectile.rotation.ToRotationVector2() * bladeLength, 24, ref collisionPoint); } diff --git a/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs b/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs index d2ec7ecbc4..04fff5d1cd 100644 --- a/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs +++ b/Projectiles/Melee/TrueBiomeBlade_MercurialTides.cs @@ -57,10 +57,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 145 * Projectile.scale; + float bladeLength = 145 * Projectile.scale; float bladeWidth = 25 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } public CurveSegment QuickOut = new CurveSegment(EasingType.PolyIn, 0f, 0f, 0.2f, 3); diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs index 675ecb07e8..1224f53a92 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFury.cs @@ -61,10 +61,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 130 * Projectile.scale; + float bladeLength = 130 * Projectile.scale; float bladeWidth = 86 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.Center, Owner.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } public void Pogo() diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryWheel.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryWheel.cs index 1777fe10ea..a80a87ef64 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryWheel.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryWheel.cs @@ -52,10 +52,10 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 84 * Projectile.scale; + float bladeLength = 84 * Projectile.scale; float bladeWidth = 76 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - direction * bladeLenght / 2, Projectile.Center + direction * bladeLenght / 2, bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center - direction * bladeLength / 2, Projectile.Center + direction * bladeLength / 2, bladeWidth, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs index ec44c58f24..fe5a34c832 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs @@ -65,9 +65,9 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 140 * Projectile.scale; + float bladeLength = 140 * Projectile.scale; float bladeWidth = 25 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } diff --git a/Projectiles/Melee/UrchinMaceProjectile.cs b/Projectiles/Melee/UrchinMaceProjectile.cs index 9318d5b68f..dc69847205 100644 --- a/Projectiles/Melee/UrchinMaceProjectile.cs +++ b/Projectiles/Melee/UrchinMaceProjectile.cs @@ -45,9 +45,9 @@ namespace CalamityMod.Projectiles.Melee return false; float collisionPoint = 0f; - float bladeLenght = 70 * Projectile.scale; + float bladeLength = 70 * Projectile.scale; float bladeWidth = 30 * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (Projectile.rotation.ToRotationVector2() * bladeLenght), bladeWidth, ref collisionPoint); + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (Projectile.rotation.ToRotationVector2() * bladeLength), bladeWidth, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Melee/WulfrumScrewdriverProj.cs b/Projectiles/Melee/WulfrumScrewdriverProj.cs index 8ebe41919f..4ef8c50a59 100644 --- a/Projectiles/Melee/WulfrumScrewdriverProj.cs +++ b/Projectiles/Melee/WulfrumScrewdriverProj.cs @@ -63,8 +63,8 @@ namespace CalamityMod.Projectiles.Melee { //The hitbox is simplified into a line collision. float collisionPoint = 0f; - float bladeLenght = 78f * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.MountedCenter + OffsetFromPlayer, Owner.MountedCenter + OffsetFromPlayer + (Projectile.velocity * bladeLenght), 24, ref collisionPoint); + float bladeLength = 78f * Projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Owner.MountedCenter + OffsetFromPlayer, Owner.MountedCenter + OffsetFromPlayer + (Projectile.velocity * bladeLength), 24, ref collisionPoint); } public override void AI() @@ -96,8 +96,8 @@ namespace CalamityMod.Projectiles.Melee if (proj.ModProjectile != null && proj.owner == Projectile.owner && proj.ModProjectile is WulfrumScrew screw && screw.BazingaTime == 0) { float collisionPoint = 0f; - float bladeLenght = 86f * Projectile.scale; - if (Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + OffsetFromPlayer, Owner.Center + OffsetFromPlayer + (Projectile.velocity * bladeLenght), 34, ref collisionPoint)) + float bladeLength = 86f * Projectile.scale; + if (Collision.CheckAABBvLineCollision(proj.Hitbox.TopLeft(), proj.Hitbox.Size(), Owner.Center + OffsetFromPlayer, Owner.Center + OffsetFromPlayer + (Projectile.velocity * bladeLength), 34, ref collisionPoint)) { Vector2 thudVelocity = TrueDirection.ToRotationVector2() * 6f; NPC potentialAimAssist = FindTarget(); diff --git a/Projectiles/Ranged/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index 43420c0318..3ab4afceca 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -184,7 +184,7 @@ namespace CalamityMod.Projectiles.Ranged spreadEffect.Parameters["halfSpreadAngle"].SetValue(halfAngle); spreadEffect.Parameters["edgeColor"].SetValue(sightsColor.ToVector3()); spreadEffect.Parameters["centerColor"].SetValue(sightsColor.ToVector3()); - spreadEffect.Parameters["edgeBlendLenght"].SetValue(0.07f); + spreadEffect.Parameters["edgeBlendLength"].SetValue(0.07f); spreadEffect.Parameters["edgeBlendStrength"].SetValue(8f); Main.spriteBatch.End(); diff --git a/Projectiles/Ranged/TitaniumRailgunShot.cs b/Projectiles/Ranged/TitaniumRailgunShot.cs index c4f6e9d9e1..9e2a73bf02 100644 --- a/Projectiles/Ranged/TitaniumRailgunShot.cs +++ b/Projectiles/Ranged/TitaniumRailgunShot.cs @@ -53,13 +53,13 @@ namespace CalamityMod.Projectiles.Ranged { Vector2 beamVector = Projectile.velocity; - float beamLenght = DetermineLaserLength_CollideWithTiles(12); + float beamLength = DetermineLaserLength_CollideWithTiles(12); //Rapid dust int dustCount = Main.rand.Next(10, 30); for (int i = 0; i < dustCount; i++) { - float dustProgressAlongBeam = beamLenght * Main.rand.NextFloat(0f, 0.8f); + float dustProgressAlongBeam = beamLength * Main.rand.NextFloat(0f, 0.8f); Vector2 dustPosition = Projectile.Center + dustProgressAlongBeam * beamVector + beamVector.RotatedBy(MathHelper.PiOver2) * Main.rand.NextFloat(-6f, 6f) * Projectile.scale; Dust dust = Dust.NewDustPerfect(dustPosition, 187, beamVector * Main.rand.NextFloat(5f, 26f), 0, Color.White, 2.2f); @@ -67,9 +67,9 @@ namespace CalamityMod.Projectiles.Ranged } //Put a titanium shell into the impact tile (if it collided with one) - if (beamLenght < MaxLaserLength) + if (beamLength < MaxLaserLength) { - Vector2 endPoint = beamLenght * beamVector + Projectile.Center + beamVector * 8.5f; + Vector2 endPoint = beamLength * beamVector + Projectile.Center + beamVector * 8.5f; Point anchorPos = new Point((int)endPoint.X / 16, (int)endPoint.Y / 16); Color burnColor = Main.rand.NextBool(4) ? Color.PaleGreen : Main.rand.NextBool(4) ? Color.PaleTurquoise : Color.OrangeRed; diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index d057d5908c..f21cd6fd5e 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -231,23 +231,23 @@ namespace CalamityMod.Projectiles.Summon } Vector2 center2 = Projectile.Center; Vector2 playerpos = player.Center - center2 + new Vector2(0f, -60f); - float lenghttoplayer = playerpos.Length(); - if (lenghttoplayer > 200f && speedtoplayer < 8f) + float LengthToPlayer = playerpos.Length(); + if (LengthToPlayer > 200f && speedtoplayer < 8f) { speedtoplayer = 10f; } - if (lenghttoplayer < idledistance && gotoplayer && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) + if (LengthToPlayer < idledistance && gotoplayer && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) { Projectile.ai[0] = 0f; Projectile.netUpdate = true; } - if (lenghttoplayer > 2700f) + if (LengthToPlayer > 2700f) { Projectile.position.X = Main.player[Projectile.owner].Center.X - (float)(Projectile.width / 2); Projectile.position.Y = Main.player[Projectile.owner].Center.Y - (float)(Projectile.height / 2); Projectile.netUpdate = true; } - if (lenghttoplayer > 70f) + if (LengthToPlayer > 70f) { playerpos.Normalize(); playerpos *= speedtoplayer; diff --git a/Projectiles/Typeless/WulfrumDrillProj.cs b/Projectiles/Typeless/WulfrumDrillProj.cs index 95fd828518..99fd498b3b 100644 --- a/Projectiles/Typeless/WulfrumDrillProj.cs +++ b/Projectiles/Typeless/WulfrumDrillProj.cs @@ -39,8 +39,8 @@ namespace CalamityMod.Projectiles.Typeless public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLenght = 54f * Projectile.scale; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (Projectile.velocity * bladeLenght), 24, ref collisionPoint); + float bladeLength = 54f * Projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (Projectile.velocity * bladeLength), 24, ref collisionPoint); } public override void AI() diff --git a/Projectiles/Typeless/WulfrumHook.cs b/Projectiles/Typeless/WulfrumHook.cs index bf7b5db93a..00a94addc6 100644 --- a/Projectiles/Typeless/WulfrumHook.cs +++ b/Projectiles/Typeless/WulfrumHook.cs @@ -113,9 +113,9 @@ namespace CalamityMod.Projectiles.Typeless else { - float lenghtToOwner = BetweenOwner.Length(); + float LengthToOwner = BetweenOwner.Length(); - if (lenghtToOwner > Owner.GetModPlayer().SwingLenght + 60f) + if (LengthToOwner > Owner.GetModPlayer().SwingLength + 60f) { State = HookState.Retracting; } @@ -196,7 +196,7 @@ namespace CalamityMod.Projectiles.Typeless //Owner.velocity = Vector2.Zero; } - mp.SwingLenght = (Owner.Center - Projectile.Center).Length(); + mp.SwingLength = (Owner.Center - Projectile.Center).Length(); mp.OldPosition = Owner.Center - Owner.velocity; mp.SetSegments(Projectile.Center); mp.Grapple = Projectile.whoAmI; diff --git a/Systems/TilePingerSystem.cs b/Systems/TilePingerSystem.cs index 6908635ad4..9d6a5aa79e 100644 --- a/Systems/TilePingerSystem.cs +++ b/Systems/TilePingerSystem.cs @@ -269,7 +269,7 @@ namespace CalamityMod.Systems tileEffect.Parameters["pingTravelTime"].SetValue(MaxPingTravelTime / (float)MaxPingLife); tileEffect.Parameters["pingFadePoint"].SetValue(0.9f); tileEffect.Parameters["edgeBlendStrength"].SetValue(1f); - tileEffect.Parameters["edgeBlendOutLenght"].SetValue(6f); + tileEffect.Parameters["edgeBlendOutLength"].SetValue(6f); tileEffect.Parameters["tileEdgeBlendStrenght"].SetValue(2f); tileEffect.Parameters["waveColor"].SetValue(Color.GreenYellow.ToVector4()); diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index 2e8c74f53e..0b2a77959f 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -30,10 +30,10 @@ namespace CalamityMod.UI.ModeIndicator public static bool ClickingMouse => Main.mouseLeft && Main.mouseLeftRelease; public static Vector2 DrawCenter => new Vector2(Main.screenWidth - 400f - WidthForTier(MostAlternateDifficulties) * 0.5f, 82f) + FrameSize * 0.5f; - private static int GlowFadeAnimLenght = 40; + private static int GlowFadeAnimLength = 40; public static int GlowFadeTime = 0; //Lock icon - internal const int LockAnimLenght = 30; + internal const int LockAnimLength = 30; private static int lockClickTime = 0; private static bool previousLockStatus = false; //Expand and shrink on hover @@ -45,7 +45,7 @@ namespace CalamityMod.UI.ModeIndicator public static float MainIconScale => 1f + iconHoverScaleBoost; //Menu state private static bool menuOpen = false; - internal static int MenuAnimLenght => MostAlternateDifficulties > 1 ? 60 : 40; + internal static int MenuAnimLength => MostAlternateDifficulties > 1 ? 60 : 40; private static int menuOpenTransitionTime = 0; private static DifficultyMode previouslyHoveredMode = null; public static float WidthForTier(int alts) => (alts - 1) * 40f; @@ -99,7 +99,7 @@ namespace CalamityMod.UI.ModeIndicator { if (!_hasCheckedItOutYet) { - GlowFadeTime = GlowFadeAnimLenght; + GlowFadeTime = GlowFadeAnimLength; _hasCheckedItOutYet = true; } @@ -116,7 +116,7 @@ namespace CalamityMod.UI.ModeIndicator if (ClickingMouse && menuOpenTransitionTime == 0 && !locked) { SoundEngine.PlaySound(menuOpen ? SoundID.MenuClose : SoundID.MenuOpen); - menuOpenTransitionTime = MenuAnimLenght; + menuOpenTransitionTime = MenuAnimLength; menuOpen = !menuOpen; } } @@ -130,7 +130,7 @@ namespace CalamityMod.UI.ModeIndicator spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); Texture2D bloomTex = ModContent.Request("CalamityMod/UI/ModeIndicator/BloomFlare").Value; - float opacity = !_hasCheckedItOutYet ? 1f : 1f * GlowFadeTime / (float)GlowFadeAnimLenght; + float opacity = !_hasCheckedItOutYet ? 1f : 1f * GlowFadeTime / (float)GlowFadeAnimLength; float scale = 0.4f + (float)Math.Sin(Main.GlobalTimeWrappedHourly) * 0.05f; float rot = Main.GlobalTimeWrappedHourly * 0.5f; @@ -244,7 +244,7 @@ namespace CalamityMod.UI.ModeIndicator //Shakes the lock if it automatically changed, because a boss was summoned if (locked != previousLockStatus && lockClickTime == 0) - lockClickTime = LockAnimLenght; + lockClickTime = LockAnimLength; previousLockStatus = locked; @@ -252,7 +252,7 @@ namespace CalamityMod.UI.ModeIndicator if (locked && menuOpen) { menuOpen = false; - menuOpenTransitionTime = MenuAnimLenght - menuOpenTransitionTime; + menuOpenTransitionTime = MenuAnimLength - menuOpenTransitionTime; } //Click handling @@ -260,7 +260,7 @@ namespace CalamityMod.UI.ModeIndicator { if (MouseScreenArea.Intersects(MainClickArea)) { - lockClickTime = LockAnimLenght; + lockClickTime = LockAnimLength; SoundEngine.PlaySound(SoundID.MenuTick); } } @@ -270,15 +270,15 @@ namespace CalamityMod.UI.ModeIndicator private static CurveSegment lockGrow = new CurveSegment(SineOutEasing, 0f, 1f, 0.4f); private static CurveSegment lockShrink = new CurveSegment(SineInEasing, 0.6f, 1.4f, -0.4f); private static CurveSegment lockBump = new CurveSegment(SineBumpEasing, 0.9f, 1f, -0.2f); - internal static float LockShakeScale => PiecewiseAnimation(lockClickTime / (float)LockAnimLenght, new CurveSegment[] { lockGrow, lockShrink, lockBump }); + internal static float LockShakeScale => PiecewiseAnimation(lockClickTime / (float)LockAnimLength, new CurveSegment[] { lockGrow, lockShrink, lockBump }); private static CurveSegment barExpand = new CurveSegment(SineInOutEasing, 0f, 0f, 1f); internal static float BarExpansionProgress { get { - float animLenght = MostAlternateDifficulties == 1 ? (float)MenuAnimLenght : MenuAnimLenght * 2 / 3f; - float progress = (menuOpenTransitionTime / animLenght); + float animLength = MostAlternateDifficulties == 1 ? (float)MenuAnimLength : MenuAnimLength * 2 / 3f; + float progress = (menuOpenTransitionTime / animLength); if (menuOpen) progress = 1 - progress; @@ -294,7 +294,7 @@ namespace CalamityMod.UI.ModeIndicator { get { - float progress = Math.Max(menuOpenTransitionTime - MenuAnimLenght * 2 / 3f, 0f) / (MenuAnimLenght / 3f); + float progress = Math.Max(menuOpenTransitionTime - MenuAnimLength * 2 / 3f, 0f) / (MenuAnimLength / 3f); if (menuOpen) progress = 1 - progress; @@ -305,9 +305,9 @@ namespace CalamityMod.UI.ModeIndicator public static void ManageHexIcons(SpriteBatch spriteBatch, out string text) { int tiers = DifficultyTiers.Count(); - float barLenght = 60 * tiers * BarExpansionProgress; - float progress = menuOpen ? 1 - menuOpenTransitionTime / (float)MenuAnimLenght : menuOpenTransitionTime / (float)MenuAnimLenght; - Vector2 basePosition = DrawCenter + (barLenght / (float)(tiers + 1f)) * Vector2.UnitY; + float barLength = 60 * tiers * BarExpansionProgress; + float progress = menuOpen ? 1 - menuOpenTransitionTime / (float)MenuAnimLength : menuOpenTransitionTime / (float)MenuAnimLength; + Vector2 basePosition = DrawCenter + (barLength / (float)(tiers + 1f)) * Vector2.UnitY; Texture2D outlineTexture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicatorOutline").Value; @@ -323,7 +323,7 @@ namespace CalamityMod.UI.ModeIndicator Texture2D hexIcon = mode.Texture.Value; //Get position - Vector2 iconPosition = basePosition + (barLenght / (float)(tiers + 1f)) * Vector2.UnitY * i; + Vector2 iconPosition = basePosition + (barLength / (float)(tiers + 1f)) * Vector2.UnitY * i; if (modesAtTier > 1) iconPosition += Vector2.UnitX * MathHelper.Lerp(WidthForTier(modesAtTier) * -0.5f, WidthForTier(modesAtTier) * 0.5f, j / (float)(modesAtTier - 1)) * BarWidthExpansionProgress; @@ -365,7 +365,7 @@ namespace CalamityMod.UI.ModeIndicator public static void DrawLock(SpriteBatch spriteBatch) { Texture2D lockTexture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicatorLock").Value; - float rotationShift = lockClickTime == 0 ? 0f : (float)Math.Sin((1 - lockClickTime / (float)LockAnimLenght) * MathHelper.TwoPi * 2f) * 0.5f * (lockClickTime / (float)LockAnimLenght); + float rotationShift = lockClickTime == 0 ? 0f : (float)Math.Sin((1 - lockClickTime / (float)LockAnimLength) * MathHelper.TwoPi * 2f) * 0.5f * (lockClickTime / (float)LockAnimLength); spriteBatch.Draw(lockTexture, DrawCenter + Vector2.UnitY * 12 * MainIconScale, null, Color.White, 0f + rotationShift, lockTexture.Size() * 0.5f, LockShakeScale * MainIconScale, SpriteEffects.None, 0f); } #endregion @@ -450,7 +450,7 @@ namespace CalamityMod.UI.ModeIndicator CalamityNetcode.SyncCalamityWorldDifficulties(Main.myPlayer); menuOpen = false; - menuOpenTransitionTime = MenuAnimLenght; + menuOpenTransitionTime = MenuAnimLength; } #endregion diff --git a/Utilities/MathematicalUtils.cs b/Utilities/MathematicalUtils.cs index 2234c28b8a..b2186da149 100644 --- a/Utilities/MathematicalUtils.cs +++ b/Utilities/MathematicalUtils.cs @@ -342,8 +342,8 @@ namespace CalamityMod endPoint = segments[i + 1].startingX; } - float segmentLenght = endPoint - startPoint; - float segmentProgress = (progress - segment.startingX) / segmentLenght; //How far along the specific segment + float segmentLength = endPoint - startPoint; + float segmentProgress = (progress - segment.startingX) / segmentLength; //How far along the specific segment ratio = segment.startingHeight; //Failsafe because somehow it can fail? what diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 5103b627c3..ea612f1fe2 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -322,11 +322,11 @@ namespace CalamityMod public static bool IntoMorseCode(string originalText, float completion) { - int spaceLenght = 13; - int betweenLetterLenght = 7; - int betweenBlipLenght = 4; - int shortLenght = 3; - int longLenght = 8; + int spaceLength = 13; + int betweenLetterLength = 7; + int betweenBlipLength = 4; + int shortLength = 3; + int longLength = 8; char[] TextKeys = { ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' }; @@ -358,18 +358,18 @@ namespace CalamityMod for (int i = 0; i < morseText.Length; i++) { if (morseText[i] == " ".ToCharArray()[0]) - morseState.AddRange(Enumerable.Repeat(false, spaceLenght)); + morseState.AddRange(Enumerable.Repeat(false, spaceLength)); if (morseText[i] == "|".ToCharArray()[0]) - morseState.AddRange(Enumerable.Repeat(false, betweenLetterLenght)); + morseState.AddRange(Enumerable.Repeat(false, betweenLetterLength)); if (morseText[i] == ".".ToCharArray()[0]) - morseState.AddRange(Enumerable.Repeat(true, shortLenght)); + morseState.AddRange(Enumerable.Repeat(true, shortLength)); if (morseText[i] == "-".ToCharArray()[0]) - morseState.AddRange(Enumerable.Repeat(true, longLenght)); + morseState.AddRange(Enumerable.Repeat(true, longLength)); - morseState.AddRange(Enumerable.Repeat(false, betweenBlipLenght)); + morseState.AddRange(Enumerable.Repeat(false, betweenBlipLength)); } return morseState[(int)((morseState.Count - 1) * completion)];