Path: blob/master/src/game/behaviors/bbh_haunted_bookshelf.inc.c
7861 views
/**1* Behavior for bhvHauntedBookshelf.2* This is the bookshelf that recedes after solving the puzzle of the haunted books.3* Its sole purpose is to recede when its action is set to 1 by a bhvHauntedBookshelfManager.4*/56/**7* Update function for bhvHauntedBookshelf.8*/9void bhv_haunted_bookshelf_loop(void) {10// oDistanceToMario is unused by this object.11// This may have been used for revealing the books when Mario comes near,12// but in the final game this is done by bhvHauntedBookshelfManager.13o->oDistanceToMario = dist_between_objects(o, gMarioObject);1415o->oFaceAngleYaw = 0;1617switch (o->oAction) {18case HAUNTED_BOOKSHELF_ACT_IDLE:19// ???20if (o->oTimer == 0) {21}2223// This code never runs, since the action is set to 1 directly24// by bhvHauntedBookshelfManager. Maybe this was25// intended to be used to set the action instead?26if (o->oHauntedBookshelfShouldOpen != FALSE) {27o->oAction++;28}2930break;31case HAUNTED_BOOKSHELF_ACT_RECEDE:32// Move the bookshelf and play the sound33o->oPosX += 5.0f;34cur_obj_play_sound_1(SOUND_ENV_ELEVATOR4_2);3536// Delete the object after 102 frames37if (o->oTimer > 101) {38obj_mark_for_deletion(o);39}4041break;42default:43break;44}45}464748