Yharon's split fireballs are now translucent while they're unable to hurt the player and make a sound and dust halo when they're able to hurt the player.
This commit is contained in:
1 parent
21cb9f51c8
commit
c30a1588b0
1 file changed
+22
@@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public class YharonFireball2 : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Boss";
|
||||
|
||||
public override string Texture => "CalamityMod/Projectiles/Boss/YharonFireball";
|
||||
|
||||
public static readonly SoundStyle FireballSound = new("CalamityMod/Sounds/Custom/Yharon/YharonFireball", 3);
|
||||
@@ -28,6 +29,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Projectile.width = 34;
|
||||
Projectile.height = 34;
|
||||
Projectile.hostile = true;
|
||||
Projectile.Opacity = 0.25f;
|
||||
Projectile.alpha = 255;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.timeLeft = 3600;
|
||||
@@ -55,6 +57,26 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Projectile.frame >= Main.projFrames[Projectile.type])
|
||||
Projectile.frame = 0;
|
||||
|
||||
if (Projectile.velocity.Y >= -16f)
|
||||
{
|
||||
if (Projectile.Opacity < 1f)
|
||||
{
|
||||
Projectile.Opacity = 1f;
|
||||
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
|
||||
int dustAmount = 36;
|
||||
for (int i = 0; i < dustAmount; i++)
|
||||
{
|
||||
Vector2 dustSpawnPosition = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.5f;
|
||||
dustSpawnPosition = dustSpawnPosition.RotatedBy((double)((float)(i - (dustAmount / 2 - 1)) * MathHelper.TwoPi / (float)dustAmount), default) + Projectile.Center;
|
||||
Vector2 dustVelocity = dustSpawnPosition - Projectile.Center;
|
||||
int dust = Dust.NewDust(dustSpawnPosition + dustVelocity, 0, 0, 55, dustVelocity.X, dustVelocity.Y);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].noLight = true;
|
||||
Main.dust[dust].velocity = dustVelocity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Projectile.velocity.Y < -1f)
|
||||
{
|
||||
// 129 frames to get from -50 to -1
|
||||
|
||||
Reference in new issue
Block a user