Files
CalamityModPublic/Projectiles/Magic/PoseidonTyphoon.cs
T
Andrew Marheine cb6b42f43f 1 - Highest tier accessory reforges now reforge into other highest tier accessory reforges.
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.
2021-04-13 00:19:56 -05:00

65 lines
1.8 KiB
C#

using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class PoseidonTyphoon : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Poseidon Typhoon");
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
projectile.friendly = true;
projectile.magic = true;
projectile.penetrate = 10; //randomized in the item file now, penetrates 4 to 10 times
projectile.timeLeft = 300;
projectile.ignoreWater = true;
}
public override void AI()
{
projectile.rotation += projectile.velocity.X * 0.05f;
CalamityGlobalProjectile.HomeInOnNPC(projectile, !projectile.tileCollide, 600f, 6f, 30f);
}
public override void Kill(int timeLeft)
{
Main.PlaySound(SoundID.Item10, projectile.position);
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(200, 200, 200, 0);
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
projectile.penetrate--;
if (projectile.penetrate <= 0)
{
projectile.Kill();
}
else
{
projectile.ai[0] += 0.1f;
if (projectile.velocity.X != oldVelocity.X)
{
projectile.velocity.X = -oldVelocity.X;
}
if (projectile.velocity.Y != oldVelocity.Y)
{
projectile.velocity.Y = -oldVelocity.Y;
}
}
return false;
}
}
}