Fix: Actually display correct GS token count in message for vanilla and rando (#2651)

* Revert "fix skulltula token count message on vanilla (#2597)"

This reverts commit 2117d98178.

* fix vanilla vs rando gs token count to be correct
This commit is contained in:
Adam Bird 2023-03-31 22:05:14 -04:00 committed by GitHub
parent f682102c96
commit 21a3bd9f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 15 deletions

View File

@ -1677,8 +1677,11 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
} else { } else {
textId = TEXT_GS_FREEZE; textId = TEXT_GS_FREEZE;
} }
// In vanilla, GS token count is incremented prior to the text box displaying
// In rando we need to bump the token count by one to show the correct count
s16 gsCount = gSaveContext.inventory.gsTokens + (gSaveContext.n64ddFlag ? 1 : 0);
messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId); messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId);
CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{gsCount}}", std::to_string(gSaveContext.inventory.gsTokens)); CustomMessageManager::ReplaceStringInMessage(messageEntry, "{{gsCount}}", std::to_string(gsCount));
} }
} }
if (textId == TEXT_HEART_CONTAINER && CVarGetInteger("gInjectItemCounts", 0)) { if (textId == TEXT_HEART_CONTAINER && CVarGetInteger("gInjectItemCounts", 0)) {

View File

@ -103,11 +103,6 @@ void func_80AFB768(EnSi* this, PlayState* play) {
if (gSaveContext.n64ddFlag) { if (gSaveContext.n64ddFlag) {
Randomizer_UpdateSkullReward(this, play); Randomizer_UpdateSkullReward(this, play);
if (getItemId != RG_ICE_TRAP) {
Randomizer_GiveSkullReward(this, play);
} else {
gSaveContext.pendingIceTrapCount++;
}
} else { } else {
Item_Give(play, giveItemId); Item_Give(play, giveItemId);
} }
@ -122,8 +117,14 @@ void func_80AFB768(EnSi* this, PlayState* play) {
Message_StartTextbox(play, textId, NULL); Message_StartTextbox(play, textId, NULL);
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) { if (gSaveContext.n64ddFlag) {
if (getItemId != RG_ICE_TRAP) {
Randomizer_GiveSkullReward(this, play);
Audio_PlayFanfare_Rando(getItem); Audio_PlayFanfare_Rando(getItem);
} else {
gSaveContext.pendingIceTrapCount++;
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
}
} else { } else {
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
} }
@ -148,19 +149,20 @@ void func_80AFB89C(EnSi* this, PlayState* play) {
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) { if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) {
if (gSaveContext.n64ddFlag) { if (gSaveContext.n64ddFlag) {
Randomizer_UpdateSkullReward(this, play); Randomizer_UpdateSkullReward(this, play);
if (getItemId != RG_ICE_TRAP) {
Randomizer_GiveSkullReward(this, play);
} else {
gSaveContext.pendingIceTrapCount++;
}
} else { } else {
Item_Give(play, giveItemId); Item_Give(play, giveItemId);
} }
Message_StartTextbox(play, textId, NULL); Message_StartTextbox(play, textId, NULL);
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) { if (gSaveContext.n64ddFlag) {
if (getItemId != RG_ICE_TRAP) {
Randomizer_GiveSkullReward(this, play);
Audio_PlayFanfare_Rando(getItem); Audio_PlayFanfare_Rando(getItem);
} else {
gSaveContext.pendingIceTrapCount++;
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
}
} else { } else {
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET); Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
} }