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
3API_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}
#define ApiStatus_DONE2
Definition evt.h:118
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
PlayerData gPlayerData
Definition 77480.c:40