2 - Stealth no longer gives movement speed. 3 - Moved a bunch of CalamityGlobalProjectile utilities to CalamityUtils where they belong. 4 - Renamed several things in CalamityGlobalProjectile
66 lines
2.4 KiB
C#
66 lines
2.4 KiB
C#
using CalamityMod.Buffs.StatDebuffs;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Audio;
|
|
namespace CalamityMod.Projectiles.Melee
|
|
{
|
|
public class TerratomereProjectile : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Bolt");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 30;
|
|
Projectile.height = 30;
|
|
Projectile.aiStyle = 27;
|
|
Projectile.friendly = true;
|
|
Projectile.DamageType = DamageClass.Melee;
|
|
Projectile.penetrate = 1;
|
|
Projectile.timeLeft = 180;
|
|
Projectile.tileCollide = false;
|
|
AIType = ProjectileID.TerraBeam;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f);
|
|
|
|
Lighting.AddLight(Projectile.Center, 0f, (255 - Projectile.alpha) * 0.75f / 255f, 0f);
|
|
}
|
|
|
|
public override Color? GetAlpha(Color lightColor)
|
|
{
|
|
return new Color(0, 200, 0, 0);
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
SoundEngine.PlaySound(SoundID.Item10, Projectile.position);
|
|
int num3;
|
|
for (int num795 = 4; num795 < 31; num795 = num3 + 1)
|
|
{
|
|
float num796 = Projectile.oldVelocity.X * (30f / (float)num795);
|
|
float num797 = Projectile.oldVelocity.Y * (30f / (float)num795);
|
|
int num798 = Dust.NewDust(new Vector2(Projectile.oldPosition.X - num796, Projectile.oldPosition.Y - num797), 8, 8, 107, Projectile.oldVelocity.X, Projectile.oldVelocity.Y, 100, default, 1.8f);
|
|
Main.dust[num798].noGravity = true;
|
|
Dust dust = Main.dust[num798];
|
|
dust.velocity *= 0.5f;
|
|
num798 = Dust.NewDust(new Vector2(Projectile.oldPosition.X - num796, Projectile.oldPosition.Y - num797), 8, 8, 107, Projectile.oldVelocity.X, Projectile.oldVelocity.Y, 100, default, 1.4f);
|
|
dust = Main.dust[num798];
|
|
dust.velocity *= 0.05f;
|
|
num3 = num795;
|
|
}
|
|
}
|
|
}
|
|
}
|