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

55 lines
1.6 KiB
C
Raw Normal View History

2019-08-25 04:46:40 +00:00
// bouncing_fireball.c.inc
void bhv_bouncing_fireball_flame_loop(void) {
o->activeFlags |= 0x400;
2020-03-02 03:42:52 +00:00
cur_obj_update_floor_and_walls();
2019-08-25 04:46:40 +00:00
switch (o->oAction) {
case 0:
if (o->oTimer == 0) {
2020-04-03 18:57:26 +00:00
o->oAnimState = random_float() * 10.0f;
2019-08-25 04:46:40 +00:00
o->oVelY = 30.0f;
}
if (o->oMoveFlags & 1)
o->oAction++;
break;
case 1:
if (o->oTimer == 0) {
o->oVelY = 50.0f;
o->oForwardVel = 30.0f;
}
if (o->oMoveFlags & (0x40 | 0x10 | 0x2) && o->oTimer > 100)
2020-03-02 03:42:52 +00:00
obj_mark_for_deletion(o);
2019-08-25 04:46:40 +00:00
break;
}
if (o->oTimer > 300)
2020-03-02 03:42:52 +00:00
obj_mark_for_deletion(o);
cur_obj_move_standard(78);
2019-08-25 04:46:40 +00:00
o->oInteractStatus = 0;
}
void bhv_bouncing_fireball_loop(void) {
struct Object *sp2C;
f32 sp28;
switch (o->oAction) {
case 0:
if (o->oDistanceToMario < 2000.0f)
o->oAction = 1;
break;
case 1:
sp2C = spawn_object(o, MODEL_RED_FLAME, bhvBouncingFireballFlame);
sp28 = (10 - o->oTimer) * 0.5;
2020-03-02 03:42:52 +00:00
obj_scale_xyz(sp2C, sp28, sp28, sp28);
2019-08-25 04:46:40 +00:00
if (o->oTimer == 0)
2020-03-02 03:42:52 +00:00
obj_become_tangible(sp2C);
2019-08-25 04:46:40 +00:00
if (o->oTimer > 10)
o->oAction++;
break;
case 2:
if (o->oTimer == 0)
2020-04-03 18:57:26 +00:00
o->oBouncingFireBallUnkF4 = random_float() * 100.0f;
2019-08-25 04:46:40 +00:00
if (o->oBouncingFireBallUnkF4 + 100 < o->oTimer)
o->oAction = 0;
break;
}
}