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

NPC buff immunity porting #2

@direwolf420

Description

@direwolf420

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions