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
3
API_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,
9
ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS
, 0);
10
enemy->varTable[0] += 1;
11
}
12
return
ApiStatus_DONE2
;
13
}
Vec3f::z
f32 z
Definition
common_structs.h:102
Vec3f::x
f32 x
Definition
common_structs.h:100
Vec3f::y
f32 y
Definition
common_structs.h:101
rand_int
#define rand_int
Definition
effect_shims.h:53
ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS
@ ITEM_SPAWN_MODE_TOSS_SPAWN_ALWAYS
Definition
enums.h:2294
ApiStatus_DONE2
#define ApiStatus_DONE2
Definition
evt.h:118
make_item_entity_nodelay
s32 make_item_entity_nodelay(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupVar)
Definition
item_entity.c:682
Enemy::npcID
s16 npcID
Definition
npc.h:300
get_npc_unsafe
Npc * get_npc_unsafe(s32 npcID)
Definition
npc.c:995
Enemy
Definition
npc.h:294
Npc
Definition
common_structs.h:213
Npc::collisionHeight
s16 collisionHeight
Definition
common_structs.h:262
Npc::pos
Vec3f pos
Definition
common_structs.h:236
src
world
common
todo
HeartPlant_SpawnHeart.inc.c
Generated by
1.10.0