Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

NPC buff immunity porting #2

Open
direwolf420 opened this issue Jan 29, 2021 · 0 comments
Open

NPC buff immunity porting #2

direwolf420 opened this issue Jan 29, 2021 · 0 comments

Comments

@direwolf420
Copy link

direwolf420 commented Jan 29, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant