Yharon split fireball changes.
This commit is contained in:
1 parent
ebb302f635
commit
4e82b8af45
2 files changed
+19
-46
No files matched your search
@@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public class YharonFireball : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Boss";
|
||||
private float speedX = -3f;
|
||||
private float speedX2 = -5f;
|
||||
private float speedX = -1f;
|
||||
private float speedX2 = -2f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -95,13 +95,13 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
for (int x = 0; x < 3; x++)
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX, -50f, ModContent.ProjectileType<YharonFireball2>(), Projectile.damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
speedX += 3f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX, -6f, ModContent.ProjectileType<YharonFireball2>(), Projectile.damage, 0f, Main.myPlayer);
|
||||
speedX += 1f;
|
||||
}
|
||||
for (int x = 0; x < 2; x++)
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX2, -75f, ModContent.ProjectileType<YharonFireball2>(), Projectile.damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
speedX2 += 10f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX2, -6f, ModContent.ProjectileType<YharonFireball2>(), Projectile.damage, 0f, Main.myPlayer);
|
||||
speedX2 += 4f;
|
||||
}
|
||||
}
|
||||
Projectile.ExpandHitboxBy(144);
|
||||
|
||||
@@ -16,6 +16,10 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
public static readonly SoundStyle FireballSound = new("CalamityMod/Sounds/Custom/Yharon/YharonFireball", 3);
|
||||
|
||||
private const float TimeBeforeFalling = 180f;
|
||||
private const float MaxUpwardVelocity = -24f;
|
||||
private const float MaxDownwardVelocity = 16f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.projFrames[Projectile.type] = 5;
|
||||
@@ -29,7 +33,6 @@ 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;
|
||||
@@ -57,41 +60,21 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (Projectile.frame >= Main.projFrames[Projectile.type])
|
||||
Projectile.frame = 0;
|
||||
|
||||
if (Projectile.velocity.Y >= -16f)
|
||||
if (Projectile.ai[0] < TimeBeforeFalling)
|
||||
{
|
||||
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, DustID.Pixie, 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
|
||||
Projectile.velocity.Y *= 0.97f;
|
||||
Projectile.ai[0] += 1f;
|
||||
Projectile.velocity.Y -= 0.1f;
|
||||
if (Projectile.velocity.Y < MaxUpwardVelocity)
|
||||
Projectile.velocity.Y = MaxUpwardVelocity;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 85 frames to get from -1 to 16
|
||||
Projectile.velocity.X *= 0.8f;
|
||||
Projectile.velocity.Y += 0.2f;
|
||||
if (Projectile.velocity.Y > 16f)
|
||||
Projectile.velocity.Y = 16f;
|
||||
if (Projectile.velocity.Y > MaxDownwardVelocity)
|
||||
Projectile.velocity.Y = MaxDownwardVelocity;
|
||||
}
|
||||
|
||||
Projectile.velocity.X *= 0.995f;
|
||||
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
|
||||
|
||||
if (Projectile.localAI[0] == 0f)
|
||||
@@ -100,13 +83,6 @@ namespace CalamityMod.Projectiles.Boss
|
||||
SoundEngine.PlaySound(FireballSound, Projectile.Center);
|
||||
}
|
||||
|
||||
if (Projectile.ai[0] >= 2f)
|
||||
{
|
||||
Projectile.alpha -= 25;
|
||||
if (Projectile.alpha < 0)
|
||||
Projectile.alpha = 0;
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(16))
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 200, default, 1f);
|
||||
@@ -115,8 +91,6 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target) => Projectile.velocity.Y >= -16f;
|
||||
|
||||
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha);
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
@@ -150,8 +124,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
if (info.Damage <= 0)
|
||||
return;
|
||||
|
||||
if (Projectile.velocity.Y >= -16f)
|
||||
target.AddBuff(ModContent.BuffType<Dragonfire>(), 60);
|
||||
target.AddBuff(ModContent.BuffType<Dragonfire>(), 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user