added forceMinion safety because I totally didn't forget this one
This commit is contained in:
1 parent
48b1c1dbf8
commit
e2e5f92ac6
7 files changed
+39
-28
No files matched your search
@@ -203,10 +203,13 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
|
||||
{
|
||||
Projectile laser = Projectile.NewProjectileDirect(projectile.Center + Utils.Vector2FromElipse(EyeRotation.ToRotationVector2(), projectile.Size * 0.5f * EyeOutwardness),
|
||||
projectile.DirectionTo(npc.Center) * 4f, ProjectileID.UFOLaser, projectile.damage, projectile.knockBack, projectile.owner);
|
||||
laser.timeLeft *= 2;
|
||||
laser.tileCollide = false;
|
||||
laser.netUpdate = true;
|
||||
laser.Calamity().forceMinion = true;
|
||||
if (laser.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
laser.timeLeft *= 2;
|
||||
laser.tileCollide = false;
|
||||
laser.netUpdate = true;
|
||||
laser.Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
projectile.ai[1]++;
|
||||
OldCenter = projectile.Center;
|
||||
|
||||
@@ -102,7 +102,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
if (dealDamage)
|
||||
{
|
||||
Projectile aura = Projectile.NewProjectileDirect(npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), dmg, 0f, projectile.owner, l);
|
||||
aura.Calamity().forceMinion = true;
|
||||
if (aura.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
aura.Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
float SpeedX = -projectile.velocity.X * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f;
|
||||
float SpeedY = -projectile.velocity.Y * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f;
|
||||
int shard = Projectile.NewProjectile(projectile.Center.X + SpeedX, projectile.Center.Y + SpeedY, SpeedX, SpeedY, ProjectileID.CrystalShard, projectile.damage / 2, 0f, projectile.owner);
|
||||
Main.projectile[shard].Calamity().forceMinion = true;
|
||||
ProjectileID.Sets.MinionShot[Main.projectile[shard].type] = true;
|
||||
if (shard.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[idx].Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
velocity.Normalize();
|
||||
velocity *= 8f;
|
||||
int proj = Projectile.NewProjectile(projectile.Center + outerPosVec, velocity, ModContent.ProjectileType<ProfanedCrystalMageFireballSplit>(), damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
if (proj != -1)
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
if (innerSplits > 0) //only runs if there's still inner splits to create
|
||||
{
|
||||
@@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
velocity.Normalize();
|
||||
velocity *= 5f;
|
||||
proj = Projectile.NewProjectile(projectile.Center + innerPosVec, velocity, ModContent.ProjectileType<ProfanedCrystalMageFireballSplit>(), damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
if (proj != -1)
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
}
|
||||
innerSplits--;
|
||||
@@ -627,7 +627,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
correctedVelocity.Normalize();
|
||||
correctedVelocity *= 25f;
|
||||
int proj = Projectile.NewProjectile(pos, correctedVelocity, ModContent.ProjectileType<ProfanedCrystalRangedHuges>(), (int)((double)projectile.damage * 1.5f), projectile.knockBack, projectile.owner, 2);
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().forceMinion = true;
|
||||
((ProfanedCrystalRangedHuges)Main.projectile[proj].modProjectile).boomerSwarm = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
velocity.Normalize();
|
||||
velocity *= shootSpeed;
|
||||
int beam = Projectile.NewProjectile(source, velocity, ProjectileID.HeatRay, projectile.damage, projectile.knockBack, projectile.owner);
|
||||
Main.projectile[beam].Calamity().forceMinion = true;
|
||||
if (beam.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[beam].Calamity().forceMinion = true;
|
||||
projectile.ai[0] = 50f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,12 +263,15 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f));
|
||||
int spark = Projectile.NewProjectile(projectile.Center, sparkS, ModContent.ProjectileType<Spark>(), projectile.damage, projectile.knockBack, projectile.owner);
|
||||
Main.projectile[spark].Calamity().forceMinion = true;
|
||||
Main.projectile[spark].timeLeft = 120;
|
||||
Main.projectile[spark].penetrate = 3;
|
||||
Main.projectile[spark].usesIDStaticNPCImmunity = true;
|
||||
Main.projectile[spark].idStaticNPCHitCooldown = 10;
|
||||
Main.projectile[spark].usesLocalNPCImmunity = false;
|
||||
if (spark.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark].Calamity().forceMinion = true;
|
||||
Main.projectile[spark].timeLeft = 120;
|
||||
Main.projectile[spark].penetrate = 3;
|
||||
Main.projectile[spark].usesIDStaticNPCImmunity = true;
|
||||
Main.projectile[spark].idStaticNPCHitCooldown = 10;
|
||||
Main.projectile[spark].usesLocalNPCImmunity = false;
|
||||
}
|
||||
}
|
||||
sparkCounter = 0;
|
||||
}
|
||||
@@ -507,12 +510,15 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f));
|
||||
int spark = Projectile.NewProjectile(projectile.Center, sparkS, ModContent.ProjectileType<Spark>(), projectile.damage, projectile.knockBack, projectile.owner);
|
||||
Main.projectile[spark].Calamity().forceMinion = true;
|
||||
Main.projectile[spark].timeLeft = 120;
|
||||
Main.projectile[spark].penetrate = 3;
|
||||
Main.projectile[spark].usesIDStaticNPCImmunity = true;
|
||||
Main.projectile[spark].idStaticNPCHitCooldown = 10;
|
||||
Main.projectile[spark].usesLocalNPCImmunity = false;
|
||||
if (spark.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[spark].Calamity().forceMinion = true;
|
||||
Main.projectile[spark].timeLeft = 120;
|
||||
Main.projectile[spark].penetrate = 3;
|
||||
Main.projectile[spark].usesIDStaticNPCImmunity = true;
|
||||
Main.projectile[spark].idStaticNPCHitCooldown = 10;
|
||||
Main.projectile[spark].usesLocalNPCImmunity = false;
|
||||
}
|
||||
}
|
||||
sparkCounter = 0;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
int idx = Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(potentialTarget.Center) * 18f, ModContent.ProjectileType<MK2RocketHoming>(),
|
||||
(int)(damage * 1.5), 5f, projectile.owner);
|
||||
Main.projectile[idx].Calamity().forceMinion = true;
|
||||
if (idx.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[idx].Calamity().forceMinion = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -163,10 +164,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
damage, knockBack, projectile.owner);
|
||||
// There's airway for a small bug in here, but the potential alterative (that has indeed been appearing), where
|
||||
// the projectile simply cannot exist, is far worse than this. If you have another solution, let me know.
|
||||
if (idx >= 0 && idx < Main.projectile.Length)
|
||||
{
|
||||
Main.projectile[idx].Calamity().forceMinion = true;
|
||||
}
|
||||
if (idx.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[idx].Calamity().forceMinion = true;
|
||||
}
|
||||
}
|
||||
projectile.MinionAntiClump(0.25f);
|
||||
|
||||
Reference in new issue
Block a user