Files
CalamityModPublic/Projectiles/Ranged/PlanetaryAnnihilationProj.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

117 lines
4.8 KiB
C#

using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class PlanetaryAnnihilationProj : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
private int dustType = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ball");
}
public override void SetDefaults()
{
projectile.width = 8;
projectile.height = 8;
projectile.friendly = true;
projectile.ranged = true;
projectile.penetrate = 1;
projectile.extraUpdates = 1;
projectile.timeLeft = 600;
projectile.arrow = true;
}
public override void AI()
{
switch ((int)projectile.ai[1])
{
case 0:
dustType = 15;
break;
case 1:
dustType = 74;
break;
case 2:
dustType = 73;
break;
case 3:
dustType = 162;
break;
case 4:
dustType = 90;
break;
case 5:
dustType = 173;
break;
case 6:
dustType = 57;
break;
}
int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2.2f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
CalamityGlobalProjectile.HomeInOnNPC(projectile, !projectile.tileCollide, 200f, 12f, 20f);
}
public override void Kill(int timeLeft)
{
int height = 40;
float num50 = 2.1f;
float num51 = 1.1f;
float num52 = 2.5f;
Vector2 value3 = (projectile.rotation - 1.57079637f).ToRotationVector2();
Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates;
Main.PlaySound(SoundID.Item14, projectile.position);
projectile.position = projectile.Center;
projectile.width = projectile.height = height;
projectile.Center = projectile.position;
projectile.maxPenetrate = -1;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.damage /= 2;
projectile.Damage();
int num3;
for (int num53 = 0; num53 < 20; num53 = num3 + 1)
{
int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 200, default, num50);
Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
Main.dust[num54].noGravity = true;
Dust dust = Main.dust[num54];
dust.velocity *= 3f;
dust = Main.dust[num54];
dust.velocity += value4 * Main.rand.NextFloat();
num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, num51);
Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
dust = Main.dust[num54];
dust.velocity *= 2f;
Main.dust[num54].noGravity = true;
Main.dust[num54].fadeIn = 1f;
dust = Main.dust[num54];
dust.velocity += value4 * Main.rand.NextFloat();
num3 = num53;
}
for (int num55 = 0; num55 < 10; num55 = num3 + 1)
{
int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, num52);
Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f;
Main.dust[num56].noGravity = true;
Dust dust = Main.dust[num56];
dust.velocity *= 0.5f;
dust = Main.dust[num56];
dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat());
num3 = num55;
}
}
}
}