lib_data function library

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

Description

Functions

data_joinable_dvs action_macro

Returns the array 'sfo_joinable_dvs', in k=>_ form, containing the lowercased dvs of all joinable creatures

data_priest_spells action_macro

Return arrays "sfo_druid_spells" and "sfo_cleric_[alignment]_spells_n", containing the learnable cleric and druid spells of in resref=>level form. [alignment] is each of the nine alignments as presented in align.ids, lowercased. Arrays are ordered from highest to lowest level and from highest-numbered to lowest-numbered spell (this facilitates correctly (or at least intuitively) ordering the learned-spell lists if we use cre_quickset_known_spells).

data_saving_throws action_macro

Read in saving throws for all classes and store in a 3da, in the form $sfo_saves("class" "level" "type")=n

Here type is 'poison','wands','polymorph','breath', or 'spells', and class is lowercased.

data_scroll_resrefs action_macro

Reads in every divine and arcane spell, and stores them like this:

WIZARD_FIREBALL_SCROLL=scrl1g $sfo_arcane_scrolls("WIZARD_FIREBALL")=scrl1g CLERIC_FREE_ACTION_SCROLL=scrl58 $sfo_divine_scrolls("CLERIC_FREE_ACTION")=scrl58

data_spell_resrefs action_macro

Read in every entry in spell.ids and set a variable with that name whose value is the spell resref, and store the data in the sfo_spell_resrefs array

e.g. WIZARD_FIREBALL = SPWI304 $sfo_spell_resrefs("WIZARD_FIREBALL") = SPWI304

Also, for wizard/priest spells, store the spell level in the format

WIZARD_FIREBALL_LEVEL=3

data_spells_by_level action_macro

Read in spell slots for all classes and store in a struct 'sfo_spell_level', in the form

sfo_spell_level_%class%_%level%_%spell_level%"=n (# spells known at level) sfo_spell_level_sl_to_cl_%class%_%level%=n (minimum level at which caster gets spells of this level) sfo_spell_level_cl_to_sl_%class%_%level%=n (maximum level of spells known at caster level) sfo_spell_level_max_%class%=n (max level of spells known)

Internal functions

These should not be called from outside the library itself.

data_internal_scroll_resrefs()=(sfo_arcane_scrolls:a, sfo_divine_scrolls:a) action

data_internal_spell_resrefs()=(sfo_spell_resrefs:a, sfo_spell_levels:a) action

data_joinable_dvs_core()=(sfo_joinable_dvs:a) action

data_priest_spells_core()=(sfo_cleric_lawful_good_spells:a, sfo_cleric_neutral_good_spells:a, sfo_cleric_chaotic_good_spells:a, sfo_cleric_lawful_neutral_spells:a, sfo_cleric_neutral_spells:a, sfo_cleric_chaotic_neutral_spells:a, sfo_cleric_lawful_evil_spells:a, sfo_cleric_neutral_evil_spells:a, sfo_cleric_chaotic_evil_spells:a, sfo_druid_spells:a) action