Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
HeartPlant_SpawnHeart.inc.c
Go to the documentation of this file.
1#include "common.h"
2
3API_CALLABLE(N(HeartPlant_SpawnHeart)) {
4 Enemy* enemy = script->owner1.enemy;
5 Npc* npc = get_npc_unsafe(enemy->npcID);
6
7 if ((enemy->varTable[0] < 5) && (rand_int(1000) > 300)) {
8 make_item_entity_nodelay(ITEM_HEART, npc->pos.x, npc->pos.y + npc->collisionHeight, npc->pos.z + 5.0,
10 enemy->varTable[0] += 1;
11 }
12 return ApiStatus_DONE2;
13}
#define rand_int
@ ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS
Definition enums.h:2294
#define ApiStatus_DONE2
Definition evt.h:118
s32 make_item_entity_nodelay(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupVar)
s16 npcID
Definition npc.h:300
Npc * get_npc_unsafe(s32 npcID)
Definition npc.c:995
Definition npc.h:294
s16 collisionHeight
Vec3f pos