Make the final Magic Bean cost 99 rupees in randomiser when it is not shuffled (#3392)

* Make rando final eban cost 99 and clean up Text IDs

* Remove Text ID changes

* Add french translation, All credit to Purple hato

Co-authored-by: Purple Hato <linkvssangoku.jr@gmail.com>

---------

Co-authored-by: Purple Hato <linkvssangoku.jr@gmail.com>
This commit is contained in:
Pepper0ni 2024-02-16 01:20:12 +00:00 committed by GitHub
parent 46aea3aa7c
commit 0932e1e504
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 70 additions and 25 deletions

View File

@ -55,6 +55,22 @@ typedef enum {
TEXT_SHOOTING_GALLERY_MAN_COME_BACK_WITH_BOW = 0x9210,
TEXT_LAKE_HYLIA_WATER_SWITCH_SIGN = 0x346, // 0x3yy for cuttable sign range
TEXT_LAKE_HYLIA_WATER_SWITCH_NAVI = 0x1B3, // 0x1yy for Navi msg range
TEXT_SARIAS_SONG_CHANNELING_POWER = 0x016D,
TEXT_BEAN_SALESMAN_BUY_FOR_10 = 0x405E,
TEXT_BEAN_SALESMAN_BUY_FOR_20 = 0x405F,
TEXT_BEAN_SALESMAN_BUY_FOR_30 = 0x4060,
TEXT_BEAN_SALESMAN_BUY_FOR_40 = 0x4061,
TEXT_BEAN_SALESMAN_BUY_FOR_50 = 0x4062,
TEXT_BEAN_SALESMAN_BUY_FOR_60 = 0x4063,
TEXT_BEAN_SALESMAN_BUY_FOR_70 = 0x4064,
TEXT_BEAN_SALESMAN_BUY_FOR_80 = 0x4065,
TEXT_BEAN_SALESMAN_BUY_FOR_90 = 0x4066,
TEXT_BEAN_SALESMAN_BUY_FOR_100 = 0x4067,
TEXT_BEAN_SALESMAN_OH_WELL = 0x4068,
TEXT_BEAN_SALESMAN_NOT_ENOUGH_MONEY = 0x4069,
TEXT_BEAN_SALESMAN_SET_A_BEAN_TO_C = 0x406A,
TEXT_BEAN_SALESMAN_SOLD_OUT = 0x406B,
TEXT_BEAN_SALESMAN_WANT_TO_PLANT = 0x406C,
} TextIDs;
#ifdef __cplusplus

View File

@ -549,13 +549,18 @@ void Randomizer::LoadMerchantMessages(const char* spoilerFileName) {
"\x12\x38\x82" "Aufgeben! Ich verkaufe dir einen&%g{{item}}%w&für %r{{price}} Rubine%w!\x07\x10\xA3",
"\x12\x38\x82" "J'abandonne! Tu veux bien m'acheter&un %g{{item}}%w?&Ça fera %r{{price}} Rubis%w!\x07\x10\xA3"));
CustomMessageManager::Instance->CreateMessage(
Randomizer::merchantMessageTableID, TEXT_BEAN_SALESMAN,
Randomizer::merchantMessageTableID, TEXT_BEAN_SALESMAN_BUY_FOR_10,
CustomMessage("I tried to be a %rmagic bean%w salesman,&but it turns out my marketing skills&weren't worth "
"beans!^Anyway, want to buy my&%gmysterious item%w for 60 Rupees?\x1B&%gYes&No%w",
"Möchten Sie einen geheimnisvollen&Gegenstand für 60 Rubine?\x1B&%gJa&Nein%w",
"J'ai essayé d'être un vendeur de&%rharicots magiques%w, mais j'étais&mauvais au niveau du marketing et&ça "
"me courait sur le haricot...^Enfin bref, ça te dirait de m'acheter un&"
"%gobjet mystérieux%w pour 60 Rubis?\x1B&%gOui&Non%w"));
CustomMessageManager::Instance->CreateMessage(
Randomizer::merchantMessageTableID, TEXT_BEAN_SALESMAN_BUY_FOR_100,
CustomMessage("I never thought I'd say this, but I'm &selling the last %rMagic Bean%w. %r99%w Rupees...\x1B&%gYes&No%w",
"\x1B&%gJa&Nein%w",
"Je te vends mon dernier %rHaricot&magique%w pour %r99 Rubis%w.\x1B&%gAcheter&Ne pas acheter%w"));
//Setup for merchant text boxes
@ -567,7 +572,7 @@ void Randomizer::LoadMerchantMessages(const char* spoilerFileName) {
"Wie wäre es mit %g&{{item}}%w für %y200 Rubine?%w\x1B&%gJa!&Nein!%w",
"Veux-tu acheter %g&{{item}}%w pour %y200 rubis?%w\x1B&%gOui&Non&w"));
//Granny Shopy
//Granny Shop
//RANDOTODO: Implement obscure/ambiguous hints
CustomMessageManager::Instance->CreateMessage(
Randomizer::merchantMessageTableID, TEXT_GRANNYS_SHOP,
@ -5385,7 +5390,7 @@ CustomMessage Randomizer::GetSheikMessage(s16 scene, u16 originalTextId) {
}
CustomMessage Randomizer::GetSariaMessage(u16 originalTextId) {
if (originalTextId == TEXT_SARIA_SFM || (originalTextId >= TEXT_SARIAS_SONG_TEXT_START && originalTextId <= TEXT_SARIAS_SONG_TEXT_END)) {
if (originalTextId == TEXT_SARIA_SFM || (originalTextId >= TEXT_SARIAS_SONG_FACE_TO_FACE && originalTextId <= TEXT_SARIAS_SONG_CHANNELING_POWER)) {
CustomMessage messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::hintMessageTableID, TEXT_SARIAS_SONG_FACE_TO_FACE);
CustomMessage messageEntry2 = messageEntry;
std::string code = originalTextId == TEXT_SARIA_SFM ? "" : "\x0B";

View File

@ -2588,10 +2588,11 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
messageEntry = OTRGlobals::Instance->gRandomizer->GetGoronMessage(choice);
} else if (Randomizer_GetSettingValue(RSK_FROGS_HINT) && textId == TEXT_FROGS_UNDERWATER) {
messageEntry = OTRGlobals::Instance->gRandomizer->GetFrogsMessage(textId);
} else if (Randomizer_GetSettingValue(RSK_SARIA_HINT)) {
if ((gPlayState->sceneNum == SCENE_SACRED_FOREST_MEADOW && textId == TEXT_SARIA_SFM) || (textId >= TEXT_SARIAS_SONG_TEXT_START && textId <= TEXT_SARIAS_SONG_TEXT_END)) {
messageEntry = OTRGlobals::Instance->gRandomizer->GetSariaMessage(textId);
}
} else if (Randomizer_GetSettingValue(RSK_SARIA_HINT) &&
(gPlayState->sceneNum == SCENE_SACRED_FOREST_MEADOW && textId == TEXT_SARIA_SFM) || (textId >= TEXT_SARIAS_SONG_FACE_TO_FACE && textId <= TEXT_SARIAS_SONG_CHANNELING_POWER)) {
messageEntry = OTRGlobals::Instance->gRandomizer->GetSariaMessage(textId);
} else if (textId == TEXT_BEAN_SALESMAN_BUY_FOR_100) {
messageEntry = CustomMessageManager::Instance->RetrieveMessage(Randomizer::merchantMessageTableID, TEXT_BEAN_SALESMAN_BUY_FOR_100);
}
}
if (textId == TEXT_GS_NO_FREEZE || textId == TEXT_GS_FREEZE) {

View File

@ -18,6 +18,7 @@ void EnMs_SetOfferText(EnMs* this, PlayState* play);
void EnMs_Wait(EnMs* this, PlayState* play);
void EnMs_Talk(EnMs* this, PlayState* play);
void EnMs_Sell(EnMs* this, PlayState* play);
void EnMs_Sell_Rando(EnMs* this, PlayState* play);
void EnMs_TalkAfterPurchase(EnMs* this, PlayState* play);
const ActorInit En_Ms_InitVars = {
@ -49,6 +50,10 @@ static s16 sPrices[] = {
10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
};
static s16 sRandoPrices[] = {
10, 20, 30, 40, 50, 60, 70, 80, 90, 99,
};
static u16 sOfferTextIDs[] = {
0x405E, 0x405F, 0x4060, 0x4061, 0x4062, 0x4063, 0x4064, 0x4065, 0x4066, 0x4067,
};
@ -127,21 +132,30 @@ void EnMs_Talk(EnMs* this, PlayState* play) {
} else if (Message_ShouldAdvance(play)) {
switch (play->msgCtx.choiceIndex) {
case 0: // yes
if (gSaveContext.rupees <
((IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS))
? 60
: sPrices[BEANS_BOUGHT])) {
Message_ContinueTextbox(play, 0x4069); // not enough rupees text
//Randomizer Mechanic: Magic bean salesman
if (IS_RANDO){
if (gSaveContext.rupees < ((Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? 60 : sRandoPrices[BEANS_BOUGHT])) {
Message_ContinueTextbox(play, 0x4069); // TEXT_BEAN_SALESMAN_NOT_ENOUGH_MONEY
return;
}
if (Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)){
GiveItemEntryFromActor(&this->actor, play,
Randomizer_GetItemFromKnownCheck(RC_ZR_MAGIC_BEAN_SALESMAN, GI_BEAN), 90.0f, 10.0f);
} else {
func_8002F434(&this->actor, play, GI_BEAN, 90.0f, 10.0f);
}
this->actionFunc = EnMs_Sell_Rando;
return;
} else { // vanilla code
if(gSaveContext.rupees < sPrices[BEANS_BOUGHT]){
Message_ContinueTextbox(play, 0x4069); // TEXT_BEAN_SALESMAN_NOT_ENOUGH_MONEY
return;
}
func_8002F434(&this->actor, play, GI_BEAN, 90.0f, 10.0f);
this->actionFunc = EnMs_Sell;
return;
}
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) {
GiveItemEntryFromActor(&this->actor, play,
Randomizer_GetItemFromKnownCheck(RC_ZR_MAGIC_BEAN_SALESMAN, GI_BEAN), 90.0f, 10.0f);
} else {
func_8002F434(&this->actor, play, GI_BEAN, 90.0f, 10.0f);
}
this->actionFunc = EnMs_Sell;
return;
//Randomizer Mechanic end
case 1: // no
Message_ContinueTextbox(play, 0x4068);
default:
@ -150,14 +164,13 @@ void EnMs_Talk(EnMs* this, PlayState* play) {
}
}
void EnMs_Sell(EnMs* this, PlayState* play) {
void EnMs_Sell_Rando(EnMs* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
Rupees_ChangeBy((IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? -60 : -sPrices[BEANS_BOUGHT]);
Rupees_ChangeBy((Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? -60 : -sRandoPrices[BEANS_BOUGHT]);
this->actor.parent = NULL;
this->actionFunc =
(IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? EnMs_Wait : EnMs_TalkAfterPurchase;
this->actionFunc = (Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? EnMs_Wait : EnMs_TalkAfterPurchase;
} else {
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) {
if (Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) {
GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_ZR_MAGIC_BEAN_SALESMAN, GI_BEAN);
gSaveContext.pendingSale = itemEntry.itemId;
gSaveContext.pendingSaleMod = itemEntry.modIndex;
@ -172,6 +185,16 @@ void EnMs_Sell(EnMs* this, PlayState* play) {
}
}
void EnMs_Sell(EnMs* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
Rupees_ChangeBy(-sPrices[BEANS_BOUGHT]);
this->actor.parent = NULL;
this->actionFunc = EnMs_TalkAfterPurchase;
} else {
func_8002F434(&this->actor, play, GI_BEAN, 90.0f, 10.0f);
}
}
void EnMs_TalkAfterPurchase(EnMs* this, PlayState* play) {
// if dialog state is 6 and player responded to textbox
if ((Message_GetState(&play->msgCtx)) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) {