Hammers, Instant transmition into this guy's skull
Changed the strange homing on Stellar Contempt, Fallen Paladins Hammer, and Galaxy Smasher to be more consistent, still cant figure out how to make them just retarget to the nearest enemy if their original target dies.
This commit is contained in:
1 parent
67cfaa9b2e
commit
ae24ea60eb
4 files changed
+22
-24
No files matched your search
@@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Melee
|
||||
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
|
||||
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
|
||||
}
|
||||
//This is all copied straight from PwnagehammerEcho with some minor edits.
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 40;
|
||||
@@ -41,23 +40,20 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
speed = Projectile.velocity.Length();
|
||||
Projectile.ai[0] += 1f;
|
||||
if (Projectile.ai[0] > 55f)
|
||||
{
|
||||
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
|
||||
}
|
||||
if (Projectile.ai[0] < 42f)
|
||||
{
|
||||
Projectile.velocity *= 0.9575f;
|
||||
Projectile.velocity *= 0.95f;
|
||||
Projectile.rotation += MathHelper.ToRadians(Projectile.ai[0] * 0.5f) * Projectile.localAI[0];
|
||||
}
|
||||
else if (Projectile.ai[0] < 44f)
|
||||
else if (Projectile.ai[0] > 42f)
|
||||
{
|
||||
Projectile.extraUpdates = 1;
|
||||
if (Projectile.ai[1] < 0f)
|
||||
{
|
||||
Projectile.Kill();
|
||||
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
|
||||
if (Projectile.ai[0] > 80f)
|
||||
Projectile.Kill();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -66,7 +62,8 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.Kill();
|
||||
else
|
||||
{
|
||||
float velConst = 12f;
|
||||
float velConst = 7f;
|
||||
velConst--;
|
||||
Projectile.velocity = new Vector2((target.Center.X - Projectile.Center.X) / velConst, (target.Center.Y - Projectile.Center.Y) / velConst);
|
||||
Projectile.rotation += MathHelper.ToRadians(48f) * Projectile.localAI[0];
|
||||
}
|
||||
|
||||
@@ -45,23 +45,19 @@ namespace CalamityMod.Projectiles.Melee
|
||||
rotatehammer *= 1.2f;
|
||||
Projectile.rotation += MathHelper.ToRadians(rotatehammer) * Projectile.direction;
|
||||
Projectile.ai[0] += 1f;
|
||||
speed = Projectile.velocity.Length();
|
||||
if (Projectile.ai[0] > 55f)
|
||||
{
|
||||
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
|
||||
}
|
||||
if (Projectile.ai[0] < 42f)
|
||||
{
|
||||
Projectile.velocity *= 0.9575f;
|
||||
Projectile.velocity *= 0.95f;
|
||||
Projectile.rotation += MathHelper.ToRadians(Projectile.ai[0] * 0.5f) * Projectile.localAI[0];
|
||||
}
|
||||
else if (Projectile.ai[0] < 44f)
|
||||
else if (Projectile.ai[0] > 42f)
|
||||
{
|
||||
Projectile.extraUpdates = 1;
|
||||
if (Projectile.ai[1] < 0f)
|
||||
{
|
||||
Projectile.Kill();
|
||||
return;
|
||||
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
|
||||
if (Projectile.ai[0] > 80f)
|
||||
Projectile.Kill();
|
||||
}
|
||||
|
||||
NPC target = Main.npc[(int)Projectile.ai[1]];
|
||||
@@ -69,7 +65,8 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.Kill();
|
||||
else
|
||||
{
|
||||
float velConst = 24f;
|
||||
float velConst = 5f;
|
||||
velConst--;
|
||||
Projectile.velocity = new Vector2((target.Center.X - Projectile.Center.X) / velConst, (target.Center.Y - Projectile.Center.Y) / velConst);
|
||||
Projectile.rotation += MathHelper.ToRadians(48f) * Projectile.localAI[0];
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
if (InPulse == 1)
|
||||
{
|
||||
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Orchid, new Vector2(1f, 1f), Main.rand.NextFloat(12f, 25f), 50f, 0.1f, 30);
|
||||
Particle pulse2 = new StaticPulseRing(Projectile.Center, Vector2.Zero, Color.Orchid, new Vector2(1f, 1f), 0f, 4.9f, 0f, 25);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
InPulse = 2;
|
||||
}
|
||||
|
||||
@@ -56,12 +56,14 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.velocity *= 0.95f;
|
||||
Projectile.rotation += MathHelper.ToRadians(Projectile.ai[0] * 0.5f) * Projectile.localAI[0];
|
||||
}
|
||||
else if (Projectile.ai[0] < 44f)
|
||||
else if (Projectile.ai[0] > 42f)
|
||||
{
|
||||
Projectile.extraUpdates = 1;
|
||||
if (Projectile.ai[1] < 0f)
|
||||
{
|
||||
Projectile.Kill();
|
||||
CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f);
|
||||
if (Projectile.ai[0] > 80f)
|
||||
Projectile.Kill();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,11 +74,13 @@ namespace CalamityMod.Projectiles.Melee
|
||||
}
|
||||
else
|
||||
{
|
||||
float velConst = 24f;
|
||||
float velConst = 7f;
|
||||
velConst--;
|
||||
Projectile.velocity = new Vector2((target.Center.X - Projectile.Center.X) / velConst, (target.Center.Y - Projectile.Center.Y) / velConst);
|
||||
Projectile.rotation += MathHelper.ToRadians(48f) * Projectile.localAI[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user