Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_subeffect_registry.cpp
Go to the documentation of this file.
6
7#include "../sf_registry.h"
8#include <map>
9#include <cstdio>
10
11static std::map<uint16_t, sub_effect_handler_ptr> s_sub_effect_handler_map;
12
13void registerSubEffectHandler(uint16_t spell_line,
15{
16 auto check = s_sub_effect_handler_map.find(spell_line);
17 if (check != s_sub_effect_handler_map.end())
18 {
19 char message[256];
20 sprintf(message,
21 "%s (v%s) has replaced a Subeffect Handler [%d] (Was this on purpose?)",
23 log_warning(message);
24 }
25
26 s_sub_effect_handler_map[spell_line] = handler;
27}
28
30{
31 auto it = s_sub_effect_handler_map.find(spell_line);
32 if (it == s_sub_effect_handler_map.end())
33 {
34 // Element doesn't exist, insert the default value
36 "Unknown Job ID for Spell End Effect, Assigning a default handler.");
37 it = s_sub_effect_handler_map.emplace(spell_line,
39 }
40 return it->second;
41}
42
44{
52
55
92}
void log_warning(const char *message)
Definition sf_wrappers.c:81
void(__thiscall * sub_effect_handler_ptr)(SF_CGDEffect *, uint16_t effect_index)
SFMod * g_current_mod
void __thiscall default_sub_effect_handler(SF_CGDEffect *_this, uint16_t effect_index)
void __thiscall common_sub_effect_handler(SF_CGDEffect *_this, uint16_t effect_index)
void __thiscall elemental_sub_effect_handler(SF_CGDEffect *_this, uint16_t effect_index)
void __thiscall elemental_chain_sub_effect_handler(SF_CGDEffect *_this, uint16_t effect_index)
sub_effect_handler_ptr get_sub_effect_handler(uint16_t spell_line)
void registerSubEffectHandler(uint16_t spell_line, sub_effect_handler_ptr handler)
void register_vanilla_sub_effect_handlers()
char mod_id[64]
char mod_version[24]