From f1377af58a03153b611e3efd081671ed486156fa Mon Sep 17 00:00:00 2001 From: Fazana <52551480+FazanaJ@users.noreply.github.com> Date: Tue, 7 Sep 2021 23:44:09 +0100 Subject: [PATCH] Unlock all define, to open every vanilla locked thing --- include/config.h | 2 ++ src/game/behaviors/boo.inc.c | 16 ++++++++++------ src/game/behaviors/ddd_warp.inc.c | 4 ++++ src/game/interaction.c | 9 ++++++++- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/include/config.h b/include/config.h index a6076b32..0f499d6b 100644 --- a/include/config.h +++ b/include/config.h @@ -129,6 +129,8 @@ #define AREA_COUNT 8 // Lightweight directional lighting engine by Fazana. Intended for giving proximity and positional pointlights to small objects. //#define PUPPYLIGHTS +// Open all courses and doors. Used for debugging purposes to unlock all content. +//#define UNLOCK_ALL // BUG/GAME QOL FIXES // Fix instant warp offset not working when warping across different areas diff --git a/src/game/behaviors/boo.inc.c b/src/game/behaviors/boo.inc.c index aef903fe..682a2b86 100644 --- a/src/game/behaviors/boo.inc.c +++ b/src/game/behaviors/boo.inc.c @@ -85,10 +85,12 @@ static s32 boo_should_be_active(void) { void bhv_courtyard_boo_triplet_init(void) { s32 i; struct Object *boo; - +#ifndef UNLOCK_ALL if (gHudDisplay.stars < 12) { obj_mark_for_deletion(o); - } else { + } else +#endif + { for (i = 0; i < 3; i++) { boo = spawn_object_relative( 0x01, @@ -725,10 +727,12 @@ static void boo_with_cage_act_3(void) { void bhv_boo_with_cage_init(void) { struct Object* cage; - +#ifndef UNLOCK_ALL if (gHudDisplay.stars < 12) { obj_mark_for_deletion(o); - } else { + } else +#endif + { cage = spawn_object(o, MODEL_HAUNTED_CAGE, bhvBooCage); cage->oBehParams = o->oBehParams; } @@ -809,11 +813,11 @@ void bhv_boo_in_castle_loop(void) { if (o->oAction == 0) { cur_obj_hide(); - +#ifndef UNLOCK_ALL if (gHudDisplay.stars < 12) { obj_mark_for_deletion(o); } - +#endif if (gMarioCurrentRoom == 1) { o->oAction++; } diff --git a/src/game/behaviors/ddd_warp.inc.c b/src/game/behaviors/ddd_warp.inc.c index 617e850f..2b594528 100644 --- a/src/game/behaviors/ddd_warp.inc.c +++ b/src/game/behaviors/ddd_warp.inc.c @@ -1,8 +1,12 @@ // ddd_warp.c.inc void bhv_ddd_warp_loop(void) { +#ifndef UNLOCK_ALL if (gDddPaintingStatus & BOWSERS_SUB_BEATEN) +#endif o->collisionData = segmented_to_virtual(inside_castle_seg7_collision_ddd_warp_2); +#ifndef UNLOCK_ALL else o->collisionData = segmented_to_virtual(inside_castle_seg7_collision_ddd_warp); +#endif } diff --git a/src/game/interaction.c b/src/game/interaction.c index 4990d0d0..03f4ceb3 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -915,6 +915,7 @@ u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Obj u32 actionArg; if (m->action == ACT_WALKING || m->action == ACT_DECELERATING) { +#ifndef UNLOCK_ALL if (warpDoorId == 1 && !(saveFlags & SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR)) { if (!(saveFlags & SAVE_FLAG_HAVE_KEY_2)) { if (!sDisplayingDoorText) { @@ -943,6 +944,7 @@ u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Obj doorAction = ACT_UNLOCKING_KEY_DOOR; } +#endif if (m->action == ACT_WALKING || m->action == ACT_DECELERATING) { actionArg = should_push_or_pull_door(m, o) + 0x00000004; @@ -1009,7 +1011,9 @@ u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object * s16 numStars = save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1); if (m->action == ACT_WALKING || m->action == ACT_DECELERATING) { +#ifndef UNLOCK_ALL if (numStars >= requiredNumStars) { +#endif u32 actionArg = should_push_or_pull_door(m, o); u32 enterDoorAction; u32 doorSaveFileFlag; @@ -1028,11 +1032,13 @@ u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object * enterDoorAction = ACT_ENTERING_STAR_DOOR; } +#ifndef UNLOCK_ALL if (doorSaveFileFlag != 0 && !(save_file_get_flags() & doorSaveFileFlag)) { enterDoorAction = ACT_UNLOCKING_STAR_DOOR; } - +#endif return set_mario_action(m, enterDoorAction, actionArg); +#ifndef UNLOCK_ALL } else if (!sDisplayingDoorText) { u32 text = DIALOG_022 << 16; @@ -1062,6 +1068,7 @@ u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object * sDisplayingDoorText = TRUE; return set_mario_action(m, ACT_READING_AUTOMATIC_DIALOG, text); } +#endif } else if (m->action == ACT_IDLE && sDisplayingDoorText == TRUE && requiredNumStars == 70) { m->interactObj = o; m->usedObj = o;