Paper Mario DX
Paper Mario (N64) modding
Loading...
Searching...
No Matches
AddHP.inc.c
Go to the documentation of this file.
1
#include "common.h"
2
3
API_CALLABLE(N(AddHP)) {
4
PlayerData
* playerData = &
gPlayerData
;
5
6
s32 amt =
evt_get_variable
(script, *script->ptrReadPos);
7
s32 newHP = playerData->
curHP
+ amt;
8
9
if
(newHP > playerData->
curMaxHP
) {
10
newHP = playerData->
curMaxHP
;
11
}
12
13
playerData->
curHP
= newHP;
14
15
return
ApiStatus_DONE2
;
16
}
PlayerData::curMaxHP
s8 curMaxHP
Definition
common_structs.h:312
PlayerData::curHP
s8 curHP
Definition
common_structs.h:311
PlayerData
Definition
common_structs.h:308
ApiStatus_DONE2
#define ApiStatus_DONE2
Definition
evt.h:118
evt_get_variable
s32 evt_get_variable(Evt *script, Bytecode var)
Definition
evt.c:1690
gPlayerData
PlayerData gPlayerData
Definition
77480.c:40
src
common
AddHP.inc.c
Generated by
1.10.0