From a64be21db87b025144890cfb3a34c40430298d01 Mon Sep 17 00:00:00 2001 From: Gregory Heskett Date: Mon, 18 Sep 2023 18:21:39 -0400 Subject: [PATCH] Added config option for previewable blue coins (#507) * Added config option for previewable blue coins * Clean up previewable blue coin implementation to only be a couple lines --------- Co-authored-by: Colin Tong --- include/config/config_objects.h | 5 +++++ src/game/behaviors/blue_coin.inc.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/config/config_objects.h b/include/config/config_objects.h index 6f2a9952..72c37f63 100644 --- a/include/config/config_objects.h +++ b/include/config/config_objects.h @@ -24,6 +24,11 @@ */ // #define BLUE_COIN_SWITCH_RETRY +/** + * Allow previewing blue coin locations from a blue coin switch when Mario is standing on the blue coin switch. + */ +// #define BLUE_COIN_SWITCH_PREVIEW + /**************** * -- GOOMBA -- ****************/ diff --git a/src/game/behaviors/blue_coin.inc.c b/src/game/behaviors/blue_coin.inc.c index 72591253..189cd2d8 100644 --- a/src/game/behaviors/blue_coin.inc.c +++ b/src/game/behaviors/blue_coin.inc.c @@ -34,15 +34,20 @@ void bhv_hidden_blue_coin_loop(void) { o->oAction = HIDDEN_BLUE_COIN_ACT_ACTIVE; } +#ifdef BLUE_COIN_SWITCH_PREVIEW + if (gMarioObject->platform == blueCoinSwitch) { + cur_obj_enable_rendering(); + } else { + cur_obj_disable_rendering(); + } +#endif + break; case HIDDEN_BLUE_COIN_ACT_ACTIVE: // Become tangible cur_obj_enable_rendering(); cur_obj_become_tangible(); -#ifdef BLUE_COIN_SWITCH_RETRY - o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; -#endif // Delete the coin once collected if (o->oInteractStatus & INT_STATUS_INTERACTED) { @@ -55,6 +60,7 @@ void bhv_hidden_blue_coin_loop(void) { if (cur_obj_wait_then_blink(200, 20)) { #ifdef BLUE_COIN_SWITCH_RETRY o->oAction = HIDDEN_BLUE_COIN_ACT_INACTIVE; + o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; #else obj_mark_for_deletion(o); #endif