Files
CalamityModPublic/Projectiles/Boss/PhantomMine.cs
T
mountaindrew10 a5ad80dbbc 1 - Max life bonuses stack additively rather than multiplicatively.
2 - Empress of Light Rev+ AI changes.
3 - Abyss enemy player detection ranges reduced so that stealth is a more viable strategy.
4 - Great Sand Shark drops the Desert Key.
5 - Queen Slime drops the Hallowed Key instead of Astrum Aureus.
6 - Non-hostile Cuttlefish are easier to see.
7 - DoG no longer uses laser walls infinitely in final phase.
8 - Cnidrion no longer falls through tiles and only gets faster with lower HP in Death Mode.
9 - Perf Hive charges faster.
10 - Polter Phantoms have more HP.
11 - Lances are no longer capped as heavily and have far higher damage while the player is not moving.
12 - Prismatic Lacewing spawn fix.
13 - DoG laser wall laser timeLeft reduced.
14 - Polter Phantom mines scale their visibility with their velocity.
2022-06-09 05:36:07 -05:00

99 lines
4.0 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Boss
{
public class PhantomMine : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Phantom Orb");
}
public override void SetDefaults()
{
Projectile.Calamity().canBreakPlayerDefense = true;
Projectile.width = 30;
Projectile.height = 30;
Projectile.hostile = true;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.timeLeft = 480;
Projectile.Opacity = 0f;
CooldownSlot = 1;
}
public override void AI()
{
Projectile.Opacity = MathHelper.Lerp(0f, 1f, Projectile.velocity.Length() / Projectile.ai[0]);
if (Projectile.velocity.Length() < Projectile.ai[0])
{
Projectile.velocity *= Projectile.ai[1];
if (Projectile.velocity.Length() > Projectile.ai[0])
{
Projectile.velocity.Normalize();
Projectile.velocity *= Projectile.ai[0];
}
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color((byte)(200 * Projectile.Opacity), (byte)(200 * Projectile.Opacity), (byte)(200 * Projectile.Opacity), Projectile.alpha);
}
public override bool CanHitPlayer(Player target) => Projectile.velocity.Length() >= Projectile.ai[0];
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 12f, targetHitbox);
public override void Kill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item14, Projectile.position);
Projectile.position.X = Projectile.position.X + (Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y + (Projectile.height / 2);
Projectile.width = 150;
Projectile.height = 150;
Projectile.position.X = Projectile.position.X - (Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2);
for (int num621 = 0; num621 < 15; num621++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 30; num623++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 180, 0f, 0f, 100, default, 1.7f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 60, 0f, 0f, 100, default, 1f);
Main.dust[num624].velocity *= 2f;
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
if (Projectile.velocity.Length() >= Projectile.ai[0])
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 180);
target.AddBuff(ModContent.BuffType<WhisperingDeath>(), 180);
}
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{
target.Calamity().lastProjectileHit = Projectile;
}
}
}