various fixes

This commit is contained in:
Altixal committed 2024-07-30 18:28:44 +07:00
1 parent 342067aaae
commit c00daa4604
9 files changed
+25 -21

No files matched your search

-2
View File
@@ -5276,8 +5276,6 @@ namespace CalamityMod.NPCs
GaussFluxTimer--;
if (ladHearts > 0)
ladHearts--;
if (vulnerabilityHex > 0)
vulnerabilityHex--;
if (banishingFire > 0)
banishingFire--;
if (wither > 0)
+3 -3
View File
@@ -4222,13 +4222,13 @@ namespace CalamityMod.Projectiles
}
}
// The vanilla damage Jousting Lance multiplier is as follows. Calamity overrides this with a new formula.
// damageScale = 0.1f + player.velocity.Length() / 7f * 0.9f
if (projectile.type == ProjectileID.JoustingLance || projectile.type == ProjectileID.HallowJoustingLance || projectile.type == ProjectileID.ShadowJoustingLance)
{
// The vanilla damage Jousting Lance multiplier is as follows. Calamity overrides this with a new formula.
float vanillaVelocityDamageMultiplier = 0.1f + player.velocity.Length() / 7f * 0.9f;
float baseVelocityDamageMultiplier = 0.01f + player.velocity.Length() * 0.002f;
float calamityVelocityDamageMultiplier = 100f * (1f - (1f / (1f + baseVelocityDamageMultiplier)));
modifiers.SourceDamage *= calamityVelocityDamageMultiplier;
modifiers.SourceDamage *= calamityVelocityDamageMultiplier / vanillaVelocityDamageMultiplier;
}
// If applicable, use ricoshot bonus damage.
+1 -1
View File
@@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Ranged
// Rotates towards its velocity.
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
if (Projectile.wet && RocketID == ItemID.DryRocket && RocketID == ItemID.WetRocket && RocketID == ItemID.LavaRocket && RocketID == ItemID.HoneyRocket)
if (Projectile.wet && (RocketID == ItemID.DryRocket || RocketID == ItemID.WetRocket || RocketID == ItemID.LavaRocket || RocketID == ItemID.HoneyRocket))
{
HasHit = true;
Projectile.Kill();
+1 -1
View File
@@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Ranged
// Rotates towards its velocity.
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
if (Projectile.wet && RocketID == ItemID.DryRocket && RocketID == ItemID.WetRocket && RocketID == ItemID.LavaRocket && RocketID == ItemID.HoneyRocket)
if (Projectile.wet && (RocketID == ItemID.DryRocket || RocketID == ItemID.WetRocket || RocketID == ItemID.LavaRocket || RocketID == ItemID.HoneyRocket))
Projectile.Kill();
Time++;
+9 -3
View File
@@ -183,7 +183,10 @@ namespace CalamityMod.Projectiles.Ranged
Collision.HitTiles(Projectile.position, Projectile.velocity, Projectile.width, Projectile.height);
// Instead of immediately killing the projectile, simply set the time left so the trail can fade out.
Projectile.timeLeft = Math.Min(Lifetime - Projectile.timeLeft, trailLength);
if (Projectile.numHits == 0)
Projectile.timeLeft = Math.Min(Lifetime - Projectile.timeLeft, trailLength);
Projectile.numHits++;
return false;
}
@@ -192,8 +195,11 @@ namespace CalamityMod.Projectiles.Ranged
target.AddBuff(BuffID.Midas, 60);
// Instead of immediately killing the projectile, simply set the time left so the trail can fade out.
Projectile.velocity = Vector2.Zero;
Projectile.timeLeft = Math.Min((Lifetime - Projectile.timeLeft), trailLength);
if (Projectile.numHits == 0)
{
Projectile.velocity = Vector2.Zero;
Projectile.timeLeft = Math.Min((Lifetime - Projectile.timeLeft), trailLength);
}
}
internal Color ColorFunction(float completionRatio)
+1 -1
View File
@@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.velocity *= 1.032f;
if (Projectile.wet && RocketID == ItemID.DryRocket && RocketID == ItemID.WetRocket && RocketID == ItemID.LavaRocket && RocketID == ItemID.HoneyRocket)
if (Projectile.wet && (RocketID == ItemID.DryRocket || RocketID == ItemID.WetRocket || RocketID == ItemID.LavaRocket || RocketID == ItemID.HoneyRocket))
Projectile.Kill();
// Every X frames it changes the projectile to its next animation frame.
+1 -1
View File
@@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged
else
Projectile.velocity *= 0.9f;
if (Projectile.wet && RocketID == ItemID.DryRocket && RocketID == ItemID.WetRocket && RocketID == ItemID.LavaRocket && RocketID == ItemID.HoneyRocket)
if (Projectile.wet && (RocketID == ItemID.DryRocket || RocketID == ItemID.WetRocket || RocketID == ItemID.LavaRocket || RocketID == ItemID.HoneyRocket))
Projectile.Kill();
// Rotates towards its velocity.
+7 -5
View File
@@ -38,7 +38,6 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Ranged;
Projectile.ignoreWater = true;
Projectile.alpha = 255;
}
public override void AI()
@@ -235,7 +234,7 @@ namespace CalamityMod.Projectiles.Ranged
player.heldProj = Projectile.whoAmI;
player.itemTime = 2;
player.itemAnimation = 2;
player.itemRotation = (float)Math.Atan2((double)(Projectile.velocity.Y * (float)Projectile.direction), (double)(Projectile.velocity.X * (float)Projectile.direction));
player.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation();
}
// Calculates which attack will occur based on coin.
@@ -320,8 +319,7 @@ namespace CalamityMod.Projectiles.Ranged
Vector2 armPosition = player.RotatedRelativePoint(player.MountedCenter, true);
armPosition += Projectile.velocity.SafeNormalize(player.direction * Vector2.UnitX) * 32f;
armPosition.Y -= 20f;
Vector2 shootDirection = (Main.MouseWorld - Projectile.Center).SafeNormalize(-Vector2.UnitY);
Vector2 gunTip = armPosition + shootDirection * player.ActiveItem().scale * 90f;
Vector2 gunTip = armPosition + Projectile.velocity.SafeNormalize(player.direction * Vector2.UnitX) * player.ActiveItem().scale * 70f;
for (int i = 0; i < projcount; ++i)
{
Vector2 perturbedSpeed = Projectile.velocity.RotatedBy(MathHelper.Lerp(-spreadfactor, spreadfactor, i / 7f)) * scaleFactor;
@@ -346,7 +344,8 @@ namespace CalamityMod.Projectiles.Ranged
int currentframe = indframeheight * Projectile.frame;
Rectangle frame = new Rectangle(0, currentframe, gun.Width, indframeheight);
Main.EntitySpriteDraw(gun, drawOffset, frame, lightColor, drawAngle, drawOrigin, Projectile.scale, flip, 0);
// This is full brightness but it's better than random flickering for whatever reason
Main.EntitySpriteDraw(gun, drawOffset, frame, Color.White, drawAngle, drawOrigin, Projectile.scale, flip, 0);
return false;
}
@@ -365,5 +364,8 @@ namespace CalamityMod.Projectiles.Ranged
// This gun does not deal melee damage, thanks.
public override bool? CanDamage() => false;
// Has velocity but updates positions manually
public override bool ShouldUpdatePosition() => false;
}
}
+2 -4
View File
@@ -17,13 +17,11 @@ namespace CalamityMod.Projectiles.Rogue
Projectile.ignoreWater = true;
Projectile.penetrate = 2;
Projectile.aiStyle = ProjAIStyleID.ThrownProjectile;
AIType = ProjectileID.ThrowingKnife;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.timeLeft = 300;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 12;
AIType = ProjectileID.ThrowingKnife;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 7;
}
public override void AI()