2 - Nerfed Amalgam extra projectile damage values. 3 - Arma bags now only drop on first boss kills. 4 - Nerfed Conference Call extra bullet damage by 30%. 5 - Cal Clone dashes are no longer predictive. 6 - Old Duke looks in the direction he's about to dash instead of directly at the player, if he's going to dash. 7 - Updated pillar spawn code a bit more. 8 - Pulse Rifle now works like it should and doesn't hit 4 times on a single target. 9 - Adjusted HomeInOnNPC calls to use projectile.tileCollide to decide homing through tiles or not.
63 lines
2.1 KiB
C#
63 lines
2.1 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Ranged
|
|
{
|
|
public class Minibirb : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Minibirb");
|
|
Main.projFrames[projectile.type] = 2;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 24;
|
|
projectile.height = 8;
|
|
projectile.friendly = true;
|
|
projectile.ranged = true;
|
|
projectile.penetrate = 1;
|
|
projectile.timeLeft = 600;
|
|
projectile.light = 0.25f;
|
|
projectile.extraUpdates = 1;
|
|
}
|
|
|
|
public override bool OnTileCollide(Vector2 oldVelocity)
|
|
{
|
|
Collision.HitTiles(projectile.position, projectile.velocity, projectile.width, projectile.height);
|
|
Main.PlaySound(SoundID.NPCHit51, projectile.Center);
|
|
return true;
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
Main.PlaySound(SoundID.NPCHit51, projectile.Center);
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
projectile.frameCounter++;
|
|
if (projectile.frameCounter > 4)
|
|
{
|
|
projectile.frame++;
|
|
projectile.frameCounter = 0;
|
|
}
|
|
if (projectile.frame > 1)
|
|
{
|
|
projectile.frame = 0;
|
|
}
|
|
if (Main.rand.Next(5) == 0)
|
|
{
|
|
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
|
}
|
|
projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt();
|
|
projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? MathHelper.Pi : 0f);
|
|
|
|
CalamityGlobalProjectile.HomeInOnNPC(projectile, !projectile.tileCollide, 300f, 10f, 20f);
|
|
}
|
|
}
|
|
}
|