Projectile spread fixes continued
Except for Arch Amaryllis (BeamingBolt) in which the change is to make the even circle follow projectile travel direction like its downgrades
This commit is contained in:
1 parent
a027d80ee6
commit
60d6add4e1
14 files changed
+51
-127
No files matched your search
@@ -61,8 +61,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - (MathHelper.Pi / 8f)).ToRotationVector2() * 4f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<BeamingBolt2>(), (int)(Projectile.damage * 1), Projectile.knockBack, Projectile.owner, Projectile.ai[0]);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - (MathHelper.ToRadians(67.5f) - Projectile.velocity.ToRotation())).ToRotationVector2() * 4f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<BeamingBolt2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, Projectile.ai[0]);
|
||||
}
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item105, Projectile.Center);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -44,17 +45,12 @@ namespace CalamityMod.Projectiles.Magic
|
||||
});
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, randomDust, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
|
||||
}
|
||||
float spread = 90f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<GleamingBolt2>(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<GleamingBolt2>(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 6f) - (MathHelper.Pi / 3f - Projectile.velocity.ToRotation())).ToRotationVector2() * 3.5f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<GleamingBolt2>(), (int)(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item105, Projectile.Center);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
@@ -37,17 +38,13 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.MagicMirror, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.TerraBlade, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
|
||||
}
|
||||
float spread = 90f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<ManaBoltSmall>(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<ManaBoltSmall2>(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 6f) - (MathHelper.Pi / 3f - Projectile.velocity.ToRotation())).ToRotationVector2() * 3.5f;
|
||||
int type = (i < 3 ? ModContent.ProjectileType<ManaBoltSmall>() : ModContent.ProjectileType<ManaBoltSmall2>());
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, type, (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item10, Projectile.Center);
|
||||
|
||||
@@ -53,19 +53,13 @@ namespace CalamityMod.Projectiles.Magic
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
float random = Main.rand.Next(30, 90);
|
||||
float spread = random * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
float offset = Main.rand.NextFloat(MathHelper.TwoPi);
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<PlasmaRay2>(), (int)(Projectile.damage * 1.75), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<PlasmaRay2>(), (int)(Projectile.damage * 1.75), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - offset).ToRotationVector2() * 4f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<PlasmaRay2>(), (int)(Projectile.damage * 1.75), Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
}
|
||||
Projectile.penetrate--;
|
||||
|
||||
@@ -125,15 +125,11 @@ namespace CalamityMod.Projectiles.Magic
|
||||
break;
|
||||
|
||||
case 2f:
|
||||
float spread = 30f * 0.01f * MathHelper.PiOver2;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
for (int i = 0; i < 4; i++)
|
||||
float offset = Main.rand.NextFloat(MathHelper.TwoPi);
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(source, Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<VividLaser2>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
Projectile.NewProjectile(source, Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<VividLaser2>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - offset).ToRotationVector2() * 4f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<VividLaser2>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -57,18 +57,12 @@ namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
if (Projectile.numHits < 1)
|
||||
{
|
||||
float spread = 30f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<DracoBeam2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<DracoBeam2>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - (MathHelper.Pi / 8f)).ToRotationVector2() * 4f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<DracoBeam2>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,18 +82,11 @@ namespace CalamityMod.Projectiles.Melee
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
float spread = 180f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4f;
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<SandFire>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<SandFire>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
}
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.PiOver2), ModContent.ProjectileType<SandFire>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(-MathHelper.PiOver2), ModContent.ProjectileType<SandFire>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item14, Projectile.position);
|
||||
Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2);
|
||||
|
||||
@@ -185,15 +185,11 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
float random = Main.rand.Next(30, 90);
|
||||
float spread = random * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
for (int i = 0; i < 4; i++)
|
||||
float angleOffset = Main.rand.NextFloat(-30f, 30f);
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
double offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int proj1 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<MagnomalyBeam>(), Projectile.damage / 4, Projectile.knockBack / 4, Projectile.owner, 0f, 1f);
|
||||
int proj2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<MagnomalyBeam>(), Projectile.damage / 4, Projectile.knockBack / 4, Projectile.owner, 0f, 1f);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - (MathHelper.ToRadians(67.5f + angleOffset) - Projectile.velocity.ToRotation())).ToRotationVector2() * 4f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<MagnomalyBeam>(), (int)(Projectile.damage * 0.25), Projectile.knockBack * 0.25f, Projectile.owner, ai1: 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,18 +58,12 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
{
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Sand, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
|
||||
}
|
||||
float spread = 180f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
for (i = 0; i <= 1; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<FossilShard>(), (int)(Projectile.damage * 0.35), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<FossilShard>(), (int)(Projectile.damage * 0.35), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 4f) - (MathHelper.Pi / 2f - Projectile.velocity.ToRotation())).ToRotationVector2() * 3.5f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<FossilShard>(), (int)(Projectile.damage * 0.35), Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,15 +152,10 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<CelestusMiniScythe>(), (int)(Projectile.damage * 0.7), Projectile.knockBack, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<CelestusMiniScythe>(), (int)(Projectile.damage * 0.7), Projectile.knockBack, Projectile.owner);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - (MathHelper.ToRadians(67.5f) - Projectile.velocity.ToRotation())).ToRotationVector2() * 2.5f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<CelestusMiniScythe>(), (int)(Projectile.damage * 0.7), Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
}
|
||||
SoundEngine.PlaySound(SoundID.Item122, Projectile.Center);
|
||||
|
||||
@@ -142,20 +142,15 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
int splitProj = ModContent.ProjectileType<ReboundingRainbowSplit>();
|
||||
if (Projectile.owner == Main.myPlayer && Main.player[Projectile.owner].ownedProjectileCounts[splitProj] < 16)
|
||||
{
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int disk = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), splitProj, Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
int disk2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), splitProj, Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - (MathHelper.ToRadians(67.5f) - Projectile.velocity.ToRotation())).ToRotationVector2() * 4f;
|
||||
Projectile split = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, velocity, splitProj, Projectile.damage, Projectile.knockBack, Projectile.owner);
|
||||
if (Projectile.Calamity().stealthStrike)
|
||||
{
|
||||
Main.projectile[disk].idStaticNPCHitCooldown = Main.projectile[disk2].idStaticNPCHitCooldown = 8;
|
||||
Main.projectile[disk].usesIDStaticNPCImmunity = Main.projectile[disk2].usesIDStaticNPCImmunity = true;
|
||||
Main.projectile[disk].timeLeft = Main.projectile[disk2].timeLeft = 60;
|
||||
split.idStaticNPCHitCooldown = 8;
|
||||
split.usesIDStaticNPCImmunity = true;
|
||||
split.timeLeft = 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,15 +177,10 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
{
|
||||
float spread = 60f * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 6f;
|
||||
double offsetAngle;
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<RegulusEnergy>(), (int)(Projectile.damage * 0.4), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType<RegulusEnergy>(), (int)(Projectile.damage * 0.4), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 6f) - (MathHelper.Pi / 3f - Projectile.velocity.ToRotation())).ToRotationVector2() * 2f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<RegulusEnergy>(), (int)(Projectile.damage * 0.4), Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,19 +51,10 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
if (Projectile.Calamity().stealthStrike)
|
||||
{
|
||||
float random = Main.rand.Next(30, 90);
|
||||
float spread = random * 0.0174f;
|
||||
double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
|
||||
int projID = ModContent.ProjectileType<TarraThornRight>();
|
||||
int splitDamage = (int)(Projectile.damage * 0.25f);
|
||||
float splitKB = 1f;
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
double offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f) * 2f, (float)(Math.Cos(offsetAngle) * 5f) * 2f, projID, splitDamage, splitKB, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f) * 2f, (float)(-Math.Cos(offsetAngle) * 5f) * 2f, projID, splitDamage, splitKB, Projectile.owner);
|
||||
Vector2 velocity = ((MathHelper.TwoPi * i / 8f) - (MathHelper.ToRadians(67.5f) - Projectile.velocity.ToRotation())).ToRotationVector2() * 10f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<TarraThornRight>(), (int)(Projectile.damage * 0.25f), Projectile.knockBack * 0.25f, Projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,23 +189,11 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
Vector2 velocity = Projectile.velocity;
|
||||
velocity.Normalize();
|
||||
velocity *= 4f;
|
||||
|
||||
int spread = 45;
|
||||
int numProj = 4;
|
||||
float rotation = MathHelper.ToRadians(spread);
|
||||
float baseSpeed = (float)Math.Sqrt(velocity.X * velocity.X + velocity.Y * velocity.Y);
|
||||
double startAngle = Math.Atan2(velocity.X, velocity.Y) - rotation / 2;
|
||||
double deltaAngle = rotation / (float)numProj;
|
||||
double offsetAngle;
|
||||
|
||||
for (int i = 0; i < numProj; i++)
|
||||
Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4f;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * i;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle),
|
||||
ModContent.ProjectileType<CursorProjSplit>(), Projectile.damage / 3, Projectile.knockBack * 0.33f, Projectile.owner, 0f, 0f);
|
||||
float offset = MathHelper.ToRadians(MathHelper.Lerp(-22.5f, 22.5f, i / 3f));
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedBy(offset), ModContent.ProjectileType<CursorProjSplit>(), Projectile.damage / 3, Projectile.knockBack * 0.33f, Projectile.owner);
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item110, Projectile.Center);
|
||||
|
||||
Reference in new issue
Block a user