This commit is contained in:
CongratsIsTrash committed 2023-10-19 17:17:48 -04:00
1 parent ae561d25bc
commit c166b401d2
38 files changed
+688 -721

No files matched your search

+4 -4
View File
@@ -63,10 +63,10 @@ namespace CalamityMod.Projectiles.Typeless
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, 1f);
Main.dust[num59].velocity = value3 * 0.66f;
Main.dust[num59].position = Projectile.Center + value3 * 12f;
Vector2 rotational = Vector2.UnitX.RotatedByRandom(1.5707963705062866).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int astralDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType<AstralOrange>(), Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1f);
Main.dust[astralDust].velocity = rotational * 0.66f;
Main.dust[astralDust].position = Projectile.Center + rotational * 12f;
}
if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server)
+33 -34
View File
@@ -58,34 +58,33 @@ namespace CalamityMod.Projectiles.Typeless
public override bool PreDraw(ref Color lightColor)
{
Texture2D value = ModContent.Request<Texture2D>(Texture).Value;
Color color33 = new Color(54, 209, 54, 0);
Vector2 vector28 = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
Color color34 = color33;
Vector2 origin5 = value.Size() / 2f;
Color color35 = color33 * 0.5f;
float num162 = Utils.GetLerpValue(15f, 30f, Projectile.timeLeft, clamped: true) * Utils.GetLerpValue(240f, 200f, Projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 30f / 0.5f * ((float)Math.PI * 2f) * 3f)) * 0.8f;
Vector2 vector29 = new Vector2(0.5f, 1f) * num162;
Vector2 vector30 = new Vector2(0.5f, 1f) * num162;
color34 *= num162;
color35 *= num162;
Texture2D starTexture = ModContent.Request<Texture2D>(Texture).Value;
Color healGreen = new Color(54, 209, 54, 0);
Vector2 projPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
Color healGreenDraw = healGreen;
Vector2 colorSize = starTexture.Size() / 2f;
Color lesserHealGreen = healGreen * 0.5f;
float colorLerp = Utils.GetLerpValue(15f, 30f, Projectile.timeLeft, clamped: true) * Utils.GetLerpValue(240f, 200f, Projectile.timeLeft, clamped: true) * (1f + 0.2f * (float)Math.Cos(Main.GlobalTimeWrappedHourly % 30f / 0.5f * ((float)Math.PI * 2f) * 3f)) * 0.8f;
Vector2 scaledColorLerp1 = new Vector2(0.5f, 1f) * colorLerp;
Vector2 scaledColorLerp2 = new Vector2(0.5f, 1f) * colorLerp;
healGreenDraw *= colorLerp;
lesserHealGreen *= colorLerp;
int num163 = 0;
Vector2 position3 = vector28 + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * num163;
Vector2 drawPos = projPos + Projectile.velocity.SafeNormalize(Vector2.Zero) * Utils.GetLerpValue(0.5f, 1f, Projectile.localAI[0] / 60f, clamped: true) * 0;
SpriteEffects spriteEffects = SpriteEffects.None;
if (Projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(value, position3, null, color34, (float)Math.PI / 2f, origin5, vector29, spriteEffects, 0);
Main.EntitySpriteDraw(value, position3, null, color34, 0f, origin5, vector30, spriteEffects, 0);
Main.EntitySpriteDraw(value, position3, null, color35, (float)Math.PI / 2f, origin5, vector29 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(value, position3, null, color35, 0f, origin5, vector30 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(value, drawPos, null, healGreenDraw, (float)Math.PI / 2f, colorSize, scaledColorLerp1, spriteEffects, 0);
Main.EntitySpriteDraw(value, drawPos, null, healGreenDraw, 0f, colorSize, scaledColorLerp2, spriteEffects, 0);
Main.EntitySpriteDraw(value, drawPos, null, lesserHealGreen, (float)Math.PI / 2f, colorSize, scaledColorLerp1 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(value, drawPos, null, lesserHealGreen, 0f, colorSize, scaledColorLerp2 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(value, position3, null, color34, MathHelper.PiOver4, origin5, vector29 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(value, position3, null, color34, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(value, position3, null, color35, MathHelper.PiOver4, origin5, vector29 * 0.36f, spriteEffects, 0);
Main.EntitySpriteDraw(value, position3, null, color35, MathHelper.PiOver4 * 3f, origin5, vector30 * 0.36f, spriteEffects, 0);
Main.EntitySpriteDraw(value, drawPos, null, healGreenDraw, MathHelper.PiOver4, colorSize, scaledColorLerp1 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(value, drawPos, null, healGreenDraw, MathHelper.PiOver4 * 3f, colorSize, scaledColorLerp2 * 0.6f, spriteEffects, 0);
Main.EntitySpriteDraw(value, drawPos, null, lesserHealGreen, MathHelper.PiOver4, colorSize, scaledColorLerp1 * 0.36f, spriteEffects, 0);
Main.EntitySpriteDraw(value, drawPos, null, lesserHealGreen, MathHelper.PiOver4 * 3f, colorSize, scaledColorLerp2 * 0.36f, spriteEffects, 0);
return false;
}
@@ -99,25 +98,25 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.height = 40;
Projectile.position.X = Projectile.position.X - (Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2);
for (int num621 = 0; num621 < 5; num621++)
for (int i = 0; i < 5; i++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
Main.dust[num622].noGravity = true;
int duster = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[duster].velocity *= 3f;
Main.dust[duster].noGravity = true;
if (Main.rand.NextBool())
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
Main.dust[duster].scale = 0.5f;
Main.dust[duster].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 8; num623++)
for (int j = 0; j < 8; j++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 247, 0f, 0f, 100, default, 3f);
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, 246, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
Main.dust[num624].noGravity = true;
int duster2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 247, 0f, 0f, 100, default, 3f);
Main.dust[duster2].noGravity = true;
Main.dust[duster2].velocity *= 5f;
duster2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[duster2].velocity *= 2f;
Main.dust[duster2].noGravity = true;
}
}
+5 -5
View File
@@ -29,12 +29,12 @@ namespace CalamityMod.Projectiles.Typeless
SoundEngine.PlaySound(SoundID.Item73, Projectile.position);
Projectile.localAI[0] += 1f;
}
for (int num457 = 0; num457 < 3; num457++)
for (int j = 0; j < 3; j++)
{
int num458 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 5, 0f, 0f, 100, default, 1.2f);
Main.dust[num458].noGravity = true;
Main.dust[num458].velocity *= 0.5f;
Main.dust[num458].velocity += Projectile.velocity * 0.1f;
int bloody = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 5, 0f, 0f, 100, default, 1.2f);
Main.dust[bloody].noGravity = true;
Main.dust[bloody].velocity *= 0.5f;
Main.dust[bloody].velocity += Projectile.velocity * 0.1f;
}
}
+26 -26
View File
@@ -33,60 +33,60 @@ namespace CalamityMod.Projectiles.Typeless
SoundEngine.PlaySound(SoundID.Item74, Projectile.position);
Projectile.localAI[0] += 1f;
}
bool flag15 = false;
bool flag16 = false;
bool xflag = false;
bool yflag = false;
if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0])
{
flag15 = true;
xflag = true;
}
if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0])
{
flag15 = true;
xflag = true;
}
if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1])
{
flag16 = true;
yflag = true;
}
if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1])
{
flag16 = true;
yflag = true;
}
if (flag15 && flag16)
if (xflag && yflag)
{
Projectile.Kill();
}
float num461 = 25f;
float projTimer = 25f;
if (Projectile.ai[0] > 180f)
{
num461 -= (Projectile.ai[0] - 180f) / 2f;
projTimer -= (Projectile.ai[0] - 180f) / 2f;
}
if (num461 <= 0f)
if (projTimer <= 0f)
{
num461 = 0f;
projTimer = 0f;
Projectile.Kill();
}
num461 *= 0.7f;
projTimer *= 0.7f;
Projectile.ai[0] += 4f;
int num462 = 0;
while ((float)num462 < num461)
int timerCounter = 0;
while ((float)timerCounter < projTimer)
{
float num463 = (float)Main.rand.Next(-30, 31);
float num464 = (float)Main.rand.Next(-30, 31);
float num465 = (float)Main.rand.Next(9, 27);
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, 5, 0f, 0f, 100, default, 1.8f);
Dust dust = Main.dust[num467];
float rand1 = (float)Main.rand.Next(-30, 31);
float rand2 = (float)Main.rand.Next(-30, 31);
float rand3 = (float)Main.rand.Next(9, 27);
float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2));
randAdjust = rand3 / randAdjust;
rand1 *= randAdjust;
rand2 *= randAdjust;
int bloody = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 5, 0f, 0f, 100, default, 1.8f);
Dust dust = Main.dust[bloody];
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++;
dust.velocity.X = rand1;
dust.velocity.Y = rand2;
timerCounter++;
}
return;
}
@@ -34,12 +34,12 @@ namespace CalamityMod.Projectiles.Typeless
SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
Projectile.localAI[0] += 1f;
}
for (int num457 = 0; num457 < 5; num457++)
for (int i = 0; i < 5; i++)
{
int num458 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 0.6f);
Main.dust[num458].noGravity = true;
Main.dust[num458].velocity *= 0.5f;
Main.dust[num458].velocity += Projectile.velocity * 0.1f;
int brimDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 0.6f);
Main.dust[brimDust].noGravity = true;
Main.dust[brimDust].velocity *= 0.5f;
Main.dust[brimDust].velocity += Projectile.velocity * 0.1f;
}
return;
}
+4 -4
View File
@@ -66,8 +66,8 @@ namespace CalamityMod.Projectiles.Typeless
SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
}
Projectile.rotation += Projectile.velocity.X * 0.1f;
int num199 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[num199];
int flareDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[flareDust];
dust.position.X -= 2f;
dust.position.Y += 2f;
dust.scale += (float)Main.rand.Next(50) * 0.01f;
@@ -75,8 +75,8 @@ namespace CalamityMod.Projectiles.Typeless
dust.velocity.Y -= 16f;
if (Main.rand.NextBool())
{
int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 1f);
Dust dust2 = Main.dust[num200];
int flareDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 1f);
Dust dust2 = Main.dust[flareDust2];
dust2.position.X -= 2f;
dust2.position.Y += 2f;
dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
+56 -63
View File
@@ -37,13 +37,9 @@ namespace CalamityMod.Projectiles.Typeless
if (Projectile.timeLeft > 285)
return;
float num29 = 5f;
float num30 = 300f;
float aiTrack = 5f;
float scaleFactor = 6f;
Vector2 value7 = new Vector2(10f, 20f);
//float num31 = 1f;
int num32 = 3 * Projectile.MaxUpdates;
int num33 = Utils.SelectRandom(Main.rand, new int[]
int dustType = Utils.SelectRandom(Main.rand, new int[]
{
246,
242,
@@ -51,7 +47,7 @@ namespace CalamityMod.Projectiles.Typeless
226,
247
});
int num34 = 255;
int crystalDustType = 255;
if (Projectile.ai[1] == 0f)
{
Projectile.ai[1] = 1f;
@@ -59,38 +55,38 @@ namespace CalamityMod.Projectiles.Typeless
}
else if (Projectile.ai[1] == 1f && Projectile.owner == Main.myPlayer)
{
int num35 = -1;
float num36 = num30;
for (int num37 = 0; num37 < Main.maxNPCs; num37++)
int targetID = -1;
float hitDistance = 300f;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[num37].active && Main.npc[num37].CanBeChasedBy(Projectile, false))
if (Main.npc[i].active && Main.npc[i].CanBeChasedBy(Projectile, false))
{
Vector2 center3 = Main.npc[num37].Center;
float num38 = Vector2.Distance(center3, Projectile.Center);
if (num38 < num36 && num35 == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, center3, 1, 1))
Vector2 targetCenter = Main.npc[i].Center;
float targetDist = Vector2.Distance(targetCenter, Projectile.Center);
if (targetDist < hitDistance && targetID == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, targetCenter, 1, 1))
{
num36 = num38;
num35 = num37;
hitDistance = targetDist;
targetID = i;
}
}
}
if (num36 < 4f)
if (hitDistance < 4f)
{
Projectile.Kill();
return;
}
if (num35 != -1)
if (targetID != -1)
{
Projectile.ai[1] = num29 + 1f;
Projectile.ai[0] = (float)num35;
Projectile.ai[1] = aiTrack + 1f;
Projectile.ai[0] = (float)targetID;
Projectile.netUpdate = true;
}
}
else if (Projectile.ai[1] > num29)
else if (Projectile.ai[1] > aiTrack)
{
Projectile.ai[1] += 1f;
int num39 = (int)Projectile.ai[0];
if (!Main.npc[num39].active || !Main.npc[num39].CanBeChasedBy(Projectile, false))
int npcTrack = (int)Projectile.ai[0];
if (!Main.npc[npcTrack].active || !Main.npc[npcTrack].CanBeChasedBy(Projectile, false))
{
Projectile.ai[1] = 1f;
Projectile.ai[0] = 0f;
@@ -99,25 +95,24 @@ namespace CalamityMod.Projectiles.Typeless
else
{
Projectile.velocity.ToRotation();
Vector2 vector6 = Main.npc[num39].Center - Projectile.Center;
if (vector6.Length() < 10f)
Vector2 npcDirection = Main.npc[npcTrack].Center - Projectile.Center;
if (npcDirection.Length() < 10f)
{
Projectile.Kill();
return;
}
if (vector6 != Vector2.Zero)
if (npcDirection != Vector2.Zero)
{
vector6.Normalize();
vector6 *= scaleFactor;
npcDirection.Normalize();
npcDirection *= scaleFactor;
}
float num40 = 30f;
Projectile.velocity = (Projectile.velocity * (num40 - 1f) + vector6) / num40;
Projectile.velocity = (Projectile.velocity * 29f + npcDirection) / 30f;
}
}
if (Projectile.ai[1] >= 1f && Projectile.ai[1] < num29)
if (Projectile.ai[1] >= 1f && Projectile.ai[1] < aiTrack)
{
Projectile.ai[1] += 1f;
if (Projectile.ai[1] == num29)
if (Projectile.ai[1] == aiTrack)
{
Projectile.ai[1] = 1f;
}
@@ -129,57 +124,55 @@ namespace CalamityMod.Projectiles.Typeless
}
if (Main.rand.NextBool(12))
{
Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num44 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, num34, 0f, 0f, 160, default, 1f);
Main.dust[num44].velocity *= 0.1f;
Main.dust[num44].position = Projectile.Center + value9 * (float)Projectile.width / 2f + Projectile.velocity * 2f;
Main.dust[num44].fadeIn = 0.9f;
Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int crystalDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 160, default, 1f);
Main.dust[crystalDust].velocity *= 0.1f;
Main.dust[crystalDust].position = Projectile.Center + rotateFirstDust * (float)Projectile.width / 2f + Projectile.velocity * 2f;
Main.dust[crystalDust].fadeIn = 0.9f;
}
if (Main.rand.NextBool(18))
{
Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 155, default, 0.8f);
Main.dust[num46].velocity *= 0.3f;
Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f;
Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int greenDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 155, default, 0.8f);
Main.dust[greenDust].velocity *= 0.3f;
Main.dust[greenDust].position = Projectile.Center + rotateSecondDust * (float)Projectile.width / 2f;
if (Main.rand.NextBool())
{
Main.dust[num46].fadeIn = 1.4f;
Main.dust[greenDust].fadeIn = 1.4f;
}
}
if (Main.rand.NextBool(8))
{
Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num48 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, num33, 0f, 0f, 0, default, 1f);
Main.dust[num48].velocity *= 0.3f;
Main.dust[num48].noGravity = true;
Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f;
Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int randomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f);
Main.dust[randomDust].velocity *= 0.3f;
Main.dust[randomDust].noGravity = true;
Main.dust[randomDust].position = Projectile.Center + rotateThirdDust * (float)Projectile.width / 2f;
if (Main.rand.NextBool())
{
Main.dust[num48].fadeIn = 1.4f;
Main.dust[randomDust].fadeIn = 1.4f;
}
}
if (Main.rand.NextBool(6))
{
Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num50 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, num34, 0f, 0f, 100, default, 1f);
Main.dust[num50].velocity *= 0.3f;
Main.dust[num50].position = Projectile.Center + value13 * (float)Projectile.width / 2f;
Main.dust[num50].fadeIn = 1.2f;
Main.dust[num50].scale = 1.5f;
Main.dust[num50].noGravity = true;
int crystalDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f);
Main.dust[crystalDust2].velocity *= 0.3f;
Main.dust[crystalDust2].position = Projectile.Center + value13 * (float)Projectile.width / 2f;
Main.dust[crystalDust2].fadeIn = 1.2f;
Main.dust[crystalDust2].scale = 1.5f;
Main.dust[crystalDust2].noGravity = true;
}
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f);
int num154 = 14;
int num155 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - num154 * 2, Projectile.height - num154 * 2, 234, 0f, 0f, 100, default, 0.8f);
Main.dust[num155].velocity *= 0.1f;
Main.dust[num155].velocity += Projectile.velocity * 0.5f;
Main.dust[num155].noGravity = true;
int paleDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - 28, Projectile.height - 28, 234, 0f, 0f, 100, default, 0.8f);
Main.dust[paleDust].velocity *= 0.1f;
Main.dust[paleDust].velocity += Projectile.velocity * 0.5f;
Main.dust[paleDust].noGravity = true;
if (Main.rand.NextBool(12))
{
int num156 = 16;
int num157 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - num156 * 2, Projectile.height - num156 * 2, 159, 0f, 0f, 100, default, 1f);
Main.dust[num157].velocity *= 0.25f;
Main.dust[num157].velocity += Projectile.velocity * 0.5f;
int shinyDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - 32, Projectile.height - 32, 159, 0f, 0f, 100, default, 1f);
Main.dust[shinyDust].velocity *= 0.25f;
Main.dust[shinyDust].velocity += Projectile.velocity * 0.5f;
}
}
+75 -86
View File
@@ -36,13 +36,9 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.rotation = (float)Math.Atan2((double)Projectile.velocity.Y, (double)Projectile.velocity.X) + 1.57f;
float num29 = 5f;
float num30 = 300f;
float aiTrack = 5f;
float scaleFactor = 6f;
Vector2 value7 = new Vector2(10f, 20f);
//float num31 = 1f;
int num32 = 3 * Projectile.MaxUpdates;
int num33 = Utils.SelectRandom(Main.rand, new int[]
int dustType = Utils.SelectRandom(Main.rand, new int[]
{
246,
242,
@@ -50,7 +46,7 @@ namespace CalamityMod.Projectiles.Typeless
226,
247
});
int num34 = 255;
int crystalDustType = 255;
if (Projectile.ai[1] == 0f)
{
Projectile.ai[1] = 1f;
@@ -60,39 +56,39 @@ namespace CalamityMod.Projectiles.Typeless
{
if (Projectile.alpha < 128)
{
int num35 = -1;
float num36 = num30;
for (int num37 = 0; num37 < Main.maxNPCs; num37++)
int targetID = -1;
float hitDistance = 300f;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[num37].active && Main.npc[num37].CanBeChasedBy(Projectile, false))
if (Main.npc[i].active && Main.npc[i].CanBeChasedBy(Projectile, false))
{
Vector2 center3 = Main.npc[num37].Center;
float num38 = Vector2.Distance(center3, Projectile.Center);
if (num38 < num36 && num35 == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, center3, 1, 1))
Vector2 targetCenter = Main.npc[i].Center;
float targetDist = Vector2.Distance(targetCenter, Projectile.Center);
if (targetDist < hitDistance && targetID == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, targetCenter, 1, 1))
{
num36 = num38;
num35 = num37;
hitDistance = targetDist;
targetID = i;
}
}
}
if (num36 < 4f)
if (hitDistance < 4f)
{
Projectile.Kill();
return;
}
if (num35 != -1)
if (targetID != -1)
{
Projectile.ai[1] = num29 + 1f;
Projectile.ai[0] = (float)num35;
Projectile.ai[1] = aiTrack + 1f;
Projectile.ai[0] = (float)targetID;
Projectile.netUpdate = true;
}
}
}
else if (Projectile.ai[1] > num29)
else if (Projectile.ai[1] > aiTrack)
{
Projectile.ai[1] += 1f;
int num39 = (int)Projectile.ai[0];
if (!Main.npc[num39].active || !Main.npc[num39].CanBeChasedBy(Projectile, false))
int npcTrack = (int)Projectile.ai[0];
if (!Main.npc[npcTrack].active || !Main.npc[npcTrack].CanBeChasedBy(Projectile, false))
{
Projectile.ai[1] = 1f;
Projectile.ai[0] = 0f;
@@ -101,25 +97,24 @@ namespace CalamityMod.Projectiles.Typeless
else
{
Projectile.velocity.ToRotation();
Vector2 vector6 = Main.npc[num39].Center - Projectile.Center;
if (vector6.Length() < 10f)
Vector2 npcDirection = Main.npc[npcTrack].Center - Projectile.Center;
if (npcDirection.Length() < 10f)
{
Projectile.Kill();
return;
}
if (vector6 != Vector2.Zero)
if (npcDirection != Vector2.Zero)
{
vector6.Normalize();
vector6 *= scaleFactor;
npcDirection.Normalize();
npcDirection *= scaleFactor;
}
float num40 = 30f;
Projectile.velocity = (Projectile.velocity * (num40 - 1f) + vector6) / num40;
Projectile.velocity = (Projectile.velocity * 29f + npcDirection) / 30f;
}
}
if (Projectile.ai[1] >= 1f && Projectile.ai[1] < num29)
if (Projectile.ai[1] >= 1f && Projectile.ai[1] < aiTrack)
{
Projectile.ai[1] += 1f;
if (Projectile.ai[1] == num29)
if (Projectile.ai[1] == aiTrack)
{
Projectile.ai[1] = 1f;
}
@@ -131,57 +126,55 @@ namespace CalamityMod.Projectiles.Typeless
}
if (Main.rand.NextBool(12))
{
Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num44 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, num34, 0f, 0f, 100, default, 1f);
Main.dust[num44].velocity *= 0.1f;
Main.dust[num44].position = Projectile.Center + value9 * (float)Projectile.width / 2f + Projectile.velocity * 2f;
Main.dust[num44].fadeIn = 0.9f;
Vector2 rotateFirstDust = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int crystalDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f);
Main.dust[crystalDust].velocity *= 0.1f;
Main.dust[crystalDust].position = Projectile.Center + rotateFirstDust * (float)Projectile.width / 2f + Projectile.velocity * 2f;
Main.dust[crystalDust].fadeIn = 0.9f;
}
if (Main.rand.NextBool(18))
{
Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 155, default, 0.8f);
Main.dust[num46].velocity *= 0.3f;
Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f;
Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int greenDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 107, 0f, 0f, 155, default, 0.8f);
Main.dust[greenDust].velocity *= 0.3f;
Main.dust[greenDust].position = Projectile.Center + rotateSecondDust * (float)Projectile.width / 2f;
if (Main.rand.NextBool())
{
Main.dust[num46].fadeIn = 1.4f;
Main.dust[greenDust].fadeIn = 1.4f;
}
}
if (Main.rand.NextBool(8))
{
Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num48 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, num33, 0f, 0f, 0, default, 1f);
Main.dust[num48].velocity *= 0.3f;
Main.dust[num48].noGravity = true;
Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f;
Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int randomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f);
Main.dust[randomDust].velocity *= 0.3f;
Main.dust[randomDust].noGravity = true;
Main.dust[randomDust].position = Projectile.Center + rotateThirdDust * (float)Projectile.width / 2f;
if (Main.rand.NextBool())
{
Main.dust[num48].fadeIn = 1.4f;
Main.dust[randomDust].fadeIn = 1.4f;
}
}
if (Main.rand.NextBool(6))
{
Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num50 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, num34, 0f, 0f, 100, default, 1f);
Main.dust[num50].velocity *= 0.3f;
Main.dust[num50].position = Projectile.Center + value13 * (float)Projectile.width / 2f;
Main.dust[num50].fadeIn = 1.2f;
Main.dust[num50].scale = 1.5f;
Main.dust[num50].noGravity = true;
int crystalDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, crystalDustType, 0f, 0f, 100, default, 1f);
Main.dust[crystalDust2].velocity *= 0.3f;
Main.dust[crystalDust2].position = Projectile.Center + value13 * (float)Projectile.width / 2f;
Main.dust[crystalDust2].fadeIn = 1.2f;
Main.dust[crystalDust2].scale = 1.5f;
Main.dust[crystalDust2].noGravity = true;
}
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f);
int num154 = 14;
int num155 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - num154 * 2, Projectile.height - num154 * 2, 234, 0f, 0f, 100, default, 0.8f);
Main.dust[num155].velocity *= 0.1f;
Main.dust[num155].velocity += Projectile.velocity * 0.5f;
Main.dust[num155].noGravity = true;
int paleDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - 28, Projectile.height - 28, 234, 0f, 0f, 100, default, 0.8f);
Main.dust[paleDust].velocity *= 0.1f;
Main.dust[paleDust].velocity += Projectile.velocity * 0.5f;
Main.dust[paleDust].noGravity = true;
if (Main.rand.NextBool(12))
{
int num156 = 16;
int num157 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - num156 * 2, Projectile.height - num156 * 2, 159, 0f, 0f, 100, default, 1f);
Main.dust[num157].velocity *= 0.25f;
Main.dust[num157].velocity += Projectile.velocity * 0.5f;
int shinyDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - 32, Projectile.height - 32, 159, 0f, 0f, 100, default, 1f);
Main.dust[shinyDust].velocity *= 0.25f;
Main.dust[shinyDust].velocity += Projectile.velocity * 0.5f;
}
}
@@ -208,7 +201,7 @@ namespace CalamityMod.Projectiles.Typeless
public override void OnKill(int timeLeft)
{
int num47 = Utils.SelectRandom(Main.rand, new int[]
int otherDustType = Utils.SelectRandom(Main.rand, new int[]
{
246,
242,
@@ -217,49 +210,45 @@ namespace CalamityMod.Projectiles.Typeless
247
});
int num48 = 187;
int num49 = 234;
//int height = 50;
float num50 = 1.2f;
float num51 = 0.6f;
float num52 = 1.5f;
int randomDust = 187;
float crystalDust2 = 1.2f;
Vector2 value3 = (Projectile.rotation - 1.57079637f).ToRotationVector2();
Vector2 value4 = value3 * Projectile.velocity.Length() * (float)Projectile.MaxUpdates;
Vector2 dustRotate = (Projectile.rotation - 1.57079637f).ToRotationVector2();
Vector2 dustVel = dustRotate * Projectile.velocity.Length() * (float)Projectile.MaxUpdates;
SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);
int num3;
for (int num53 = 0; num53 < 20; num53 = num3 + 1)
int dustCount;
for (int j = 0; j < 20; j = dustCount + 1)
{
int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num47, 0f, 0f, 200, default, num50);
Dust dust = Main.dust[num54];
int superRandomDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, otherDustType, 0f, 0f, 200, default, crystalDust2);
Dust dust = Main.dust[superRandomDust];
dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f;
dust.noGravity = true;
dust.velocity.Y -= 6f;
dust.velocity *= 3f;
dust.velocity += value4 * Main.rand.NextFloat();
num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num48, 0f, 0f, 100, default, num51);
dust.velocity += dustVel * Main.rand.NextFloat();
superRandomDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 0.6f);
dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f;
dust.velocity.Y -= 6f;
dust.velocity *= 2f;
dust.noGravity = true;
dust.fadeIn = 1f;
dust.color = Color.Cyan * 0.5f;
dust.velocity += value4 * Main.rand.NextFloat();
num3 = num53;
dust.velocity += dustVel * Main.rand.NextFloat();
dustCount = j;
}
for (int num55 = 0; num55 < 10; num55 = num3 + 1)
for (int k = 0; k < 10; k = dustCount + 1)
{
int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num49, 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;
Dust dust = Main.dust[num56];
int palestDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 234, 0f, 0f, 0, default, 1.5f);
Main.dust[palestDust].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)Projectile.velocity.ToRotation(), default) * (float)Projectile.width / 3f;
Dust dust = Main.dust[palestDust];
dust.noGravity = true;
dust.velocity.Y -= 6f;
dust.velocity *= 0.5f;
dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat());
num3 = num55;
dust.velocity += dustVel * (0.6f + 0.6f * Main.rand.NextFloat());
dustCount = k;
}
}
}
+26 -26
View File
@@ -31,60 +31,60 @@ namespace CalamityMod.Projectiles.Typeless
{
Projectile.Kill();
}
bool flag15 = false;
bool flag16 = false;
bool xflag = false;
bool yflag = false;
if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0])
{
flag15 = true;
xflag = true;
}
if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0])
{
flag15 = true;
xflag = true;
}
if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1])
{
flag16 = true;
yflag = true;
}
if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1])
{
flag16 = true;
yflag = true;
}
if (flag15 && flag16)
if (xflag && yflag)
{
Projectile.Kill();
}
float num461 = 25f;
float projTimer = 25f;
if (Projectile.ai[0] > 180f)
{
num461 -= (Projectile.ai[0] - 180f) / 2f;
projTimer -= (Projectile.ai[0] - 180f) / 2f;
}
if (num461 <= 0f)
if (projTimer <= 0f)
{
num461 = 0f;
projTimer = 0f;
Projectile.Kill();
}
num461 *= 0.7f;
projTimer *= 0.7f;
Projectile.ai[0] += 4f;
int num462 = 0;
while ((float)num462 < num461)
int timerCounter = 0;
while ((float)timerCounter < projTimer)
{
float num463 = (float)Main.rand.Next(-30, 31);
float num464 = (float)Main.rand.Next(-30, 31);
float num465 = (float)Main.rand.Next(9, 27);
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, 127, 0f, 0f, 100, default, 1.5f);
Dust dust = Main.dust[num467];
float rand1 = (float)Main.rand.Next(-30, 31);
float rand2 = (float)Main.rand.Next(-30, 31);
float rand3 = (float)Main.rand.Next(9, 27);
float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2));
randAdjust = rand3 / randAdjust;
rand1 *= randAdjust;
rand2 *= randAdjust;
int fiery = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 127, 0f, 0f, 100, default, 1.5f);
Dust dust = Main.dust[fiery];
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++;
dust.velocity.X = rand1;
dust.velocity.Y = rand2;
timerCounter++;
}
}
+62 -67
View File
@@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
bool flag64 = Projectile.type == ModContent.ProjectileType<DemonshadeRedDevil>();
bool isMinion = Projectile.type == ModContent.ProjectileType<DemonshadeRedDevil>();
Player player = Main.player[Projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
if (!modPlayer.redDevil)
@@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.active = false;
return;
}
if (flag64)
if (isMinion)
{
if (player.dead)
{
@@ -58,12 +58,11 @@ namespace CalamityMod.Projectiles.Typeless
dust--;
if (dust >= 0)
{
int num501 = 50;
for (int num502 = 0; num502 < num501; num502++)
for (int i = 0; i < 50; i++)
{
int num503 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f);
Main.dust[num503].velocity *= 2f;
Main.dust[num503].scale *= 1.15f;
int brimDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y + 16f), Projectile.width, Projectile.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f);
Main.dust[brimDust].velocity *= 2f;
Main.dust[brimDust].scale *= 1.15f;
}
}
Projectile.frameCounter++;
@@ -76,19 +75,16 @@ namespace CalamityMod.Projectiles.Typeless
{
Projectile.frame = 0;
}
float num = (float)Main.rand.Next(90, 111) * 0.01f;
num *= Main.essScale;
Lighting.AddLight(Projectile.Center, 1f * num, 0f * num, 0.15f * num);
float lights = (float)Main.rand.Next(90, 111) * 0.01f;
lights *= Main.essScale;
Lighting.AddLight(Projectile.Center, 1f * lights, 0f * lights, 0.15f * lights);
Projectile.rotation = Projectile.velocity.X * 0.04f;
if ((double)Math.Abs(Projectile.velocity.X) > 0.2)
{
Projectile.spriteDirection = -Projectile.direction;
}
float num633 = 2000f;
float num634 = 2000f;
float num635 = 3000f;
float num636 = 150f;
bool flag24 = false;
float attackRange = 2000f;
bool decelerate = false;
if (Projectile.ai[0] == 2f)
{
Projectile.ai[1] += 1f;
@@ -103,15 +99,15 @@ namespace CalamityMod.Projectiles.Typeless
}
else
{
flag24 = true;
decelerate = true;
}
}
if (flag24)
if (decelerate)
{
return;
}
Vector2 vector46 = Projectile.position;
bool flag25 = false;
Vector2 projPos = Projectile.position;
bool canAttack = false;
if (Projectile.ai[0] != 1f)
{
Projectile.tileCollide = false;
@@ -125,96 +121,95 @@ namespace CalamityMod.Projectiles.Typeless
NPC npc = Main.npc[player.MinionAttackTargetNPC];
if (npc.CanBeChasedBy(Projectile, false))
{
float num646 = Vector2.Distance(npc.Center, Projectile.Center);
if (!flag25 && num646 < num633)
float npcDist = Vector2.Distance(npc.Center, Projectile.Center);
if (!canAttack && npcDist < attackRange)
{
num633 = num646;
vector46 = npc.Center;
flag25 = true;
attackRange = npcDist;
projPos = npc.Center;
canAttack = true;
}
}
}
else
{
for (int num645 = 0; num645 < Main.maxNPCs; num645++)
for (int j = 0; j < Main.maxNPCs; j++)
{
NPC nPC2 = Main.npc[num645];
NPC nPC2 = Main.npc[j];
if (nPC2.CanBeChasedBy(Projectile, false))
{
float num646 = Vector2.Distance(nPC2.Center, Projectile.Center);
if ((!flag25 && num646 < num633) && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, nPC2.position, nPC2.width, nPC2.height))
float npcDist = Vector2.Distance(nPC2.Center, Projectile.Center);
if ((!canAttack && npcDist < attackRange) && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, nPC2.position, nPC2.width, nPC2.height))
{
num633 = num646;
vector46 = nPC2.Center;
flag25 = true;
attackRange = npcDist;
projPos = nPC2.Center;
canAttack = true;
}
}
}
}
float num647 = num634;
if (flag25)
float separationAnxietyDist = 2000f;
if (canAttack)
{
num647 = num635;
separationAnxietyDist = 3000f;
}
if (Vector2.Distance(player.Center, Projectile.Center) > num647)
if (Vector2.Distance(player.Center, Projectile.Center) > separationAnxietyDist)
{
Projectile.ai[0] = 1f;
Projectile.tileCollide = false;
Projectile.netUpdate = true;
}
if (flag25 && Projectile.ai[0] == 0f)
if (canAttack && Projectile.ai[0] == 0f)
{
Vector2 vector47 = vector46 - Projectile.Center;
float num648 = vector47.Length();
vector47.Normalize();
if (num648 > 200f)
Vector2 projDirection = projPos - Projectile.Center;
float projDist = projDirection.Length();
projDirection.Normalize();
if (projDist > 200f)
{
float scaleFactor2 = 16f; //8
vector47 *= scaleFactor2;
Projectile.velocity = (Projectile.velocity * 40f + vector47) / 41f;
projDirection *= scaleFactor2;
Projectile.velocity = (Projectile.velocity * 40f + projDirection) / 41f;
}
else
{
float num649 = 4f;
vector47 *= -num649;
Projectile.velocity = (Projectile.velocity * 40f + vector47) / 41f;
projDirection *= -4f;
Projectile.velocity = (Projectile.velocity * 40f + projDirection) / 41f;
}
}
else
{
bool flag26 = false;
if (!flag26)
bool isReturning = false;
if (!isReturning)
{
flag26 = Projectile.ai[0] == 1f;
isReturning = Projectile.ai[0] == 1f;
}
float num650 = 5f; //6
if (flag26)
float returnSpeed = 5f; //6
if (isReturning)
{
num650 = 12f; //15
returnSpeed = 12f; //15
}
Vector2 center2 = Projectile.Center;
Vector2 vector48 = player.Center - center2 + new Vector2(0f, -30f); //-60
float num651 = vector48.Length();
if (num651 > 200f && num650 < 6.5f) //200 and 8
Vector2 playerDirection = player.Center - center2 + new Vector2(0f, -30f); //-60
float playerDist = playerDirection.Length();
if (playerDist > 200f && returnSpeed < 6.5f) //200 and 8
{
num650 = 6.5f; //8
returnSpeed = 6.5f; //8
}
if (num651 < num636 && flag26 && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height))
if (playerDist < 150f && isReturning && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height))
{
Projectile.ai[0] = 0f;
Projectile.netUpdate = true;
}
if (num651 > 2000f)
if (playerDist > 2000f)
{
Projectile.position.X = player.Center.X - (float)(Projectile.width / 2);
Projectile.position.Y = player.Center.Y - (float)(Projectile.height / 2);
Projectile.netUpdate = true;
}
if (num651 > 70f)
if (playerDist > 70f)
{
vector48.Normalize();
vector48 *= num650;
Projectile.velocity = (Projectile.velocity * 40f + vector48) / 41f;
playerDirection.Normalize();
playerDirection *= returnSpeed;
Projectile.velocity = (Projectile.velocity * 40f + playerDirection) / 41f;
}
else if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f)
{
@@ -235,12 +230,12 @@ namespace CalamityMod.Projectiles.Typeless
{
float speed = 24f;
int projType = ProjectileID.UnholyTridentFriendly;
if (flag25 && Projectile.ai[1] == 0f)
if (canAttack && Projectile.ai[1] == 0f)
{
Projectile.ai[1] += 1f;
if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.Center, Projectile.width, Projectile.height, vector46, 0, 0))
if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.Center, Projectile.width, Projectile.height, projPos, 0, 0))
{
Vector2 velocity = vector46 - Projectile.Center;
Vector2 velocity = projPos - Projectile.Center;
velocity.Normalize();
velocity *= speed;
int trident = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projType, Projectile.damage, 0f, Main.myPlayer);
@@ -261,9 +256,9 @@ namespace CalamityMod.Projectiles.Typeless
{
SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
Texture2D texture2D13 = ModContent.Request<Texture2D>(Texture).Value;
int num214 = ModContent.Request<Texture2D>(Texture).Value.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, spriteEffects, 0);
int framing = ModContent.Request<Texture2D>(Texture).Value.Height / Main.projFrames[Projectile.type];
int y6 = framing * Projectile.frame;
Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, spriteEffects, 0);
return false;
}
+26 -26
View File
@@ -23,60 +23,60 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0f / 255f);
bool flag15 = false;
bool flag16 = false;
bool xflag = false;
bool yflag = false;
if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0])
{
flag15 = true;
xflag = true;
}
if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0])
{
flag15 = true;
xflag = true;
}
if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1])
{
flag16 = true;
yflag = true;
}
if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1])
{
flag16 = true;
yflag = true;
}
if (flag15 && flag16)
if (xflag && yflag)
{
Projectile.Kill();
}
float num461 = 25f;
float projTimer = 25f;
if (Projectile.ai[0] > 60f)
{
num461 -= (Projectile.ai[0] - 60f) / 2f;
projTimer -= (Projectile.ai[0] - 60f) / 2f;
}
if (num461 <= 0f)
if (projTimer <= 0f)
{
num461 = 0f;
projTimer = 0f;
Projectile.Kill();
}
num461 *= 0.7f;
projTimer *= 0.7f;
Projectile.ai[0] += 4f;
int num462 = 0;
while ((float)num462 < num461)
int timerCounter = 0;
while ((float)timerCounter < projTimer)
{
float num463 = (float)Main.rand.Next(-8, 9);
float num464 = (float)Main.rand.Next(-8, 9);
float num465 = (float)Main.rand.Next(2, 7);
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, 244, 0f, 0f, 100, default, 1.5f);
Dust dust = Main.dust[num467];
float rand1 = (float)Main.rand.Next(-8, 9);
float rand2 = (float)Main.rand.Next(-8, 9);
float rand3 = (float)Main.rand.Next(2, 7);
float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2));
randAdjust = rand3 / randAdjust;
rand1 *= randAdjust;
rand2 *= randAdjust;
int dragonDuster = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 1.5f);
Dust dust = Main.dust[dragonDuster];
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++;
dust.velocity.X = rand1;
dust.velocity.Y = rand2;
timerCounter++;
}
}
+26 -26
View File
@@ -24,60 +24,60 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.35f / 255f, (255 - Projectile.alpha) * 0.05f / 255f, (255 - Projectile.alpha) * 0.25f / 255f);
bool flag15 = false;
bool flag16 = false;
bool xflag = false;
bool yflag = false;
if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0])
{
flag15 = true;
xflag = true;
}
if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0])
{
flag15 = true;
xflag = true;
}
if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1])
{
flag16 = true;
yflag = true;
}
if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1])
{
flag16 = true;
yflag = true;
}
if (flag15 && flag16)
if (xflag && yflag)
{
Projectile.Kill();
}
float num461 = 25f;
float projTimer = 25f;
if (Projectile.ai[0] > 180f)
{
num461 -= (Projectile.ai[0] - 180f) / 2f;
projTimer -= (Projectile.ai[0] - 180f) / 2f;
}
if (num461 <= 0f)
if (projTimer <= 0f)
{
num461 = 0f;
projTimer = 0f;
Projectile.Kill();
}
num461 *= 0.7f;
projTimer *= 0.7f;
Projectile.ai[0] += 4f;
int num462 = 0;
while ((float)num462 < num461)
int timerCounter = 0;
while ((float)timerCounter < projTimer)
{
float num463 = (float)Main.rand.Next(-10, 11);
float num464 = (float)Main.rand.Next(-10, 11);
float num465 = (float)Main.rand.Next(3, 9);
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, 62, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[num467];
float rand1 = (float)Main.rand.Next(-10, 11);
float rand2 = (float)Main.rand.Next(-10, 11);
float rand3 = (float)Main.rand.Next(3, 9);
float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2));
randAdjust = rand3 / randAdjust;
rand1 *= randAdjust;
rand2 *= randAdjust;
int ourpleDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[ourpleDust];
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++;
dust.velocity.X = rand1;
dust.velocity.Y = rand2;
timerCounter++;
}
}
}
+4 -4
View File
@@ -48,8 +48,8 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.rotation += Projectile.velocity.X * 0.1f;
if (Main.rand.NextBool(3))
{
int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 0.75f);
Dust dust2 = Main.dust[num200];
int ourpleDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 0.75f);
Dust dust2 = Main.dust[ourpleDust];
dust2.position.X -= 2f;
dust2.position.Y += 2f;
dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
@@ -58,8 +58,8 @@ namespace CalamityMod.Projectiles.Typeless
}
else
{
int num199 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 0.75f);
Dust dust = Main.dust[num199];
int ourpleDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 0.75f);
Dust dust = Main.dust[ourpleDust2];
dust.position.X -= 2f;
dust.position.Y += 2f;
dust.scale += (float)Main.rand.Next(50) * 0.01f;
+3 -3
View File
@@ -23,9 +23,9 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.localAI[0] += 1f;
if (Projectile.localAI[0] > 4f)
{
int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 1f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
int ourpleDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 1f);
Main.dust[ourpleDust].noGravity = true;
Main.dust[ourpleDust].velocity *= 0f;
}
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 8f, 20f);
}
+3 -3
View File
@@ -21,9 +21,9 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 2f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
int ourpleDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 2f);
Main.dust[ourpleDust].noGravity = true;
Main.dust[ourpleDust].velocity *= 0f;
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 7f, 20f);
}
}
@@ -26,9 +26,9 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.localAI[0] += 1f;
if (Projectile.localAI[0] > 4f)
{
int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 2f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
int ourpleDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 62, 0f, 0f, 100, default, 2f);
Main.dust[ourpleDust].noGravity = true;
Main.dust[ourpleDust].velocity *= 0f;
}
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 10f, 20f);
}
+4 -4
View File
@@ -65,8 +65,8 @@ namespace CalamityMod.Projectiles.Typeless
SoundEngine.PlaySound(SoundID.Item14, Projectile.position);
for (int dustIndexA = 0; dustIndexA < 4; dustIndexA = incrementer + 1)
{
int num992 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1.5f);
Main.dust[num992].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f;
int smoky = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1.5f);
Main.dust[smoky].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(Math.PI) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f;
incrementer = dustIndexA;
}
for (int dustIndexB = 0; dustIndexB < 10; dustIndexB = incrementer + 1)
@@ -94,8 +94,8 @@ namespace CalamityMod.Projectiles.Typeless
}
for (int dustIndexD = 0; dustIndexD < 10; dustIndexD = incrementer + 1)
{
int num998 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 0, default, 1.5f);
Dust dust = Main.dust[num998];
int smokier = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 0, default, 1.5f);
Dust dust = Main.dust[smokier];
dust.position = Projectile.Center + Vector2.UnitX.RotatedByRandom(Math.PI).RotatedBy((double)Projectile.velocity.ToRotation(), default) * (float)Projectile.width / 2f;
dust.noGravity = true;
dust.velocity *= 3f;
+11 -11
View File
@@ -31,24 +31,24 @@ namespace CalamityMod.Projectiles.Typeless
if (Projectile.localAI[0] == 6f)
{
SoundEngine.PlaySound(SoundID.Item8, Projectile.position);
for (int num151 = 0; num151 < 40; num151++)
for (int i = 0; i < 40; i++)
{
int num152 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, 0f, 0f, 100, default, 1f);
Main.dust[num152].velocity *= 3f;
Main.dust[num152].velocity += Projectile.velocity * 0.75f;
Main.dust[num152].scale *= 1.2f;
Main.dust[num152].noGravity = true;
int cursedDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, 0f, 0f, 100, default, 1f);
Main.dust[cursedDust].velocity *= 3f;
Main.dust[cursedDust].velocity += Projectile.velocity * 0.75f;
Main.dust[cursedDust].scale *= 1.2f;
Main.dust[cursedDust].noGravity = true;
}
}
Projectile.localAI[0] += 1f;
if (Projectile.localAI[0] > 6f)
{
for (int num153 = 0; num153 < 3; num153++)
for (int j = 0; j < 3; j++)
{
int num154 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f);
Main.dust[num154].velocity *= 0.6f;
Main.dust[num154].scale *= 1.4f;
Main.dust[num154].noGravity = true;
int cursedDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f, 100, default, 1f);
Main.dust[cursedDust2].velocity *= 0.6f;
Main.dust[cursedDust2].scale *= 1.4f;
Main.dust[cursedDust2].noGravity = true;
}
}
}
+24 -24
View File
@@ -52,22 +52,22 @@ namespace CalamityMod.Projectiles.Typeless
{
if (Math.Abs(Projectile.velocity.X) >= 2f || Math.Abs(Projectile.velocity.Y) >= 2f)
{
for (int num246 = 0; num246 < 2; num246++)
for (int i = 0; i < 2; i++)
{
float num247 = 0f;
float num248 = 0f;
if (num246 == 1)
float shortXVel = 0f;
float shortYVel = 0f;
if (i == 1)
{
num247 = Projectile.velocity.X * 0.5f;
num248 = Projectile.velocity.Y * 0.5f;
shortXVel = Projectile.velocity.X * 0.5f;
shortYVel = 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, 173, 0f, 0f, 100, default, 1f);
Main.dust[num249].scale *= 1f + (float)Main.rand.Next(5) * 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, 199, 0f, 0f, 100, default, 0.1f);
Main.dust[num249].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[num249].velocity *= 0.05f;
int dusting = Dust.NewDust(new Vector2(Projectile.position.X + 3f + shortXVel, Projectile.position.Y + 3f + shortYVel) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, 173, 0f, 0f, 100, default, 1f);
Main.dust[dusting].scale *= 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[dusting].velocity *= 0.2f;
Main.dust[dusting].noGravity = true;
dusting = Dust.NewDust(new Vector2(Projectile.position.X + 3f + shortXVel, Projectile.position.Y + 3f + shortYVel) - Projectile.velocity * 0.5f, Projectile.width - 8, Projectile.height - 8, 199, 0f, 0f, 100, default, 0.1f);
Main.dust[dusting].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f;
Main.dust[dusting].velocity *= 0.05f;
}
}
}
@@ -83,23 +83,23 @@ namespace CalamityMod.Projectiles.Typeless
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item89, Projectile.position);
for (int num621 = 0; num621 < 5; num621++)
for (int j = 0; j < 5; j++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 199, 0f, 0f, 100, default, 1.5f);
Main.dust[num622].velocity *= 3f;
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 199, 0f, 0f, 100, default, 1.5f);
Main.dust[dust].velocity *= 3f;
if (Main.rand.NextBool())
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[dust].scale = 0.5f;
Main.dust[dust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 10; num623++)
for (int k = 0; k < 10; k++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f);
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, 173, 0f, 0f, 100, default, 1.5f);
Main.dust[num624].velocity *= 2f;
int dust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 2f);
Main.dust[dust2].noGravity = true;
Main.dust[dust2].velocity *= 5f;
dust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 1.5f);
Main.dust[dust2].velocity *= 2f;
}
}
+19 -19
View File
@@ -27,19 +27,19 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0.5f, 0f, 0.75f);
float num461 = 25f;
float projTimer = 25f;
if (Projectile.ai[0] > 180f)
{
num461 -= (Projectile.ai[0] - 180f) / 2f;
projTimer -= (Projectile.ai[0] - 180f) / 2f;
}
if (num461 <= 0f)
if (projTimer <= 0f)
{
num461 = 0f;
projTimer = 0f;
Projectile.Kill();
}
num461 *= 0.7f;
projTimer *= 0.7f;
Projectile.ai[0] += 4f;
int num462 = 0;
int timerCounter = 0;
float scale = 0.7f;
int dustType = Main.rand.NextBool() ? ModContent.DustType<AstralOrange>() : ModContent.DustType<AstralBlue>();
if (Projectile.ai[1] == 0f)
@@ -47,17 +47,17 @@ namespace CalamityMod.Projectiles.Typeless
scale = 1.5f;
dustType = 173;
}
while ((float)num462 < num461)
while ((float)timerCounter < projTimer)
{
float num463 = (float)Main.rand.Next(-30, 31);
float num464 = (float)Main.rand.Next(-30, 31);
float num465 = (float)Main.rand.Next(9, 27);
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, dustType, 0f, 0f, 100, default, scale);
Dust dust = Main.dust[num467];
float rand1 = (float)Main.rand.Next(-30, 31);
float rand2 = (float)Main.rand.Next(-30, 31);
float rand3 = (float)Main.rand.Next(9, 27);
float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2));
randAdjust = rand3 / randAdjust;
rand1 *= randAdjust;
rand2 *= randAdjust;
int dusty = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, scale);
Dust dust = Main.dust[dusty];
if (dustType != 173)
dust.color = new Color(255, 255, 255, 0);
dust.noGravity = true;
@@ -65,9 +65,9 @@ namespace CalamityMod.Projectiles.Typeless
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++;
dust.velocity.X = rand1;
dust.velocity.Y = rand2;
timerCounter++;
}
}
+4 -4
View File
@@ -54,8 +54,8 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.ai[1] = 1f;
SoundEngine.PlaySound(SoundID.Item13, Projectile.position);
}
int num199 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 0.5f);
Dust dust = Main.dust[num199];
int godDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 0.5f);
Dust dust = Main.dust[godDust];
dust.position.X -= 2f;
dust.position.Y += 2f;
dust.scale += (float)Main.rand.Next(50) * 0.01f;
@@ -63,8 +63,8 @@ namespace CalamityMod.Projectiles.Typeless
dust.velocity.Y -= 2f;
if (Main.rand.NextBool())
{
int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 0.5f);
Dust dust2 = Main.dust[num200];
int godDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 173, 0f, 0f, 100, default, 0.5f);
Dust dust2 = Main.dust[godDust2];
dust2.position.X -= 2f;
dust2.position.Y += 2f;
dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
+20 -20
View File
@@ -29,16 +29,16 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.localAI[0] += 1f;
return;
}
int num3;
for (int num586 = 0; num586 < 1; num586 = num3 + 1)
int inc;
for (int i = 0; i < 1; i = inc + 1)
{
for (int num587 = 0; num587 < 6; num587 = num3 + 1)
for (int j = 0; j < 6; j = inc + 1)
{
float num588 = Projectile.velocity.X / 6f * (float)num587;
float num589 = Projectile.velocity.Y / 6f * (float)num587;
int num590 = 6;
int num591 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num590, Projectile.position.Y + (float)num590), Projectile.width - num590 * 2, Projectile.height - num590 * 2, 170, 0f, 0f, 75, default, 1.2f);
Dust dust = Main.dust[num591];
float dustX = Projectile.velocity.X / 6f * (float)j;
float dustY = Projectile.velocity.Y / 6f * (float)j;
int dustPosMod = 6;
int goldenDust = Dust.NewDust(new Vector2(Projectile.position.X + (float)dustPosMod, Projectile.position.Y + (float)dustPosMod), Projectile.width - dustPosMod * 2, Projectile.height - dustPosMod * 2, 170, 0f, 0f, 75, default, 1.2f);
Dust dust = Main.dust[goldenDust];
if (Main.rand.NextBool())
{
dust.alpha += 25;
@@ -55,31 +55,31 @@ namespace CalamityMod.Projectiles.Typeless
dust.velocity *= 0.3f;
dust.velocity += Projectile.velocity * 0.5f;
dust.position = Projectile.Center;
dust.position.X -= num588;
dust.position.Y -= num589;
dust.position.X -= dustX;
dust.position.Y -= dustY;
dust.velocity *= 0.2f;
num3 = num587;
inc = j;
}
if (Main.rand.NextBool(4))
{
int num592 = 6;
int num593 = Dust.NewDust(new Vector2(Projectile.position.X + (float)num592, Projectile.position.Y + (float)num592), Projectile.width - num592 * 2, Projectile.height - num592 * 2, 170, 0f, 0f, 75, default, 0.65f);
Dust dust = Main.dust[num593];
int dustPosMod2 = 6;
int moreGoldenDust = Dust.NewDust(new Vector2(Projectile.position.X + (float)dustPosMod2, Projectile.position.Y + (float)dustPosMod2), Projectile.width - dustPosMod2 * 2, Projectile.height - dustPosMod2 * 2, 170, 0f, 0f, 75, default, 0.65f);
Dust dust = Main.dust[moreGoldenDust];
dust.velocity *= 0.5f;
dust.velocity += Projectile.velocity * 0.5f;
}
num3 = num586;
inc = i;
}
}
public override void OnKill(int timeLeft)
{
Projectile.velocity = Projectile.oldVelocity * 0.2f;
int num3;
for (int num362 = 0; num362 < 100; num362 = num3 + 1)
int inc;
for (int k = 0; k < 100; k = inc + 1)
{
int num363 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 170, 0f, 0f, 75, default, 1.2f);
Dust dust = Main.dust[num363];
int deathGoldenDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 170, 0f, 0f, 75, default, 1.2f);
Dust dust = Main.dust[deathGoldenDust];
if (Main.rand.NextBool())
{
dust.alpha += 25;
@@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Typeless
dust.velocity.X += (float)Main.rand.Next(-50, 51) * 0.015f;
dust.velocity.Y += (float)Main.rand.Next(-50, 51) * 0.015f;
dust.position = Projectile.Center;
num3 = num362;
inc = k;
}
}
@@ -34,38 +34,38 @@ namespace CalamityMod.Projectiles.Typeless
SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
Projectile.localAI[0] += 1f;
}
float num461 = 25f;
float projTimer = 25f;
if (Projectile.ai[0] > 180f)
{
num461 -= (Projectile.ai[0] - 180f) / 2f;
projTimer -= (Projectile.ai[0] - 180f) / 2f;
}
if (num461 <= 0f)
if (projTimer <= 0f)
{
num461 = 0f;
projTimer = 0f;
Projectile.Kill();
}
num461 *= 0.7f;
projTimer *= 0.7f;
Projectile.ai[0] += 4f;
int num462 = 0;
while ((float)num462 < num461)
int timerCounter = 0;
while ((float)timerCounter < projTimer)
{
float num463 = (float)Main.rand.Next(-15, 16);
float num464 = (float)Main.rand.Next(-15, 16);
float num465 = (float)Main.rand.Next(5, 12);
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, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 0.75f);
Dust dust = Main.dust[num467];
float rand1 = (float)Main.rand.Next(-15, 16);
float rand2 = (float)Main.rand.Next(-15, 16);
float rand3 = (float)Main.rand.Next(5, 12);
float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2));
randAdjust = rand3 / randAdjust;
rand1 *= randAdjust;
rand2 *= randAdjust;
int brimDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 0.75f);
Dust dust = Main.dust[brimDust];
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++;
dust.velocity.X = rand1;
dust.velocity.Y = rand2;
timerCounter++;
}
}
+11 -11
View File
@@ -32,23 +32,23 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.height = 20;
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 < 20; num621++)
for (int i = 0; i < 20; i++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
int holyDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[holyDust].velocity *= 3f;
if (Main.rand.NextBool())
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[holyDust].scale = 0.5f;
Main.dust[holyDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 40; num623++)
for (int j = 0; j < 40; j++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 3f);
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, 246, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
int holyDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 3f);
Main.dust[holyDust2].noGravity = true;
Main.dust[holyDust2].velocity *= 5f;
holyDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[holyDust2].velocity *= 2f;
}
}
}
+28 -28
View File
@@ -39,29 +39,29 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.height = 60;
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++)
for (int i = 0; i < 5; i++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
int holyDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[holyDust].velocity *= 3f;
if (Projectile.ai[0] == 1)
Main.dust[num622].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
Main.dust[holyDust].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
if (Main.rand.NextBool())
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[holyDust].scale = 0.5f;
Main.dust[holyDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 10; num623++)
for (int j = 0; j < 10; j++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
int holyDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 3f);
Main.dust[holyDust2].noGravity = true;
Main.dust[holyDust2].velocity *= 5f;
if (Projectile.ai[0] == 1)
Main.dust[num624].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
Main.dust[holyDust2].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
holyDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 246, 0f, 0f, 100, default, 2f);
Main.dust[holyDust2].velocity *= 2f;
if (Projectile.ai[0] == 1)
Main.dust[num624].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
Main.dust[holyDust2].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
}
}
else
@@ -74,26 +74,26 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.height = 60;
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 < 8; num621++)
for (int i = 0; i < 8; i++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, 0f, 0f, 100, default, Main.rand.NextFloat(1.2f, 1.8f));
Main.dust[num622].velocity *= 3f;
Main.dust[num622].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
int holyDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 181, 0f, 0f, 100, default, Main.rand.NextFloat(1.2f, 1.8f));
Main.dust[holyDust].velocity *= 3f;
Main.dust[holyDust].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
if (Main.rand.NextBool())
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[holyDust].scale = 0.5f;
Main.dust[holyDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 12; num623++)
for (int j = 0; j < 12; j++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 272, 0f, 0f, 100, default, 0.8f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
Main.dust[num624].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 226, 0f, 0f, 100, default, 0.6f);
Main.dust[num624].velocity *= 2f;
Main.dust[num624].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
int holyDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 272, 0f, 0f, 100, default, 0.8f);
Main.dust[holyDust2].noGravity = true;
Main.dust[holyDust2].velocity *= 5f;
Main.dust[holyDust2].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
holyDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 226, 0f, 0f, 100, default, 0.6f);
Main.dust[holyDust2].velocity *= 2f;
Main.dust[holyDust2].shader = GameShaders.Armor.GetSecondaryShader(Owner.cShield, Owner);
}
}
}
+3 -3
View File
@@ -37,12 +37,12 @@ namespace CalamityMod.Projectiles.Typeless
}
if (Main.rand.NextBool(4))
{
int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 1f);
int fieryDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 1f);
if (Main.rand.NextBool(4))
{
Main.dust[num469].scale *= 0.35f;
Main.dust[fieryDust].scale *= 0.35f;
}
Main.dust[num469].velocity *= 0f;
Main.dust[fieryDust].velocity *= 0f;
}
Vector2 goreVec = new Vector2(Projectile.position.X, Projectile.position.Y);
+7 -7
View File
@@ -92,14 +92,14 @@ namespace CalamityMod.Projectiles.Typeless
{
SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
Projectile.ExpandHitboxBy(24);
int num226 = 36;
for (int num227 = 0; num227 < num226; num227++)
int dustAmt = 36;
for (int j = 0; j < dustAmt; j++)
{
Vector2 vector6 = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f;
vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + Projectile.Center;
Vector2 vector7 = vector6 - Projectile.Center;
int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 67, vector7.X * 0.5f, vector7.Y * 0.5f, 100, default, 0.75f);
Main.dust[num228].noGravity = true;
Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f;
rotate = rotate.RotatedBy((double)((float)(j - (dustAmt / 2 - 1)) * 6.28318548f / (float)dustAmt), default) + Projectile.Center;
Vector2 faceDirection = rotate - Projectile.Center;
int icyDust = Dust.NewDust(rotate + faceDirection, 0, 0, 67, faceDirection.X * 0.5f, faceDirection.Y * 0.5f, 100, default, 0.75f);
Main.dust[icyDust].noGravity = true;
}
}
+90 -99
View File
@@ -25,13 +25,10 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
float num29 = 5f;
float num30 = 150f;
float aiTrack = 5f;
float scaleFactor = 6f;
Vector2 value7 = new Vector2(10f, 20f);
float num31 = 1f;
int num32 = 3 * Projectile.MaxUpdates;
int num33 = Utils.SelectRandom(Main.rand, new int[]
Vector2 dustRotation = new Vector2(10f, 20f);
int dustType = Utils.SelectRandom(Main.rand, new int[]
{
246,
244,
@@ -39,7 +36,7 @@ namespace CalamityMod.Projectiles.Typeless
262,
247
});
int num34 = 259;
int solarDustType = 259;
if (Projectile.ai[1] == 0f)
{
Projectile.ai[1] = 1f;
@@ -47,38 +44,38 @@ namespace CalamityMod.Projectiles.Typeless
}
else if (Projectile.ai[1] == 1f && Projectile.owner == Main.myPlayer)
{
int num35 = -1;
float num36 = num30;
for (int num37 = 0; num37 < Main.maxNPCs; num37++)
int targetID = -1;
float hitDistance = 150f;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[num37].active && Main.npc[num37].CanBeChasedBy(Projectile, false))
if (Main.npc[i].active && Main.npc[i].CanBeChasedBy(Projectile, false))
{
Vector2 center3 = Main.npc[num37].Center;
float num38 = Vector2.Distance(center3, Projectile.Center);
if (num38 < num36 && num35 == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, center3, 1, 1))
Vector2 targetCenter = Main.npc[i].Center;
float targetDist = Vector2.Distance(targetCenter, Projectile.Center);
if (targetDist < hitDistance && targetID == -1 && Collision.CanHitLine(Projectile.Center, 1, 1, targetCenter, 1, 1))
{
num36 = num38;
num35 = num37;
hitDistance = targetDist;
targetID = i;
}
}
}
if (num36 < 8f)
if (hitDistance < 8f)
{
Projectile.Kill();
return;
}
if (num35 != -1)
if (targetID != -1)
{
Projectile.ai[1] = num29 + 1f;
Projectile.ai[0] = (float)num35;
Projectile.ai[1] = aiTrack + 1f;
Projectile.ai[0] = (float)targetID;
Projectile.netUpdate = true;
}
}
else if (Projectile.ai[1] > num29)
else if (Projectile.ai[1] > aiTrack)
{
Projectile.ai[1] += 1f;
int num39 = (int)Projectile.ai[0];
if (!Main.npc[num39].active || !Main.npc[num39].CanBeChasedBy(Projectile, false))
int npcTrack = (int)Projectile.ai[0];
if (!Main.npc[npcTrack].active || !Main.npc[npcTrack].CanBeChasedBy(Projectile, false))
{
Projectile.ai[1] = 1f;
Projectile.ai[0] = 0f;
@@ -87,25 +84,24 @@ namespace CalamityMod.Projectiles.Typeless
else
{
Projectile.velocity.ToRotation();
Vector2 vector6 = Main.npc[num39].Center - Projectile.Center;
if (vector6.Length() < 20f)
Vector2 npcDirection = Main.npc[npcTrack].Center - Projectile.Center;
if (npcDirection.Length() < 20f)
{
Projectile.Kill();
return;
}
if (vector6 != Vector2.Zero)
if (npcDirection != Vector2.Zero)
{
vector6.Normalize();
vector6 *= scaleFactor;
npcDirection.Normalize();
npcDirection *= scaleFactor;
}
float num40 = 30f;
Projectile.velocity = (Projectile.velocity * (num40 - 1f) + vector6) / num40;
Projectile.velocity = (Projectile.velocity * 29f + npcDirection) / 30f;
}
}
if (Projectile.ai[1] >= 1f && Projectile.ai[1] < num29)
if (Projectile.ai[1] >= 1f && Projectile.ai[1] < aiTrack)
{
Projectile.ai[1] += 1f;
if (Projectile.ai[1] == num29)
if (Projectile.ai[1] == aiTrack)
{
Projectile.ai[1] = 1f;
}
@@ -117,83 +113,81 @@ namespace CalamityMod.Projectiles.Typeless
}
else if (Projectile.alpha == 0)
{
for (int num41 = 0; num41 < 2; num41++)
for (int j = 0; j < 2; j++)
{
Vector2 value8 = Vector2.UnitX * -30f;
value8 = -Vector2.UnitY.RotatedBy((double)(Projectile.localAI[0] * 0.1308997f + (float)num41 * 3.14159274f), default) * value7 - Projectile.rotation.ToRotationVector2() * 10f;
int num42 = Dust.NewDust(Projectile.Center, 0, 0, num34, 0f, 0f, 160, default, 1f);
Main.dust[num42].scale = num31;
Main.dust[num42].noGravity = true;
Main.dust[num42].position = Projectile.Center + value8 + Projectile.velocity * 2f;
Main.dust[num42].velocity = Vector2.Normalize(Projectile.Center + Projectile.velocity * 2f * 8f - Main.dust[num42].position) * 2f + Projectile.velocity * 2f;
Vector2 rotateFirstDust = Vector2.UnitX * -30f;
rotateFirstDust = -Vector2.UnitY.RotatedBy((double)(Projectile.localAI[0] * 0.1308997f + (float)j * 3.14159274f), default) * dustRotation - Projectile.rotation.ToRotationVector2() * 10f;
int solarDust = Dust.NewDust(Projectile.Center, 0, 0, solarDustType, 0f, 0f, 160, default, 1f);
Main.dust[solarDust].scale = 1f;
Main.dust[solarDust].noGravity = true;
Main.dust[solarDust].position = Projectile.Center + rotateFirstDust + Projectile.velocity * 2f;
Main.dust[solarDust].velocity = Vector2.Normalize(Projectile.Center + Projectile.velocity * 2f * 8f - Main.dust[solarDust].position) * 2f + Projectile.velocity * 2f;
}
}
if (Main.rand.NextBool(12))
{
for (int num43 = 0; num43 < 1; num43++)
for (int k = 0; k < 1; k++)
{
Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num44 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f);
Main.dust[num44].velocity *= 0.1f;
Main.dust[num44].position = Projectile.Center + value9 * (float)Projectile.width / 2f + Projectile.velocity * 2f;
Main.dust[num44].fadeIn = 0.9f;
Vector2 rotateSecondDust = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int smokyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 100, default, 1f);
Main.dust[smokyDust].velocity *= 0.1f;
Main.dust[smokyDust].position = Projectile.Center + rotateSecondDust * (float)Projectile.width / 2f + Projectile.velocity * 2f;
Main.dust[smokyDust].fadeIn = 0.9f;
}
}
if (Main.rand.NextBool(64))
{
for (int num45 = 0; num45 < 1; num45++)
for (int l = 0; l < 1; l++)
{
Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num46 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 155, default, 0.8f);
Main.dust[num46].velocity *= 0.3f;
Main.dust[num46].position = Projectile.Center + value10 * (float)Projectile.width / 2f;
Vector2 rotateThirdDust = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int smokyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 155, default, 0.8f);
Main.dust[smokyDust2].velocity *= 0.3f;
Main.dust[smokyDust2].position = Projectile.Center + rotateThirdDust * (float)Projectile.width / 2f;
if (Main.rand.NextBool())
{
Main.dust[num46].fadeIn = 1.4f;
Main.dust[smokyDust2].fadeIn = 1.4f;
}
}
}
if (Main.rand.NextBool(4))
{
for (int num47 = 0; num47 < 2; num47++)
for (int m = 0; m < 2; m++)
{
Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num48 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, num33, 0f, 0f, 0, default, 1.2f);
Main.dust[num48].velocity *= 0.3f;
Main.dust[num48].noGravity = true;
Main.dust[num48].position = Projectile.Center + value11 * (float)Projectile.width / 2f;
Vector2 rotateFourthDust = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int randomDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1.2f);
Main.dust[randomDust].velocity *= 0.3f;
Main.dust[randomDust].noGravity = true;
Main.dust[randomDust].position = Projectile.Center + rotateFourthDust * (float)Projectile.width / 2f;
if (Main.rand.NextBool())
{
Main.dust[num48].fadeIn = 1.4f;
Main.dust[randomDust].fadeIn = 1.4f;
}
}
}
if (Main.rand.NextBool(3))
{
Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int num50 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, num34, 0f, 0f, 100, default, 1f);
Main.dust[num50].velocity *= 0.3f;
Main.dust[num50].position = Projectile.Center + value13 * (float)Projectile.width / 2f;
Main.dust[num50].fadeIn = 1.2f;
Main.dust[num50].scale = 1.5f;
Main.dust[num50].noGravity = true;
Vector2 rotateFifthDust = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)Projectile.velocity.ToRotation(), default);
int solarDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, solarDustType, 0f, 0f, 100, default, 1f);
Main.dust[solarDust2].velocity *= 0.3f;
Main.dust[solarDust2].position = Projectile.Center + rotateFifthDust * (float)Projectile.width / 2f;
Main.dust[solarDust2].fadeIn = 1.2f;
Main.dust[solarDust2].scale = 1.5f;
Main.dust[solarDust2].noGravity = true;
}
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.25f / 255f, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.25f / 255f);
for (int num151 = 0; num151 < 3; num151++)
for (int r = 0; r < 3; r++)
{
int num154 = 14;
int num155 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - num154 * 2, Projectile.height - num154 * 2, 259, 0f, 0f, 100, default, 1.35f);
Main.dust[num155].noGravity = true;
Main.dust[num155].velocity *= 0.1f;
Main.dust[num155].velocity += Projectile.velocity * 0.5f;
int moreSolarDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - 28, Projectile.height - 28, 259, 0f, 0f, 100, default, 1.35f);
Main.dust[moreSolarDust].noGravity = true;
Main.dust[moreSolarDust].velocity *= 0.1f;
Main.dust[moreSolarDust].velocity += Projectile.velocity * 0.5f;
}
if (Main.rand.NextBool(8))
{
int num156 = 16;
int num157 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - num156 * 2, Projectile.height - num156 * 2, 259, 0f, 0f, 100, default, 1f);
Main.dust[num157].velocity *= 0.25f;
Main.dust[num157].noGravity = true;
Main.dust[num157].velocity += Projectile.velocity * 0.5f;
int mostSolarDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width - 32, Projectile.height - 32, 259, 0f, 0f, 100, default, 1f);
Main.dust[mostSolarDust].velocity *= 0.25f;
Main.dust[mostSolarDust].noGravity = true;
Main.dust[mostSolarDust].velocity += Projectile.velocity * 0.5f;
}
}
@@ -210,7 +204,7 @@ namespace CalamityMod.Projectiles.Typeless
public override void OnKill(int timeLeft)
{
int num47 = Utils.SelectRandom(Main.rand, new int[]
int m = Utils.SelectRandom(Main.rand, new int[]
{
246,
244,
@@ -218,14 +212,11 @@ namespace CalamityMod.Projectiles.Typeless
262,
247
});
int num48 = 259;
int num49 = 259;
int randomDust = 259;
int height = 50;
float num50 = 1.7f;
float num51 = 0.8f;
float num52 = 2f;
Vector2 value3 = (Projectile.rotation - 1.57079637f).ToRotationVector2();
Vector2 value4 = value3 * Projectile.velocity.Length() * (float)Projectile.MaxUpdates;
float solarDust2 = 1.7f;
Vector2 dustRotate = (Projectile.rotation - 1.57079637f).ToRotationVector2();
Vector2 dustVel = dustRotate * Projectile.velocity.Length() * (float)Projectile.MaxUpdates;
SoundEngine.PlaySound(SoundID.Item14, Projectile.position);
Projectile.position = Projectile.Center;
Projectile.width = Projectile.height = height;
@@ -235,10 +226,10 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.Damage();
int num3;
for (int num53 = 0; num53 < 40; num53 = num3 + 1)
int inc;
for (int j = 0; j < 40; j = inc + 1)
{
num47 = Utils.SelectRandom(Main.rand, new int[]
m = Utils.SelectRandom(Main.rand, new int[]
{
246,
244,
@@ -246,30 +237,30 @@ namespace CalamityMod.Projectiles.Typeless
262,
247
});
int num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num47, 0f, 0f, 200, default, num50);
Dust dust = Main.dust[num54];
int orangeDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, m, 0f, 0f, 200, default, solarDust2);
Dust dust = Main.dust[orangeDust];
dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f;
dust.noGravity = true;
dust.velocity *= 3f;
dust.velocity += value4 * Main.rand.NextFloat();
num54 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num48, 0f, 0f, 100, default, num51);
dust.velocity += dustVel * Main.rand.NextFloat();
orangeDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 0.8f);
dust.position = Projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)Projectile.width / 2f;
dust.velocity *= 2f;
dust.noGravity = true;
dust.fadeIn = 1f;
dust.color = Color.Crimson * 0.5f;
dust.velocity += value4 * Main.rand.NextFloat();
num3 = num53;
dust.velocity += dustVel * Main.rand.NextFloat();
inc = j;
}
for (int num55 = 0; num55 < 20; num55 = num3 + 1)
for (int k = 0; k < 20; k = inc + 1)
{
int num56 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, num49, 0f, 0f, 0, default, num52);
Dust dust = Main.dust[num56];
int deathSolar = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 259, 0f, 0f, 0, default, 2f);
Dust dust = Main.dust[deathSolar];
dust.position = Projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)Projectile.velocity.ToRotation(), default) * (float)Projectile.width / 3f;
dust.noGravity = true;
dust.velocity *= 0.5f;
dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat());
num3 = num55;
dust.velocity += dustVel * (0.6f + 0.6f * Main.rand.NextFloat());
inc = k;
}
}
}
+15 -15
View File
@@ -56,27 +56,27 @@ namespace CalamityMod.Projectiles.Typeless
public override void OnKill(int timeLeft)
{
int num3;
for (int num191 = 0; num191 < 2; num191 = num3 + 1)
int inc;
for (int i = 0; i < 2; i = inc + 1)
{
int num192 = (int)(10f * Projectile.scale);
int num193 = Dust.NewDust(Projectile.Center - Vector2.One * (float)num192, num192 * 2, num192 * 2, 107, 0f, 0f, 0, default, 1f);
Dust dust20 = Main.dust[num193];
Vector2 value8 = Vector2.Normalize(dust20.position - Projectile.Center);
dust20.position = Projectile.Center + value8 * (float)num192 * Projectile.scale;
if (num191 < 30)
int dustScale = (int)(10f * Projectile.scale);
int greenDust = Dust.NewDust(Projectile.Center - Vector2.One * (float)dustScale, dustScale * 2, dustScale * 2, 107, 0f, 0f, 0, default, 1f);
Dust nanoDust = Main.dust[greenDust];
Vector2 dustDirection = Vector2.Normalize(nanoDust.position - Projectile.Center);
nanoDust.position = Projectile.Center + dustDirection * (float)dustScale * Projectile.scale;
if (i < 30)
{
dust20.velocity = value8 * dust20.velocity.Length();
nanoDust.velocity = dustDirection * nanoDust.velocity.Length();
}
else
{
dust20.velocity = value8 * (float)Main.rand.Next(45, 91) / 10f;
nanoDust.velocity = dustDirection * (float)Main.rand.Next(45, 91) / 10f;
}
dust20.color = Main.hslToRgb((float)(0.40000000596046448 + Main.rand.NextDouble() * 0.20000000298023224), 0.9f, 0.5f);
dust20.color = Color.Lerp(dust20.color, Color.White, 0.3f);
dust20.noGravity = true;
dust20.scale = 0.7f;
num3 = num191;
nanoDust.color = Main.hslToRgb((float)(0.40000000596046448 + Main.rand.NextDouble() * 0.20000000298023224), 0.9f, 0.5f);
nanoDust.color = Color.Lerp(nanoDust.color, Color.White, 0.3f);
nanoDust.noGravity = true;
nanoDust.scale = 0.7f;
inc = i;
}
}
}
+5 -5
View File
@@ -22,12 +22,12 @@ namespace CalamityMod.Projectiles.Typeless
{
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f);
Projectile.rotation += Projectile.velocity.X * 1.25f;
for (int num457 = 0; num457 < 5; num457++)
for (int i = 0; i < 5; i++)
{
int num458 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 0.6f);
Main.dust[num458].noGravity = true;
Main.dust[num458].velocity *= 0.5f;
Main.dust[num458].velocity += Projectile.velocity * 0.1f;
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 0.6f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0.5f;
Main.dust[dust].velocity += Projectile.velocity * 0.1f;
}
}
+5 -5
View File
@@ -22,12 +22,12 @@ namespace CalamityMod.Projectiles.Typeless
{
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f);
Projectile.rotation += Projectile.velocity.X * 1.25f;
for (int num457 = 0; num457 < 5; num457++)
for (int i = 0; i < 5; i++)
{
int num458 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 0.6f);
Main.dust[num458].noGravity = true;
Main.dust[num458].velocity *= 0.5f;
Main.dust[num458].velocity += Projectile.velocity * 0.1f;
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 0.6f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0.5f;
Main.dust[dust].velocity += Projectile.velocity * 0.1f;
}
}
+5 -5
View File
@@ -24,12 +24,12 @@ namespace CalamityMod.Projectiles.Typeless
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f);
Projectile.rotation += Projectile.velocity.X * 1.25f;
for (int num457 = 0; num457 < 5; num457++)
for (int i = 0; i < 5; i++)
{
int num458 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 0.6f);
Main.dust[num458].noGravity = true;
Main.dust[num458].velocity *= 0.5f;
Main.dust[num458].velocity += Projectile.velocity * 0.1f;
int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 187, 0f, 0f, 100, default, 0.6f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0.5f;
Main.dust[dust].velocity += Projectile.velocity * 0.1f;
}
}
+4 -4
View File
@@ -36,14 +36,14 @@ namespace CalamityMod.Projectiles.Typeless
{
randomDust = 33;
}
for (int num468 = 0; num468 < 2; num468++)
for (int i = 0; i < 2; i++)
{
int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 1f);
int seaDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 1f);
if (randomDust == 89)
{
Main.dust[num469].scale *= 0.35f;
Main.dust[seaDust].scale *= 0.35f;
}
Main.dust[num469].velocity *= 0f;
Main.dust[seaDust].velocity *= 0f;
}
}
+11 -11
View File
@@ -59,23 +59,23 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.width = Projectile.height = 200;
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 < 4; num621++)
for (int i = 0; i < 4; i++)
{
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
int skyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[skyDust].velocity *= 3f;
if (Main.rand.NextBool())
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[skyDust].scale = 0.5f;
Main.dust[skyDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 12; num623++)
for (int j = 0; j < 12; j++)
{
int num624 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
int skyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 3f);
Main.dust[skyDust2].noGravity = true;
Main.dust[skyDust2].velocity *= 5f;
skyDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[skyDust2].velocity *= 2f;
}
if (Main.netMode != NetmodeID.Server)
+9 -9
View File
@@ -58,8 +58,8 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.ai[1] = 1f;
SoundEngine.PlaySound(SoundID.Item13, Projectile.position);
}
int num199 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[num199];
int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[brimDust];
dust.position.X -= 2f;
dust.position.Y += 2f;
dust.scale += (float)Main.rand.Next(50) * 0.01f;
@@ -67,13 +67,13 @@ namespace CalamityMod.Projectiles.Typeless
dust.velocity.Y -= 2f;
if (Main.rand.NextBool())
{
int num200 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f);
Dust dust2 = Main.dust[num200];
dust2.position.X -= 2f;
dust2.position.Y += 2f;
dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
dust2.noGravity = true;
dust2.velocity *= 0.1f;
int brimDusty = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f);
Dust dusty = Main.dust[brimDusty];
dusty.position.X -= 2f;
dusty.position.Y += 2f;
dusty.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
dusty.noGravity = true;
dusty.velocity *= 0.1f;
}
if ((double)Projectile.velocity.Y < 0.25 && (double)Projectile.velocity.Y > 0.15)
{
+11 -11
View File
@@ -41,23 +41,23 @@ namespace CalamityMod.Projectiles.Typeless
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 < 15; num621++)
for (int i = 0; i < 15; i++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1.2f);
Main.dust[num622].velocity *= 3f;
int blueDust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1.2f);
Main.dust[blueDust].velocity *= 3f;
if (Main.rand.NextBool())
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
Main.dust[blueDust].scale = 0.5f;
Main.dust[blueDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 30; num623++)
for (int j = 0; j < 30; j++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 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, 206, 0f, 0f, 100, default, 1f);
Main.dust[num624].velocity *= 2f;
int blueDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1.7f);
Main.dust[blueDust2].noGravity = true;
Main.dust[blueDust2].velocity *= 5f;
blueDust2 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 206, 0f, 0f, 100, default, 1f);
Main.dust[blueDust2].velocity *= 2f;
}
}
}
@@ -102,9 +102,9 @@ namespace CalamityMod.Projectiles.Typeless
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture2D13 = ModContent.Request<Texture2D>(Texture).Value;
int num214 = ModContent.Request<Texture2D>(Texture).Value.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
int framing = ModContent.Request<Texture2D>(Texture).Value.Height / Main.projFrames[Projectile.type];
int y6 = framing * Projectile.frame;
Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -135,17 +135,17 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.width = Projectile.height = 60;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
int num3;
for (int num246 = 0; num246 < 25; num246 = num3 + 1)
int inc;
for (int i = 0; i < 25; i = inc + 1)
{
int num247 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 0, default, 1f);
Main.dust[num247].position = (Main.dust[num247].position + Projectile.position) / 2f;
Main.dust[num247].velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
Main.dust[num247].velocity.Normalize();
Dust dust = Main.dust[num247];
int toxicDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 31, 0f, 0f, 0, default, 1f);
Main.dust[toxicDust].position = (Main.dust[toxicDust].position + Projectile.position) / 2f;
Main.dust[toxicDust].velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
Main.dust[toxicDust].velocity.Normalize();
Dust dust = Main.dust[toxicDust];
dust.velocity *= (float)Main.rand.Next(1, 30) * 0.1f;
Main.dust[num247].alpha = Projectile.alpha;
num3 = num246;
Main.dust[toxicDust].alpha = Projectile.alpha;
inc = i;
}
}
}
+10 -10
View File
@@ -32,18 +32,18 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
for (int num136 = 0; num136 < 2; num136++)
for (int i = 0; i < 2; i++)
{
float x2 = Projectile.position.X - Projectile.velocity.X / 10f * (float)num136;
float y2 = Projectile.position.Y - Projectile.velocity.Y / 10f * (float)num136;
float x2 = Projectile.position.X - Projectile.velocity.X / 10f * (float)i;
float y2 = Projectile.position.Y - Projectile.velocity.Y / 10f * (float)i;
Vector2 dspeed = Projectile.velocity * Main.rand.NextFloat(0.7f, 0.4f);
int num137 = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default, 1f);
Main.dust[num137].alpha = Projectile.alpha;
Main.dust[num137].position.X = x2;
Main.dust[num137].position.Y = y2;
Main.dust[num137].velocity = dspeed;
Main.dust[num137].noGravity = true;
Main.dust[num137].noLight = true;
int greenDust = Dust.NewDust(new Vector2(x2, y2), 1, 1, 107, 0f, 0f, 0, default, 1f);
Main.dust[greenDust].alpha = Projectile.alpha;
Main.dust[greenDust].position.X = x2;
Main.dust[greenDust].position.Y = y2;
Main.dust[greenDust].velocity = dspeed;
Main.dust[greenDust].noGravity = true;
Main.dust[greenDust].noLight = true;
}
if (Projectile.timeLeft < 170)