Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_mod_registry.cpp File Reference
Include dependency graph for sf_mod_registry.cpp:

Go to the source code of this file.

Functions

SFSpell *__thiscall registerSpell (uint16_t spell_id)
 
void __thiscall applySpellTag (SFSpell *spell, SpellTag tag)
 
void __thiscall linkTypeHandler (SFSpell *spell, handler_ptr typeHandler)
 
void __thiscall linkSingleTargetAIHandler (SFSpell *spell, ai_single_handler_ptr handler)
 
void __thiscall linkAvoidanceAIHandler (SFSpell *spell, ai_avoidance_handler_ptr handler)
 
void __thiscall linkAOEAIHandler (SFSpell *spell, ai_aoe_handler_ptr handler)
 
void __thiscall linkOnHitHandler (SFSpell *spell, onhit_handler_ptr onhitHandler, OnHitPhase phase)
 
void __thiscall linkEffectHandler (SFSpell *spell, uint16_t spell_effect_id, handler_ptr effectHandler)
 
void __thiscall linkEndHandler (SFSpell *spell, handler_ptr endHandler)
 
void __thiscall linkSubEffectHandler (SFSpell *spell, sub_effect_handler_ptr handler)
 
void __thiscall linkRefreshHandler (SFSpell *spell, refresh_handler_ptr handler)
 
void __thiscall linkDealDamageHandler (SFSpell *spell, damage_handler_ptr handler, SpellDamagePhase phase)
 
uint16_t __thiscall getSpellTags (uint16_t spell_line_id)
 
void register_mod_spells ()
 Registers the mod spells and performs basic conflict checking.
 

Variables

std::list< SFSpell * > g_internal_spell_list
 

Function Documentation

◆ applySpellTag()

void __thiscall applySpellTag ( SFSpell * spell,
SpellTag tag )

Definition at line 51 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ getSpellTags()

uint16_t __thiscall getSpellTags ( uint16_t spell_line_id)

Definition at line 117 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkAOEAIHandler()

void __thiscall linkAOEAIHandler ( SFSpell * spell,
ai_aoe_handler_ptr handler )

Definition at line 74 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkAvoidanceAIHandler()

void __thiscall linkAvoidanceAIHandler ( SFSpell * spell,
ai_avoidance_handler_ptr handler )

Definition at line 68 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkDealDamageHandler()

void __thiscall linkDealDamageHandler ( SFSpell * spell,
damage_handler_ptr handler,
SpellDamagePhase phase )

Definition at line 109 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkEffectHandler()

void __thiscall linkEffectHandler ( SFSpell * spell,
uint16_t spell_effect_id,
handler_ptr effectHandler )

Definition at line 86 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkEndHandler()

void __thiscall linkEndHandler ( SFSpell * spell,
handler_ptr endHandler )

Definition at line 93 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkOnHitHandler()

void __thiscall linkOnHitHandler ( SFSpell * spell,
onhit_handler_ptr onhitHandler,
OnHitPhase phase )

Definition at line 79 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkRefreshHandler()

void __thiscall linkRefreshHandler ( SFSpell * spell,
refresh_handler_ptr handler )

Definition at line 104 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkSingleTargetAIHandler()

void __thiscall linkSingleTargetAIHandler ( SFSpell * spell,
ai_single_handler_ptr handler )

Definition at line 62 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkSubEffectHandler()

void __thiscall linkSubEffectHandler ( SFSpell * spell,
sub_effect_handler_ptr handler )

Definition at line 98 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ linkTypeHandler()

void __thiscall linkTypeHandler ( SFSpell * spell,
handler_ptr typeHandler )

Definition at line 57 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

◆ register_mod_spells()

void register_mod_spells ( )

Registers the mod spells and performs basic conflict checking.

This function iterates over the g_internal_spell_list and registers each spell by adding it to the spell_id_map and spell_effect_id_map. It checks for conflicts by checking if the spell_id or spell_effect_id is already registered by another mod. If a conflict is detected, an error message is logged. If no conflict is detected, the spell is added to the respective map.

Additionally, it registers the spell type handler, spell effect handler, and spell end handler if the SFSpell struct has a non-null handler pointer.

After registering all the spells, the memory allocated for each spell is freed.

Definition at line 143 of file sf_mod_registry.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerSpell()

SFSpell *__thiscall registerSpell ( uint16_t spell_id)

Definition at line 27 of file sf_mod_registry.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ g_internal_spell_list

std::list<SFSpell *> g_internal_spell_list

Definition at line 25 of file sf_mod_registry.cpp.