Files
CalamityModPublic/Projectiles/Melee/ForbiddenOathbladeProjectile.cs
T
Andrew Marheine 632e869448 Boss Rush no longer disables mounts.
Forbidden Oathblade line projectile piercing tweaks.
Multiple refactors.
Skeletron Prime defense scales with number of arms remaining and all arms explode when the head reaches phase 2.
Gatling Laser sound bug fix.
Yharon and Birb tornado/aura spawner projectiles last longer so they can actually reach their max velocity.
2020-04-26 00:45:09 -05:00

54 lines
1.8 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class ForbiddenOathbladeProjectile : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Oathblade");
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
}
public override void SetDefaults()
{
projectile.width = 50;
projectile.height = 50;
projectile.aiStyle = 18;
projectile.alpha = 100;
projectile.friendly = true;
projectile.melee = true;
projectile.tileCollide = true;
projectile.penetrate = 3;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 30;
aiType = ProjectileID.DemonScythe;
}
public override void AI()
{
Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.35f);
if (Main.rand.NextBool(3))
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f);
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.OnFire, 180);
target.AddBuff(BuffID.ShadowFlame, 180);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
return false;
}
}
}