/**1* Behavior for bhvBooCage.2* This is the cage inside the big boo in the castle courtyard3* that lets Mario enter BBH. It has its own special interaction type,4* INTERACT_BBH_ENTRANCE.5*/67/**8* Boo cage hitbox. It's not tangible; this is the hitbox9* Mario has to enter to enter BBH.10*/11static struct ObjectHitbox sBooCageHitbox = {12/* interactType: */ INTERACT_BBH_ENTRANCE,13/* downOffset: */ 0,14/* damageOrCoinValue: */ 0,15/* health: */ 0,16/* numLootCoins: */ 0,17/* radius: */ 120,18/* height: */ 300,19/* hurtboxRadius: */ 0,20/* hurtboxHeight: */ 0,21};2223/**24* Update function for bhvBooCage.25*/26void bhv_boo_cage_loop(void) {27UNUSED s32 unused;2829obj_set_hitbox(o, &sBooCageHitbox);3031switch (o->oAction) {32case BOO_CAGE_ACT_IN_BOO:33// Don't let Mario enter BBH until the boo is killed34cur_obj_become_intangible();3536// Useless scale. This is also found in the code for BOO_CAGE_ACT_ON_GROUND.37// Was the boo cage originally meant to have been shrunk and grow while falling?38cur_obj_scale(1.0f);3940// If the cage's parent boo is killed, set the action to BOO_CAGE_ACT_FALLING,41// give the cage an initial Y velocity of 60 units/frame, and play the puzzle jingle.42// Otherwise, stay inside the boo.43if (o->parentObj->oBooDeathStatus != BOO_DEATH_STATUS_ALIVE) {44o->oAction++;45o->oVelY = 60.0f;46play_puzzle_jingle();47} else {48obj_copy_pos_and_angle(o, o->parentObj);49}5051break;52case BOO_CAGE_ACT_FALLING:53// Reset pitch and roll. This is useless, since the cage never rotates.54// Was it meant to rotate inside the boo, like the beta boo key?55o->oFaceAnglePitch = 0;56o->oFaceAngleRoll = 0;5758// Apply standard physics to the cage.59cur_obj_update_floor_and_walls();60cur_obj_move_standard(-78);6162// Spawn sparkles while the cage falls.63spawn_object(o, MODEL_NONE, bhvSparkleSpawn);6465// When the cage lands/bounces, play a landing/bouncing sound.66if (o->oMoveFlags & OBJ_MOVE_LANDED) {67cur_obj_play_sound_2(SOUND_GENERAL_SOFT_LANDING);68}6970// Once the cage stops bouncing and settles on the ground,71// set the action to BOO_CAGE_ACT_ON_GROUND.72// This is the only use of the OBJ_MOVE_AT_WATER_SURFACE flag in the game.73// It seems to serve no purpose here.74if (o->oMoveFlags75& (OBJ_MOVE_UNDERWATER_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE | OBJ_MOVE_ON_GROUND)) {76o->oAction++;77}7879break;80case BOO_CAGE_ACT_ON_GROUND:81// Allow Mario to enter the cage once it's still on the ground.82cur_obj_become_tangible();8384// The other useless scale85cur_obj_scale(1.0f);8687// Set the action to BOO_CAGE_ACT_MARIO_JUMPING_IN when Mario jumps in.88if (obj_check_if_collided_with_object(o, gMarioObject)) {89o->oAction++;90}9192break;93case BOO_CAGE_ACT_MARIO_JUMPING_IN:94// All this action does is wait 100 frames after Mario starts95// jumping into the cage to set the action to BOO_CAGE_ACT_USELESS,96// which does nothing. By extension, this action is also useless.9798if (o->oTimer > 100) {99o->oAction++;100}101102break;103case BOO_CAGE_ACT_USELESS:104break;105}106}107108109