Thorn Ball visibility improvements
This commit is contained in:
1 parent
52e7020578
commit
be6247b058
3 files changed
+9
-7
No files matched your search
@@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
if (Projectile.velocity.Length() < MaxVelocity)
|
||||
{
|
||||
Projectile.velocity *= 1.05f;
|
||||
Projectile.velocity *= 1.045f;
|
||||
if (Projectile.velocity.Length() > MaxVelocity)
|
||||
{
|
||||
Projectile.velocity.Normalize();
|
||||
@@ -58,6 +58,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 90);
|
||||
|
||||
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha);
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (Projectile.timeLeft > TimeLeft - 5)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 304 B |
@@ -4390,15 +4390,15 @@ namespace CalamityMod.Projectiles
|
||||
|
||||
if (projectile.type == ProjectileID.ThornBall)
|
||||
{
|
||||
float startTurningBrownGateValue = 420f;
|
||||
float timeToReachFullBrown = 180f;
|
||||
float timeToReachThornExplosion = startTurningBrownGateValue + timeToReachFullBrown;
|
||||
float startWarningColorGateValue = 420f;
|
||||
float timeToReachFullIntensity = 180f;
|
||||
float timeToReachThornExplosion = startWarningColorGateValue + timeToReachFullIntensity;
|
||||
Color initialColor = lightColor;
|
||||
Color finalColor = new Color(125, 75, 75);
|
||||
Color finalColor = Color.Lerp(new Color(125, 75, 75), Color.Red, (float)Math.Abs(Math.Sin((projectile.ai[1] - startWarningColorGateValue) * (MathHelper.Pi / 45))));
|
||||
finalColor.A = (byte)(255 - projectile.alpha);
|
||||
if (projectile.ai[1] > startTurningBrownGateValue)
|
||||
if (projectile.ai[1] > startWarningColorGateValue)
|
||||
{
|
||||
float colorTransitionRatio = (projectile.ai[1] - startTurningBrownGateValue) / timeToReachFullBrown;
|
||||
float colorTransitionRatio = (projectile.ai[1] - startWarningColorGateValue) / timeToReachFullIntensity;
|
||||
Color dehydratedColor = Color.Lerp(initialColor, finalColor, colorTransitionRatio);
|
||||
return dehydratedColor;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user