bound npcs no longer take damage
This commit is contained in:
1 parent
076cdbc21d
commit
c273f17eec
2 files changed
+21
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user