Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
UnkFunc11.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "npc.h"
3
4API_CALLABLE(N(UnkFunc11)) {
5 s32 pushableColliderID = evt_get_variable(script, *script->ptrReadPos);
6 PlayerStatus* playerStatus = &gPlayerStatus;
7 CollisionStatus* collisionStatus = &gCollisionStatus;
8
9#if VERSION_JP
10 if (collisionStatus->pushingAgainstWall != pushableColliderID && playerStatus->actionState == ACTION_STATE_PUSHING_BLOCK) {
11#else
12 if ((collisionStatus->pushingAgainstWall != pushableColliderID && playerStatus->actionState == ACTION_STATE_PUSHING_BLOCK) ||
13 playerStatus->enableCollisionOverlapsCheck || playerStatus->inputDisabledCount != 0) {
14#endif
16 script->varTable[0] = 0;
17 return ApiStatus_DONE2;
18 }
19
20 if (collisionStatus->pushingAgainstWall != pushableColliderID) {
21 script->varTable[0] = 0;
22 } else if (
23 (playerStatus->actionState != ACTION_STATE_PUSHING_BLOCK) &&
24 (playerStatus->actionState != ACTION_STATE_WALK) &&
25 (playerStatus->actionState != ACTION_STATE_RUN))
26 {
27 script->varTable[0] = 0;
28 } else if (playerStatus->animFlags & PA_FLAG_USING_WATT) {
29 script->varTable[0] = 0;
30 } else {
31 script->varTable[0] = 1;
32 }
33
34 return ApiStatus_DONE2;
35}
s8 enableCollisionOverlapsCheck
@ PA_FLAG_USING_WATT
Definition enums.h:3090
@ ACTION_STATE_PUSHING_BLOCK
Definition enums.h:2448
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ ACTION_STATE_WALK
Definition enums.h:2427
@ ACTION_STATE_RUN
Definition enums.h:2428
#define ApiStatus_DONE2
Definition evt.h:118
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
void set_action_state(s32 actionState)
Definition 7E9D0.c:209
CollisionStatus gCollisionStatus
Definition 7BB60.c:6
PlayerStatus gPlayerStatus
Definition 77480.c:39