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

43 lines
1.7 KiB
C#

using CalamityMod.Projectiles.BaseProjectiles;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee.Spears
{
public class ElementalLanceProjectile : BaseSpearProjectile
{
public override void SetDefaults()
{
Projectile.width = Projectile.height = 40;
Projectile.DamageType = DamageClass.Melee; //Dictates whether this 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 = 7;
}
public override float InitialSpeed => 3f;
public override float ReelbackSpeed => 1.1f;
public override float ForwardSpeed => 0.6f;
public override Action<Projectile> EffectBeforeReelback => (proj) =>
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Projectile.velocity, Projectile.velocity, ModContent.ProjectileType<SpatialSpear>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
};
public override void ExtraBehavior()
{
if (Main.rand.NextBool(5))
{
int idx = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 66, Projectile.direction * 2, 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f);
Main.dust[idx].noGravity = true;
}
}
}
}