bound npcs no longer take damage

This commit is contained in:
ben-tk committed 2021-11-11 11:20:17 -05:00
1 parent 076cdbc21d
commit c273f17eec
2 files changed
+21

No files matched your search

+12
View File
@@ -686,6 +686,16 @@ namespace CalamityMod.NPCs
//NPCID.WanderingEyeFish,
//NPCID.ZombieMerman,
};
public static List<int> BoundNPCIDs = new List<int>
{
NPCID.BoundGoblin,
NPCID.BoundWizard,
NPCID.BoundMechanic,
NPCID.SleepingAngler,
NPCID.BartenderUnconscious,
//NPCID.GolferRescue
};
#endregion
#region Instance Per Entity
@@ -1098,6 +1108,8 @@ namespace CalamityMod.NPCs
RevDeathStatChanges(npc, mod);
OtherStatChanges(npc);
CalamityGlobalTownNPC.BoundNPCSafety(mod, npc);
}
#endregion
+9
View File
@@ -1148,6 +1148,15 @@ namespace CalamityMod.NPCs
#endregion
#region NPC Stat Changes
public static void BoundNPCSafety(Mod mod, NPC npc)
{
// Make Bound Town NPCs take no damage
if (CalamityGlobalNPC.BoundNPCIDs.Contains(npc.type))
{
npc.dontTakeDamageFromHostiles = true;
}
}
public static void MakeTownNPCsTakeMoreDamage(NPC npc, Projectile projectile, Mod mod, ref int damage)
{
if (npc.townNPC && projectile.hostile)