sm64pc/src/game/behaviors/rotating_platform.inc.c

37 lines
1.1 KiB
C
Raw Normal View History

2019-08-25 04:46:40 +00:00
// rotating_platform.c.inc
2019-11-03 19:36:27 +00:00
#include "levels/wf/header.h"
#include "levels/wdw/header.h"
struct WFRotatingPlatformData sWFRotatingPlatformData[] = {
{ 0, 100, wf_seg7_collision_rotating_platform, 2000 },
{ 0, 150, wdw_seg7_collision_070186B4, 1000 }
};
2019-08-25 04:46:40 +00:00
void bhv_wf_rotating_wooden_platform_loop(void) {
if (o->oAction == 0) {
o->oAngleVelYaw = 0;
if (o->oTimer > 60) {
o->oAction++;
; // needed to match
}
} else {
o->oAngleVelYaw = 0x100;
if (o->oTimer > 126)
o->oAction = 0;
2020-03-02 03:42:52 +00:00
cur_obj_play_sound_1(SOUND_ENV_ELEVATOR2);
2019-08-25 04:46:40 +00:00
}
2020-03-02 03:42:52 +00:00
cur_obj_rotate_face_angle_using_vel();
2019-08-25 04:46:40 +00:00
}
void bhv_rotating_platform_loop(void) {
s8 sp1F = o->oBehParams >> 24;
if (o->oTimer == 0) {
2020-03-02 03:42:52 +00:00
obj_set_collision_data(o, sWFRotatingPlatformData[o->oBehParams2ndByte].collisionData);
2019-11-03 19:36:27 +00:00
o->oCollisionDistance = sWFRotatingPlatformData[o->oBehParams2ndByte].collisionDistance;
2020-03-02 03:42:52 +00:00
cur_obj_scale(sWFRotatingPlatformData[o->oBehParams2ndByte].scale * 0.01f);
2019-08-25 04:46:40 +00:00
}
o->oAngleVelYaw = sp1F << 4;
o->oFaceAngleYaw += o->oAngleVelYaw;
}