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 <tongcolin@live.ca>
This commit is contained in:
Gregory Heskett
2023-09-18 18:21:39 -04:00
committed by GitHub
parent 44b48ffacd
commit a64be21db8
2 changed files with 14 additions and 3 deletions

View File

@@ -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 --
****************/

View File

@@ -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