Files
CalamityModPublic/Projectiles/Melee/Spears/StarnightLanceProjectile.cs
T
Altixal 822c673bd1 Suggestions and fixes
- Various dye slot changes for accessory/armor dust spawning
- Lab Hologram Projectors can now face left or right
- Dragonblood Disgorger minor tooltip changes
- Nuclear Rod renamed to Nuclear Fuel Rod
- Graveyard enemies can now drop Blood Orbs
- Nadir now uses Auric Bars and is buffed accordingly
- [1.4.4 fix] Fixed typical spear AI prematurely expiring
- [1.4.4 fix] Fixed Wulfrum Blunderbuss ammo text being misplaced
2023-07-05 02:40:49 +07:00

42 lines
1.9 KiB
C#

using CalamityMod.Projectiles.BaseProjectiles;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Spears
{
public class StarnightLanceProjectile : BaseSpearProjectile
{
public override void SetDefaults()
{
Projectile.width = Projectile.height = 40;
Projectile.DamageType = DamageClass.Melee; //Dictates whether projectile is a melee-class weapon.
Projectile.timeLeft = 90;
Projectile.friendly = true;
Projectile.hostile = false;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.penetrate = -1;
Projectile.ownerHitCheck = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 8;
}
public override float InitialSpeed => 3f;
public override float ReelbackSpeed => 2.4f;
public override float ForwardSpeed => 0.95f;
public override Action<Projectile> EffectBeforeReelback => (proj) =>
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X + Projectile.velocity.X, Projectile.Center.Y + Projectile.velocity.Y,
Projectile.velocity.X * 2.4f, Projectile.velocity.Y * 2.4f, ModContent.ProjectileType<StarnightBeam>(), (int)(Projectile.damage * 0.8), Projectile.knockBack * 0.85f, Projectile.owner, 0f, 0f);
};
public override void ExtraBehavior()
{
if (Main.rand.NextBool(5))
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 29, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn2, 120);
}
}