Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
7BB60.c
Go to the documentation of this file.
1#include "common.h"
2#include "world/partners.h"
3#include "sprite/player.h"
4
8f32 StepUpLastYaw; // never read, remove?
9f32 StepUpLastY; // never read, remove?
10
12
13HitID collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 yaw);
15void phys_save_ground_pos(void);
16
20
22 PlayerData* playerData = &gPlayerData;
23 s32 actionState = gPlayerStatusPtr->actionState;
24 PartnerStatus* partnerStatus = &gPartnerStatus;
25
26 if (actionState == ACTION_STATE_IDLE ||
27 actionState == ACTION_STATE_WALK ||
28 actionState == ACTION_STATE_RUN ||
29 actionState == ACTION_STATE_USE_TWEESTER ||
30 actionState == ACTION_STATE_SPIN
31 ) {
32 return TRUE;
33 }
34
35 if (actionState == ACTION_STATE_RIDE) {
36 if (playerData->curPartner == PARTNER_LAKILESTER || playerData->curPartner == PARTNER_BOW) {
37 if (partnerStatus->partnerActionState != PARTNER_ACTION_NONE) {
38 return TRUE;
39 } else {
41 return FALSE;
42 }
43 } else {
44 if (partnerStatus->actingPartner == PARTNER_WATT || partnerStatus->actingPartner == PARTNER_SUSHIE) {
45 return partnerStatus->partnerActionState != PARTNER_ACTION_NONE;
46 }
47 if (partnerStatus->actingPartner == PARTNER_PARAKARRY) {
49 return FALSE;
50 }
51 }
52 }
53 return FALSE;
54}
55
66
68 PlayerStatus* playerStatus = &gPlayerStatus;
69 CollisionStatus* collisionStatus = &gCollisionStatus;
70 HitID hitResult;
71 f32 x, y, z;
72 f32 halfHeight;
73 f32 moveAngle;
74 f32 moveMagnitude;
75 f32 outDepth;
76
77 outDepth = halfHeight = playerStatus->colliderHeight * 0.5f;
78 x = playerStatus->pos.x;
79 y = playerStatus->pos.y + halfHeight;
80 z = playerStatus->pos.z;
81
82 player_input_to_move_vector(&moveAngle, &moveMagnitude);
83
84 if (moveMagnitude != 0.0f) {
85 moveAngle = playerStatus->targetYaw;
86 } else {
87 moveAngle = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw;
88 }
89
90 hitResult = player_raycast_up_corners(playerStatus, &x, &y, &z, &outDepth, moveAngle);
91 collisionStatus->curCeiling = hitResult;
92
93 if (hitResult > NO_COLLIDER) {
94 if (playerStatus->actionState != ACTION_STATE_FALLING
95 && playerStatus->actionState != ACTION_STATE_STEP_DOWN
96 && collisionStatus->curFloor <= NO_COLLIDER
97 ) {
98 if (outDepth <= fabsf(halfHeight + playerStatus->gravityIntegrator[0])) {
99 if ((hitResult & COLLISION_WITH_ENTITY_BIT) && get_entity_type(hitResult) == ENTITY_TYPE_BRICK_BLOCK) {
100 return hitResult;
101 }
102
103 playerStatus->pos.y = y - ((playerStatus->colliderHeight / 5.0f) * 3.0f);
104 if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP
105 && playerStatus->actionState != ACTION_STATE_SPIN_JUMP
106 ) {
107 playerStatus->gravityIntegrator[0] = 0.0f;
108 playerStatus->gravityIntegrator[1] = 0.0f;
109 playerStatus->gravityIntegrator[2] = 0.0f;
110 playerStatus->gravityIntegrator[3] = 0.0f;
111 }
112 }
113 }
114 }
115
116 return hitResult;
117}
118
120 PlayerStatus* playerStatus = &gPlayerStatus;
121 s32 colliderID;
122 f32 groundPosY;
123 AnimID anim;
124
125 if (playerStatus->flags & PS_FLAG_ACTION_STATE_CHANGED) {
126 playerStatus->flags &= ~PS_FLAG_ACTION_STATE_CHANGED;
128 }
129
130 if (playerStatus->actionSubstate == LANDING_ON_SWITCH_SUBSTATE_0) {
131 if (dist2D(JumpedOnSwitchX, JumpedOnSwitchZ, playerStatus->pos.x, playerStatus->pos.z) <= 22.0f) {
132 add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, 5.0f, playerStatus->targetYaw);
133 }
135 if (playerStatus->gravityIntegrator[0] <= 0.0f) {
140 }
141 if (playerStatus->gravityIntegrator[0] > playerStatus->maxJumpSpeed) {
142 playerStatus->gravityIntegrator[0] = playerStatus->maxJumpSpeed;
143 }
144 playerStatus->pos.y += playerStatus->gravityIntegrator[0];
145 } else if (playerStatus->actionSubstate == LANDING_ON_SWITCH_SUBSTATE_2) {
146 if (dist2D(JumpedOnSwitchX, JumpedOnSwitchZ, playerStatus->pos.x, playerStatus->pos.z) <= 22.0f) {
147 add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, 5.0f, playerStatus->targetYaw);
148 }
149 groundPosY = player_check_collision_below(player_fall_distance(), &colliderID);
151 playerStatus->pos.y = groundPosY;
152 if (colliderID > NO_COLLIDER) {
153 if (!(playerStatus->animFlags & PA_FLAG_USING_WATT)) {
154 anim = ANIM_Mario1_Land;
155 } else {
156 anim = ANIM_MarioW1_LandWatt;
157 }
161 }
162 }
163}
164
166 PlayerStatus* playerStatus = &gPlayerStatus;
167 s32 cond = FALSE;
168
169 if (playerStatus->pos.y < playerStatus->gravityIntegrator[3] + playerStatus->gravityIntegrator[2]) {
170 f32 phi_f6 = (playerStatus->gravityIntegrator[3] - playerStatus->pos.y) / 777.0f;
171
172 if (phi_f6 < -0.47) {
173 phi_f6 = -0.47f;
174 }
175 if (phi_f6 > 0.001) {
176 phi_f6 = 0.001f;
177 }
178 playerStatus->gravityIntegrator[0] += phi_f6;
179 playerStatus->pos.y += playerStatus->gravityIntegrator[0];
180 if (playerStatus->gravityIntegrator[0] <= 0.0f) {
181 cond = TRUE;
182 }
183 } else {
184 playerStatus->gravityIntegrator[0] += -1.2;
185 if (playerStatus->gravityIntegrator[0] <= 0.0f) {
186 cond = TRUE;
187 }
188 playerStatus->pos.y += playerStatus->gravityIntegrator[0];
189 }
190
191 if (cond) {
195 }
196}
197
199 PlayerStatus* playerStatus = &gPlayerStatus;
200
201 if (playerStatus->timeInAir != 0) {
202 switch (playerStatus->actionState) {
205 return;
208 return;
211 playerStatus->pos.y += playerStatus->gravityIntegrator[0];
212 if (playerStatus->gravityIntegrator[0] <= 0.0f) {
215 playerStatus->gravityIntegrator[0] = 0.154343f;
216 playerStatus->gravityIntegrator[1] = -0.35008f;
217 playerStatus->gravityIntegrator[2] = 0.0f;
218 playerStatus->gravityIntegrator[3] = 0.0f;
219 } else {
221 }
224 }
225 return;
226 case ACTION_STATE_HOP:
227 playerStatus->gravityIntegrator[0] -= 4.5;
228 playerStatus->pos.y += playerStatus->gravityIntegrator[0];
229 if (playerStatus->gravityIntegrator[0] <= 0.0f) {
234 }
235 return;
238 return;
239 default:
240 if (!(playerStatus->curButtons & BUTTON_A)) {
244 if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
245 playerStatus->gravityIntegrator[1] *= 0.5f;
246 playerStatus->gravityIntegrator[2] *= 0.5f;
247 playerStatus->gravityIntegrator[3] *= 0.5f;
248 }
249 }
250 break;
251 }
252 }
253
255 if (playerStatus->gravityIntegrator[0] <= 0.0f) {
260 }
261
262 if (playerStatus->gravityIntegrator[0] > playerStatus->maxJumpSpeed) {
263 playerStatus->gravityIntegrator[0] = playerStatus->maxJumpSpeed;
264 }
265 playerStatus->pos.y += playerStatus->gravityIntegrator[0];
266}
267
268f32 GravityParamsStartJump[] = { 15.7566404343f, -7.38624f, 3.44693994522f, -0.75f };
269f32 GravityParamsStartFall[] = { 0.154342994094f, -0.350080013275f, -0.182262003422f, 0.0115200001746f };
270
300
314
324
326 PlayerStatus* playerStatus = &gPlayerStatus;
327 PartnerStatus* partnerStatus = &gPartnerStatus;
328
329 if (colliderID > NO_COLLIDER) {
330 s32 surfaceType = get_collider_flags(colliderID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK;
331 switch (surfaceType) {
336 break;
338 if ((*(s32*)(&partnerStatus->partnerActionState) & 0xFF0000FF) != 0x01000009) {
339 if (playerStatus->blinkTimer == 0) {
340 if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
341 playerStatus->hazardType = HAZARD_TYPE_LAVA;
343 }
344 } else {
346 }
347 }
348 break;
350 if ((*(s32*)(&partnerStatus->partnerActionState) & 0xFF0000FF) != 0x01000009) {
351 if (playerStatus->blinkTimer == 0) {
352 if (playerStatus->actionState != ACTION_STATE_HIT_FIRE) {
353 playerStatus->hazardType = HAZARD_TYPE_SPIKES;
355 }
356 break;
357 }
359 }
360 break;
361 default:
363 break;
364 }
365 }
366}
367
369 PlayerStatus* playerStatus = &gPlayerStatus;
370 CollisionStatus* collisionStatus = &gCollisionStatus;
371 f32 moveAngle;
372 f32 moveMagnitude;
373
374 playerStatus->timeInAir = 0;
375 playerStatus->peakJumpTime = 0;
376 playerStatus->flags &= ~PS_FLAG_SCRIPTED_FALL;
377 playerStatus->landPos.x = playerStatus->pos.x;
378 playerStatus->landPos.z = playerStatus->pos.z;
379 playerStatus->flags &= ~PS_FLAG_AIRBORNE;
381 if (!(collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT)) {
383 }
384
385 collisionStatus->lastTouchedFloor = -1;
386 if (collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT) {
387 s32 entityType = get_entity_type(collisionStatus->curFloor);
388
389 if (entityType <= ACTION_STATE_FALLING) {
390 if (entityType >= ACTION_STATE_LANDING_ON_SWITCH) {
391 Entity* entity = get_entity_by_index(collisionStatus->curFloor);
392
394 if (playerStatus->actionState != ACTION_STATE_TORNADO_JUMP
395 && playerStatus->actionState != ACTION_STATE_TORNADO_POUND
396 && playerStatus->actionState != ACTION_STATE_SPIN_JUMP
397 && playerStatus->actionState != ACTION_STATE_SPIN_POUND
398 ) {
400 } else {
402 playerStatus->actionSubstate = 11;
403 }
404 return;
405 }
406 }
407 }
408
409 if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) {
411 return;
412 }
413
414 if (playerStatus->actionState == ACTION_STATE_LANDING_ON_SWITCH) {
416 return;
417 }
418
419 player_input_to_move_vector(&moveAngle, &moveMagnitude);
420 if (moveMagnitude == 0.0f) {
421 if (playerStatus->actionState != ACTION_STATE_STEP_DOWN) {
423 } else {
425 }
426 return;
427 }
428
429 if (moveMagnitude != 0.0f) {
430 playerStatus->targetYaw = moveAngle;
431 }
433}
434
436 PlayerStatus* playerStatus = &gPlayerStatus;
437
438 if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
439 playerStatus->gravityIntegrator[2] += playerStatus->gravityIntegrator[3] / 1.7f;
440 playerStatus->gravityIntegrator[1] += playerStatus->gravityIntegrator[2] / 1.7f;
441 playerStatus->gravityIntegrator[0] += playerStatus->gravityIntegrator[1] / 1.7f;
442 } else {
443 #if DX_DEBUG_MENU
444 if (dx_debug_is_cheat_enabled(DEBUG_CHEAT_HIGH_JUMP)) {
445 playerStatus->gravityIntegrator[2] += playerStatus->gravityIntegrator[3];
446 playerStatus->gravityIntegrator[1] += playerStatus->gravityIntegrator[2] * 1.5;
447 playerStatus->gravityIntegrator[0] += playerStatus->gravityIntegrator[1] * 1.5;
448 return playerStatus->gravityIntegrator[0];
449 }
450 #endif
451
452 playerStatus->gravityIntegrator[2] += playerStatus->gravityIntegrator[3];
453 playerStatus->gravityIntegrator[1] += playerStatus->gravityIntegrator[2];
454 playerStatus->gravityIntegrator[0] += playerStatus->gravityIntegrator[1];
455 }
456
457 return playerStatus->gravityIntegrator[0];
458}
459
461 f32 velocity = integrate_gravity();
462
464 velocity = 0.0f;
465 }
466 return velocity;
467}
468
469f32 player_check_collision_below(f32 offset, s32* colliderID) {
470 PlayerStatus* playerStatus = &gPlayerStatus;
471 CollisionStatus* collisionStatus = &gCollisionStatus;
472 f32 temp_f4 = playerStatus->colliderHeight * 0.5f;
473 f32 outLength = fabsf(offset) + temp_f4;
474 f32 x = playerStatus->pos.x;
475 f32 y = playerStatus->pos.y + temp_f4;
476 f32 z = playerStatus->pos.z;
477 f32 sp38, sp3C, sp40, sp44;
478 s32 hit = *colliderID = player_raycast_below_cam_relative(&gPlayerStatus, &x, &y, &z, &outLength,
479 &sp38, &sp3C, &sp40, &sp44);
480
481 if (hit <= NO_COLLIDER) {
482 if (offset >= 0.0f && collisionStatus->curCeiling > NO_COLLIDER) {
483 return playerStatus->pos.y;
484 }
485 y = playerStatus->pos.y + offset;
486 } else {
487 collisionStatus->curFloor = hit;
488 collisionStatus->lastTouchedFloor = -1;
489 }
490 return y;
491}
492
494 PlayerStatus* playerStatus = &gPlayerStatus;
495 CollisionStatus* collisionStatus = &gCollisionStatus;
496 f32 playerX, playerY, playerZ;
497 f32 test1X, test1Y, test1Z;
498 f32 test2X, test2Y, test2Z;
499 f32 yaw;
500 f32 yaw2;
501 f32 speed;
502 f32 sinTheta;
503 f32 cosTheta;
504 s32 result;
505 s32 test1;
506 s32 test2;
507 f32 xBump;
508 f32 zBump;
509
511 if (playerStatus->flags & PS_FLAG_CUTSCENE_MOVEMENT) {
512 speed = playerStatus->curSpeed;
513 if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
514 speed *= 0.5f;
515 }
516 add_vec2D_polar(&playerStatus->pos.x, &playerStatus->pos.z, speed, playerStatus->heading);
517 return;
518 }
519
520 switch (playerStatus->actionState) {
523 playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw);
524 break;
527 playerStatus->pos.x += playerStatus->pushVel.x;
528 playerStatus->pos.y += playerStatus->pushVel.y;
529 playerStatus->pos.z += playerStatus->pushVel.z;
530
531 if (playerStatus->pushVel.x != 0.0f ||
532 playerStatus->pushVel.y != 0.0f ||
533 playerStatus->pushVel.z != 0.0f)
534 {
535 gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x;
536 gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y;
537 gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z;
538 if (playerStatus->curAlpha != 128) {
540 atan2(0.0f, 0.0f, playerStatus->pushVel.x, playerStatus->pushVel.z));
541 }
542 }
543 }
544 break;
547 playerStatus->pos.x += playerStatus->pushVel.x;
548 playerStatus->pos.y += playerStatus->pushVel.y;
549 playerStatus->pos.z += playerStatus->pushVel.z;
550 if (playerStatus->pushVel.x != 0.0f ||
551 playerStatus->pushVel.y != 0.0f ||
552 playerStatus->pushVel.z != 0.0f)
553 {
554 gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x;
555 gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y;
556 gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z;
557 }
558 if (playerStatus->pushVel.x != 0.0f ||
559 playerStatus->pushVel.y != 0.0f ||
560 playerStatus->pushVel.z != 0.0f)
561 {
563 playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw);
564 }
565 break;
567 playerStatus->pos.x += playerStatus->pushVel.x;
568 playerStatus->pos.y += playerStatus->pushVel.y;
569 playerStatus->pos.z += playerStatus->pushVel.z;
570 if (playerStatus->pushVel.x != 0.0f ||
571 playerStatus->pushVel.y != 0.0f ||
572 playerStatus->pushVel.z != 0.0f)
573 {
574 gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x;
575 gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y;
576 gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z;
577 }
578
579 playerX = playerStatus->pos.x;
580 playerY = playerStatus->pos.y;
581 playerZ = playerStatus->pos.z;
582 if (playerStatus->curSpeed != 0.0f) {
583 yaw = playerStatus->targetYaw;
584 } else {
585 yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw;
586 }
587 collisionStatus->curWall =
588 player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ,
589 playerStatus->colliderDiameter * 0.5f, yaw);
590
591 if (playerStatus->pushVel.x != 0.0f ||
592 playerStatus->pushVel.y != 0.0f ||
593 playerStatus->pushVel.z != 0.0f)
594 {
596 playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw);
597 }
598 break;
599 default:
600 if (!(playerStatus->flags & PS_FLAG_FLYING)) {
601 speed = 0.0f;
602 if (!(playerStatus->flags & (PS_FLAG_SCRIPTED_FALL | PS_FLAG_INPUT_DISABLED))) {
603 player_input_to_move_vector(&yaw, &speed);
604 if (!(playerStatus->animFlags & PA_FLAG_SPINNING)) {
605 speed *= 0.03125f;
606 if (!(playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING))) {
607 speed *= 0.25;
608 }
609 if (playerStatus->actionState == ACTION_STATE_LAUNCH) {
610 speed *= 1.5;
611 }
612 if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
613 speed *= 0.5f;
614 }
615 }
616 sin_cos_rad(DEG_TO_RAD(yaw), &sinTheta, &cosTheta);
617
618 if (playerStatus->actionState == ACTION_STATE_PUSHING_BLOCK) {
619 if (fabsf(sinTheta) > fabsf(cosTheta)) {
620 xBump = speed * sinTheta;
621 zBump = 0.0f;
622 } else {
623 xBump = 0.0f;
624 zBump = -speed * cosTheta;
625 }
626 } else if (!(playerStatus->animFlags & PA_FLAG_SPINNING)) {
627 xBump = speed * sinTheta;
628 zBump = -speed * cosTheta;
629 } else {
630 xBump = 0.0f;
631 zBump = 0.0f;
632 }
633
634 sin_cos_rad(DEG_TO_RAD(playerStatus->targetYaw), &sinTheta, &cosTheta);
635 speed = playerStatus->curSpeed;
636 if (playerStatus->flags & PS_FLAG_ENTERING_BATTLE) {
637 speed *= 0.5f;
638 }
639 playerX = xBump + (speed * sinTheta);
640 playerZ = zBump - (speed * cosTheta);
641 yaw = atan2(0.0f, 0.0f, playerX, playerZ);
642 speed = sqrtf(SQ(playerX) + SQ(playerZ));
643 if (playerStatus->flags & (PS_FLAG_FALLING | PS_FLAG_JUMPING)) {
644 if (speed > playerStatus->runSpeed) {
645 speed = playerStatus->runSpeed;
646 }
647 }
648 }
649
650 playerStatus->pos.x += playerStatus->pushVel.x;
651 playerStatus->pos.z += playerStatus->pushVel.z;
652 if (playerStatus->timeInAir == 0) {
653 playerStatus->pos.y += playerStatus->pushVel.y;
654 }
655
656 if (
657 playerStatus->pushVel.x != 0.0f ||
658 playerStatus->pushVel.y != 0.0f ||
659 playerStatus->pushVel.z != 0.0f)
660 {
661 gCameras[CAM_DEFAULT].targetPos.x = playerStatus->pos.x;
662 gCameras[CAM_DEFAULT].targetPos.y = playerStatus->pos.y;
663 gCameras[CAM_DEFAULT].targetPos.z = playerStatus->pos.z;
664 }
665
666 playerX = playerStatus->pos.x;
667 playerY = playerStatus->pos.y;
668 playerZ = playerStatus->pos.z;
669 result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ,
670 playerStatus->colliderDiameter * 0.5f, playerStatus->targetYaw);
671 if (speed == 0.0f && result <= NO_COLLIDER) {
672 yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw;
673 sin_cos_rad(DEG_TO_RAD(yaw2 + 180.0f), &sinTheta, &cosTheta);
674 playerX = playerStatus->pos.x + (sinTheta * playerStatus->colliderDiameter * 0.5f);
675 playerY = playerStatus->pos.y;
676 playerZ = playerStatus->pos.z - (cosTheta * playerStatus->colliderDiameter * 0.5f);
677 result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ,
678 playerStatus->colliderDiameter, yaw2);
679 }
680 collisionStatus->curWall = result;
681 if (!(playerStatus->flags & PS_FLAG_MOVEMENT_LOCKED) && playerStatus->actionState != ACTION_STATE_HAMMER) {
682 if (speed == 0.0f) {
684 playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw);
685 break;
686 }
687
688 playerX = playerStatus->pos.x;
689 playerZ = playerStatus->pos.z;
690 playerY = playerStatus->pos.y;
691 yaw2 = yaw;
692
693 if (speed > 4.0f) {
694 result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, 4.0f, yaw2);
695 if (result <= NO_COLLIDER) {
696 result = player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, speed - 4.0f, yaw2);
697 }
698 collisionStatus->pushingAgainstWall = result;
699 } else {
700 collisionStatus->pushingAgainstWall =
701 player_test_move_with_slipping(playerStatus, &playerX, &playerY, &playerZ, speed, yaw2);
702 }
703
704 test1X = playerX;
705 test1Y = playerY;
706 test1Z = playerZ;
707 yaw = clamp_angle(yaw2 - 35.0);
708 test1 = player_test_lateral_overlap(PLAYER_COLLISION_0, playerStatus, &test1X, &test1Y, &test1Z, 0.0f, yaw);
709 test2X = playerX;
710 test2Z = playerY;
711 test2Y = playerZ;
712 yaw = clamp_angle(yaw2 + 35.0);
713 test2 = player_test_lateral_overlap(PLAYER_COLLISION_0, playerStatus, &test2X, &test2Z, &test2Y, 0.0f, yaw);
714
715 if (test1 <= NO_COLLIDER) {
716 if (test2 <= NO_COLLIDER) {
717 playerStatus->pos.x = playerX;
718 playerStatus->pos.z = playerZ;
719 } else {
720 playerStatus->pos.x = test1X;
721 playerStatus->pos.z = test1Z;
722 }
723 } else if (test2 <= NO_COLLIDER) {
724 playerStatus->pos.x = test2X;
725 playerStatus->pos.z = test2Y;
726 }
727
728 if (playerStatus->enableCollisionOverlapsCheck == 0) {
729 if (playerStatus->animFlags & PA_FLAG_SPINNING) {
730 yaw2 = playerStatus->targetYaw;
731 } else {
732 yaw2 = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw;
733 }
736 }
737 }
738 }
739 }
740 break;
750 break;
751 }
752}
753
755 HitID ret = NO_COLLIDER;
756 f32 angle = 0.0f;
757 s32 i;
758
759 for (i = 0; i < 4; i++) {
760 f32 x = gPlayerStatusPtr->pos.x;
761 f32 y = gPlayerStatusPtr->pos.y + arg1;
762 f32 z = gPlayerStatusPtr->pos.z;
763 s32 hitID, hitID2;
764
765 hitID = player_test_lateral_overlap(mode, gPlayerStatusPtr, &x, &y, &z, 0.0f, angle);
766
767 // required to match
768 if (hitID > 0 || hitID == 0) {
769 hitID2 = hitID;
770 } else if (hitID == -1) {
771 hitID2 = hitID;
772 } else {
773 hitID2 = hitID;
774 }
775
776 if (hitID2 > NO_COLLIDER) {
777 ret = hitID2;
778 }
780
783 angle += 90.0f;
784 }
785
786 return ret;
787}
788
789HitID func_800E4404(s32 mode, s32 offsetY, f32 arg2, f32* outX, f32* outY, f32* outZ) {
790 HitID ret = NO_COLLIDER;
791 f32 angle = 0.0f;
792 s32 i;
793
794 for (i = 0; i < 4; i++) {
795 f32 x = *outX;
796 f32 y = *outY + offsetY;
797 f32 z = *outZ;
798 s32 hitID = player_test_lateral_overlap(mode, gPlayerStatusPtr, &x, &y, &z, 0.0f, angle);
799
800 if (hitID > NO_COLLIDER) {
801 ret = hitID;
802 }
803
804 *outX = x;
805 *outZ = z;
806 angle += 90.0f;
807 }
808
809 return ret;
810}
811
813 PlayerStatus* playerStatus = &gPlayerStatus;
814 f32 overlapPush = playerStatus->overlapPushAmount;
815
816 if (overlapPush != 0.0f) {
817 f32 x = playerStatus->pos.x;
818 f32 y = playerStatus->pos.y;
819 f32 z = playerStatus->pos.z;
820
821 player_test_lateral_overlap(PLAYER_COLLISION_0, &gPlayerStatus, &x, &y, &z, overlapPush, playerStatus->overlapPushYaw);
822
823 overlapPush -= playerStatus->runSpeed / 10.0f;
824 playerStatus->pos.x = x;
825 playerStatus->pos.y = y;
826 playerStatus->pos.z = z;
827
828 if (overlapPush < 0.0f) {
829 overlapPush = 0.0f;
830 }
831
832 playerStatus->overlapPushAmount = overlapPush;
833 }
834}
835
837
839 if (PlayerSlidingCallback != NULL) {
840 return PlayerSlidingCallback();
841 }
842 return FALSE;
843}
844
845void phys_set_player_sliding_check(b32 (*funcPtr)(void)) {
846 PlayerSlidingCallback = funcPtr;
847}
848
851 f32 rotZ = playerShadow->rot.z + 180.0;
852 f32 rotX = playerShadow->rot.x + 180.0;
853 s32 ret = TRUE;
854
855 if (fabsf(rotZ) < 20.0f && fabsf(rotX) < 20.0f) {
856 ret = FALSE;
857 }
858
859 return ret;
860}
861
863 PlayerStatus* playerStatus = &gPlayerStatus;
864 PartnerStatus* partnerStatus = &gPartnerStatus;
865 CollisionStatus* collisionStatus = &gCollisionStatus;
866 f32 collHeightHalf = playerStatus->colliderHeight * 0.5f;
867 f32 playerX = playerStatus->pos.x;
868 f32 playerY = playerStatus->pos.y + collHeightHalf;
869 f32 playerZ = playerStatus->pos.z;
870 f32 outLength = playerStatus->colliderHeight;
871 f32 temp_f24 = (2.0f * playerStatus->colliderHeight) / 7.0f;
872 f32 hitRx, hitRz;
873 f32 hitDirX, hitDirZ;
874 s32 colliderID;
875 s32 cond;
876
877 colliderID = player_raycast_below_cam_relative(playerStatus, &playerX, &playerY, &playerZ, &outLength, &hitRx, &hitRz,
878 &hitDirX, &hitDirZ);
880
881 if (collHeightHalf + (temp_f24 * 0.5f) < outLength) {
882 colliderID = NO_COLLIDER;
883 }
884 if (playerStatus->timeInAir == 0) {
885 collisionStatus->curFloor = colliderID;
886 }
887 if (colliderID > NO_COLLIDER) {
888 playerStatus->groundAnglesXZ.x = hitDirX;
889 playerStatus->groundAnglesXZ.y = hitDirZ;
890 }
891
893 return;
894 }
895
896 if (playerStatus->flags & PS_FLAG_AIRBORNE) {
897 return;
898 }
899
900 if (playerStatus->actionState == ACTION_STATE_SLIDING) {
901 return;
902 }
903
904 if (playerStatus->flags & PS_FLAG_SLIDING) {
906 }
907
908 if (playerStatus->flags & PS_FLAG_SLIDING && phys_should_player_be_sliding()) {
910 }
911
912 if (playerStatus->actionState == ACTION_STATE_SLIDING) {
913 return;
914 }
915
916 if (colliderID > NO_COLLIDER) {
917 s32 surfaceType = get_collider_flags(colliderID) & COLLIDER_FLAGS_SURFACE_TYPE_MASK;
918 switch (surfaceType) {
920 if (partnerStatus->partnerActionState == PARTNER_ACTION_NONE || partnerStatus->actingPartner != PARTNER_BOW) {
921 if (playerStatus->blinkTimer == 0) {
922 if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
923 playerStatus->hazardType = HAZARD_TYPE_SPIKES;
925 }
926 } else {
928 }
929 }
930 break;
932 if (partnerStatus->partnerActionState == PARTNER_ACTION_NONE || partnerStatus->actingPartner != PARTNER_BOW) {
933 if (playerStatus->blinkTimer == 0) {
934 if (playerStatus->actionState != ACTION_STATE_HIT_LAVA) {
935 playerStatus->hazardType = HAZARD_TYPE_LAVA;
937 }
938 } else {
940 }
941 }
942 break;
943 default:
944 cond = FALSE;
945 if (collisionStatus->curFloor & COLLISION_WITH_ENTITY_BIT) {
946 cond = get_entity_type(collisionStatus->curFloor) == ENTITY_TYPE_HIDDEN_PANEL;
947 }
948
949 if (playerStatus->actionState != ACTION_STATE_STEP_UP && !cond) {
950 if (!(playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS)) {
951 if (playerY - playerStatus->pos.y < 6.0f) {
952 playerStatus->pos.y = playerY;
953 } else {
955 StepUpLastY = playerY;
956 StepUpLastYaw = playerStatus->targetYaw;
957 }
958 } else {
959 playerStatus->pos.y = playerY;
960 }
962 }
963 break;
964 }
965 } else if (!(playerStatus->flags & PS_FLAG_FLYING)
967 ) {
968 if (outLength <= collHeightHalf + temp_f24 && hitDirX == 0.0f && hitDirZ == 0.0f) {
970 } else {
972 }
974 }
975}
976
977void func_800E4AD8(s32 mode) {
978 f32 camYaw = gCameras[gCurrentCameraID].curYaw;
979
981}
982
983void func_800E4B40(s32 mode, f32* outX, f32* outY, f32* outZ) {
984 f32 camYaw = gCameras[gCurrentCameraID].curYaw;
985
986 func_800E4404(mode, 0, gPlayerStatus.spriteFacingAngle - 90.0f + camYaw, outX, outY, outZ);
987}
988
990 PlayerStatus* playerStatus = &gPlayerStatus;
991 f32 x, y, z;
992 f32 yaw;
993
994 if (playerStatus->animFlags & PA_FLAG_USING_PEACH_PHYSICS) {
996 return;
997 }
998
999 yaw = clamp_angle(playerStatus->targetYaw - 30.0);
1000 y = playerStatus->pos.y + (playerStatus->colliderHeight * 0.75f);
1001 x = playerStatus->pos.x;
1002 z = playerStatus->pos.z;
1004 playerStatus->pos.x = x;
1005 playerStatus->pos.z = z;
1006
1007 yaw = clamp_angle(playerStatus->targetYaw + 30.0);
1008 y = playerStatus->pos.y + (playerStatus->colliderHeight * 0.75f);
1009 x = playerStatus->pos.x;
1010 z = playerStatus->pos.z;
1012 playerStatus->pos.x = x;
1013 playerStatus->pos.z = z;
1014
1015 yaw = clamp_angle(playerStatus->targetYaw - 30.0);
1016 x = playerStatus->pos.x;
1017 y = playerStatus->pos.y;
1018 z = playerStatus->pos.z;
1020 playerStatus->pos.x = x;
1021 playerStatus->pos.z = z;
1022
1023 yaw = clamp_angle(playerStatus->targetYaw + 30.0);
1024 x = playerStatus->pos.x;
1025 y = playerStatus->pos.y;
1026 z = playerStatus->pos.z;
1028 playerStatus->pos.x = x;
1029 playerStatus->pos.z = z;
1030
1031 yaw = clamp_angle(playerStatus->targetYaw + 90.0);
1032 x = playerStatus->pos.x;
1033 y = playerStatus->pos.y;
1034 z = playerStatus->pos.z;
1036 playerStatus->pos.x = x;
1037 playerStatus->pos.z = z;
1038 yaw = clamp_angle(playerStatus->targetYaw - 90.0);
1039
1040 x = playerStatus->pos.x;
1041 y = playerStatus->pos.y;
1042 z = playerStatus->pos.z;
1044 playerStatus->pos.x = x;
1045 playerStatus->pos.z = z;
1046
1047 yaw = clamp_angle(playerStatus->targetYaw + 180.0);
1048 x = playerStatus->pos.x;
1049 y = playerStatus->pos.y;
1050 z = playerStatus->pos.z;
1052 playerStatus->pos.x = x;
1053 playerStatus->pos.z = z;
1054}
1055
1057 PlayerStatus* playerStatus = &gPlayerStatus;
1058 s32 climbableStep = FALSE;
1059 f32 yaw = playerStatus->targetYaw;
1060 f32 x = playerStatus->pos.x;
1061 f32 y = playerStatus->pos.y;
1062 f32 z = playerStatus->pos.z;
1063 HitID wall = player_test_move_without_slipping(&gPlayerStatus, &x, &y, &z, 0, yaw, &climbableStep);
1064
1065 playerStatus->pos.x = x;
1066 playerStatus->pos.z = z;
1067
1068 // If there was a climbable step in this direction, but no wall, we can climb up it
1069 if (climbableStep
1070 && wall <= NO_COLLIDER
1071 && playerStatus->actionState != ACTION_STATE_STEP_UP_PEACH
1072 && playerStatus->curSpeed != 0.0f
1073 ) {
1075 }
1076}
1077
1082 && gPlayerStatus.timeInAir < 18
1084 ) {
1085 switch (gPlayerData.bootsLevel) {
1086 case 0:
1087 break;
1088 case 1:
1091 break;
1092 case 2:
1095 break;
1096 }
1097 }
1098}
1099
1101 return gPlayerData.curPartner;
1102}
1103
1104void try_player_footstep_sounds(s32 interval) {
1105 if (gGameStatusPtr->frameCounter % interval == 0) {
1107 s32 soundID, altSoundID;
1108
1109 if (surfaceType == SURFACE_TYPE_FLOWERS || surfaceType == SURFACE_TYPE_HEDGES) {
1110 soundID = SOUND_STEP_CRUNCHY1;
1111 altSoundID = SOUND_STEP_CRUNCHY2;
1112 } else {
1113 soundID = SOUND_STEP_NORMAL1;
1114 altSoundID = SOUND_STEP_NORMAL2;
1115 }
1116
1117 if (FootstepSoundSelector == 0) {
1118 soundID = altSoundID;
1119 }
1120
1123 }
1124}
1125
1129
1131 PlayerStatus* playerStatus = &gPlayerStatus;
1132 HitID ret = NO_COLLIDER;
1133 f32 x, y, z, yaw;
1134
1135 if (playerStatus->flags & PS_FLAG_INPUT_DISABLED) {
1136 return ret;
1137 }
1138
1139 if (playerStatus->pressedButtons & BUTTON_A) {
1140 yaw = playerStatus->targetYaw;
1141 x = playerStatus->pos.x;
1142 y = playerStatus->pos.y;
1143 z = playerStatus->pos.z;
1144 ret = player_test_move_with_slipping(playerStatus, &x, &y, &z, playerStatus->colliderDiameter * 0.5f, yaw);
1145
1146 if (ret <= NO_COLLIDER && playerStatus->curSpeed == 0.0f) {
1147 yaw = playerStatus->spriteFacingAngle - 90.0f + gCameras[gCurrentCameraID].curYaw;
1148 x = playerStatus->pos.x;
1149 y = playerStatus->pos.y;
1150 z = playerStatus->pos.z;
1151 ret = player_test_move_with_slipping(playerStatus, &x, &y, &z, playerStatus->colliderDiameter * 0.5f, yaw);
1152 }
1153 }
1154
1155 return ret;
1156}
1157
1159 s32 ret = TRUE;
1160
1164 ret = FALSE;
1165 }
1166 } else {
1167 ret = FALSE;
1168 }
1172 ret = FALSE;
1173 }
1174 return ret;
1175}
1176
1179
1180 if (deltaYaw < -5.0f && deltaYaw > -175.0f) {
1181 deltaYaw = 0.0f;
1182 } else if (deltaYaw > 5.0f && deltaYaw < 175.0f) {
1183 deltaYaw = 180.0f;
1184 } else {
1185 deltaYaw = PrevPlayerCamRelativeYaw;
1186 }
1187 return clamp_angle(deltaYaw - 90.0f + gCameras[gCurrentCameraID].curYaw);
1188}
1189
1191 f32 angle = 0.0f;
1192
1194 angle = 180.0f;
1195 }
1196
1197 angle = angle + gCameras[CAM_DEFAULT].curYaw + 90.0f;
1198
1199 return clamp_angle(angle);
1200}
1201
1203 PlayerStatus* playerStatus = &gPlayerStatus;
1204
1205 playerStatus->lastGoodPos.x = playerStatus->pos.x;
1206 playerStatus->lastGoodPos.y = playerStatus->pos.y;
1207 playerStatus->lastGoodPos.z = playerStatus->pos.z;
1208}
f32 player_get_camera_facing_angle(void)
Definition 7BB60.c:1190
HitID phys_check_interactable_collision(void)
Definition 7BB60.c:1130
s32 phys_can_player_interact(void)
Definition 7BB60.c:1158
HitID collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 yaw)
Definition 7BB60.c:754
f32 JumpedOnSwitchZ
Definition 7BB60.c:7
f32 integrate_gravity(void)
Definition 7BB60.c:435
void func_800E4B40(s32 mode, f32 *outX, f32 *outY, f32 *outZ)
Definition 7BB60.c:983
void handle_jumping_launch(void)
Definition 7BB60.c:165
CollisionStatus gCollisionStatus
Definition 7BB60.c:5
void phys_player_land(void)
Definition 7BB60.c:368
void phys_update_falling(void)
Definition 7BB60.c:315
f32 GravityParamsStartFall[]
Definition 7BB60.c:269
void phys_set_player_sliding_check(b32(*funcPtr)(void))
Definition 7BB60.c:845
void move_player(s32 duration, f32 heading, f32 speed)
Definition 7BB60.c:56
s32 phys_should_player_be_sliding(void)
Definition 7BB60.c:838
f32 player_get_side_angle(void)
Definition 7BB60.c:1177
void phys_main_collision_below(void)
Definition 7BB60.c:862
void collision_check_player_overlaps(void)
Definition 7BB60.c:812
void gravity_use_fall_parms(void)
Definition 7BB60.c:301
void collision_lateral_peach(void)
Definition 7BB60.c:1056
void handle_jumping_land_on_switch(void)
Definition 7BB60.c:119
f32 StepUpLastYaw
Definition 7BB60.c:8
void player_handle_floor_collider_type(s32 colliderID)
Definition 7BB60.c:325
s32 phys_is_on_sloped_ground(void)
Definition 7BB60.c:849
void phys_update_interact_collider(void)
Definition 7BB60.c:1126
s16 FootstepSoundSelector
Definition 7BB60.c:11
void try_player_footstep_sounds(s32 interval)
Definition 7BB60.c:1104
void record_jump_apex(void)
Definition 7BB60.c:17
f32 StepUpLastY
Definition 7BB60.c:9
void func_800E4AD8(s32 mode)
Definition 7BB60.c:977
void collision_main_lateral(void)
Definition 7BB60.c:493
HitID func_800E4404(s32 mode, s32 offsetY, f32 arg2, f32 *outX, f32 *outY, f32 *outZ)
Definition 7BB60.c:789
void collision_lava_reset_check_additional_overlaps(void)
Definition 7BB60.c:989
b32(* PlayerSlidingCallback)(void)
Definition 7BB60.c:836
void phys_update_jump(void)
Definition 7BB60.c:198
f32 JumpedOnSwitchX
Definition 7BB60.c:6
void phys_init_integrator_for_current_state(void)
Definition 7BB60.c:271
f32 GravityParamsStartJump[]
Definition 7BB60.c:268
f32 player_fall_distance(void)
Definition 7BB60.c:460
s8 get_current_partner_id(void)
Definition 7BB60.c:1100
void phys_save_ground_pos(void)
Definition 7BB60.c:1202
void check_input_midair_jump(void)
Definition 7BB60.c:1078
b32 can_trigger_loading_zone(void)
Definition 7BB60.c:21
f32 player_check_collision_below(f32 offset, s32 *colliderID)
Definition 7BB60.c:469
HitID collision_main_above(void)
Definition 7BB60.c:67
s8 enableCollisionOverlapsCheck
s32 b32
s32 HitID
f32 gravityIntegrator[4]
u32 AnimID
#define sqrtf
#define clamp_angle
#define atan2
@ BUTTON_A
Definition enums.h:2790
@ SURFACE_TYPE_HEDGES
used within hedge maze in flo_11
Definition enums.h:4678
@ SURFACE_TYPE_WATER
Definition enums.h:4670
@ SURFACE_TYPE_SLIDE
Definition enums.h:4674
@ SURFACE_TYPE_LAVA
Definition enums.h:4672
@ SURFACE_TYPE_DOCK_WALL
Definition enums.h:4673
@ SURFACE_TYPE_FLOWERS
Definition enums.h:4675
@ SURFACE_TYPE_SPIKES
Definition enums.h:4671
@ PS_FLAG_FALLING
Definition enums.h:3036
@ PS_FLAG_ENTERING_BATTLE
Definition enums.h:3061
@ PS_FLAG_JUMPING
Definition enums.h:3035
@ PS_FLAG_ACTION_STATE_CHANGED
Definition enums.h:3084
@ PS_FLAG_FLYING
Definition enums.h:3037
@ PS_FLAG_CUTSCENE_MOVEMENT
Definition enums.h:3054
@ PS_FLAG_AIRBORNE
Definition enums.h:3033
@ PS_FLAG_SLIDING
Definition enums.h:3038
@ PS_FLAG_SCRIPTED_FALL
Definition enums.h:3071
@ PS_FLAG_INPUT_DISABLED
Definition enums.h:3052
@ PS_FLAG_MOVEMENT_LOCKED
Definition enums.h:3069
@ PARTNER_ACTION_BOMBETTE_2
Definition enums.h:2937
@ PARTNER_ACTION_NONE
Definition enums.h:2932
@ LANDING_ON_SWITCH_SUBSTATE_1
Definition enums.h:2483
@ LANDING_ON_SWITCH_SUBSTATE_0
Definition enums.h:2482
@ LANDING_ON_SWITCH_SUBSTATE_2
Definition enums.h:2484
@ COLLIDER_FLAGS_SURFACE_TYPE_MASK
Definition enums.h:4692
@ HAZARD_TYPE_LAVA
Definition enums.h:3500
@ HAZARD_TYPE_SPIKES
Definition enums.h:3501
@ ENTITY_TYPE_HIDDEN_PANEL
Definition enums.h:2585
@ ENTITY_TYPE_BRICK_BLOCK
Definition enums.h:2556
@ PLAYER_COLLISION_0
Definition enums.h:4711
@ PLAYER_COLLISION_1
Definition enums.h:4712
@ PA_FLAG_INTERRUPT_USE_PARTNER
forces actions with bow, parakarry, watt, and lakilester to end (sushie not tested)
Definition enums.h:3093
@ PA_FLAG_SPINNING
Definition enums.h:3107
@ PA_FLAG_8BIT_MARIO
Definition enums.h:3105
@ PA_FLAG_RIDING_PARTNER
Definition enums.h:3116
@ PA_FLAG_USING_PEACH_PHYSICS
Definition enums.h:3103
@ PA_FLAG_USING_WATT
Definition enums.h:3090
@ ENTITY_COLLISION_PLAYER_TOUCH_FLOOR
Definition enums.h:2648
@ SOUND_STEP_NORMAL1
Definition enums.h:759
@ SOUND_LAND_SOFTLY
Definition enums.h:765
@ SOUND_STEP_CRUNCHY1
Definition enums.h:761
@ SOUND_STEP_CRUNCHY2
Definition enums.h:762
@ SOUND_STEP_NORMAL2
Definition enums.h:760
@ PARTNER_BOMBETTE
Definition enums.h:2888
@ PARTNER_LAKILESTER
Definition enums.h:2893
@ PARTNER_WATT
Definition enums.h:2891
@ PARTNER_BOW
Definition enums.h:2894
@ PARTNER_SUSHIE
Definition enums.h:2892
@ PARTNER_PARAKARRY
Definition enums.h:2889
@ ACTION_STATE_PUSHING_BLOCK
Definition enums.h:2448
@ ACTION_STATE_RIDE
Definition enums.h:2461
@ ACTION_STATE_HIT_LAVA
Definition enums.h:2451
@ ACTION_STATE_JUMP
Definition enums.h:2430
@ ACTION_STATE_STEP_DOWN_LAND
Definition enums.h:2438
@ ACTION_STATE_SPIN_POUND
Definition enums.h:2442
@ ACTION_STATE_LANDING_ON_SWITCH
Small red/blue ! switches.
Definition enums.h:2434
@ ACTION_STATE_SPIN_JUMP
Definition enums.h:2441
@ ACTION_STATE_LAUNCH
Shy Guy Toybox jack-in-the-boxes.
Definition enums.h:2433
@ ACTION_STATE_IDLE
Definition enums.h:2426
@ ACTION_STATE_USE_TWEESTER
Definition enums.h:2459
@ ACTION_STATE_USE_SPRING
Definition enums.h:2466
@ ACTION_STATE_USE_SNEAKY_PARASOL
Definition enums.h:2453
@ ACTION_STATE_BOUNCE_OFF_SWITCH
Small red/blue ! switches.
Definition enums.h:2460
@ ACTION_STATE_STEP_UP_PEACH
Definition enums.h:2452
@ ACTION_STATE_TORNADO_POUND
Definition enums.h:2444
@ ACTION_STATE_USE_SPINNING_FLOWER
Definition enums.h:2457
@ ACTION_STATE_FALLING
Definition enums.h:2435
@ ACTION_STATE_LAND
Definition enums.h:2437
@ ACTION_STATE_SLIDING
Definition enums.h:2445
@ ACTION_STATE_HOP
Released A before apex of jump.
Definition enums.h:2432
@ ACTION_STATE_KNOCKBACK
Definition enums.h:2450
@ ACTION_STATE_WALK
Definition enums.h:2427
@ ACTION_STATE_BOUNCE
Used with Kooper.
Definition enums.h:2431
@ ACTION_STATE_STEP_DOWN
Definition enums.h:2436
@ ACTION_STATE_HAMMER
Definition enums.h:2446
@ ACTION_STATE_HIT_FIRE
Causes Mario to fly up and take damage. Used for fire bars.
Definition enums.h:2449
@ ACTION_STATE_TORNADO_JUMP
Definition enums.h:2443
@ ACTION_STATE_STEP_UP
Definition enums.h:2462
@ ACTION_STATE_SPIN
Definition enums.h:2454
@ ACTION_STATE_RUN
Definition enums.h:2428
@ SOUND_SPACE_DEFAULT
Definition enums.h:1737
@ CAM_DEFAULT
Definition enums.h:1800
Entity * get_entity_by_index(s32 index)
Definition entity.c:530
f32 fabsf(f32 f)
void player_input_to_move_vector(f32 *angle, f32 *magnitude)
Definition 7B440.c:139
void update_locomotion_state(void)
Definition 7E9D0.c:281
HitID player_raycast_below_cam_relative(PlayerStatus *playerStatus, f32 *outX, f32 *outY, f32 *outZ, f32 *outLength, f32 *hitRx, f32 *hitRz, f32 *hitDirX, f32 *hitDirZ)
Definition 77480.c:192
b32 check_player_action_debug(void)
Definition 77480.c:1015
s32 disable_player_input(void)
Definition 77480.c:989
Shadow * get_shadow_by_index(s32 index)
Definition entity.c:534
s32 get_collider_flags(s32 colliderID)
Definition collision.c:481
s32 enable_player_input(void)
Definition 77480.c:997
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
Definition 43F0.c:668
s32 player_test_lateral_overlap(s32, PlayerStatus *, f32 *, f32 *, f32 *, f32, f32)
Definition 77480.c:369
s32 phys_adjust_cam_on_landing(void)
Definition 7E9D0.c:46
u32 get_entity_type(s32 arg0)
Definition entity.c:568
s32 is_starting_conversation(void)
Definition encounter.c:2816
void set_action_state(s32 actionState)
Definition 7E9D0.c:209
HitID player_raycast_up_corners(PlayerStatus *, f32 *, f32 *, f32 *, f32 *, f32)
Definition 77480.c:254
HitID player_test_move_with_slipping(PlayerStatus *playerStatus, f32 *posX, f32 *posY, f32 *posZ, f32 speed, f32 heading)
Definition 77480.c:562
void suggest_player_anim_allow_backward(AnimID anim)
Definition 77480.c:893
HitID player_test_move_without_slipping(PlayerStatus *, f32 *, f32 *, f32 *, f32, f32, s32 *)
Only used for Peach physics.
Definition 77480.c:495
f32 get_player_normal_pitch(void)
Definition 43F0.c:660
void sin_cos_rad(f32 rad, f32 *outSinTheta, f32 *outCosTheta)
Definition 43F0.c:704
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
Definition 43F0.c:683
f32 get_clamped_angle_diff(f32, f32)
Definition 43F0.c:604
void sfx_play_sound_at_player(s32 soundID, s32 arg1)
Definition sfx.c:521
#define COLLISION_WITH_ENTITY_BIT
Definition macros.h:156
#define DEG_TO_RAD(deg)
Definition macros.h:138
#define LOAD_INTEGRATOR_FALL(ptr)
Definition macros.h:190
#define SQ(x)
Definition macros.h:170
#define NO_COLLIDER
Definition macros.h:160
Vec3f targetPos
u8 collisionFlags
PlayerStatus * gPlayerStatusPtr
PartnerStatus gPartnerStatus
Definition partners.c:42
GameStatus * gGameStatusPtr
Definition main_loop.c:31
Camera gCameras[4]
Definition cam_main.c:16
s32 PrevPlayerCamRelativeYaw
Definition 7E9D0.c:31
PlayerData gPlayerData
Definition 77480.c:39
PlayerStatus gPlayerStatus
Definition 77480.c:38
s32 gCurrentCameraID
Definition cam_math.c:5