This commit formats the entire codebase according to `dotnet format` and its limited understanding of our provided `.editorconfig`.
59 lines
2.2 KiB
C#
59 lines
2.2 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Rogue
|
|
{
|
|
public class InfernalKrisExplosion : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Rogue";
|
|
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
|
|
|
public static float radius = 64;
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = (int)radius * 2;
|
|
Projectile.height = (int)radius * 2;
|
|
Projectile.friendly = true;
|
|
Projectile.penetrate = -1;
|
|
Projectile.tileCollide = false;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.timeLeft = 9;
|
|
Projectile.usesLocalNPCImmunity = true;
|
|
Projectile.localNPCHitCooldown = -1;
|
|
Projectile.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Projectile.timeLeft >= 5)
|
|
{
|
|
int numDust = 40;
|
|
int dustType = 6;
|
|
float minRange = 0;
|
|
float maxRange = radius / 10f;
|
|
|
|
for (int i = 0; i < numDust; i++)
|
|
{
|
|
|
|
Vector2 circleVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1));
|
|
circleVelocity.Normalize();
|
|
circleVelocity *= Main.rand.NextFloat(minRange, maxRange);
|
|
|
|
int circle = Dust.NewDust(Projectile.Center, 1, 1, dustType, circleVelocity.X, circleVelocity.Y, 0, default, 2f);
|
|
Main.dust[circle].noGravity = true;
|
|
Main.dust[circle].velocity = circleVelocity;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire, 180);
|
|
|
|
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 180);
|
|
|
|
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, radius, targetHitbox);
|
|
}
|
|
}
|