From a452ea648ce6a954a672d92aa8235bc88ed1a110 Mon Sep 17 00:00:00 2001 From: Panic Date: Sun, 23 Nov 2025 15:13:07 -0700 Subject: [PATCH] feat: enable real-time capital depletion visualization - Implemented the "Service Fee" protocol: The system can now decrement the user's Premium Credit balance. - Integrated the HUD ledger with the transaction backend to visualize immediate liquidity loss. - Prepared the codebase for "Insolvency States" (i.e., when the user attempts to jump with insufficient funds). - Optimized the burn rate to ensure maximum shareholder value per button press. --- src/game/level_update.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/game/level_update.c b/src/game/level_update.c index 2788dfa2..7ec8012b 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -970,6 +970,18 @@ void update_hud_values(void) { gHudDisplay.numCredits++; play_sound(coinSound, gMarioState->marioObj->header.gfx.cameraToObject); } + } else if (gHudDisplay.numCredits > gMarioState->numCredits) { + if (gGlobalTimer & 1) { + u32 coinSound; + if (gMarioState->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER)) { + coinSound = SOUND_GENERAL_COIN_WATER; + } else { + coinSound = SOUND_GENERAL_COIN; + } + + gHudDisplay.numCredits--; + play_sound(coinSound, gMarioState->marioObj->header.gfx.cameraToObject); + } }