2020-10-18 04:27:25 +02:00
|
|
|
#include "common.h"
|
2020-12-23 12:37:03 +01:00
|
|
|
#include "goombario.h"
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-12-23 12:50:36 +01:00
|
|
|
extern s32** D_802BDF64;
|
|
|
|
|
2020-11-23 20:19:13 +01:00
|
|
|
s32 func_802BD100(s32 arg0) {
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < 0x40; i++) {
|
|
|
|
Trigger* trigger = get_trigger_by_id(i);
|
|
|
|
|
|
|
|
if (trigger != NULL && trigger->flags.flags & 0x100 && trigger->params2 == arg0) {
|
|
|
|
return trigger->unk_2C;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-12-22 16:53:16 +01:00
|
|
|
void world_goombario_init(Npc* npc) {
|
2020-11-07 20:44:44 +01:00
|
|
|
npc->collisionHeight = 24;
|
|
|
|
npc->collisionRadius = 20;
|
|
|
|
}
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-12-23 12:50:36 +01:00
|
|
|
INCLUDE_ASM(ApiStatus, "world/partner/goombario", func_802BD188, ScriptInstance* script, s32 isInitialCall);
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-12-23 12:50:36 +01:00
|
|
|
INCLUDE_ASM(ApiStatus, "world/partner/goombario", func_802BD1D0, ScriptInstance* script, s32 isInitialCall);
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-12-23 12:18:47 +01:00
|
|
|
INCLUDE_ASM(s32, "world/partner/goombario", func_802BD564);
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-12-23 12:37:03 +01:00
|
|
|
// Compiler is generating more efficient code than the original asm, using xori and sltiu instead of beq
|
|
|
|
#ifdef NON_MATCHING
|
|
|
|
s32 world_goombario_can_pause(Npc* partner) {
|
|
|
|
if (D_8010EBB0[0]) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((partner->flags & 0x1800) != 0x1000) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
INCLUDE_ASM(s32, "world/partner/goombario", world_goombario_can_pause, Npc* partner);
|
|
|
|
#endif
|
|
|
|
|
2020-12-23 12:50:36 +01:00
|
|
|
// Returns on SI_VAR(0)
|
|
|
|
INCLUDE_ASM(ApiStatus, "world/partner/goombario", func_802BD5D8, ScriptInstance* script, s32 isInitialCall);
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-12-23 12:50:36 +01:00
|
|
|
INCLUDE_ASM(ApiStatus, "world/partner/goombario", func_802BDB30, ScriptInstance* script, s32 isInitialCall);
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-11-23 20:19:13 +01:00
|
|
|
ApiStatus func_802BDB84(ScriptInstance* script, s32 isInitialCall) {
|
|
|
|
s32 unk = script->owner2.npc; // todo what is this?
|
|
|
|
|
|
|
|
if (isInitialCall) {
|
|
|
|
func_800EE994(unk);
|
|
|
|
}
|
2020-10-18 04:27:25 +02:00
|
|
|
|
2020-11-23 20:19:13 +01:00
|
|
|
return func_800EE9B8(unk) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Something is up with D_8010EBB0 I think. It might be a struct or something
|
|
|
|
#ifdef NON_MATCHING
|
2020-12-22 16:53:16 +01:00
|
|
|
void world_goombario_pre_battle(s32 arg0) {
|
2020-11-23 20:19:13 +01:00
|
|
|
if (D_8010EBB0[0] != 0) {
|
|
|
|
func_80027088(0);
|
|
|
|
enable_player_input();
|
|
|
|
CancelMessageAndBlock();
|
|
|
|
clear_partner_move_history(arg0);
|
|
|
|
D_8010EBB0[0] = 0;
|
|
|
|
D_8010EBB0[3] = 0;
|
|
|
|
disable_npc_blur(arg0);
|
|
|
|
}
|
|
|
|
D_8010EBB0[3] = 1;
|
|
|
|
}
|
|
|
|
#else
|
2020-12-23 12:18:47 +01:00
|
|
|
INCLUDE_ASM(void, "world/partner/goombario", world_goombario_pre_battle, s32 arg0);
|
2020-11-23 20:19:13 +01:00
|
|
|
#endif
|