53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using ForgottenWawiTech.Content.GlobalProjectiles;
|
|
|
|
namespace ForgottenWawiTech.Content.Projectiles.Protogen
|
|
{
|
|
public class ProtogenSentinelCoreBeam : ModProjectile
|
|
{
|
|
|
|
public override string Texture => "ForgottenWawiTech/Assets/PlaceholderProj";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ProjectileID.Sets.MinionShot[Type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 18;
|
|
Projectile.height = 18;
|
|
Projectile.friendly = true;
|
|
Projectile.timeLeft = 120;
|
|
Projectile.penetrate = 2;
|
|
Projectile.tileCollide = false;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.DamageType = DamageClass.Summon;
|
|
Projectile.extraUpdates = 1;
|
|
Projectile.usesLocalNPCImmunity = true;
|
|
Projectile.localNPCHitCooldown = 10;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Projectile.rotation = Projectile.velocity.ToRotation();
|
|
Lighting.AddLight(Projectile.Center, 0.35f, 0.9f, 1.2f);
|
|
|
|
if (Main.rand.NextBool(3))
|
|
{
|
|
Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.BlueCrystalShard, 0f, 0f, 150, default, 1.1f);
|
|
dust.noGravity = true;
|
|
dust.velocity = Projectile.velocity * 0.2f;
|
|
}
|
|
}
|
|
|
|
public override void OnSpawn(IEntitySource source)
|
|
{
|
|
Projectile.GetGlobalProjectile<ProtogenSentinelGlobalProjectile>().DisableSentinelSplit = true;
|
|
}
|
|
}
|
|
}
|