Files
CalamityModPublic/Projectiles/Boss/PhantomShot2.cs
T
Andrew Marheine 6b3e15ff79 1 - Astral Blade and Mantis Claws melee speed nerf.
2 - Astral Blade mechanic change.
3 - Lethal Lava Burn inflicted by Yharon's projectiles.
4 - Abyss worms move more naturally.
5 - Ceaseless Void dark energy NPCs and attacks inflict distorted.
6 - Polterghast inflicts moon bite with contact.
7 - Polterghast cyan projectiles inflict nightwither.
8 - Polterghast red projectiles inflict whispering death.
9 - Polterghast changes, hooks and clone now adjust aggression with Polter.
10 - Profaned Guardians inflict holy flames.
11 - Ravager, Deus and Aureus fixes.
12 - Yharon DR boosted while telegraphing his charge.
13 - Cosmic Guardian pierce resist.
14 - Leviathan meteors inflict armor crunch.
15 - Signus charge flames inflict god slayer inferno.
16 - Birb projectiles inflict electrified.
17 - Dark Spark damage adjusted at full charge.
18 - Made the Abyss wider.
2020-06-13 00:32:25 -05:00

104 lines
3.0 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using Microsoft.Xna.Framework;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class PhantomShot2 : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Potent Phantom Shot");
}
public override void SetDefaults()
{
projectile.width = 14;
projectile.height = 14;
projectile.hostile = true;
projectile.alpha = 255;
projectile.penetrate = 5;
cooldownSlot = 1;
}
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(projectile.localAI[0]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
projectile.localAI[0] = reader.ReadSingle();
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
projectile.penetrate--;
if (projectile.penetrate <= 0)
{
projectile.Kill();
}
else
{
if (projectile.velocity.X != oldVelocity.X)
{
projectile.velocity.X = -oldVelocity.X;
}
if (projectile.velocity.Y != oldVelocity.Y)
{
projectile.velocity.Y = -oldVelocity.Y;
}
}
return false;
}
public override void AI()
{
if (projectile.ai[1] == 0f)
{
projectile.ai[1] = 1f;
Main.PlaySound(SoundID.Item20, projectile.position);
}
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f;
projectile.localAI[0] += 1f;
if (projectile.localAI[0] > 9f)
{
projectile.alpha -= 5;
if (projectile.alpha < 30)
projectile.alpha = 30;
}
if (projectile.localAI[0] > 180f && projectile.localAI[0] < 300f && Main.expertMode)
{
if (projectile.ai[0] == 0f)
projectile.ai[0] = projectile.velocity.Length() * 2f;
int num189 = Player.FindClosest(projectile.Center, 1, 1);
Vector2 vector20 = Main.player[num189].Center - projectile.Center;
vector20.Normalize();
vector20 *= projectile.ai[0];
int num190 = 80;
projectile.velocity = (projectile.velocity * (num190 - 1) + vector20) / num190;
}
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(250, 100, 100, projectile.alpha);
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<WhisperingDeath>(), 120);
}
public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
{
target.Calamity().lastProjectileHit = projectile;
}
}
}