made an IsSummon() shortcut
This commit is contained in:
1 parent
4131a754ae
commit
84520f4100
4 files changed
+9
-7
No files matched your search
@@ -5211,7 +5211,7 @@ namespace CalamityMod.CalPlayer
|
||||
return;
|
||||
|
||||
bool isTrueMelee = proj.Calamity().trueMelee;
|
||||
bool isSummon = proj.minion || proj.sentry || CalamityMod.projectileMinionList.Contains(proj.type) || ProjectileID.Sets.MinionShot[proj.type] || ProjectileID.Sets.SentryShot[proj.type];
|
||||
bool isSummon = proj.IsSummon();
|
||||
bool hasClassType = proj.melee || proj.ranged || proj.magic || isSummon || proj.Calamity().rogue;
|
||||
|
||||
Item heldItem = player.ActiveItem();
|
||||
|
||||
@@ -3509,7 +3509,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (modPlayer.nucleogenesis)
|
||||
{
|
||||
if (projectile.minion || projectile.sentry || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type] || CalamityMod.projectileMinionList.Contains(projectile.type))
|
||||
if (projectile.IsSummon())
|
||||
{
|
||||
damage = npc.lifeMax * 3;
|
||||
}
|
||||
@@ -3716,7 +3716,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
private void PierceResistGlobal(Projectile projectile, ref int damage)
|
||||
{
|
||||
if (projectile.minion)
|
||||
if (projectile.IsSummon())
|
||||
return;
|
||||
|
||||
if (projectile.penetrate == -1)
|
||||
@@ -3753,7 +3753,7 @@ namespace CalamityMod.NPCs
|
||||
Player player = Main.player[projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
bool isSummon = projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type];
|
||||
bool isSummon = projectile.IsSummon();
|
||||
|
||||
if (modPlayer.sGenerator)
|
||||
{
|
||||
|
||||
@@ -1015,7 +1015,7 @@ namespace CalamityMod.Projectiles
|
||||
defCrit = modPlayer.critStats[2];
|
||||
else if (rogue)
|
||||
defCrit = modPlayer.critStats[3];
|
||||
else if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type])
|
||||
else if (projectile.IsSummon())
|
||||
defCrit = 4;
|
||||
}
|
||||
|
||||
@@ -1302,7 +1302,7 @@ namespace CalamityMod.Projectiles
|
||||
OTHEREFFECTS:
|
||||
|
||||
if (modPlayer.alchFlask &&
|
||||
(projectile.magic || rogue || projectile.melee || projectile.minion || projectile.ranged || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type]) &&
|
||||
(projectile.magic || rogue || projectile.melee || projectile.IsSummon() || projectile.ranged) &&
|
||||
player.ownedProjectileCounts[ProjectileType<PlagueSeeker>()] < 6)
|
||||
{
|
||||
int plague = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ProjectileType<PlagueSeeker>(), CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30), 0f, projectile.owner, 0f, 0f);
|
||||
@@ -1601,7 +1601,7 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
}
|
||||
}
|
||||
if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type) || ProjectileID.Sets.MinionShot[projectile.type] || ProjectileID.Sets.SentryShot[projectile.type])
|
||||
if (projectile.IsSummon())
|
||||
{
|
||||
if (modPlayer.profanedCrystalBuffs || (modPlayer.pArtifact && !modPlayer.profanedCrystal))
|
||||
{
|
||||
|
||||
@@ -759,6 +759,8 @@ namespace CalamityMod
|
||||
|
||||
public static int CountHookProj() => Main.projectile.Count(proj => Main.projHook[proj.type] && proj.ai[0] == 2f && proj.active && proj.owner == Main.myPlayer);
|
||||
|
||||
public static bool IsSummon(this Projectile proj) => proj.minion || proj.sentry || CalamityMod.projectileMinionList.Contains(proj.type) || ProjectileID.Sets.MinionShot[proj.type] || ProjectileID.Sets.SentryShot[proj.type];
|
||||
|
||||
public static void KillAllHostileProjectiles()
|
||||
{
|
||||
for (int x = 0; x < Main.maxProjectiles; x++)
|
||||
|
||||
Reference in new issue
Block a user