Files
CalamityModPublic/Projectiles/Boss/BrimstoneHellfireball.cs
T

57 lines
2.1 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class BrimstoneHellfireball : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Brimstone Hellfireball");
}
public override void SetDefaults()
{
projectile.width = 12;
projectile.height = 12;
projectile.hostile = true;
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.timeLeft = 600;
}
public override void AI()
{
projectile.velocity.Y *= 1.01f;
projectile.velocity.X *= 1.01f;
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.05f / 255f, (255 - projectile.alpha) * 0.05f / 255f);
if (projectile.ai[0] == 0f)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
projectile.ai[0] += 1f;
}
for (int num457 = 0; num457 < 5; num457++)
{
int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1.6f);
Main.dust[num458].noGravity = true;
Main.dust[num458].velocity *= 0.5f;
Main.dust[num458].velocity += projectile.velocity * 0.1f;
}
}
public override void Kill(int timeLeft)
{
if (projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<HellfireExplosion>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 600);
}
}
}