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

64 lines
1.8 KiB
C
Raw Normal View History

2019-08-25 04:46:40 +00:00
// lll_rotating_hex_flame.c.inc
void bhv_lll_rotating_hex_flame_loop(void) {
f32 sp24 = o->oLllRotatingHexFlameUnkF4;
f32 sp20 = o->oLllRotatingHexFlameUnkF8;
f32 sp1C = o->oLllRotatingHexFlameUnkFC;
2020-03-02 03:42:52 +00:00
cur_obj_set_pos_relative(o->parentObj, sp24, sp20, sp1C);
2019-08-25 04:46:40 +00:00
o->oPosY = o->parentObj->oPosY + 100.0f;
if (o->parentObj->oAction == 3)
2020-03-02 03:42:52 +00:00
obj_mark_for_deletion(o);
2019-08-25 04:46:40 +00:00
}
2020-03-02 03:42:52 +00:00
void fire_bar_spawn_flames(s16 a0) {
2019-08-25 04:46:40 +00:00
struct Object *sp2C;
UNUSED s32 unused;
s32 i;
s32 sp20;
f32 sp1C = sins(a0) * 200.0f;
f32 sp18 = coss(a0) * 200.0f;
sp20 = (o->oBehParams2ndByte == 0) ? 4 : 3;
for (i = 0; i < sp20; i++) {
sp2C = spawn_object(o, MODEL_RED_FLAME, bhvLllRotatingHexFlame);
sp2C->oLllRotatingHexFlameUnkF4 += sp1C;
sp2C->oLllRotatingHexFlameUnkF8 = o->oPosY - 200.0f;
sp2C->oLllRotatingHexFlameUnkFC += sp18;
2020-03-02 03:42:52 +00:00
obj_scale_xyz(sp2C, 6.0f, 6.0f, 6.0f);
2019-08-25 04:46:40 +00:00
sp1C += sins(a0) * 150.0f;
sp18 += coss(a0) * 150.0f;
}
}
2020-03-02 03:42:52 +00:00
void fire_bar_act_0(void) {
2019-08-25 04:46:40 +00:00
if (o->oDistanceToMario < 3000.0f)
o->oAction = 1;
}
2020-03-02 03:42:52 +00:00
void fire_bar_act_1(void) {
fire_bar_spawn_flames(0);
fire_bar_spawn_flames(-0x8000);
2019-08-25 04:46:40 +00:00
o->oAngleVelYaw = 0;
o->oMoveAngleYaw = 0;
o->oAction = 2;
}
2020-03-02 03:42:52 +00:00
void fire_bar_act_2(void) {
2019-08-25 04:46:40 +00:00
o->oAngleVelYaw = -0x100;
o->oMoveAngleYaw += o->oAngleVelYaw;
if (o->oDistanceToMario > 3200.0f)
o->oAction = 3;
}
2020-03-02 03:42:52 +00:00
void fire_bar_act_3(void) {
2019-08-25 04:46:40 +00:00
o->oAction = 0;
}
2020-03-02 03:42:52 +00:00
void (*sRotatingCwFireBarsActions[])(void) = { fire_bar_act_0, fire_bar_act_1,
fire_bar_act_2, fire_bar_act_3 };
2019-08-25 04:46:40 +00:00
void bhv_lll_rotating_block_fire_bars_loop(void) {
2020-03-02 03:42:52 +00:00
cur_obj_call_action_function(sRotatingCwFireBarsActions);
2019-08-25 04:46:40 +00:00
if (o->oBehParams2ndByte == 0)
load_object_collision_model();
}