Files
CalamityModPublic/Projectiles/Melee/CrescentMoonProj.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

66 lines
2.1 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.Buffs.DamageOverTime;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class CrescentMoonProj : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/Magic/Crescent";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Crescent Moon");
ProjectileID.Sets.TrailCacheLength[projectile.type] = 6;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.width = 50;
projectile.height = 50;
projectile.alpha = 100;
projectile.friendly = true;
projectile.melee = true;
projectile.tileCollide = false;
projectile.penetrate = 5;
projectile.timeLeft = 180;
projectile.ignoreWater = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.extraUpdates = 1;
projectile.aiStyle = 18;
aiType = ProjectileID.DeathSickle;
}
public override void AI()
{
Lighting.AddLight(projectile.Center, 0f, 0f, 0.6f);
if (projectile.soundDelay == 0)
{
projectile.soundDelay = 30 + Main.rand.Next(50);
if (Main.rand.NextBool(10))
{
Main.PlaySound(SoundID.Item9, (int)projectile.position.X, (int)projectile.position.Y);
}
}
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 460f, 15f, 20f);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 180);
}
}
}