Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_ai_functions.h
Go to the documentation of this file.
1
12#pragma once
13#include <stdint.h>
14#include <stdbool.h>
16
23typedef struct __attribute__((packed))
24{
25 uint16_t *first;
26 uint16_t *data;
27 uint16_t *post_last;
29
30typedef struct __attribute__((packed))
31{
32 uint32_t *first;
33 uint32_t *data;
34 uint32_t *post_last;
36
44typedef struct __attribute((packed))
45{
46 uint16_t entity_index;
47 uint16_t padding;
48 uint32_t hate_value;
50
57typedef struct __attribute((packed))
58{
59 AutoClass60_data data[500];
60 uint16_t entityCount;
62
71typedef struct __attribute__((packed))
72{
83 void *CGdObject;
85 void *CGdPlayer;
95 uint16_t unkn1;
97 uint16_t unkn2;
99 uint16_t unkn3;
101 uint16_t unkn4;
102 uint32_t unkn5;
108 uint16_t unkn6;
110 uint8_t unkn7;
115 uint32_t unkn_flag1;
126 uint8_t unkn8;
127 uint32_t current_hate;
129 uint8_t unkn_list[0xfa2];
130 uint16_t unkn9;
133 ushort_list_node some_figure_list[2000];
135 ushort_list_node another_figure_list[2000];
136 uint32_t unkn_array[2000];
139 uint16_t unkn10;
143 uint32_t unkn_flag2;
147 uint16_t unkn11;
150 uint8_t unkn12;
151 uint32_t some_ranking;
154 uint8_t unkn13;
155 uint8_t unkn14;
157 uint32_t unkn_flag3;
161
166typedef struct __attribute__((packed))
167{
168 void *vfTable;
172
185DECLARE_FUNCTION(SF_SGtFigureAction *, getTargetAction, SF_CGdFigure *figure,
186 SF_SGtFigureAction *action, uint16_t figure_id);
187
188DECLARE_FUNCTION(SF_SGtFigureAction *, getFigureAction, SF_CGdFigure *figure,
189 SF_SGtFigureAction *action, uint16_t figure_id,
190 uint8_t action_index);
191
202DECLARE_FUNCTION(void, setAICurrentActionRanking,
203 SF_CGdBattleDevelopment *_this, int rank);
204
205DECLARE_FUNCTION(int, getAICurrentActionRanking,
207
208DECLARE_FUNCTION(bool, canFigureDoAction, SF_CGdBattleDevelopment *_this,
210DECLARE_FUNCTION(void, getActionStats, SF_CGdBattleDevelopment *_this,
211 uint16_t *minRange, uint16_t *maxRange,
213
214// May be moved to General if it is used elsewhere
215DECLARE_FUNCTION(bool, isAIVectorEmpty, void *_this);
216DECLARE_FUNCTION(uint16_t **, getAIVectorFirstElement, void *_this,
217 uint16_t **pvalue);
218DECLARE_FUNCTION(uint16_t **, getAIVectorGetCurrent, void *_this,
219 uint16_t **value);
220DECLARE_FUNCTION(int, getAIVectorLength, void *_this);
221DECLARE_FUNCTION(uint16_t, getCastType, void *resource, uint16_t spellID);
222DECLARE_FUNCTION(void *, AC60AddOrGetEntity, void *_autoclass60,
223 uint16_t entity_index);
224DECLARE_FUNCTION(SF_Coord *, getPositionToCastAlly,
225 SF_CGdBattleDevelopment *_this,SF_Coord *param_1,
226 void *std_vector_uint16_t);
227DECLARE_FUNCTION(SF_Coord *, getPositionToCastEnemy,
228 SF_CGdBattleDevelopment *_this,SF_Coord *param_1,
229 void *std_vector_uint16_t);
230
231DECLARE_FUNCTION(bool, isUnknownWorldFeature, SF_CGdWorldToolBox *,
232 uint16_t figure_index, SF_Coord * param2, SF_Coord *param3,
233 uint32_t param4, SF_Coord * param5, uint16_t param6);
234
uint16_t **(__thiscall * getAIVectorFirstElement_ptr)(void *_this, uint16_t **pvalue)
SF_Coord *(__thiscall * getPositionToCastEnemy_ptr)(SF_CGdBattleDevelopment *_this, SF_Coord *param_1, void *std_vector_uint16_t)
bool(__thiscall * isUnknownWorldFeature_ptr)(SF_CGdWorldToolBox *, uint16_t figure_index, SF_Coord *param2, SF_Coord *param3, uint32_t param4, SF_Coord *param5, uint16_t param6)
void(__thiscall * setAICurrentActionRanking_ptr)(SF_CGdBattleDevelopment *_this, int rank)
Sets the ranking of the current action for AI decision-making.
bool(__thiscall * canFigureDoAction_ptr)(SF_CGdBattleDevelopment *_this, SF_SGtFigureAction *action)
int(__thiscall * getAICurrentActionRanking_ptr)(SF_CGdBattleDevelopment *_this)
SF_SGtFigureAction *(__thiscall * getTargetAction_ptr)(SF_CGdFigure *figure, SF_SGtFigureAction *action, uint16_t figure_id)
Retrieves the target action for a specific figure.
SF_Coord *(__thiscall * getPositionToCastAlly_ptr)(SF_CGdBattleDevelopment *_this, SF_Coord *param_1, void *std_vector_uint16_t)
int(__thiscall * getAIVectorLength_ptr)(void *_this)
uint16_t(__thiscall * getCastType_ptr)(void *resource, uint16_t spellID)
bool(__thiscall * isAIVectorEmpty_ptr)(void *_this)
void *(__thiscall * AC60AddOrGetEntity_ptr)(void *_autoclass60, uint16_t entity_index)
uint16_t **(__thiscall * getAIVectorGetCurrent_ptr)(void *_this, uint16_t **value)
SF_SGtFigureAction *(__thiscall * getFigureAction_ptr)(SF_CGdFigure *figure, SF_SGtFigureAction *action, uint16_t figure_id, uint8_t action_index)
void(__thiscall * getActionStats_ptr)(SF_CGdBattleDevelopment *_this, uint16_t *minRange, uint16_t *maxRange, SF_CGdResourceSpell *spellData)
Group of Structures and Enums used throught SFSF.
#define DECLARE_FUNCTION(type, name,...)
Declares a function with the specified return type, name, and arguments.
Group of functions related to AI manipulation.
getCastType_ptr getCastType
setAICurrentActionRanking_ptr setAICurrentActionRanking
sets the ranking of the AI's current selected action
getPositionToCastAlly_ptr getPositionToCastAlly
getPositionToCastEnemy_ptr getPositionToCastEnemy
getAICurrentActionRanking_ptr getAICurrentActionRanking
isAIVectorEmpty_ptr isAIVectorEmpty
isUnknownWorldFeature_ptr isUnknownWorldFeature
getAIVectorFirstElement_ptr getAIVectorFirstElement
getTargetAction_ptr getTargetAction
getAIVectorGetCurrent_ptr getAIVectorGetCurrent
canFigureDoAction_ptr canFigureDoAction
getActionStats_ptr getActionStats
getAIVectorLength_ptr getAIVectorLength
getFigureAction_ptr getFigureAction
AC60AddOrGetEntity_ptr AC60AddOrGetEntity
Stores data related to a specific entity in the AI system.
Holds a list of entities with associated data and an entity count.
uint16_t entityCount
The main structure for handling AI battle data.
uint32_t figures_missing_hp
SF_SGtFigureAction current_action
uint32_t action_is_siege_aura
SF_CGdBuilding * CGdBuilding
AutoClass60 building_ally
uint32_t current_figure_has_amok
uint32_t figure_is_charmed_summon_maybe
SF_CGdTargetData current_source_maybe
SF_CGdTargetData unknown_target
uint32_t current_figure_is_hero
SF_CGdTargetData current_target
uint32_t current_figure_has_owner
uint32_t current_figure_noaggroattack
uint16_t current_action_min_rng
uint32_t manual_hit_target_maybe
uint32_t current_figure_is_not_mainchar_or_hero
uint32_t current_target_level_possibly
uint32_t current_figure_is_pet
uint32_t current_figure_is_tower
uint32_t can_be_target_maybe
SF_Coord current_figure_pos
uint32_t current_figure_is_mainchar
SF_CGdFigureToolbox * CGdFigureToolBox
SF_CGdFigure * CGdFigure
AutoClass60 ally_figures
SF_CGdFigureJobs * CGdFigureJobs
uint32_t current_figure_is_aggroed
SF_CGdSpell * CGdSpell
AutoClass60 building_not_ally
SF_Coord current_figure_target_position
uint8_t current_figure_sight_range_maybe
SF_CGdWorld * CGdWorld
uint32_t current_figure_has_aggro
uint32_t current_figure_is_warrior
uint32_t something_related_to_ranking
uint16_t current_action_max_rng
AutoClass60 enemy_figures
uint8_t current_figure_target_type
uint16_t current_figure_target_index
uint32_t current_figure_has_demoralization
uint16_t current_figure_master
uint32_t force_process_figure_maybe
ushort_list_node unkn_node
uint32_t current_figure_is_combat_involved_maybe
SF_CGdWorldToolBox * CGdWorldToolBox
High-level structure managing AI battle development.
A structure for the global list of figures and related statistics for them.
uint32_t * post_last
Represents a node in a list of unsigned short values.