Spellforce-Spell-framework
Toggle main menu visibility
Loading...
Searching...
No Matches
sf_subeffect_hook.c
Go to the documentation of this file.
1
8
9
#include "
../../registry/spell_data_registries/sf_subeffect_registry.h
"
10
#include "
../sf_wrappers.h
"
11
#include "
../sf_hooks.h
"
12
13
#include "
sf_subeffect_hook.h
"
14
15
void
__thiscall
sf_subeffect_hook
(
SF_CGdEffect
*_this, uint16_t effect_id)
16
{
17
uint16_t spell_id =
effectAPI
.getEffectXData(_this, effect_id,
EFFECT_SUBSPELL_ID
);
18
if
(spell_id)
19
{
20
SF_CGdResourceSpell
spell_data;
21
spellAPI
.getResourceSpellData(_this->
SF_CGdResource
, &spell_data, spell_id);
22
sub_effect_handler_ptr
handler =
get_sub_effect_handler
(spell_data.
spell_line_id
);
23
if
(handler != NULL)
24
{
25
uint16_t source_index =
effectAPI
.getEffectXData(_this, effect_id,
EFFECT_ENTITY_INDEX
);
26
log_debug
(
DEBUG_HIGH
,
"Spell line [%d] from figure %d"
, spell_data.
spell_line_id
, source_index);
27
handler(_this, effect_id);
28
}
29
}
30
}
31
spellAPI
SpellFunctions * spellAPI
Definition
TestMod.cpp:11
effectAPI
EffectFunctions effectAPI
Definition
sf_hooks.c:45
sf_subeffect_hook
void __thiscall sf_subeffect_hook(SF_CGdEffect *_this, uint16_t effect_id)
Definition
sf_subeffect_hook.c:15
log_debug
void log_debug(DebugLevel level, const char *format,...)
Definition
sf_wrappers.c:182
sub_effect_handler_ptr
void(__thiscall * sub_effect_handler_ptr)(SF_CGdEffect *, uint16_t effect_index)
Definition
sf_effect_functions.h:13
EFFECT_SUBSPELL_ID
@ EFFECT_SUBSPELL_ID
Definition
sf_general_structures.h:479
EFFECT_ENTITY_INDEX
@ EFFECT_ENTITY_INDEX
Definition
sf_general_structures.h:492
DEBUG_HIGH
@ DEBUG_HIGH
Definition
sf_general_structures.h:40
sf_hooks.h
sf_subeffect_hook.h
get_sub_effect_handler
sub_effect_handler_ptr get_sub_effect_handler(uint16_t spell_line)
Definition
sf_subeffect_registry.cpp:29
sf_subeffect_registry.h
sf_wrappers.h
SF_CGdEffect
Definition
sf_effect_structures.h:22
SF_CGdEffect::SF_CGdResource
SF_CGdResource * SF_CGdResource
Definition
sf_effect_structures.h:31
SF_CGdResourceSpell
Definition
sf_spell_functions.h:7
SF_CGdResourceSpell::spell_line_id
uint16_t spell_line_id
Definition
sf_spell_functions.h:9
src
internal
core
hooks
sf_subeffect_hook.c
Generated by
1.17.0