Files
CalamityModPublic/Projectiles/Summon/IrradiatedAura.cs
T
termigator1359 1b22071cf4 squash merge: Removed all unused textures
Removed nearly all unused textures in the entire mod, especially focusing on projectiles.
Apotheosis & the Death Valley Duster weapon line were ignored to prevent merge conflicts.
2020-11-15 14:25:46 -05:00

69 lines
2.2 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
namespace CalamityMod.Projectiles.Summon
{
public class IrradiatedAura : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Irradiated Aura");
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.penetrate = -1;
projectile.timeLeft = 180;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 20;
}
public override void AI()
{
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.15f / 255f, (255 - projectile.alpha) * 0.4f / 255f);
int randomDust = Main.rand.Next(4);
if (randomDust == 3)
{
randomDust = 89;
}
else if (randomDust == 2)
{
randomDust = (int)CalamityDusts.SulfurousSeaAcid;
}
else
{
randomDust = 33;
}
for (int num468 = 0; num468 < (Main.rand.NextBool(2) ? 1 : 2); num468++)
{
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 1f);
if (randomDust == 89)
{
Main.dust[num469].scale *= 0.35f;
}
Main.dust[num469].velocity *= 0f;
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
}
}
}