# lib_spellstyle function library

Dependencies: alter_effect, lib_2da, lib_anon, lib_array, lib_fn, lib_ini, lib_sfo, lib_sugar, lib_tools, lib_ui, resolve_spell

## Description

Library to set up the visual and sound style of a spell to match standard templates.

Styles (at least in the default use) are:

- mage_[school] (e.g., mage_enchantment), though there is no illusion or conjuration school
- cleric_[school], though there is no illusion school
- mage_[type], where type is 'blind_deaf', 'mirror_image', 'spook', 'invisibility', 'detect_illusion', 'antimagic', 'ruby_ray', 'confusion', or 'symbol'

## Public functions

spellstyle_apply_style(arguments:s, style_file:s)=() patch

As a patch function, apply a style to a spell. 'arguments' is the style, 'style_file' contains the style data.

spellstyle_collect_styles(prototypes:s=".../stratagems-inline/spell_style_prototypes.txt", output_loc:s, output:s)=() action

Get the actual styles from a list of prototypes (probably not run in live-distributed code). The default for prototypes is inline in this library.

spellstyle_get_style_data()=(vvc:s, wav:s, glow:s) patch

Get the style data (if any) for the current spell, as defined by its 'vvc' (an actual vvc played by opcode 215, or a lighting type from opcode 141), its wav (played by opcode 174), and its glow (played by opcode 50 or 61).

spellstyle_identify_style(style_file:s)=(style:s) patch

Identify a style for the current spell, using 'style_file' as the list of styles

spellstyle_load_styles(file:s)=(style_vvc:a, style_wav:a, style_glow:a) dimorphic

Load in the data in a style list

spellstyle_update_style(old_style:s, new_style:s)=() patch

Update the currently-being-patched spell's style, and log it as updated.