lib_immunity function library

Dependencies: lib_2da, lib_anon, lib_array, lib_fn, lib_ini, lib_sfo, lib_struct, lib_sugar, lib_tools

Description

Functions

immunity_effect(permanent:i=1, arguments:s, struct:s)=(struct:a) dimorphic

immunity_effects_load action_macro

Defines the arrays for the immunity_effect function

immunity_find_strings()=(immunity_string_array:a) action

This function gets all the immunity strings - loading them from a premade file if it exists, creating that file otherwise. The file is created with COPY + and so persists even when the component is uninstalled.

The 'create file' version only works in English. It shouldn't be run in distributed code. Make sure it's run ahead of time (on each of BG2, SoD, IWD) to make the files.

Currently EE-only, though wouldn't be difficult to adapt.

immunity_spell(struct:s, arguments:s)=(struct:a) dimorphic

Given a list of spell resrefs, grants (for an item or creature) while-equipped or permanent immunity. On a spell, adds permanent (not just until-death) immunity to target=2 as an ability effect.

Internal functions

These should not be called from outside the library itself.

immunity_spell_helper()=() patch