scorpio rocket resprites
This commit is contained in:
1 parent
39176b878f
commit
5033d91f58
5 files changed
+51
-47
No files matched your search
@@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Big Nuke");
|
||||
Main.projFrames[projectile.type] = 4;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -25,8 +26,21 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
if (Math.Abs(projectile.velocity.X) >= 8f || Math.Abs(projectile.velocity.Y) >= 8f)
|
||||
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
|
||||
|
||||
//Animation
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter > 7)
|
||||
{
|
||||
projectile.frame++;
|
||||
projectile.frameCounter = 0;
|
||||
}
|
||||
if (projectile.frame >= Main.projFrames[projectile.type])
|
||||
{
|
||||
projectile.frame = 0;
|
||||
}
|
||||
|
||||
if (projectile.velocity.Length() >= 8f)
|
||||
{
|
||||
for (int num246 = 0; num246 < 2; num246++)
|
||||
{
|
||||
@@ -58,10 +72,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 720;
|
||||
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
||||
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 720);
|
||||
projectile.maxPenetrate = -1;
|
||||
projectile.penetrate = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 369 B |
@@ -82,10 +82,8 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 192;
|
||||
projectile.Center = projectile.position;
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 192);
|
||||
Main.PlaySound(SoundID.Item14, projectile.Center);
|
||||
//DO NOT REMOVE THIS PROJECTILE
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<MagnomalyExplosion>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Rocket");
|
||||
Main.projFrames[projectile.type] = 4;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -24,52 +25,46 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3)
|
||||
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
|
||||
|
||||
//Animation
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter > 7)
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.alpha = 255;
|
||||
projectile.position.X = projectile.position.X + (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2);
|
||||
projectile.width = 200;
|
||||
projectile.height = 200;
|
||||
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
||||
projectile.knockBack = 10f;
|
||||
projectile.frame++;
|
||||
projectile.frameCounter = 0;
|
||||
}
|
||||
else
|
||||
if (projectile.frame >= Main.projFrames[projectile.type])
|
||||
{
|
||||
if (Math.Abs(projectile.velocity.X) >= 8f || Math.Abs(projectile.velocity.Y) >= 8f)
|
||||
{
|
||||
for (int num246 = 0; num246 < 2; num246++)
|
||||
{
|
||||
float num247 = 0f;
|
||||
float num248 = 0f;
|
||||
if (num246 == 1)
|
||||
{
|
||||
num247 = projectile.velocity.X * 0.5f;
|
||||
num248 = projectile.velocity.Y * 0.5f;
|
||||
}
|
||||
int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[num249].velocity *= 0.2f;
|
||||
Main.dust[num249].noGravity = true;
|
||||
num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f);
|
||||
Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
|
||||
Main.dust[num249].velocity *= 0.05f;
|
||||
}
|
||||
}
|
||||
projectile.frame = 0;
|
||||
}
|
||||
|
||||
if (projectile.velocity.Length() >= 8f)
|
||||
{
|
||||
for (int num246 = 0; num246 < 2; num246++)
|
||||
{
|
||||
float num247 = 0f;
|
||||
float num248 = 0f;
|
||||
if (num246 == 1)
|
||||
{
|
||||
num247 = projectile.velocity.X * 0.5f;
|
||||
num248 = projectile.velocity.Y * 0.5f;
|
||||
}
|
||||
int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 6, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num249].scale *= 2f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[num249].velocity *= 0.2f;
|
||||
Main.dust[num249].noGravity = true;
|
||||
num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, 31, 0f, 0f, 100, default, 0.5f);
|
||||
Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
|
||||
Main.dust[num249].velocity *= 0.05f;
|
||||
}
|
||||
}
|
||||
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 400f, 20f, 20f);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 32;
|
||||
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
||||
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 32);
|
||||
projectile.maxPenetrate = -1;
|
||||
projectile.penetrate = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 369 B |
Reference in new issue
Block a user