Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_hooks.h
Go to the documentation of this file.
1#ifndef HOOKS_H
2#define HOOKS_H
3
4#include "../../api/sfsf.h"
5#include "../../asi/sf_asi.h"
7
8#define DEFINE_FUNCTION(group, name, address) \
9 name ## _ptr name = (name ## _ptr)(ASI::AddrOf(address)); \
10 group ## API.name = name;
11
12#define INCLUDE_FUNCTION(group, name, pointer) \
13 group ## API.name = pointer;
14
22extern AiFunctions aiAPI;
23extern UiFunctions uiAPI;
24
25extern SFBuilding *__thiscall registerBuilding(uint8_t building_type);
26extern void __thiscall linkBuildingDoneHandler (SFBuilding *building, building_done_handler_ptr handler);
27extern void __thiscall linkBuildingJSON(SFBuilding *building, const char *building_json_name);
28extern void __thiscall linkBuildingEntryHandler (SFBuilding *building, building_entry_handler_ptr handler);
29extern void __thiscall applyBuildingTag(SFBuilding *spell, BuildingTag tag);
30
31extern SFSpell *__thiscall registerSpell(uint16_t spell_id);
32extern void __thiscall applySpellTag(SFSpell *spell, SpellTag tag);
33extern void __thiscall linkTypeHandler(SFSpell *spell, handler_ptr typeHandler);
34extern void __thiscall linkEffectHandler(SFSpell *spell, uint16_t spell_effect_id, handler_ptr effectHandler);
35extern void __thiscall linkEndHandler(SFSpell *spell, handler_ptr endHandler);
36extern void __thiscall linkSubEffectHandler(SFSpell *spell, sub_effect_handler_ptr handler);
37extern void __thiscall linkRefreshHandler(SFSpell *spell, refresh_handler_ptr handler);
38extern void __thiscall linkDealDamageHandler(SFSpell *spell, damage_handler_ptr handler, SpellDamagePhase phase);
39extern void __thiscall linkOnHitHandler(SFSpell *spell, onhit_handler_ptr handler, OnHitPhase phase);
40extern void __thiscall linkSingleTargetAIHandler(SFSpell *spell, ai_single_handler_ptr handler);
41extern void __thiscall linkAOEAIHandler(SFSpell *spell, ai_aoe_handler_ptr handler);
42extern void __thiscall linkAvoidanceAIHandler(SFSpell *spell, ai_avoidance_handler_ptr handler);
43extern void __thiscall linkPhysRainHandler(SFSpell *spell, sub_effect_handler_ptr handler);
44extern void __thiscall linkPhysEffectHandler(SFSpell *spell, phys_effect_handler_ptr handler);
45extern void __thiscall linkEnchantChanceHandler(SFSpell *spell, enchant_handler_ptr handler);
46
47extern SFMod *createModInfo(const char *mod_id, const char *mod_version, const char *mod_author,
48 const char *mod_description);
49
52#endif
RegistrationFunctions * registrationAPI
Definition TestMod.cpp:14
SpellFunctions * spellAPI
Definition TestMod.cpp:11
FigureFunctions * figureAPI
Definition TestMod.cpp:13
ToolboxFunctions * toolboxAPI
Definition TestMod.cpp:12
void initialize_data_hooks()
Used to initialize all disparate hooks in one place.
Definition sf_hooks.c:61
EffectFunctions effectAPI
Definition sf_hooks.c:45
void initialize_beta_hooks()
Definition sf_hooks.c:874
UiFunctions uiAPI
Definition sf_hooks.c:50
IteratorFunctions iteratorAPI
Definition sf_hooks.c:49
BuildingFunctions buildingAPI
Definition sf_hooks.c:47
AiFunctions aiAPI
Definition sf_hooks.c:51
void(__thiscall * sub_effect_handler_ptr)(SF_CGdEffect *, uint16_t effect_index)
void __thiscall applyBuildingTag(SFBuilding *spell, BuildingTag tag)
void __thiscall linkAOEAIHandler(SFSpell *spell, ai_aoe_handler_ptr handler)
void __thiscall linkEndHandler(SFSpell *spell, handler_ptr endHandler)
SFBuilding *__thiscall registerBuilding(uint8_t building_type)
void __thiscall linkDealDamageHandler(SFSpell *spell, damage_handler_ptr handler, SpellDamagePhase phase)
void __thiscall applySpellTag(SFSpell *spell, SpellTag tag)
void __thiscall linkTypeHandler(SFSpell *spell, handler_ptr typeHandler)
void __thiscall linkEnchantChanceHandler(SFSpell *spell, enchant_handler_ptr handler)
void __thiscall linkPhysEffectHandler(SFSpell *spell, phys_effect_handler_ptr handler)
void __thiscall linkRefreshHandler(SFSpell *spell, refresh_handler_ptr handler)
void __thiscall linkEffectHandler(SFSpell *spell, uint16_t spell_effect_id, handler_ptr effectHandler)
void __thiscall linkSingleTargetAIHandler(SFSpell *spell, ai_single_handler_ptr handler)
void __thiscall linkBuildingJSON(SFBuilding *building, const char *building_json_name)
void __thiscall linkAvoidanceAIHandler(SFSpell *spell, ai_avoidance_handler_ptr handler)
void __thiscall linkOnHitHandler(SFSpell *spell, onhit_handler_ptr handler, OnHitPhase phase)
void __thiscall linkBuildingDoneHandler(SFBuilding *building, building_done_handler_ptr handler)
SFMod * createModInfo(const char *mod_id, const char *mod_version, const char *mod_author, const char *mod_description)
void __thiscall linkPhysRainHandler(SFSpell *spell, sub_effect_handler_ptr handler)
void __thiscall linkSubEffectHandler(SFSpell *spell, sub_effect_handler_ptr handler)
SFSpell *__thiscall registerSpell(uint16_t spell_id)
void __thiscall linkBuildingEntryHandler(SFBuilding *building, building_entry_handler_ptr handler)
void(__thiscall * building_done_handler_ptr)(SF_CGdBuildingToolbox *_this, uint16_t building_index)
uint16_t(__thiscall * phys_effect_handler_ptr)(SF_CGdEffect *_this, uint16_t source, uint16_t target, bool *isSpellDamage, uint16_t damage)
uint16_t(__thiscall * damage_handler_ptr)(SF_CGdFigureToolbox *_toolbox, uint16_t source, uint16_t target, uint16_t current_damage, uint16_t is_spell_damage, uint32_t is_ranged_damage, uint16_t spell_id)
uint32_t(__thiscall * ai_single_handler_ptr)(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t(__thiscall * ai_aoe_handler_ptr)(SF_CGdBattleDevelopment *_this, SF_Coord *position, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
void(__thiscall * building_entry_handler_ptr)(SF_CGdFigureJobs *_this, uint16_t figure_id, uint16_t building_id)
uint16_t(__thiscall * enchant_handler_ptr)(SF_CGdFigure *_this, uint16_t figure_id)
uint32_t(__thiscall * ai_avoidance_handler_ptr)(CGdAIBattleData *_this, uint16_t figure_index, uint16_t spell_line)
uint16_t(__thiscall * onhit_handler_ptr)(SF_CGdFigureJobs *, uint16_t source, uint16_t target, uint16_t damage)
int(__thiscall * refresh_handler_ptr)(SF_CGdSpell *, uint16_t)
Definition sfsf.h:31
void(__thiscall * handler_ptr)(SF_CGdSpell *, uint16_t)
Definition sfsf.h:30
Group of functions related to AI manipulation.
Group of functions related to Effect manipulation.
Group of functions to manipulate the behavior and statistics of the game figures (units).
Group of functions related to Iteration, Often used for AOE or Chain Like Spells.
A structure dedicated to the registration of spells This structure holds functions that are used to c...
Represents a collection of function pointers for managing spell-related operations.
Holds most of the Toolbox Functions relevent for custom spells. Includes functions for the manipulati...
Group of functions related to UI manipulation.