2 - Increased Bloodflare heart drop timer from 3 to 5 seconds. 3 - Moved Revivify, Daedalus Absorb and Absorber healing to Hurt instead of PreHurt. 4 - Reduced various life steal/healing bonuses, made their caps more strict and increased their cooldowns. 5 - Changed Baleful Harvester to be true melee and increased skull velocity and changed the skull AI. 6 - Nerfed RE weapons but made their ammo sold by the Arms Dealer and not drop from bosses. 7 - Adjusted more OOA armors by moving stats from the armor pieces to the set bonuses. 8 - Buffed Relic of Convergence healing, because it wasn't good. 9 - Adjusted DoG phase 2 AI to transition phases at different HP intervals, teleport rift creates a fireball explosion when DoG teleports to it when he's below 60% HP. 10 - Hive Cyst, Perforator Cyst and ??? no longer spawn while the pillars are active. 11 - Nerfed some Malice Mode AIs again and buffed others. 12 - Added new Perforator Hive spore attack, it's scuffed as fuck atm because it's using a placeholder sprite and projectile lol. 13 - Polter movement changed when lining up a charge. 14 - Nerfed Event Horizon homing range and black hole duration. 15 - Nerfed several other projectile homing ranges. 16 - Reduced Venom Staff buff from 66% to 33%.
153 lines
6.2 KiB
C#
153 lines
6.2 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Buffs.StatDebuffs;
|
|
using CalamityMod.Projectiles.Healing;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Melee
|
|
{
|
|
public class Exocomet : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Comet");
|
|
Main.projFrames[projectile.type] = 5;
|
|
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
|
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 12;
|
|
projectile.height = 12;
|
|
projectile.friendly = true;
|
|
projectile.ignoreWater = true;
|
|
projectile.tileCollide = false;
|
|
projectile.melee = true;
|
|
projectile.penetrate = 1;
|
|
projectile.alpha = 50;
|
|
projectile.timeLeft = 360;
|
|
}
|
|
|
|
public override bool? CanHitNPC(NPC target) => projectile.timeLeft < 240 && target.CanBeChasedBy(projectile);
|
|
|
|
public override void AI()
|
|
{
|
|
projectile.frameCounter++;
|
|
if (projectile.frameCounter > 5)
|
|
{
|
|
projectile.frame++;
|
|
projectile.frameCounter = 0;
|
|
}
|
|
if (projectile.frame > 4)
|
|
projectile.frame = 0;
|
|
|
|
if (projectile.timeLeft > 30 && projectile.alpha > 0)
|
|
projectile.alpha -= 25;
|
|
if (projectile.timeLeft > 30 && projectile.alpha < 128 && Collision.SolidCollision(projectile.position, projectile.width, projectile.height))
|
|
projectile.alpha = 128;
|
|
if (projectile.alpha < 0)
|
|
projectile.alpha = 0;
|
|
|
|
if (projectile.alpha < 40)
|
|
{
|
|
int num309 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, new Color(0, 255, 255), 0.5f);
|
|
Main.dust[num309].velocity *= -0.25f;
|
|
num309 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, new Color(0, 255, 255), 0.5f);
|
|
Main.dust[num309].velocity *= -0.25f;
|
|
Main.dust[num309].position -= projectile.velocity * 0.5f;
|
|
}
|
|
|
|
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
|
|
|
Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.5f);
|
|
|
|
if (projectile.timeLeft < 240)
|
|
CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 600f, 12f, 20f);
|
|
else
|
|
{
|
|
float num953 = 100f * projectile.ai[1];
|
|
float scaleFactor12 = 20f * projectile.ai[1];
|
|
float num954 = 40f;
|
|
if (Main.player[projectile.owner].active && !Main.player[projectile.owner].dead)
|
|
{
|
|
if (projectile.Distance(Main.player[projectile.owner].Center) > num954)
|
|
{
|
|
Vector2 moveDirection = projectile.SafeDirectionTo(Main.player[projectile.owner].Center, Vector2.UnitY);
|
|
projectile.velocity = (projectile.velocity * (num953 - 1f) + moveDirection * scaleFactor12) / num953;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.ExoDebuffs();
|
|
|
|
float healAmt = damage * 0.01f;
|
|
if ((int)healAmt == 0)
|
|
return;
|
|
|
|
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
|
return;
|
|
|
|
if (healAmt > CalamityMod.lifeStealCap)
|
|
healAmt = CalamityMod.lifeStealCap;
|
|
|
|
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType<Exoheal>(), 1200f, 3f);
|
|
}
|
|
|
|
public override void OnHitPvp(Player target, int damage, bool crit)
|
|
{
|
|
target.ExoDebuffs();
|
|
|
|
float healAmt = damage * 0.01f;
|
|
if ((int)healAmt == 0)
|
|
return;
|
|
|
|
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
|
return;
|
|
|
|
if (healAmt > CalamityMod.lifeStealCap)
|
|
healAmt = CalamityMod.lifeStealCap;
|
|
|
|
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType<Exoheal>(), 1200f, 3f);
|
|
}
|
|
|
|
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
|
{
|
|
CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1);
|
|
return false;
|
|
}
|
|
|
|
public override Color? GetAlpha(Color lightColor)
|
|
{
|
|
return new Color(0, 255, 255, projectile.alpha);
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f);
|
|
projectile.position = projectile.Center;
|
|
projectile.width = projectile.height = 80;
|
|
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
|
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
|
for (int num193 = 0; num193 < 2; num193++)
|
|
{
|
|
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f);
|
|
}
|
|
for (int num194 = 0; num194 < 20; num194++)
|
|
{
|
|
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 0, new Color(0, 255, 255), 2.5f);
|
|
Main.dust[num195].noGravity = true;
|
|
Main.dust[num195].velocity *= 3f;
|
|
num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f);
|
|
Main.dust[num195].velocity *= 2f;
|
|
Main.dust[num195].noGravity = true;
|
|
}
|
|
}
|
|
}
|
|
}
|