# ui_ranger_favored_enemy function library

Dependencies: alter_effect, ds, lib_2da, lib_2daq, lib_anon, lib_array, lib_class, lib_cre, lib_data, lib_eff, lib_fn, lib_ids, lib_ietool, lib_ini, lib_kit, lib_script, lib_sfo, lib_spl, lib_splconv, lib_ssl, lib_struct, lib_sugar, lib_tools, lib_ui, lib_vtable, resolve_spell, ui_add_subraces, ui_bonus_spells, ui_deolvynize, ui_detect_class_kit, ui_dual_class_kits, ui_externalize_hlas, ui_externalize_proficiencies, ui_extra_spells, ui_on_open, ui_shared_code, ui_spell_system, ui_system_call, ui_virtual_class

## Description

This library externalizes the ranger favored (i.e., 'racial') enemy system to the UI. This achives two things: firstly, it lets us re-select the favored enemy at subsequent levels, and secondly, it allows multiple races to be included in a single favored-enemy selection.

## Public functions

process_favored_enemy_ini(file:s, location:s, locbase:s, path:s)=() action

Process an ini file identifying various ranger favored enemies, in SFO's format. The format is a series of blocks like:
[SKELETAL_UNDEAD]
race=LICH,DEMILICH
primary_race=SKELETON
name=3
desc=4

Here: SKELETAL_UNDEAD is an internal identifier. 'primary_race' is the race that actually gets set as a favored enemy in the game engine. 'race' is a comma-separated list of other races that SFO fakes up as additional favored enemies. 'name' and 'desc' are TRA references to the name and description of the favored enemy as shown on the selection screen.

rechoose_ranger_favored_enemy(levels:s)=() action

Given a space-separated list of numbers, allow rangers to rechoose their favored enemy at every level in the list.

## Internal functions

These should not be called from outside the library itself.

build_favored_enemy_applicator_spells()=() action

build_favored_enemy_menu()=() action

clear_out_haterace()=() action

define_favored_enemy_effect(id:i=1, hit:i=4, damage:i=4, name:i, desc:i, spell:s, race:s, class:s, general:s, label:s)=() action

externalize_haterace()=() action

sort_haterace()=() action

ui_ranger_favored_enemy_setup()=() action