Adjusted Norfleet and Starmada offsets again
This commit is contained in:
1 parent
9e07129c38
commit
2d41ef4086
4 files changed
+41
-93
No files matched your search
@@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
projectile.rotation = projectile.velocity.ToRotation();
|
||||
Vector2 displayOffset = new Vector2(64, 10).RotatedBy(projectile.rotation);
|
||||
Vector2 displayOffset = new Vector2(15, -10f * projectile.direction).RotatedBy(projectile.rotation);
|
||||
projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + displayOffset;
|
||||
if (projectile.spriteDirection == -1)
|
||||
projectile.rotation += MathHelper.Pi;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -52,34 +53,30 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
projectile.localAI[0] = 0f;
|
||||
for (int l = 0; l < 12; l++)
|
||||
{
|
||||
Vector2 vector3 = Vector2.UnitX * (float)-(float)projectile.width / 2f;
|
||||
vector3 += -Vector2.UnitY.RotatedBy((double)((float)l * 3.14159274f / 6f), default) * new Vector2(8f, 16f);
|
||||
vector3 = vector3.RotatedBy((double)(projectile.rotation - 1.57079637f), default);
|
||||
int num9 = Dust.NewDust(projectile.Center, 0, 0, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 160, default, 1f);
|
||||
Main.dust[num9].scale = 1.1f;
|
||||
Main.dust[num9].noGravity = true;
|
||||
Main.dust[num9].position = projectile.Center + vector3;
|
||||
Main.dust[num9].velocity = projectile.velocity * 0.1f;
|
||||
Main.dust[num9].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[num9].position) * 1.25f;
|
||||
Vector2 dustOffset = Vector2.UnitX * (float)-(float)projectile.width / 2f;
|
||||
dustOffset += -Vector2.UnitY.RotatedBy((double)((float)l * MathHelper.Pi / 6f), default) * new Vector2(8f, 16f);
|
||||
dustOffset = dustOffset.RotatedBy((double)(projectile.rotation - MathHelper.PiOver2), default);
|
||||
int idx = Dust.NewDust(projectile.Center, 0, 0, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 160, default, 1f);
|
||||
Main.dust[idx].scale = 1.1f;
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].position = projectile.Center + dustOffset;
|
||||
Main.dust[idx].velocity = projectile.velocity * 0.1f;
|
||||
Main.dust[idx].velocity = Vector2.Normalize(projectile.Center - projectile.velocity * 3f - Main.dust[idx].position) * 1.25f;
|
||||
}
|
||||
}
|
||||
projectile.alpha -= 15;
|
||||
int num58 = 150;
|
||||
if (projectile.Center.Y >= projectile.ai[1])
|
||||
int alphaLimit = 150;
|
||||
if (projectile.alpha < alphaLimit)
|
||||
{
|
||||
num58 = 0;
|
||||
projectile.alpha = alphaLimit;
|
||||
}
|
||||
if (projectile.alpha < num58)
|
||||
{
|
||||
projectile.alpha = num58;
|
||||
}
|
||||
projectile.rotation = projectile.velocity.ToRotation() - 1.57079637f;
|
||||
projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2;
|
||||
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, Main.rand.NextBool(2) ? 221 : 244, 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;
|
||||
Vector2 dustOffset = Vector2.UnitX.RotatedByRandom(Math.PI * 0.5).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f);
|
||||
Main.dust[idx].velocity = dustOffset * 0.66f;
|
||||
Main.dust[idx].position = projectile.Center + dustOffset * 12f;
|
||||
}
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
@@ -100,25 +97,22 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<NorfleetExplosion>(), (int)((double)projectile.damage * 0.3), projectile.knockBack * 0.1f, projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<NorfleetExplosion>(), (int)(projectile.damage * 0.3), projectile.knockBack * 0.1f, projectile.owner);
|
||||
}
|
||||
Main.PlaySound(SoundID.Item10, projectile.position);
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 144;
|
||||
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 < 4; num193++)
|
||||
Main.PlaySound(SoundID.Item10, projectile.Center);
|
||||
CalamityGlobalProjectile.ExpandHitboxBy(projectile, 144);
|
||||
for (int d = 0; d < 4; d++)
|
||||
{
|
||||
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f);
|
||||
Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f);
|
||||
}
|
||||
for (int num194 = 0; num194 < 20; num194++)
|
||||
for (int d = 0; d < 20; d++)
|
||||
{
|
||||
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 0, default, 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, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f);
|
||||
Main.dust[num195].velocity *= 2f;
|
||||
Main.dust[num195].noGravity = true;
|
||||
int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 0, default, 2.5f);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity *= 3f;
|
||||
idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 50, default, 1.5f);
|
||||
Main.dust[idx].velocity *= 2f;
|
||||
Main.dust[idx].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,61 +28,15 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.01f / 255f);
|
||||
bool flag15 = false;
|
||||
bool flag16 = false;
|
||||
if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0])
|
||||
{
|
||||
flag15 = true;
|
||||
}
|
||||
if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0])
|
||||
{
|
||||
flag15 = true;
|
||||
}
|
||||
if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1])
|
||||
{
|
||||
flag16 = true;
|
||||
}
|
||||
if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1])
|
||||
{
|
||||
flag16 = true;
|
||||
}
|
||||
if (flag15 && flag16)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
float num461 = 25f;
|
||||
if (projectile.ai[0] > 180f)
|
||||
{
|
||||
num461 -= (projectile.ai[0] - 180f) / 2f;
|
||||
}
|
||||
if (num461 <= 0f)
|
||||
{
|
||||
num461 = 0f;
|
||||
projectile.Kill();
|
||||
}
|
||||
num461 *= 0.7f;
|
||||
projectile.ai[0] += 4f;
|
||||
int num462 = 0;
|
||||
while ((float)num462 < num461)
|
||||
{
|
||||
float num463 = (float)Main.rand.Next(-120, 121);
|
||||
float num464 = (float)Main.rand.Next(-120, 121);
|
||||
float num465 = (float)Main.rand.Next(36, 108);
|
||||
float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464));
|
||||
num466 = num465 / num466;
|
||||
num463 *= num466;
|
||||
num464 *= num466;
|
||||
int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 100, default, 2f);
|
||||
Dust dust = Main.dust[num467];
|
||||
dust.noGravity = true;
|
||||
dust.position.X = projectile.Center.X;
|
||||
dust.position.Y = projectile.Center.Y;
|
||||
dust.position.X += (float)Main.rand.Next(-10, 11);
|
||||
dust.position.Y += (float)Main.rand.Next(-10, 11);
|
||||
dust.velocity.X = num463;
|
||||
dust.velocity.Y = num464;
|
||||
num462++;
|
||||
}
|
||||
Vector2 dustVel = CalamityUtils.RandomVelocity(120f, 36f, 108f, 1f);
|
||||
int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 100, default, 2f);
|
||||
Dust dust = Main.dust[idx];
|
||||
dust.noGravity = true;
|
||||
dust.position.X = projectile.Center.X;
|
||||
dust.position.Y = projectile.Center.Y;
|
||||
dust.position.X += Main.rand.NextFloat(-10f, 10f);
|
||||
dust.position.Y += Main.rand.NextFloat(-10f, 10f);
|
||||
dust.velocity = dustVel;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
projectile.rotation = projectile.velocity.ToRotation();
|
||||
Vector2 displayOffset = new Vector2(32, 0).RotatedBy(projectile.rotation);
|
||||
Vector2 displayOffset = new Vector2(32f, -10f * projectile.direction).RotatedBy(projectile.rotation);
|
||||
projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + displayOffset;
|
||||
if (projectile.spriteDirection == -1)
|
||||
projectile.rotation += MathHelper.Pi;
|
||||
|
||||
Reference in new issue
Block a user