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

Go to the source code of this file.

Macros

#define REFLECTED_SWITCH_HIDDEN   1
 
#define REFLECTED_SWITCH_LINKED   2
 

Functions

void entity_GreenStompSwitch_idle (Entity *entity)
 
void entity_GreenStompSwitch_retract (Entity *entity)
 
void entity_GreenStompSwitch_extend (Entity *entity)
 
void entity_switch_fall_down (Entity *entity)
 
void entity_HugeBlueSwitch_idle (Entity *entity)
 
void entity_small_switch_idle (Entity *entity)
 
void entity_RedSwitch_wait_and_reset (Entity *entity)
 
void entity_base_switch_anim_init (Entity *entity)
 
s32 entity_RedSwitch_animate_scale (Entity *entity)
 
void entity_base_switch_start_bound_script (Entity *entity)
 
void entity_base_switch_animate_scale (Entity *entity)
 
void entity_base_switch_init (Entity *entity)
 
void entity_BlueSwitch_init (Entity *entity)
 
void entity_HugeBlueSwitch_init (Entity *entity)
 

Variables

Gfx Entity_RedSwitch_Render []
 
Gfx Entity_BlueSwitch_Render []
 
Gfx Entity_GreenStompSwitch_Render []
 
BSS EntitySwitchToLink
 
EntityScript Entity_RedSwitch_Script
 
EntityScript Entity_HugeBlueSwitch_Script
 
EntityScript Entity_BlueSwitch_Script
 
EntityScript Entity_GreenStompSwitch_Script
 
EntityModelScript Entity_BlueSwitch_RenderScript = STANDARD_ENTITY_MODEL_SCRIPT(Entity_BlueSwitch_Render, RENDER_MODE_SURFACE_XLU_LAYER1)
 
EntityModelScript Entity_HugeBlueSwitch_RenderScript = STANDARD_ENTITY_MODEL_SCRIPT(Entity_BlueSwitch_Render, RENDER_MODE_SURFACE_XLU_LAYER1)
 
EntityModelScript Entity_RedSwitch_RenderScript = STANDARD_ENTITY_MODEL_SCRIPT(Entity_RedSwitch_Render, RENDER_MODE_SURFACE_XLU_LAYER1)
 
EntityModelScript Entity_GreenStompSwitch_RenderScript = STANDARD_ENTITY_MODEL_SCRIPT(Entity_GreenStompSwitch_Render, RENDER_MODE_SURFACE_OPA)
 
EntityBlueprint Entity_RedSwitch
 
EntityBlueprint Entity_BlueSwitch
 
EntityBlueprint Entity_HugeBlueSwitch
 
EntityBlueprint Entity_GreenStompSwitch
 

Macro Definition Documentation

◆ REFLECTED_SWITCH_HIDDEN

#define REFLECTED_SWITCH_HIDDEN   1

Definition at line 16 of file Switch.c.

Referenced by entity_BlueSwitch_init().

◆ REFLECTED_SWITCH_LINKED

#define REFLECTED_SWITCH_LINKED   2

Definition at line 17 of file Switch.c.

Referenced by entity_BlueSwitch_init().

Function Documentation

◆ entity_GreenStompSwitch_idle()

void entity_GreenStompSwitch_idle ( Entity * entity)

Definition at line 25 of file Switch.c.

25 {
26 PlayerStatus* playerStatus = &gPlayerStatus;
27 SwitchData* data = entity->dataBuf.swtch;
28
30 if ((playerStatus->actionState == ACTION_STATE_SPIN_POUND)
31 || (playerStatus->actionState == ACTION_STATE_TORNADO_POUND)) {
33 data->greenMotionTimer = 8;
34 }
35 }
36}
struct SwitchData * swtch
s16 greenMotionTimer
Definition entity.h:87
@ ENTITY_COLLISION_PLAYER_TOUCH_FLOOR
Definition enums.h:2648
@ ACTION_STATE_SPIN_POUND
Definition enums.h:2442
@ ACTION_STATE_TORNADO_POUND
Definition enums.h:2444
void exec_entity_commandlist(Entity *entity)
Definition entity.c:313
EntityData dataBuf
u8 collisionFlags
PlayerStatus gPlayerStatus
Definition 77480.c:39

◆ entity_GreenStompSwitch_retract()

void entity_GreenStompSwitch_retract ( Entity * entity)

Definition at line 38 of file Switch.c.

38 {
39 SwitchData* data = entity->dataBuf.swtch;
40 u16 curTime = data->greenMotionTimer--;
41
42 if (curTime != 0) {
43 entity->pos.y -= 1.8625;
44 return;
45 }
46 entity_start_script(entity);
48 data->greenMotionTimer = 8;
49}
s32 entity_start_script(Entity *entity)
Definition entity.c:560

◆ entity_GreenStompSwitch_extend()

void entity_GreenStompSwitch_extend ( Entity * entity)

Definition at line 51 of file Switch.c.

51 {
52 SwitchData* data = entity->dataBuf.swtch;
53 u16 curTime = data->greenMotionTimer--;
54
55 if (curTime != 0) {
56 entity->pos.y += 1.8625;
57 return;
58 }
60 data->greenMotionTimer = 8;
61}

◆ entity_switch_fall_down()

void entity_switch_fall_down ( Entity * entity)

Definition at line 63 of file Switch.c.

63 {
64 SwitchData* data = entity->dataBuf.swtch;
65 f32 hitDepth = 10.0f;
66 f32 x = entity->pos.x;
67 f32 y = entity->pos.y;
68 f32 z = entity->pos.z;
69 f32 hitYaw;
70 f32 hitPitch;
71
72 entity_raycast_down(&x, &y, &z, &hitYaw, &hitPitch, &hitDepth);
73
74 if (entity->pos.y != y && entity->pos.y > y) {
75 f32 fallVelocity = data->fallVel;
76
77 fallVelocity += 0.5;
78 data->fallVel = fallVelocity;
79 entity->pos.y -= fallVelocity;
80 if (entity->pos.y < y) {
81 entity->pos.y = y;
82 }
83 }
84}
f32 fallVel
Definition entity.h:79
b32 entity_raycast_down(f32 *, f32 *, f32 *, f32 *, f32 *, f32 *)
Mostly used for shadows.
Definition entity.c:1637

Referenced by entity_base_switch_animate_scale(), entity_RedSwitch_animate_scale(), and entity_small_switch_idle().

◆ entity_HugeBlueSwitch_idle()

void entity_HugeBlueSwitch_idle ( Entity * entity)

Definition at line 86 of file Switch.c.

86 {
87 PlayerStatus* playerStatus = &gPlayerStatus;
88
90 if ((playerStatus->actionState == ACTION_STATE_SPIN_POUND)
91 || (playerStatus->actionState == ACTION_STATE_TORNADO_POUND)) {
93 }
94 }
95}

◆ entity_small_switch_idle()

void entity_small_switch_idle ( Entity * entity)

Definition at line 97 of file Switch.c.

97 {
98 SwitchData* data = entity->dataBuf.swtch;
99 PlayerStatus* playerStatus = &gPlayerStatus;
100 PartnerStatus* partnerStatus = &gPartnerStatus;
101
103
105 if (playerStatus->actionState == ACTION_STATE_HAMMER) {
106 if (gPlayerData.hammerLevel < 0) {
107 return;
108 }
110
111 if (data->linkedSwitch == NULL) {
112 return;
113 }
114
116 return;
117 }
118 }
119
120 if (playerStatus->actionState == ACTION_STATE_SPIN_JUMP) {
121 return;
122 }
123
124 if (partnerStatus->actingPartner == PARTNER_PARAKARRY && partnerStatus->partnerActionState != PARTNER_ACTION_NONE) {
125 return;
126 }
127
129 if (!(entity->collisionFlags & ENTITY_COLLISION_PARTNER)) {
130 return;
131 }
132 }
133
135
136 if (data->linkedSwitch == NULL) {
137 return;
138 }
139
141}
void entity_switch_fall_down(Entity *entity)
Definition Switch.c:63
struct Entity * linkedSwitch
Definition entity.h:89
@ PARTNER_ACTION_NONE
Definition enums.h:2932
@ ENTITY_COLLISION_PARTNER
Definition enums.h:2655
@ ENTITY_COLLISION_PLAYER_HAMMER
Definition enums.h:2654
@ PARTNER_PARAKARRY
Definition enums.h:2889
@ ACTION_STATE_SPIN_JUMP
Definition enums.h:2441
@ ACTION_STATE_HAMMER
Definition enums.h:2446
PartnerStatus gPartnerStatus
Definition partners.c:42
PlayerData gPlayerData
Definition 77480.c:40

◆ entity_RedSwitch_wait_and_reset()

void entity_RedSwitch_wait_and_reset ( Entity * entity)

Definition at line 143 of file Switch.c.

143 {
146 }
147}

◆ entity_base_switch_anim_init()

void entity_base_switch_anim_init ( Entity * entity)

Definition at line 149 of file Switch.c.

149 {
150 SwitchData* data = entity->dataBuf.swtch;
151
152 data->fallVel = 1.0f;
153 data->deltaScaleX = 0.1f;
154 data->deltaScaleY = -0.1f;
155 data->animStateScaleX = 0;
156 data->animStateScaleY = 0;
157}
s8 animStateScaleX
Definition entity.h:83
f32 deltaScaleX
Definition entity.h:80
s8 animStateScaleY
Definition entity.h:84
f32 deltaScaleY
Definition entity.h:81

◆ entity_RedSwitch_animate_scale()

s32 entity_RedSwitch_animate_scale ( Entity * entity)

Definition at line 159 of file Switch.c.

159 {
160 f32 phi_f4;
161 f32 temp_f6;
162 SwitchData* data = entity->dataBuf.swtch;
163 s32 phi_s2 = 0;
164
165 switch (data->animStateScaleX) {
166 case 0:
167 temp_f6 = data->baseScale.z * 0.3;
168 phi_f4 = ((data->baseScale.x + temp_f6) - entity->scale.x) / 4.0;
169 if (phi_f4 < 0.01) {
170 phi_f4 = 0.01f;
171 }
172 data->deltaScaleX += phi_f4;
173 entity->scale.x += data->deltaScaleX;
174 if ((data->baseScale.x + temp_f6) <= entity->scale.x) {
175 data->deltaScaleX = 0.0f;
176 data->animStateScaleX++;
177 }
178 break;
179 case 1:
180 temp_f6 = data->baseScale.z * -0.2;
181 phi_f4 = ((data->baseScale.x + temp_f6) - entity->scale.x) / 6.0;
182 if (phi_f4 > -0.01) {
183 phi_f4 = -0.01f;
184 }
185 data->deltaScaleX += phi_f4;
186 entity->scale.x += data->deltaScaleX;
187 if (entity->scale.x <= (data->baseScale.x + temp_f6)) {
188 data->deltaScaleX = 0.0f;
189 data->animStateScaleX++;
190 }
191 break;
192 case 2:
193 temp_f6 = data->baseScale.z * 0.15;
194 phi_f4 = ((data->baseScale.x + temp_f6) - entity->scale.x) / 4.0;
195 if (phi_f4 < 0.01) {
196 phi_f4 = 0.01f;
197 }
198 data->deltaScaleX += phi_f4;
199 entity->scale.x += data->deltaScaleX;
200 if ((data->baseScale.x + temp_f6) <= entity->scale.x) {
201 data->deltaScaleX = 0.0f;
202 data->animStateScaleX++;
203 }
204 break;
205 case 3:
206 temp_f6 = data->baseScale.z * -0.1;
207 phi_f4 = ((data->baseScale.x + temp_f6) - entity->scale.x) / 6.0;
208 if (phi_f4 > -0.01) {
209 phi_f4 = -0.01f;
210 }
211 data->deltaScaleX += phi_f4;
212 entity->scale.x += data->deltaScaleX;
213 if (entity->scale.x <= (data->baseScale.x + temp_f6)) {
214 data->deltaScaleX = 0.0f;
215 data->animStateScaleX++;
216 }
217 break;
218 case 4:
219 phi_f4 = (data->baseScale.x - entity->scale.x) / 4.0;
220 if (phi_f4 < 0.01) {
221 phi_f4 = 0.01f;
222 }
223 data->deltaScaleX += phi_f4;
224 entity->scale.x += data->deltaScaleX;
225 if (data->baseScale.x <= entity->scale.x) {
226 entity->scale.x = data->baseScale.x;
227 data->deltaScaleX = 0.0f;
228 data->animStateScaleX++;
229 }
230 break;
231 case 5:
232 phi_s2++;
233 break;
234 }
235
236 entity->scale.z = entity->scale.x;
237
238 switch (data->animStateScaleY) {
239 case 0:
240 temp_f6 = data->baseScale.z * -0.5;
241 phi_f4 = ((data->baseScale.y + temp_f6) - entity->scale.y) / 5.0;
242 if (phi_f4 > -0.01) {
243 phi_f4 = -0.01f;
244 }
245 data->deltaScaleY += phi_f4;
246 entity->scale.y += data->deltaScaleY;
247 if (entity->scale.y <= (data->baseScale.y + temp_f6)) {
248 data->deltaScaleY = 0.0f;
249 data->animStateScaleY++;
250 }
251 break;
252 case 1:
253 temp_f6 = data->baseScale.z * 0.1;
254 phi_f4 = ((data->baseScale.y + temp_f6) - entity->scale.y) / 10.0;
255 if (phi_f4 < 0.01) {
256 phi_f4 = 0.01f;
257 }
258 data->deltaScaleY += phi_f4;
259 entity->scale.y += data->deltaScaleY;
260 if ((data->baseScale.y + temp_f6) <= entity->scale.y) {
261 data->deltaScaleY = 0.0f;
262 data->animStateScaleY++;
263 }
264 break;
265 case 2:
266 temp_f6 = data->baseScale.z * -0.3;
267 phi_f4 = ((data->baseScale.y + temp_f6) - entity->scale.y) / 5.0;
268 if (phi_f4 > -0.01) {
269 phi_f4 = -0.01f;
270 }
271 data->deltaScaleY += phi_f4;
272 entity->scale.y += data->deltaScaleY;
273 if (entity->scale.y <= (data->baseScale.y + temp_f6)) {
274 data->deltaScaleY = 0.0f;
275 data->animStateScaleY++;
276 }
277 break;
278 case 3:
279 temp_f6 = data->baseScale.z * 0.0;
280 phi_f4 = ((data->baseScale.y + temp_f6) - entity->scale.y) / 10.0;
281 if (phi_f4 < 0.01) {
282 phi_f4 = 0.01f;
283 }
284 data->deltaScaleY += phi_f4;
285 entity->scale.y += data->deltaScaleY;
286 if ((data->baseScale.y + temp_f6) <= entity->scale.y) {
287 data->deltaScaleY = 0.0f;
288 data->animStateScaleY++;
289 }
290 break;
291 case 4:
292 phi_f4 = (data->baseScale.y - entity->scale.y) / 5.0;
293 if (phi_f4 > -0.01) {
294 phi_f4 = -0.01f;
295 }
296 data->deltaScaleY += phi_f4;
297 entity->scale.y += data->deltaScaleY;
298 if (entity->scale.y <= data->baseScale.y) {
299 entity->scale.y = data->baseScale.y;
300 data->deltaScaleY = 0.0f;
301 data->animStateScaleY++;
302 }
303 break;
304 case 5:
305 phi_s2++;
306 break;
307 }
308
310 if (phi_s2 == 2) {
311 data->animStateScaleX = 0;
312 data->animStateScaleY = 0;
314 }
315}
Vec3f baseScale
Definition entity.h:85
Vec3f scale

◆ entity_base_switch_start_bound_script()

void entity_base_switch_start_bound_script ( Entity * entity)

Definition at line 317 of file Switch.c.

317 {
318 SwitchData* data = entity->dataBuf.swtch;
320 entity_start_script(entity);
321}
u16 areaFlagIndex
Definition entity.h:86
s32 set_area_flag(s32 index)

◆ entity_base_switch_animate_scale()

void entity_base_switch_animate_scale ( Entity * entity)

Definition at line 323 of file Switch.c.

323 {
324 f32 phi_f4;
325 f32 scaleChange;
326 SwitchData* data = entity->dataBuf.swtch;
327 s32 phi_s2 = 0;
328
329 switch (data->animStateScaleX) {
330 case 0:
331 scaleChange = data->baseScale.z * 0.3;
332 phi_f4 = ((data->baseScale.x + scaleChange) - entity->scale.x) / 4.0;
333 if (phi_f4 < 0.01) {
334 phi_f4 = 0.01f;
335 }
336 data->deltaScaleX += phi_f4;
337 entity->scale.x += data->deltaScaleX;
338 if ((data->baseScale.x + scaleChange) <= entity->scale.x) {
339 data->deltaScaleX = 0.0f;
340 data->animStateScaleX++;
341 }
342 break;
343 case 1:
344 scaleChange = (data->baseScale.z * -0.2);
345 phi_f4 = ((data->baseScale.x + scaleChange) - entity->scale.x) / 6.0;
346 if (phi_f4 > -0.01) {
347 phi_f4 = -0.01f;
348 }
349 data->deltaScaleX += phi_f4;
350 entity->scale.x += data->deltaScaleX;
351 if (entity->scale.x <= (data->baseScale.x + scaleChange)) {
352 data->deltaScaleX = 0.0f;
353 data->animStateScaleX++;
354 }
355 break;
356 case 2:
357 scaleChange = data->baseScale.z * 0.15;
358 phi_f4 = ((data->baseScale.x + scaleChange) - entity->scale.x) / 4.0;
359 if (phi_f4 < 0.01) {
360 phi_f4 = 0.01f;
361 }
362 data->deltaScaleX += phi_f4;
363 entity->scale.x += data->deltaScaleX;
364 if ((data->baseScale.x + scaleChange) <= entity->scale.x) {
365 data->deltaScaleX = 0.0f;
366 data->animStateScaleX++;
367 }
368 break;
369 case 3:
370 scaleChange = data->baseScale.z * -0.1;
371 phi_f4 = ((data->baseScale.x + scaleChange) - entity->scale.x) / 6.0;
372 if (phi_f4 > -0.01) {
373 phi_f4 = -0.01f;
374 }
375 data->deltaScaleX += phi_f4;
376 entity->scale.x += data->deltaScaleX;
377 if (entity->scale.x <= (data->baseScale.x + scaleChange)) {
378 data->deltaScaleX = 0.0f;
379 data->animStateScaleX++;
380 }
381 break;
382 case 4:
383 phi_s2++;
384 break;
385 }
386
387 entity->scale.z = entity->scale.x;
388
389 switch (data->animStateScaleY) {
390 case 0:
391 scaleChange = data->baseScale.z * -0.5;
392 phi_f4 = ((data->baseScale.y + scaleChange) - entity->scale.y) / 5.0;
393 if (phi_f4 > -0.01) {
394 phi_f4 = -0.01f;
395 }
396 data->deltaScaleY += phi_f4;
397 entity->scale.y += data->deltaScaleY;
398 if (entity->scale.y <= (data->baseScale.y + scaleChange)) {
399 data->deltaScaleY = 0.0f;
400 data->animStateScaleY++;
401 }
402 break;
403 case 1:
404 scaleChange = data->baseScale.z * 0.1;
405 phi_f4 = ((data->baseScale.y + scaleChange) - entity->scale.y) / 10.0;
406 if (phi_f4 < 0.01) {
407 phi_f4 = 0.01f;
408 }
409 data->deltaScaleY += phi_f4;
410 entity->scale.y += data->deltaScaleY;
411 if ((data->baseScale.y + scaleChange) <= entity->scale.y) {
412 data->deltaScaleY = 0.0f;
413 data->animStateScaleY++;
414 }
415 break;
416 case 2:
417 scaleChange = data->baseScale.z * -0.3;
418 phi_f4 = ((data->baseScale.y + scaleChange) - entity->scale.y) / 5.0;
419 if (phi_f4 > -0.01) {
420 phi_f4 = -0.01f;
421 }
422 data->deltaScaleY += phi_f4;
423 entity->scale.y += data->deltaScaleY;
424 if (entity->scale.y <= (data->baseScale.y + scaleChange)) {
425 data->deltaScaleY = 0.0f;
426 data->animStateScaleY++;
427 }
428 break;
429 case 3:
430 phi_s2++;
431 break;
432 }
433
435 if (phi_s2 == 2) {
436 data->animStateScaleX = 0;
437 data->animStateScaleY = 0;
439 }
440
441 data->scaleAnimTimer++;
442 if (data->scaleAnimTimer == 10 && data->linkedSwitch == NULL) {
443 fx_cold_breath(0, entity->pos.x, entity->pos.y, entity->pos.z, 1.0f, 60);
444 }
445}
s16 scaleAnimTimer
Definition entity.h:88

◆ entity_base_switch_init()

void entity_base_switch_init ( Entity * entity)

Definition at line 447 of file Switch.c.

447 {
448 PlayerStatus* playerStatus = &gPlayerStatus;
449 SwitchData* data = entity->dataBuf.swtch;
450
451 playerStatus->animFlags |= PA_FLAG_MAP_HAS_SWITCH;
452 data->baseScale.x = 1.0f;
453 data->baseScale.y = 1.0f;
454 data->baseScale.z = 1.0f;
455}
@ PA_FLAG_MAP_HAS_SWITCH
Definition enums.h:3119

Referenced by entity_BlueSwitch_init(), and entity_HugeBlueSwitch_init().

◆ entity_BlueSwitch_init()

void entity_BlueSwitch_init ( Entity * entity)

Definition at line 457 of file Switch.c.

457 {
458 SwitchData* data = entity->dataBuf.swtch;
459
462 SwitchToLink = entity;
463 return;
464 }
465
467 if (SwitchToLink != NULL) {
469 entity->flags |= ENTITY_FLAG_HIDDEN;
470 return;
471 }
472 } else {
473 SwitchToLink = NULL;
474 }
475}
#define REFLECTED_SWITCH_LINKED
Definition Switch.c:17
void entity_base_switch_init(Entity *entity)
Definition Switch.c:447
BSS Entity * SwitchToLink
Definition Switch.c:23
#define REFLECTED_SWITCH_HIDDEN
Definition Switch.c:16
s32 CreateEntityVarArgBuffer[]
Definition entity.c:35
@ ENTITY_FLAG_HIDDEN
Definition enums.h:2613

◆ entity_HugeBlueSwitch_init()

void entity_HugeBlueSwitch_init ( Entity * entity)

Definition at line 477 of file Switch.c.

477 {
478 SwitchData* data;
479
481 data = entity->dataBuf.swtch;
482 entity->scale.x = 3.0f;
483 entity->scale.y = 3.0f;
484 entity->scale.z = 3.0f;
485 data->baseScale.x = 3.0f;
486 data->baseScale.y = 3.0f;
487 data->baseScale.z = 3.0f;
488}

Variable Documentation

◆ Entity_RedSwitch_Render

Gfx Entity_RedSwitch_Render[]
extern

Definition at line 183 of file RedSwitch.c.

183 {
184 gsSPDisplayList(Entity_RedSwitch_RenderMain),
185 gsSPEndDisplayList(),
186};
Gfx Entity_RedSwitch_RenderMain[]
Definition RedSwitch.c:176

◆ Entity_BlueSwitch_Render

Gfx Entity_BlueSwitch_Render[]
extern

Definition at line 188 of file BlueSwitch.c.

188 {
189 gsSPDisplayList(Entity_BlueSwitch_RenderMain),
190 gsSPEndDisplayList(),
191};
Gfx Entity_BlueSwitch_RenderMain[]
Definition BlueSwitch.c:181

◆ Entity_GreenStompSwitch_Render

Gfx Entity_GreenStompSwitch_Render[]
extern

Definition at line 99 of file GreenStompSwitch.c.

99 {
100 gsSPDisplayList(Entity_GreenStompSwitch_RenderMain),
101 gsSPEndDisplayList(),
102};
Gfx Entity_GreenStompSwitch_RenderMain[]

◆ SwitchToLink

BSS Entity* SwitchToLink

Definition at line 23 of file Switch.c.

Referenced by entity_BlueSwitch_init().

◆ Entity_RedSwitch_Script

EntityScript Entity_RedSwitch_Script
Initial value:
= {
}
void entity_base_switch_start_bound_script(Entity *entity)
Definition Switch.c:317
void entity_RedSwitch_wait_and_reset(Entity *entity)
Definition Switch.c:143
void entity_small_switch_idle(Entity *entity)
Definition Switch.c:97
s32 entity_RedSwitch_animate_scale(Entity *entity)
Definition Switch.c:159
void entity_base_switch_anim_init(Entity *entity)
Definition Switch.c:149
#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 es_End
Definition entity.h:35
#define es_PlaySound(soundId)
Definition entity.h:45
@ SOUND_ACTIVATE_SWITCH
Definition enums.h:772

Definition at line 490 of file Switch.c.

◆ Entity_HugeBlueSwitch_Script

◆ Entity_BlueSwitch_Script

◆ Entity_GreenStompSwitch_Script

EntityScript Entity_GreenStompSwitch_Script
Initial value:
= {
es_SetCallback(NULL, 128)
}
void entity_GreenStompSwitch_extend(Entity *entity)
Definition Switch.c:51
void entity_GreenStompSwitch_retract(Entity *entity)
Definition Switch.c:38
void entity_GreenStompSwitch_idle(Entity *entity)
Definition Switch.c:25

Definition at line 521 of file Switch.c.

◆ Entity_BlueSwitch_RenderScript

◆ Entity_HugeBlueSwitch_RenderScript

Definition at line 532 of file Switch.c.

◆ Entity_RedSwitch_RenderScript

◆ Entity_GreenStompSwitch_RenderScript

Definition at line 536 of file Switch.c.

◆ Entity_RedSwitch

EntityBlueprint Entity_RedSwitch
Initial value:
= {
.typeDataSize = sizeof(SwitchData),
.renderCommandList = Entity_RedSwitch_RenderScript,
.modelAnimationNodes = 0,
.updateEntityScript = Entity_RedSwitch_Script,
.fpHandleCollision = NULL,
{ .dma = ENTITY_ROM(RedSwitch) },
.entityType = ENTITY_TYPE_RED_SWITCH,
.aabbSize = {22, 23, 22}
}
EntityScript Entity_RedSwitch_Script
Definition Switch.c:490
EntityModelScript Entity_RedSwitch_RenderScript
Definition Switch.c:534
#define ENTITY_ROM(name)
Definition entity.h:65
@ ENTITY_TYPE_RED_SWITCH
Definition enums.h:2551
@ ENTITY_FLAG_8000
Definition enums.h:2628
@ ENTITY_FLAG_ALWAYS_FACE_CAMERA
Definition enums.h:2626

Definition at line 538 of file Switch.c.

538 {
540 .typeDataSize = sizeof(SwitchData),
541 .renderCommandList = Entity_RedSwitch_RenderScript,
542 .modelAnimationNodes = 0,
543 .fpInit = entity_base_switch_init,
544 .updateEntityScript = Entity_RedSwitch_Script,
545 .fpHandleCollision = NULL,
546 { .dma = ENTITY_ROM(RedSwitch) },
547 .entityType = ENTITY_TYPE_RED_SWITCH,
548 .aabbSize = {22, 23, 22}
549};

◆ Entity_BlueSwitch

EntityBlueprint Entity_BlueSwitch
Initial value:
= {
.typeDataSize = sizeof(SwitchData),
.renderCommandList = Entity_BlueSwitch_RenderScript,
.modelAnimationNodes = 0,
.updateEntityScript = Entity_BlueSwitch_Script,
.fpHandleCollision = NULL,
{ .dma = ENTITY_ROM(BlueSwitch) },
.entityType = ENTITY_TYPE_BLUE_SWITCH,
.aabbSize = {22, 23, 22}
}
EntityModelScript Entity_BlueSwitch_RenderScript
Definition Switch.c:530
EntityScript Entity_BlueSwitch_Script
Definition Switch.c:511
void entity_BlueSwitch_init(Entity *entity)
Definition Switch.c:457
@ ENTITY_TYPE_BLUE_SWITCH
Definition enums.h:2550
@ ENTITY_FLAG_HAS_DYNAMIC_SHADOW
Definition enums.h:2615
@ ENTITY_FLAG_FIXED_SHADOW_SIZE
Definition enums.h:2622
@ ENTITY_FLAG_CIRCULAR_SHADOW
Definition enums.h:2624

Definition at line 551 of file Switch.c.

551 {
553 .typeDataSize = sizeof(SwitchData),
554 .renderCommandList = Entity_BlueSwitch_RenderScript,
555 .modelAnimationNodes = 0,
556 .fpInit = entity_BlueSwitch_init,
557 .updateEntityScript = Entity_BlueSwitch_Script,
558 .fpHandleCollision = NULL,
559 { .dma = ENTITY_ROM(BlueSwitch) },
560 .entityType = ENTITY_TYPE_BLUE_SWITCH,
561 .aabbSize = {22, 23, 22}
562};

◆ Entity_HugeBlueSwitch

EntityBlueprint Entity_HugeBlueSwitch
Initial value:
= {
.typeDataSize = sizeof(SwitchData),
.renderCommandList = Entity_HugeBlueSwitch_RenderScript,
.modelAnimationNodes = 0,
.updateEntityScript = Entity_HugeBlueSwitch_Script,
.fpHandleCollision = NULL,
{ .dma = ENTITY_ROM(BlueSwitch) },
.aabbSize = {66, 75, 66}
}
EntityModelScript Entity_HugeBlueSwitch_RenderScript
Definition Switch.c:532
void entity_HugeBlueSwitch_init(Entity *entity)
Definition Switch.c:477
EntityScript Entity_HugeBlueSwitch_Script
Definition Switch.c:501
@ ENTITY_TYPE_HUGE_BLUE_SWITCH
Definition enums.h:2552

Definition at line 564 of file Switch.c.

564 {
566 .typeDataSize = sizeof(SwitchData),
567 .renderCommandList = Entity_HugeBlueSwitch_RenderScript,
568 .modelAnimationNodes = 0,
570 .updateEntityScript = Entity_HugeBlueSwitch_Script,
571 .fpHandleCollision = NULL,
572 { .dma = ENTITY_ROM(BlueSwitch) },
573 .entityType = ENTITY_TYPE_HUGE_BLUE_SWITCH,
574 .aabbSize = {66, 75, 66}
575};

◆ Entity_GreenStompSwitch

EntityBlueprint Entity_GreenStompSwitch
Initial value:
= {
.typeDataSize = sizeof(SwitchData),
.modelAnimationNodes = 0,
.updateEntityScript = Entity_GreenStompSwitch_Script,
.fpHandleCollision = NULL,
{ .dma = ENTITY_ROM(GreenStompSwitch) },
.aabbSize = {50, 15, 50}
}
EntityModelScript Entity_GreenStompSwitch_RenderScript
Definition Switch.c:536
EntityScript Entity_GreenStompSwitch_Script
Definition Switch.c:521
@ ENTITY_TYPE_GREEN_STOMP_SWITCH
Definition enums.h:2553
@ ENTITY_FLAG_4000
Definition enums.h:2627

Definition at line 577 of file Switch.c.

577 {
579 .typeDataSize = sizeof(SwitchData),
580 .renderCommandList = Entity_GreenStompSwitch_RenderScript,
581 .modelAnimationNodes = 0,
582 .fpInit = entity_base_switch_init,
583 .updateEntityScript = Entity_GreenStompSwitch_Script,
584 .fpHandleCollision = NULL,
585 { .dma = ENTITY_ROM(GreenStompSwitch) },
586 .entityType = ENTITY_TYPE_GREEN_STOMP_SWITCH,
587 .aabbSize = {50, 15, 50}
588};