22 uint16_t target_index,
52 uint16_t target_index,
65 uint16_t target_index,
86 uint16_t target_index,
99 uint16_t manacost = (spell_data->
mana_cost * 7) / 2;
120 uint16_t target_index,
154 uint16_t target_index,
168 uint16_t manacost = (spell_data->
mana_cost * 7) / 2;
190 uint16_t target_index,
210 uint16_t manacost = (spell_data->
mana_cost * 7) / 2;
215 uint16_t best_target = 0;
216 uint16_t subspell_id = spell_data->
params[6];
219 uint16_t healing_amount = sub_spell_data.
params[0];
225 best_target = figure_id;
229 if (best_target == 0)
244 uint16_t target_index,
270 uint16_t manacost = (spell_data->
mana_cost * 7) / 2;
289 uint16_t target_index,
302 uint8_t figure_count = 0;
306 uint16_t ally_index =
314 if (figure_count > 3)
319 if (figure_count < 3)
332 uint16_t target_index,
348 uint16_t target_index,
385 uint16_t target_index,
397 uint16_t manacost = (spell_data->
mana_cost * 3) / 2;
412 uint16_t target_index, uint16_t spell_line,
423 uint8_t figure_count = 0;
436 if (figure_count > 2)
441 if (figure_count < 2)
450 uint16_t target_index,
475 uint16_t target_index,
488 target_index) > (100 - spell_data->
params[0]))
497 uint16_t target_index,
511 uint16_t figures_count = 0;
515 uint16_t ally_index =
537 if (figures_count < 3)
546 uint16_t target_index,
561 if (percent > (100 - spell_data->
params[1]))
570 uint16_t target_index,
584 iteratorAPI.figureIteratorInit(&iter, 0, 0, 0x3ff, 0x3ff);
598 bool should_use =
false;
599 uint16_t figure_id =
iteratorAPI.getNextFigure(&iter);
600 while (figure_id != 0)
630 uint16_t target_index,
638 uint16_t target_index,
647 uint16_t target_index,
656 if ((max_mana / 2 < current_mp) && (current_health < max_health))
658 if (current_health == 0)
670 rank = (current_health * 2 - max_health) / (max_health * max_health);
682 uint16_t target_index,
688 uint16_t list_length = ((uint32_t)node.
data - (uint32_t)node.
first) >> 1;
705 uint16_t target_index,
712 uint16_t threshold = spell_data->
params[0];
745 uint16_t target_index,
756 uint16_t healing_amount = 0;
763 uint32_t *list_first;
764 uint32_t *list_current;
766 uint32_t list_length = ((uint32_t)some_list.data - (uint32_t)some_list.first) >> 2;
767 if (list_length != 0)
769 list_first = some_list.first;
770 list_current = some_list.data;
771 while (list_current != list_first)
773 healing_amount += spell_data->
params[0];
777 if (current_health + healing_amount < max_health)
779 if (current_health == 0)
785 if (((max_health * 9) / 10 < current_health + healing_amount) ||
786 (current_health + healing_amount < max_health / 10))
799 uint16_t target_index, uint16_t spell_line,
816 uint16_t target_index,
837 uint16_t target_index,
844 if (current_health < max_health)
858 uint16_t target_index,
872 uint16_t target_index, uint16_t spell_line,
885 uint16_t target_index,
904 uint16_t target_index,
920 uint16_t target_index, uint16_t spell_line,
933 uint16_t target_index,
946 uint16_t target_index,
954 if (current_mp <= (uint16_t)((max_mana * 95) / 100))
958 if ((target_max_mana / 10) > target_mana)
971 uint16_t target_index,
984 uint16_t target_index,
999 uint16_t target_index,
1000 uint16_t spell_line,
1012 uint16_t target_index,
1013 uint16_t spell_line,
1028 uint16_t target_index,
1029 uint16_t spell_line,
1033 bool hasAura =
false;
1058 uint16_t target_index,
1059 uint16_t spell_line,
1063 bool hasAura =
false;
1089 uint16_t target_index,
1090 uint16_t spell_line,
1097 uint16_t target_index,
1098 uint16_t spell_line,
1111 uint16_t target_index,
1112 uint16_t spell_line,
1132 uint16_t target_index,
1133 uint16_t spell_line,
SpellFunctions * spellAPI
FigureFunctions * figureAPI
ToolboxFunctions * toolboxAPI
IteratorFunctions iteratorAPI
uint32_t __thiscall getDistance(SF_Coord *pointA, SF_Coord *pointB)
uint32_t __thiscall cure_disease_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall hallow_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall berserk_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall shields_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall death_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall fireburst_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall disenchant_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall manatap_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall RCA_ability_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall amok_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall dominate_animal_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall hypnotize_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall lifetap_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall do_not_cast_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall dispel_white_aura_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall befriend_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall healing_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall tower_extinct_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall shift_life_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall death_grasp_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall demoralization_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall charm_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall freeze_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall summon_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall riposte_ability_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall default_support_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall dominate_undead_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall cure_poison_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall dispel_black_aura_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall sacrifice_mana_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall offensive_aura_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall HCA_ability_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall illusion_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall critical_hits_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall wave_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall dominate_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall petrify_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall defensive_aura_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall blessing_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall healing_aura_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall extinct_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall benefactions_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall default_offensive_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall confuse_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
uint32_t __thiscall aura_light_ai_handler(SF_CGdBattleDevelopment *_this, uint16_t target_index, uint16_t spell_line, SF_CGdResourceSpell *spell_data)
@ kGdSpellLineDispelWhiteAura
@ kGdSpellLineDispelBlackAura
EntityPriorityList ally_figures
uint32_t figures_missing_hp
SF_CGdTargetData current_source_maybe
uint32_t current_target_level_possibly
SF_Coord current_figure_pos
EntityPriorityList enemy_figures
SF_CGdFigureToolbox * CGdFigureToolBox
ushort_list_node another_figure_list[2000]
SF_CGdWorldToolBox * CGdWorldToolBox
EntityPriorityList_data data[500]
High-level structure managing AI battle development.
CGdAIBattleData battleData
uint8_t skill_requirements[12]
SF_world_unkn_2 cells[1048576]
Represents a node in a list of unsigned short values.