Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
twink.c
Go to the documentation of this file.
1#include "common.h"
2#include "../partners.h"
3#include "twink.h"
4
5#define NAMESPACE world_twink
6
7void N(init)(Npc* twink) {
8 twink->collisionHeight = 20;
9 twink->collisionDiameter = 20;
10}
11
12API_CALLABLE(N(TakeOut)) {
13 Npc* twink = script->owner2.npc;
14
15 if (isInitialCall) {
17 }
18
19 if(partner_get_out(twink)) {
20 return ApiStatus_DONE1;
21 } else {
22 return ApiStatus_BLOCK;
23 }
24}
25
26API_CALLABLE(N(Update)) {
27 PlayerData* playerData = &gPlayerData;
28 Npc* twink = script->owner2.npc;
29
30 if (isInitialCall) {
31 partner_flying_enable(twink, TRUE);
32 }
33
36 playerData->partnerUsedTime[PARTNER_TWINK]++;
37
38 return ApiStatus_BLOCK;
39}
40
41API_CALLABLE(N(UseAbility)) {
42 return ApiStatus_DONE2;
43}
44
45API_CALLABLE(N(PutAway)) {
46 Npc* twink = script->owner2.npc;
47
48 if (isInitialCall) {
50 }
51
52 if(partner_put_away(twink)) {
53 return ApiStatus_DONE1;
54 } else {
55 return ApiStatus_BLOCK;
56 }
57}
58
60 Call(N(TakeOut))
61 Return
62 End
63};
64
66 Call(N(Update))
67 Return
68 End
69};
70
72 Call(N(UseAbility))
73 Return
74 End
75};
76
78 Call(N(PutAway))
79 Return
80 End
81};
s32 partnerUsedTime[12]
Bytecode EvtScript[]
@ PARTNER_TWINK
Definition enums.h:2896
#define ApiStatus_DONE2
Definition evt.h:118
#define ApiStatus_DONE1
Definition evt.h:117
#define ApiStatus_BLOCK
Definition evt.h:116
void partner_flying_update_player_tracking(Npc *partner)
Definition partners.c:1751
void partner_flying_update_motion(Npc *partner)
Definition partners.c:1777
void partner_flying_enable(Npc *partner, s32 val)
Definition partners.c:1706
s32 partner_init_get_out(Npc *npc)
Definition partners.c:2252
s32 partner_init_put_away(Npc *partner)
Definition partners.c:2178
s32 partner_put_away(Npc *partner)
Definition partners.c:2185
s32 partner_get_out(Npc *partner)
Definition partners.c:2259
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Return
Kills the current EVT thread.
Definition macros.h:217
PlayerData gPlayerData
Definition 77480.c:40
EvtScript EVS_WorldTwink_TakeOut
Definition twink.c:59
void N init(Npc *twink)
Definition twink.c:7
EvtScript EVS_WorldTwink_UseAbility
Definition twink.c:71
EvtScript EVS_WorldTwink_PutAway
Definition twink.c:77
EvtScript EVS_WorldTwink_Update
Definition twink.c:65