Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
Signpost.c File Reference

Go to the source code of this file.

Functions

void entity_Signpost_idle (Entity *entity)
 

Variables

Gfx Entity_Signpost_Render []
 
EntityScript Entity_Signpost_Script
 
EntityModelScript Entity_Signpost_RenderScript = STANDARD_ENTITY_MODEL_SCRIPT(Entity_Signpost_Render, RENDER_MODE_SURFACE_OPA)
 
EntityBlueprint Entity_Signpost
 

Function Documentation

◆ entity_Signpost_idle()

void entity_Signpost_idle ( Entity * entity)

Definition at line 12 of file Signpost.c.

12 {
13 PlayerStatus* playerStatus = &gPlayerStatus;
14 f32 val = fabsf(clamp_angle(180.0f - entity->rot.y) - clamp_angle(atan2(entity->pos.x, entity->pos.z,
15 playerStatus->pos.x, playerStatus->pos.z)));
16
17 if (!(playerStatus->animFlags & PA_FLAG_USING_WATT) && !(entity->collisionFlags & ENTITY_COLLISION_PLAYER_TOUCH_FLOOR) && (val <= 40.0f || val >= 320.0f)) {
20 entity_start_script(entity);
21 }
22 } else {
23 entity->flags &= ~ENTITY_FLAG_SHOWS_INSPECT_PROMPT;
24 playerStatus->interactingWithID = NO_COLLIDER;
25 }
26}
#define clamp_angle
#define atan2
@ PA_FLAG_INTERACT_PROMPT_AVAILABLE
! prompt
Definition enums.h:3095
@ PA_FLAG_USING_WATT
Definition enums.h:3090
@ ENTITY_COLLISION_PLAYER_TOUCH_WALL
Definition enums.h:2651
@ ENTITY_COLLISION_PLAYER_TOUCH_FLOOR
Definition enums.h:2648
@ ENTITY_FLAG_SHOWS_INSPECT_PROMPT
Definition enums.h:2625
f32 fabsf(f32 f)
s32 entity_start_script(Entity *entity)
Definition entity.c:560
#define NO_COLLIDER
Definition macros.h:156
u8 collisionFlags
PlayerStatus gPlayerStatus
Definition 77480.c:39

Variable Documentation

◆ Entity_Signpost_Render

Gfx Entity_Signpost_Render[]
extern

Definition at line 99 of file Signpost.c.

99 {
100 gsSPDisplayList(Entity_Signpost_RenderMain),
101 gsSPEndDisplayList(),
102};
Gfx Entity_Signpost_RenderMain[]
Definition Signpost.c:93

◆ Entity_Signpost_Script

EntityScript Entity_Signpost_Script
Initial value:
= {
}
void entity_Signpost_idle(Entity *entity)
Definition Signpost.c:12
#define es_SetCallback(func, time)
Definition entity.h:38
#define es_End
Definition entity.h:35

Definition at line 28 of file Signpost.c.

◆ Entity_Signpost_RenderScript

Definition at line 33 of file Signpost.c.

◆ Entity_Signpost

EntityBlueprint Entity_Signpost
Initial value:
= {
.typeDataSize = sizeof(SignpostData),
.renderCommandList = Entity_Signpost_RenderScript,
.modelAnimationNodes = NULL,
.fpInit = NULL,
.updateEntityScript = Entity_Signpost_Script,
.fpHandleCollision = NULL,
{{ entity_model_Signpost_ROM_START, entity_model_Signpost_ROM_END }},
.entityType = ENTITY_TYPE_SIGNPOST,
.aabbSize = { 40, 50, 20 }
}
EntityModelScript Entity_Signpost_RenderScript
Definition Signpost.c:33
EntityScript Entity_Signpost_Script
Definition Signpost.c:28
@ ENTITY_TYPE_SIGNPOST
Definition enums.h:2588
@ ENTITY_FLAG_400
Definition enums.h:2623
@ ENTITY_FLAG_FIXED_SHADOW_SIZE
Definition enums.h:2622
@ ENTITY_FLAG_CIRCULAR_SHADOW
Definition enums.h:2624

Definition at line 35 of file Signpost.c.

35 {
37 .typeDataSize = sizeof(SignpostData),
38 .renderCommandList = Entity_Signpost_RenderScript,
39 .modelAnimationNodes = NULL,
40 .fpInit = NULL,
41 .updateEntityScript = Entity_Signpost_Script,
42 .fpHandleCollision = NULL,
43 {{ entity_model_Signpost_ROM_START, entity_model_Signpost_ROM_END }},
44 .entityType = ENTITY_TYPE_SIGNPOST,
45 .aabbSize = { 40, 50, 20 }
46};