Spellforce-Spell-framework
|
#include "sf_mod_registry.h"
#include "spell_data_registries/sf_spelltype_registry.h"
#include "spell_data_registries/sf_spelleffect_registry.h"
#include "spell_data_registries/sf_spellend_registry.h"
#include "spell_data_registries/sf_subeffect_registry.h"
#include "spell_data_registries/sf_spellrefresh_registry.h"
#include "spell_data_registries/sf_onhit_registry.h"
#include "spell_data_registries/sf_spelldamage_registry.h"
#include "ai_data_registries/sf_ai_aoe_registry.h"
#include "ai_data_registries/sf_ai_avoidance_registry.h"
#include "ai_data_registries/sf_ai_single_target_registry.h"
#include <windows.h>
#include <iostream>
#include <map>
#include <list>
#include <cstdint>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
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 |
uint16_t __thiscall getSpellTags | ( | uint16_t | spell_line_id | ) |
void __thiscall linkAOEAIHandler | ( | SFSpell * | spell, |
ai_aoe_handler_ptr | handler ) |
void __thiscall linkAvoidanceAIHandler | ( | SFSpell * | spell, |
ai_avoidance_handler_ptr | handler ) |
void __thiscall linkDealDamageHandler | ( | SFSpell * | spell, |
damage_handler_ptr | handler, | ||
SpellDamagePhase | phase ) |
void __thiscall linkEffectHandler | ( | SFSpell * | spell, |
uint16_t | spell_effect_id, | ||
handler_ptr | effectHandler ) |
void __thiscall linkEndHandler | ( | SFSpell * | spell, |
handler_ptr | endHandler ) |
void __thiscall linkOnHitHandler | ( | SFSpell * | spell, |
onhit_handler_ptr | onhitHandler, | ||
OnHitPhase | phase ) |
void __thiscall linkRefreshHandler | ( | SFSpell * | spell, |
refresh_handler_ptr | handler ) |
void __thiscall linkSingleTargetAIHandler | ( | SFSpell * | spell, |
ai_single_handler_ptr | handler ) |
void __thiscall linkSubEffectHandler | ( | SFSpell * | spell, |
sub_effect_handler_ptr | handler ) |
void __thiscall linkTypeHandler | ( | SFSpell * | spell, |
handler_ptr | typeHandler ) |
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.
SFSpell *__thiscall registerSpell | ( | uint16_t | spell_id | ) |
std::list<SFSpell *> g_internal_spell_list |
Definition at line 25 of file sf_mod_registry.cpp.