Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_building_done_handlers.cpp
Go to the documentation of this file.
3
4void __thiscall default_done_handler (SF_CGdBuildingToolbox *_this,uint16_t building_index)
5{
6 return;
7}
8
9// woodcutters, quaries, farms. BUT NOT MINES?!
10void __thiscall multiworker_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
11{
12 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::BUILDING_POSITION_X,
13 _this->CGdBuilding->buildings[building_index].position.X);
14 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::BUILDING_POSITION_Y,
15 _this->CGdBuilding->buildings[building_index].position.Y);
16}
17
18//resource doubling stuff: foodstores, smelteries, stonecutters, sawmills
19void __thiscall singleworker_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
20{
21 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::BUILDING_QUEUE_COUNT, 0);
22 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::BUILDING_ANIM_START, 0);
23 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::BUILDING_ANIM_LENGTH, 0);
24}
25
26void __thiscall breeder_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
27{
28 //it has different meaning in context of buildings. IDK which
29 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::SPELL_TICK_COUNT_AUX, 0);
30 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::SPELL_PESTILENCE_DAMAGE, 0);
31}
32
33void __thiscall army_worker_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
34{
35 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::SPELL_PESTILENCE_DAMAGE, 0);
36}
37
38void __thiscall human_crossbow_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
39{
40 buildingAPI.attachTowerUnit(_this, building_index, 0x341);
41}
42
43void __thiscall human_white_hand_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
44{
45 buildingAPI.attachTowerUnit(_this, building_index, 0x33a);
46}
47
48void __thiscall elf_archer_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
49{
50 buildingAPI.attachTowerUnit(_this, building_index, 0x342);
51}
52
53void __thiscall elf_frostbringer_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
54{
55 buildingAPI.attachTowerUnit(_this, building_index, 0x339);
56}
57
58void __thiscall orc_firestarter_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
59{
60 buildingAPI.attachTowerUnit(_this, building_index, 0x48f);
61}
62
63void __thiscall troll_stonethrower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
64{
65 buildingAPI.attachTowerUnit(_this, building_index, 0x550);
66}
67
68void __thiscall norcaine_sorcery_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
69{
70 buildingAPI.attachTowerUnit(_this, building_index, 0x54e);
71}
72
73void __thiscall norcaine_mindbreaker_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
74{
75 buildingAPI.attachTowerUnit(_this, building_index, 0x528);
76 SF_CGdTargetData source;
77 source.entity_index = building_index;
78 source.entity_type = 2;
79 source.position = {0,0};
80 SF_CGdTargetData target;
81 target.entity_index = building_index;
82 target.entity_type = 2;
83 target.position = {0,0};
84 SF_Rectangle rect = {0,0};
85
86 uint16_t effect_index = effectAPI.addEffect(_this->CGdEffect, kGdEffectMentalTowerIdle,&source,&target,
87 _this->OpaqueClass->current_step, 0, &rect);
88 if (effect_index != 0)
89 {
90 buildingAPI.setBuildingXData(_this, building_index, SpellDataKey::BUILDING_EFFECT_ID, effect_index);
91 }
92}
93
94void __thiscall npc_stonethrower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
95{
96 buildingAPI.attachTowerUnit(_this, building_index, 0x682);
97}
98
99void __thiscall npc_crossbow_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
100{
101 buildingAPI.attachTowerUnit(_this, building_index, 0x3d9);
102}
103
104void __thiscall wulfgar_crossbow_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
105{
106 buildingAPI.attachTowerUnit(_this, building_index, 0x430);
107}
108
109void __thiscall wulfgar_crossbow_tower_done_handler2(SF_CGdBuildingToolbox *_this,uint16_t building_index)
110{
111 buildingAPI.attachTowerUnit(_this, building_index, 0x48b);
112}
113
114void __thiscall npc_firestarter_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
115{
116 buildingAPI.attachTowerUnit(_this, building_index, 0x490);
117}
118
119void __thiscall undead_bone_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
120{
121 buildingAPI.attachTowerUnit(_this, building_index, 0x259);
122}
123
124void __thiscall npc_white_hand_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
125{
126 buildingAPI.attachTowerUnit(_this, building_index, 0x51d);
127}
128
129void __thiscall blade_black_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
130{
131 buildingAPI.attachTowerUnit(_this, building_index, 0x551);
132}
133
134void __thiscall npc_spitflower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
135{
136 buildingAPI.attachTowerUnit(_this, building_index, 0x552);
137}
138
139void __thiscall npc_frostbringer_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
140{
141 buildingAPI.attachTowerUnit(_this, building_index, 0x55a);
142}
143
144void __thiscall blade_black_tower_done_handler2(SF_CGdBuildingToolbox *_this,uint16_t building_index)
145{
146 buildingAPI.attachTowerUnit(_this, building_index, 0x572);
147}
148
149void __thiscall blade_dark_crystal_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
150{
151 buildingAPI.attachTowerUnit(_this, building_index, 0x581);
152}
153
154void __thiscall blade_dark_mananode_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
155{
156 buildingAPI.attachTowerUnit(_this, building_index, 0x582);
157}
158
159void __thiscall npc_mindbreaker_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
160{
161 buildingAPI.attachTowerUnit(_this, building_index, 0x5e7);
162}
163
164void __thiscall npc_holy_statue_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
165{
166 buildingAPI.attachTowerUnit(_this, building_index, 0x62e);
167}
168
169void __thiscall npc_sun_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
170{
171 buildingAPI.attachTowerUnit(_this, building_index, 0x66f);
172}
173
174void __thiscall npc_moon_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
175{
176 buildingAPI.attachTowerUnit(_this, building_index, 0x670);
177}
178
179void __thiscall npc_spitflower_done_handler2(SF_CGdBuildingToolbox *_this,uint16_t building_index)
180{
181 buildingAPI.attachTowerUnit(_this, building_index, 0x73d);
182}
183
184void __thiscall npc_sorcery_tower_done_handler(SF_CGdBuildingToolbox *_this,uint16_t building_index)
185{
186 buildingAPI.attachTowerUnit(_this, building_index, 0x787);
187}
188
189void __thiscall npc_sorcery_tower_done_handler2(SF_CGdBuildingToolbox *_this,uint16_t building_index)
190{
191 buildingAPI.attachTowerUnit(_this, building_index, 0x9b6);
192}
193
194void __thiscall undead_bone_tower_done_handler2(SF_CGdBuildingToolbox *_this,uint16_t building_index)
195{
196 buildingAPI.attachTowerUnit(_this, building_index, 0x9b7);
197}
198
199void __thiscall undead_bone_tower_done_handler3(SF_CGdBuildingToolbox *_this,uint16_t building_index)
200{
201 buildingAPI.attachTowerUnit(_this, building_index, 0x9b8);
202}
203
204void __thiscall npc_firestarter_done_handler2(SF_CGdBuildingToolbox *_this,uint16_t building_index)
205{
206 buildingAPI.attachTowerUnit(_this, building_index, 0x9b9);
207}
208
209void __thiscall blade_black_tower_done_handler3(SF_CGdBuildingToolbox *_this,uint16_t building_index)
210{
211 buildingAPI.attachTowerUnit(_this, building_index, 0x9ba);
212}
EffectFunctions effectAPI
Definition sf_hooks.c:45
BuildingFunctions buildingAPI
Definition sf_hooks.c:47
void __thiscall npc_moon_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall elf_frostbringer_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_sorcery_tower_done_handler2(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall norcaine_sorcery_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_sun_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_frostbringer_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall human_white_hand_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall multiworker_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_spitflower_done_handler2(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall undead_bone_tower_done_handler2(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall army_worker_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_white_hand_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall orc_firestarter_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_mindbreaker_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall default_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall breeder_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_holy_statue_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_firestarter_done_handler2(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_sorcery_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_crossbow_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_spitflower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall blade_black_tower_done_handler3(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall norcaine_mindbreaker_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall troll_stonethrower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall human_crossbow_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall elf_archer_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall blade_dark_mananode_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall wulfgar_crossbow_tower_done_handler2(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall wulfgar_crossbow_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall blade_black_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall undead_bone_tower_done_handler3(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall undead_bone_tower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_stonethrower_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall blade_dark_crystal_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall singleworker_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall npc_firestarter_done_handler(SF_CGdBuildingToolbox *_this, uint16_t building_index)
void __thiscall blade_black_tower_done_handler2(SF_CGdBuildingToolbox *_this, uint16_t building_index)
@ kGdEffectMentalTowerIdle
@ BUILDING_EFFECT_ID
@ BUILDING_POSITION_X
@ BUILDING_ANIM_START
@ SPELL_PESTILENCE_DAMAGE
@ BUILDING_POSITION_Y
@ BUILDING_QUEUE_COUNT
@ SPELL_TICK_COUNT_AUX
@ BUILDING_ANIM_LENGTH
GdBuilding buildings[1000]