Spellforce-Spell-framework
Loading...
Searching...
No Matches
src
internal
core
hooks
sf_spelleffect_hook.c
Go to the documentation of this file.
1
9
#include "
../sf_wrappers.h
"
10
#include "
../sf_hooks.h
"
11
#include "
../../registry/spell_data_registries/sf_spelleffect_registry.h
"
12
#include "
sf_spelleffect_hook.h
"
13
14
void
__thiscall
sf_spelleffect_hook
(
SF_CGdSpell
*_this)
15
{
16
uint16_t spell_index;
17
for
(spell_index = 1; spell_index <= _this->
max_used
; ++spell_index)
18
{
19
if
(_this->
active_spell_list
[spell_index].
spell_id
!= 0)
20
{
21
short
to_do_count =
22
_this->
active_spell_list
[spell_index].
to_do_count
;
23
if
(to_do_count <= 0)
24
{
25
to_do_count = 0;
26
}
27
else
28
{
29
to_do_count = to_do_count + -1;
30
}
31
_this->
active_spell_list
[spell_index].
to_do_count
= to_do_count;
32
if
(to_do_count == 0)
33
{
34
uint16_t spell_job =
35
_this->
active_spell_list
[spell_index].
spell_job
;
36
handler_ptr
func =
get_spell_effect
(spell_job);
37
if
(func != NULL)
38
{
39
func(_this, spell_index);
40
}
41
}
42
}
43
}
44
}
45
sf_spelleffect_hook
void __thiscall sf_spelleffect_hook(SF_CGdSpell *_this)
Definition
sf_spelleffect_hook.c:14
sf_hooks.h
handler_ptr
void(__thiscall * handler_ptr)(SF_CGdSpell *, uint16_t)
Definition
sf_registration_functions.h:15
sf_spelleffect_hook.h
get_spell_effect
handler_ptr get_spell_effect(uint16_t spell_job)
Definition
sf_spelleffect_registry.cpp:26
sf_spelleffect_registry.h
sf_wrappers.h
SF_CGdSpell
Definition
sf_general_structures.h:512
SF_CGdSpell::active_spell_list
SF_GdSpell active_spell_list[800]
Definition
sf_general_structures.h:535
SF_CGdSpell::max_used
uint16_t max_used
Definition
sf_general_structures.h:534
SF_GdSpell::to_do_count
uint16_t to_do_count
Definition
sf_general_structures.h:389
SF_GdSpell::spell_job
uint16_t spell_job
Definition
sf_general_structures.h:392
SF_GdSpell::spell_id
uint16_t spell_id
Definition
sf_general_structures.h:390
Generated by
1.12.0