31static uint8_t getRacialSmallHQ(uint8_t race)
61 SF_Coord *ranges, uint8_t walk_mode, uint32_t param5);
67 uint8_t resource_type,
70typedef void (__thiscall *
AC65_FUN_0074caf0_ptr)(
void *autoclass65, uint16_t owner, uint16_t resource, uint16_t amount);
73typedef uint32_t *(*getGlobalAC65_ptr)(void);
101static void setupWalkToMonument(
SF_CGdFigureJobs *_this, uint16_t figure_id, uint16_t monument_id)
118 uint8_t target_building_type = 0;
119 uint16_t target_building = 0;
124 target_building_type = getRacialSmallHQ(race);
125 if (target_building_type != 0)
129 target_building_type,
136 target_building_type =
buildingAPI.getRacialSawmill(race);
137 if (target_building_type != 0)
143 target_building_type,
147 if (target_building != 0)
155 uint16_t monument_id, unused;
157 if (monument_id == 0)
159 figureAPI.setJob(_this, figure_id, job_id);
162 figureAPI.prepareJobTransition(_this, figure_id, job_id, target_job);
164 figureAPI.onStartJob(_this, figure_id, target_job);
165 setupWalkToMonument(_this, figure_id, monument_id);
173 figureAPI.prepareJobTransition(_this, figure_id, job_id, target_job);
175 figureAPI.onStartJob(_this, figure_id, target_job);
183 figureAPI.setFigureWalkPos(_this, figure_id, &walk_pos, 0, 1);
192 uint8_t target_building_type = 0;
193 uint16_t target_building = 0;
198 target_building_type = getRacialSmallHQ(race);
199 if (target_building_type != 0)
203 target_building_type,
217 target_building_type =
buildingAPI.getRacialSmelter(race);
218 if (target_building_type != 0)
226 pos, target_building_type,
231 if (target_building != 0)
239 uint16_t monument_id, unused;
241 if (monument_id == 0)
243 figureAPI.setJob(_this, figure_id, job_id);
246 figureAPI.prepareJobTransition(_this, figure_id, job_id, target_job);
248 figureAPI.onStartJob(_this, figure_id, target_job);
249 setupWalkToMonument(_this, figure_id, monument_id);
257 figureAPI.prepareJobTransition(_this, figure_id, job_id, target_job);
259 figureAPI.onStartJob(_this, figure_id, target_job);
267 figureAPI.setFigureWalkPos(_this, figure_id, &walk_pos, 0, 1);
276 uint8_t target_building_type = 0;
277 uint16_t target_building = 0;
282 target_building_type = getRacialSmallHQ(race);
283 if (target_building_type != 0)
287 target_building_type,
294 target_building_type =
buildingAPI.getRacialStonecutter(race);
295 if (target_building_type != 0)
301 target_building_type,
305 if (target_building != 0)
313 uint16_t monument_id, unused;
315 if (monument_id == 0)
317 figureAPI.setJob(_this, figure_id, job_id);
320 figureAPI.prepareJobTransition(_this, figure_id, job_id, target_job);
322 figureAPI.onStartJob(_this, figure_id, target_job);
323 setupWalkToMonument(_this, figure_id, monument_id);
331 figureAPI.prepareJobTransition(_this, figure_id, job_id, target_job);
333 figureAPI.onStartJob(_this, figure_id, target_job);
341 figureAPI.setFigureWalkPos(_this, figure_id, &walk_pos, 0, 1);
347 uint8_t resource_type, uint8_t amount)
357 uint8_t resource_type = 0;
388 bool side = ((race != 3) && (race != 2) && (race != 1));
RegistrationFunctions * registrationAPI
SpellFunctions * spellAPI
FigureFunctions * figureAPI
ToolboxFunctions * toolboxAPI
void __thiscall sf_endspell_hook(SF_CGdSpell *_this, uint16_t spell_index)
EffectFunctions effectAPI
IteratorFunctions iteratorAPI
BuildingFunctions buildingAPI
int AddrOf(int offset)
returns "real" virtual address of given memory offset
getGlobalAC65_ptr getGlobalAC65
uint32_t *(* getGlobalAC65_ptr)(void)
@ kGdJobWoodCutterWalkHome
@ kGdJobStoneMinerWalkHome
@ kGdJobWoodCutterWalkToDeliverGood
@ kGdJobCarpenterSearchForWork
@ kGdJobStoneMinerWalkToDeliverGood
@ kGdJobMinerWalkToDeliverGood
@ WORKER_HOST_BUILDING_POS_Y
@ WORKER_HOST_BUILDING_POS_X
@ WORKER_DELIVERY_BUILDING
@ kGdSpellLineInvisibility
getObjectQueue_ptr getObjectQueue
bool __thiscall onWoodcutterFinishJob(SF_CGdFigureJobs *_this, uint16_t figure_id)
getGlobalAC65_ptr getGlobalAC65
bool __thiscall onMinerFinishJob(SF_CGdFigureJobs *_this, uint16_t figure_id)
void __thiscall onCarpenterFinishJob(SF_CGdFigureJobs *_this, uint16_t figure_id)
void terminate_job_spells(SF_CGdFigureJobs *_this, uint16_t figure_id)
void initialize_worker_logic_data_hooks()
void(__thiscall * startWalkingTo_ptr)(SF_CGdFigureJobs *_this, uint16_t figure_id, SF_CGdTargetData *target, SF_Coord *ranges, uint8_t walk_mode, uint32_t param5)
void(__thiscall * AC65_FUN_0074caf0_ptr)(void *autoclass65, uint16_t owner, uint16_t resource, uint16_t amount)
addResource_ptr addResource
AC65_FUN_0074caf0_ptr AC65_FUN_0074caf0
void(__thiscall * doArtisanAnimation_ptr)(SF_CGdFigureJobs *_this, uint16_t figure_id)
doArtisanAnimation_ptr doArtisanAnimation
void(__thiscall * AC30_FUN_006c3880_ptr)(void *autoclass30, uint16_t figure_id, uint8_t resource, uint16_t amount)
bool __thiscall onStoneMinerFinishJob(SF_CGdFigureJobs *_this, uint16_t figure_id)
startWalkingTo_ptr startWalkingTo
addToObjectQueue_ptr addToObjectQueue
void __thiscall update_owner_resources(SF_CGdFigureJobs *_this, uint16_t owner, uint16_t figure_id, uint8_t resource_type, uint8_t amount)
AC30_FUN_006c3880_ptr AC30_FUN_006c3880
uint32_t(__thiscall * addResource_ptr)(SF_CGdPlayer *_this, uint16_t player_id, bool isLight, uint8_t resource_type, uint32_t amount)
void(__thiscall * addToObjectQueue_ptr)(uint32_t *_this, uint16_t figure_index)
uint32_t *(__thiscall * getObjectQueue_ptr)(void *CGdObject, uint16_t object_index)
Group of functions related to AI manipulation.
Group of functions related to Effect manipulation.
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...
GdBuilding buildings[1000]
Represents a collection of function pointers for managing spell-related operations.