Skip to content

Commit 8fcd6f9

Browse files
committed
MAP2_S02: func_800D240C
1 parent 208ce7e commit 8fcd6f9

2 files changed

Lines changed: 90 additions & 1 deletion

File tree

include/maps/map2/map2_s02.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ void func_800DEC98(s_SubCharacter* arg0);
3535

3636
void func_800DEC04(s_SubCharacter* chara);
3737

38+
u32 func_800DEE80(s_SubCharacter* chara);
39+
40+
void func_800D240C(s_SubCharacter* arg0);
41+
3842
#endif

src/maps/map2_s02/map2_s02.c

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,92 @@ INCLUDE_RODATA("asm/maps/map2_s02/nonmatchings/map2_s02", sharedData_800CAA98_0_
168168

169169
#include "maps/shared/sharedFunc_800D3DFC_0_s01.h" // 0x800D2350
170170

171-
INCLUDE_ASM("asm/maps/map2_s02/nonmatchings/map2_s02", func_800D240C);
171+
void func_800D240C(s_SubCharacter* arg0)
172+
{
173+
bool cond0;
174+
bool cond1;
175+
s32 newStep;
176+
s32 animStatus;
177+
s32 animState;
178+
s32 check;
179+
u32 tmp0;
180+
u32 step;
181+
182+
animStatus = arg0->model_0.anim_4.status_0;
183+
sharedFunc_800D5638_0_s01(arg0);
184+
step = arg0->model_0.stateStep_3;
185+
animState = ANIM_STATUS(12, true);
186+
check = animStatus | 1;
187+
switch (step)
188+
{
189+
case 0:
190+
newStep = func_800DEE80(arg0);
191+
cond1 = 0;
192+
cond0 = arg0->position_18.vy >= 0x8000;
193+
if (func_800808AC(arg0->position_18.vx, arg0->position_18.vz) == 7)
194+
{
195+
cond1 = (arg0->position_18.vy < func_80080884(arg0->position_18.vx, arg0->position_18.vz)) ^ 1;
196+
}
197+
if (cond0 != 0)
198+
{
199+
Chara_DamageTake(arg0, 0);
200+
arg0->position_18.vx = g_SysWork.player_4C.chara_0.position_18.vx + Q12(100.0f);
201+
arg0->position_18.vz = g_SysWork.player_4C.chara_0.position_18.vz + Q12(100.0f);
202+
sharedFunc_800D3DFC_0_s01(arg0);
203+
return;
204+
}
205+
if (cond1 != 0)
206+
{
207+
Chara_DamageTake(arg0, 0);
208+
sharedFunc_800D2364_0_s01(arg0);
209+
arg0->position_18.vx = g_SysWork.player_4C.chara_0.position_18.vx + Q12(100.0f);
210+
arg0->position_18.vz = g_SysWork.player_4C.chara_0.position_18.vz + Q12(100.0f);
211+
sharedFunc_800D3DFC_0_s01(arg0);
212+
return;
213+
}
214+
if (arg0->health_B0 <= 0)
215+
{
216+
Chara_DamageTake(arg0, 0);
217+
if (animStatus == ANIM_STATUS(26, true) && newStep == 1)
218+
{
219+
arg0->health_B0 = NO_VALUE;
220+
func_800622B8(3, arg0, 9, 2);
221+
arg0->model_0.stateStep_3 = newStep;
222+
sharedFunc_800D3DFC_0_s01(arg0);
223+
return;
224+
}
225+
}
226+
else
227+
{
228+
arg0->flags_3E |= 2;
229+
if (Chara_DamageTake(arg0, Q12(1.0f)) == 4)
230+
{
231+
if (arg0->health_B0 <= 0)
232+
{
233+
arg0->model_0.anim_4.status_0 = ANIM_STATUS(5, false);
234+
arg0->properties_E4.player.flags_11C |= 0x40;
235+
return;
236+
}
237+
arg0->model_0.anim_4.status_0 = ANIM_STATUS(12, false);
238+
arg0->model_0.stateStep_3 = 2;
239+
arg0->properties_E4.player.flags_11C |= 8;
240+
return;
241+
}
242+
return;
243+
}
244+
break;
245+
case 1:
246+
Chara_DamageTake(arg0, 0);
247+
break;
248+
case 2:
249+
Chara_DamageTake(arg0, Q12(0.5f));
250+
if (check != animState)
251+
{
252+
arg0->model_0.stateStep_3 = 0;
253+
}
254+
break;
255+
}
256+
}
172257

173258
INCLUDE_ASM("asm/maps/map2_s02/nonmatchings/map2_s02", func_800D262C);
174259

0 commit comments

Comments
 (0)