tModPorter
tModPorter copied to clipboard
NPC buff immunity porting
1.4 changed the way it declares buff immunity on npcs:
//Don't set immunities like this as of 1.4:
NPC.buffImmune[BuffID.Confused] = true;
immunities are handled via dictionaries through NPCID.Sets.DebuffImmunitySets
which looks like this, in SetStaticDefaults (!):
//Specify the debuffs it is immune to
NPCDebuffImmunityData debuffData = new NPCDebuffImmunityData {
SpecificallyImmuneTo = new int[] {
BuffID.Confused
}
};
NPCID.Sets.DebuffImmunitySets.Add(Type, debuffData);
So it would be necessary to port such statements (most often found in SetDefaults), problematic would be dynamic immunities in AI() (haven't seen anyone do it), or looping through all buff IDs to set it, which I believe is just done through ImmuneToAllBuffsThatAreNotWhips = true now. Detecting this would be a pain I bet.
As an aside, Player.buffImmune is unchanged