Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
SimpleSpring.c
Go to the documentation of this file.
1#include "common.h"
2#include "entity.h"
3#include "animation_script.h"
4#include "ld_addrs.h"
5
6#if VERSION_JP // TODO remove once segments are split
7extern Addr entity_model_ScriptSpring_anim_ROM_END;
8extern Addr entity_model_ScriptSpring_anim_ROM_START;
9extern Addr entity_model_ScriptSpring_gfx_ROM_END;
10extern Addr entity_model_ScriptSpring_gfx_ROM_START;
11extern Addr entity_model_SimpleSpring_anim_ROM_END;
12extern Addr entity_model_SimpleSpring_anim_ROM_START;
13extern Addr entity_model_SimpleSpring_gfx_ROM_END;
14extern Addr entity_model_SimpleSpring_gfx_ROM_START;
15#endif
16
23
25 PlayerStatus* playerStatus = &gPlayerStatus;
26
28 playerStatus->camResetDelay = 5;
29 playerStatus->flags &= ~PS_FLAG_FALLING;
30 playerStatus->flags |= PS_FLAG_SCRIPTED_FALL;
32 if (entity_start_script(entity)) {
34 }
37 }
38}
39
42 PlayerStatus* playerStatus = &gPlayerStatus;
43
45 if (data->launchVel >= 70) {
46 playerStatus->camResetDelay = 5;
47 }
49 entity_start_script(entity);
53 playerStatus->curSpeed = 0;
54 }
55}
56
66
70
72}
73
77
84
95
96DmaEntry Entity_ScriptSpring_dma[] = { ENTITY_ROM(ScriptSpring_gfx), ENTITY_ROM(ScriptSpring_anim) };
97
98DmaEntry Entity_SimpleSpring_dma[] = { ENTITY_ROM(SimpleSpring_gfx), ENTITY_ROM(SimpleSpring_anim) };
99
102 .typeDataSize = 0,
103 .renderCommandList = Entity_ScriptSpring_AnimIdle,
104 .modelAnimationNodes = Entity_ScriptSpring_Mesh,
105 .fpInit = entity_ScriptSpring_init,
106 .updateEntityScript = Entity_ScriptSpring_Script,
107 .fpHandleCollision = NULL,
108 { .dmaList = Entity_ScriptSpring_dma },
109 .entityType = ENTITY_TYPE_SCRIPT_SPRING,
110 .aabbSize = {40, 25, 40}
111};
112
115 .typeDataSize = sizeof(SimpleSpringData),
116 .renderCommandList = Entity_SimpleSpring_AnimIdle,
117 .modelAnimationNodes = Entity_SimpleSpring_Mesh,
118 .fpInit = entity_SimpleSpring_init,
119 .updateEntityScript = Entity_SimpleSpring_Script,
120 .fpHandleCollision = NULL,
121 { .dmaList = Entity_SimpleSpring_dma },
122 .entityType = ENTITY_TYPE_SIMPLE_SPRING,
123 .aabbSize = {40, 25, 40}
124};
EntityScript Entity_ScriptSpring_Script
DmaEntry Entity_ScriptSpring_dma[]
void entity_ScriptSpring_init(Entity *entity)
EntityBlueprint Entity_ScriptSpring
void entity_SimpleSpring_init(Entity *entity)
AnimScript Entity_SimpleSpring_AnimLaunch
EntityBlueprint Entity_SimpleSpring
StaticAnimatorNode * Entity_SimpleSpring_Mesh[]
AnimScript Entity_ScriptSpring_AnimLaunch
EntityScript Entity_SimpleSpring_Script
AnimScript Entity_SimpleSpring_AnimIdle
StaticAnimatorNode * Entity_ScriptSpring_Mesh[]
DmaEntry Entity_SimpleSpring_dma[]
void entity_ScriptSpring_idle(Entity *entity)
void entity_SimpleSpring_enable_player_input(Entity *ent)
AnimScript Entity_ScriptSpring_AnimIdle
void entity_SimpleSpring_idle(Entity *entity)
void entity_SimpleSpring_set_jump_params(Entity *entity)
s16 AnimScript[]
f32 gravityIntegrator[4]
struct SimpleSpringData * simpleSpring
#define sfx_play_sound_at_position
s32 CreateEntityVarArgBuffer[]
Definition entity.c:35
#define es_Call(func)
Definition entity.h:37
#define es_Restart
Definition entity.h:40
#define es_SetCallback(func, time)
Definition entity.h:38
#define ENTITY_ROM(name)
Definition entity.h:65
s32 EntityScript[]
Definition entity.h:6
#define es_End
Definition entity.h:35
@ PS_FLAG_SCRIPTED_FALL
Definition enums.h:3071
@ ENTITY_TYPE_SCRIPT_SPRING
Definition enums.h:2584
@ ENTITY_TYPE_SIMPLE_SPRING
Definition enums.h:2583
@ ENTITY_COLLISION_PLAYER_TOUCH_FLOOR
Definition enums.h:2648
@ SOUND_SPRING
Definition enums.h:1427
@ ENTITY_FLAG_HAS_ANIMATED_MODEL
Definition enums.h:2616
@ ENTITY_FLAG_ALWAYS_FACE_CAMERA
Definition enums.h:2626
@ ACTION_STATE_RIDE
Definition enums.h:2461
@ ACTION_STATE_LAUNCH
Shy Guy Toybox jack-in-the-boxes.
Definition enums.h:2433
@ ACTION_STATE_USE_SPRING
Definition enums.h:2466
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
void play_model_animation(s32, s16 *)
Definition animator.c:1101
s32 disable_player_input(void)
Definition 77480.c:990
s32 entity_start_script(Entity *entity)
Definition entity.c:560
s32 enable_player_input(void)
Definition 77480.c:998
void set_action_state(s32 actionState)
Definition 7E9D0.c:209
void exec_entity_commandlist(Entity *entity)
Definition entity.c:313
s16 virtualModelIndex
EntityData dataBuf
u8 collisionFlags
u8 Addr[]
Linker symbol address, as in ld_addrs.h.
Definition types.h:16
PlayerStatus gPlayerStatus
Definition 77480.c:39