2 - Provi darkness is now at max distance during all attacks while any guardian is alive. 3 - Elemental Quiver increases ranged damage by 15% instead of 10%. 4 - Increased Frequency Manipulator damage by 13 and made it throw the spear sooner. 5 - Increased Galvanizing Glaive damage by 16 and made the spear itself ignore more i-frames. 6 - Increased Gauss Dagger size by 50% and allowed the player to turn while using it. 7 - Decreased Gauss Pistol damage by 20 and made the projectile stay still for half the time. 8 - Increased Plasma Grenade damage by 1000 and gave it an impact sound. 9 - Increased Pulse Rifle damage by 2000. 10 - Increased Snake Eyes damage by 15 and made the leash distance longer. 11 - Decreased Taser damage by 6 and increased the velocity of it. 12 - Increased Tesla Cannon damage by 5000 and increased split beam damage by 10%. 13 - Tripled Wave Pounder damage. 14 - Reduced Shadowdrop Staff projectiles from 20 per use to 6 and reduced spread by 75%. 15 - Increased Ancient Crusher size by 50% again. 16 - Increased Astral Blade damage due to how dangerous it is to use at times. 17 - Gave Brimlance, Earthen Pike, Fulguration Halberd, Goldplume Spear, Hellion Flower Spear, Marnite Spear, Sausage Maker, Starnight Lance, Urchin Spear and Yateveo Bloom autoswing. 18 - Increased Earthen Pike, Majestic Guard and Fulguration Halberd size by 50%. 19 - Decreased Insidious Impaler damage by 40. 20 - Ultimus Cleaver explodes on hit now and increased size by 50%. 21 - Decreased Arterial Assault damage by 32. 22 - Onyxia onyx shard travels further. 23 - Increased God's Bellows range. 24 - Made SCal bullet hell 5 feel less rng with how full or empty it can sometimes feel. 25 - Reduced how often Supreme Catastrophe fires projectiles. 26 - Reduced how insane Old Duke is in Boss Rush. 27 - Reduced Rev+ Destroyer laser speed again from 14 to 12. 28 - Fixed a bug with Rev+ Destroyer flying phase lights where they'd show even when broken. 29 - Dark Energies resist piercing. 30 - Skeletron Head is now immune to all debuffs. 31 - Storm Weaver phase 2 resists Wave Pounder. 32 - Increased Volt Crasher Voltage Stream damage. 33 - Destroyer and Aquatic Scourge resist Volt Crasher. 34 - Gauss Rifle dust particles are smaller and the explosion no longer vanishes when tiles are near it, made the explosion pierce infinitely. 35 - Pole Warpers ignore more i-frames. 36 - Gave Pulse Dragon an extra update. 37 - Decreased Tracking Disk laser damage. 38 - Matter Modulator projectiles now deal a third of their damage if they haven't hit a tile yet to avoid confusion. 39 - Astral Pike stars now home in. 40 - Gilded Proboscis heals less often. 41 - Increased Goldplume Spear feather damage. 42 - Increased Avalanche ice shard damage. 43 - Gave Mourningstar an extra update and made it ignore more i-frames. 44 - True Caustic Edge projectiles no longer gain damage on tile collision. 45 - Version bump.
149 lines
6.4 KiB
C#
149 lines
6.4 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Dusts;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using System;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Typeless
|
|
{
|
|
public class AstralStar : ModProjectile
|
|
{
|
|
private int noTileHitCounter = 120;
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Star");
|
|
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
|
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 24;
|
|
projectile.height = 24;
|
|
projectile.friendly = true;
|
|
projectile.alpha = 50;
|
|
projectile.penetrate = 1;
|
|
projectile.tileCollide = false;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (projectile.ai[0] == 3f)
|
|
CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 12f, 20);
|
|
|
|
if (projectile.ai[0] == 2f)
|
|
{
|
|
projectile.Calamity().rogue = true;
|
|
}
|
|
int randomToSubtract = Main.rand.Next(1, 3);
|
|
noTileHitCounter -= randomToSubtract;
|
|
if (noTileHitCounter == 0)
|
|
{
|
|
projectile.tileCollide = true;
|
|
}
|
|
if (projectile.soundDelay == 0)
|
|
{
|
|
projectile.soundDelay = 20 + Main.rand.Next(40);
|
|
if (Main.rand.NextBool(5))
|
|
{
|
|
Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 9);
|
|
}
|
|
}
|
|
projectile.alpha -= 15;
|
|
int num58 = 150;
|
|
if (projectile.Center.Y >= projectile.ai[1])
|
|
{
|
|
num58 = 0;
|
|
}
|
|
if (projectile.alpha < num58)
|
|
{
|
|
projectile.alpha = num58;
|
|
}
|
|
projectile.localAI[0] += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction;
|
|
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction;
|
|
if (Main.rand.NextBool(16))
|
|
{
|
|
Vector2 value3 = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
|
int num59 = Dust.NewDust(projectile.position, projectile.width, projectile.height, ModContent.DustType<AstralOrange>(), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f);
|
|
Main.dust[num59].velocity = value3 * 0.66f;
|
|
Main.dust[num59].position = projectile.Center + value3 * 12f;
|
|
}
|
|
if (Main.rand.NextBool(48))
|
|
{
|
|
int num60 = Gore.NewGore(projectile.Center, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), 16, 1f);
|
|
Main.gore[num60].velocity *= 0.66f;
|
|
Main.gore[num60].velocity += projectile.velocity * 0.3f;
|
|
}
|
|
if (projectile.ai[1] == 1f)
|
|
{
|
|
projectile.light = 0.9f;
|
|
if (Main.rand.NextBool(10))
|
|
{
|
|
Dust.NewDust(projectile.position, projectile.width, projectile.height, ModContent.DustType<AstralOrange>(), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f);
|
|
}
|
|
if (Main.rand.NextBool(20))
|
|
{
|
|
Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120);
|
|
}
|
|
|
|
public override void OnHitPvp(Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120);
|
|
}
|
|
|
|
public override Color? GetAlpha(Color lightColor)
|
|
{
|
|
return new Color(200, 100, 250, projectile.alpha);
|
|
}
|
|
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
|
|
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
|
|
projectile.width = 50;
|
|
projectile.height = 50;
|
|
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
|
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
|
for (int num621 = 0; num621 < 5; num621++)
|
|
{
|
|
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType<AstralOrange>(), 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 + (float)Main.rand.Next(10) * 0.1f;
|
|
}
|
|
}
|
|
for (int num623 = 0; num623 < 5; num623++)
|
|
{
|
|
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType<AstralOrange>(), 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, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 1f);
|
|
Main.dust[num624].velocity *= 2f;
|
|
}
|
|
for (int num480 = 0; num480 < 3; num480++)
|
|
{
|
|
Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f);
|
|
}
|
|
}
|
|
|
|
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
|
{
|
|
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
|
return false;
|
|
}
|
|
}
|
|
}
|