Paper Mario DX
Paper Mario (N64) modding
Loading...
Searching...
No Matches
AwaitPlayerNearNpc.inc.c
Go to the documentation of this file.
1
#include "common.h"
2
#include "
npc.h
"
3
4
API_CALLABLE(N(
func_80240814_97BE44
)) {
5
Npc
* npc =
get_npc_safe
(
script
->owner2.npcID);
6
7
npc->
verticalRenderOffset
= npc->
collisionHeight
;
8
npc->
pos
.
y
-= (
f32
) npc->
collisionHeight
;
9
10
return
ApiStatus_DONE2
;
11
}
12
13
API_CALLABLE(N(
AwaitPlayerNearNpc
)) {
14
PlayerStatus
*
playerStatus
= &
gPlayerStatus
;
15
Npc
* npc =
get_npc_safe
(
script
->owner2.npcID);
16
17
if
(
dist2D
(npc->
pos
.
x
, npc->
pos
.
z
,
playerStatus
->pos.x,
playerStatus
->pos.z) < 50.0f) {
18
return
ApiStatus_DONE2
;
19
}
20
21
return
ApiStatus_BLOCK
;
22
}
23
24
API_CALLABLE(N(
func_802408B4_97BEE4
)) {
25
EncounterStatus
*
currentEncounter
= &
gCurrentEncounter
;
26
Enemy
* enemy =
script
->owner1.enemy;
27
Npc
* npc =
get_npc_safe
(
script
->owner2.npcID);
28
29
if
(
isInitialCall
) {
30
npc->
verticalRenderOffset
= 0;
31
}
32
33
if
(npc->
flags
&
NPC_FLAG_GROUNDED
) {
34
currentEncounter
->encounterList[enemy->
encounterIndex
]->battle = enemy->varTable[0];
35
return
ApiStatus_DONE2
;
36
}
37
38
return
ApiStatus_BLOCK
;
39
}
PopupMenu_SelectedIndex
BSS s32 PopupMenu_SelectedIndex
Definition
8a860_len_3f30.c:84
Vec3f::z
f32 z
Definition
common_structs.h:103
Vec3f::x
f32 x
Definition
common_structs.h:101
Vec3f::y
f32 y
Definition
common_structs.h:102
PlayerStatus
Definition
common_structs.h:1980
NPC_FLAG_GROUNDED
@ NPC_FLAG_GROUNDED
Definition
enums.h:3010
ApiStatus_DONE2
#define ApiStatus_DONE2
Definition
evt.h:118
ApiStatus_BLOCK
#define ApiStatus_BLOCK
Definition
evt.h:116
dist2D
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
Definition
43F0.c:669
npc.h
Enemy::encounterIndex
s8 encounterIndex
Definition
npc.h:296
gCurrentEncounter
EncounterStatus gCurrentEncounter
Definition
encounter.c:176
get_npc_safe
Npc * get_npc_safe(s32 npcID)
Definition
npc.c:1009
EncounterStatus
Definition
npc.h:365
Enemy
Definition
npc.h:294
Npc
Definition
common_structs.h:214
Npc::flags
s32 flags
Definition
common_structs.h:215
Npc::collisionHeight
s16 collisionHeight
Definition
common_structs.h:263
Npc::verticalRenderOffset
s8 verticalRenderOffset
Definition
common_structs.h:265
Npc::pos
Vec3f pos
Definition
common_structs.h:237
gPlayerStatus
PlayerStatus gPlayerStatus
Definition
77480.c:39
src
world
common
todo
AwaitPlayerNearNpc.inc.c
Generated by
1.10.0