Skip to content

Commit 5c80d02

Browse files
committed
MAP2_S00: func_800D5974
1 parent 3e27436 commit 5c80d02

File tree

3 files changed

+117
-1
lines changed

3 files changed

+117
-1
lines changed

include/maps/map2/map2_s00.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,10 @@ void func_800EB174(void);
142142

143143
void func_800DF710(s_SubCharacter* chara);
144144

145+
s32 func_800DC30C(s_SubCharacter* chara);
146+
147+
s32 func_800DC598(s_SubCharacter* chara);
148+
149+
void func_800D5974(s_SubCharacter* chara);
150+
145151
#endif

include/maps/shared.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,9 @@ typedef struct
19441944
VECTOR3 field_11C;
19451945
VECTOR3 field_128;
19461946
VECTOR3 field_134;
1947+
VECTOR3 unk_140;
1948+
u32 field_14C;
1949+
s32 field_150;
19471950
} s_sharedData_800E21D0_0_s01;
19481951

19491952
typedef struct

src/maps/map2_s00/map2_s00.c

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,114 @@ INCLUDE_ASM("asm/maps/map2_s00/nonmatchings/map2_s00", func_800D5268);
184184

185185
INCLUDE_ASM("asm/maps/map2_s00/nonmatchings/map2_s00", func_800D5554);
186186

187-
INCLUDE_ASM("asm/maps/map2_s00/nonmatchings/map2_s00", func_800D5974);
187+
void func_800D5974(s_SubCharacter* chara)
188+
{
189+
s32 bit3;
190+
s32 f150;
191+
s32 idx;
192+
s32 switch2Idx;
193+
u32 stateStep;
194+
s32 animStatus;
195+
s16 one;
196+
197+
animStatus = chara->model_0.anim_4.status_0;
198+
idx = sharedFunc_800D4A80_0_s01(chara);
199+
switch2Idx = 0;
200+
bit3 = (sharedData_800E21D0_0_s01.field_14C >> 2) & 1;
201+
stateStep = chara->model_0.stateStep_3;
202+
f150 = sharedData_800E21D0_0_s01.field_150;
203+
one = 1;
204+
switch (stateStep)
205+
{
206+
case 0:
207+
if (!func_800DC30C(chara) || func_80080514() >= FP_ANGLE(252.0f))
208+
{
209+
chara->properties_E4.larvalStalker.properties_E8[0xE].val32 = Q12(2.0f);
210+
chara->model_0.stateStep_3 = one;
211+
}
212+
else
213+
{
214+
chara->model_0.stateStep_3 = 2;
215+
}
216+
break;
217+
case 1:
218+
if (func_800DC598(chara))
219+
{
220+
chara->model_0.stateStep_3 = 2;
221+
}
222+
break;
223+
case 2:
224+
if ((animStatus == ANIM_STATUS(25, true)) || (animStatus == ANIM_STATUS(23, true)))
225+
{
226+
switch2Idx = 1;
227+
chara->model_0.anim_4.status_0 = ANIM_STATUS(22, false);
228+
chara->model_0.stateStep_3 = 3;
229+
}
230+
break;
231+
case 3:
232+
switch2Idx = 1;
233+
break;
234+
}
235+
sharedFunc_800DE1F8_2_s00(chara);
236+
func_800DF710(chara);
237+
switch (Chara_DamageTake(chara, Q12(1.0f)))
238+
{
239+
case 0:
240+
switch (switch2Idx)
241+
{
242+
case 0:
243+
if ((chara->properties_E4.larvalStalker.properties_E8[0xE].val32 == 0) || (f150 > 0x2000))
244+
{
245+
if (bit3 == 0)
246+
{
247+
chara->model_0.state_2 = 0xD;
248+
}
249+
else
250+
{
251+
chara->model_0.state_2 = 10;
252+
}
253+
chara->model_0.stateStep_3 = 0;
254+
}
255+
break;
256+
case 1:
257+
if (idx == 2)
258+
{
259+
if (bit3 != 0)
260+
{
261+
chara->model_0.state_2 = 0x18;
262+
}
263+
else
264+
{
265+
chara->model_0.state_2 = 0x1a;
266+
}
267+
chara->model_0.stateStep_3 = 0;
268+
}
269+
break;
270+
default:
271+
return;
272+
}
273+
break;
274+
case 1:
275+
case 2:
276+
chara->model_0.state_2 = 0x10;
277+
chara->model_0.stateStep_3 = 0;
278+
chara->properties_E4.player.flags_11C |= CharaUnk0Flag_Unk3;
279+
return;
280+
case 3:
281+
case 4:
282+
chara->model_0.state_2 = 0x11;
283+
chara->model_0.stateStep_3 = 0;
284+
if (chara->health_B0 <= 0)
285+
{
286+
chara->properties_E4.player.flags_11C |= CharaUnk0Flag_Unk6;
287+
}
288+
else
289+
{
290+
chara->properties_E4.player.flags_11C |= CharaUnk0Flag_Unk3;
291+
}
292+
break;
293+
}
294+
}
188295

189296
INCLUDE_ASM("asm/maps/map2_s00/nonmatchings/map2_s00", func_800D5B88);
190297

0 commit comments

Comments
 (0)