mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-24 07:05:34 -07:00
Port Better Bombchu Shopping
This commit is contained in:
parent
d6d54334f0
commit
6399eb2d89
3 changed files with 40 additions and 18 deletions
39
soh/soh/Enhancements/Items/BetterBombchuShopping.cpp
Normal file
39
soh/soh/Enhancements/Items/BetterBombchuShopping.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#include <soh/OTRGlobals.h>
|
||||
|
||||
extern "C" {
|
||||
#include <variables.h>
|
||||
}
|
||||
|
||||
//RANDOTODO: Port the rest of the behavior associated with this option here.
|
||||
|
||||
void BuildShopDescMessage(uint16_t* textId, bool* loadFromMessageTable) {
|
||||
CustomMessage msg = CustomMessage(
|
||||
"\x08%rBombchu 10 pieces 99 Rupees&%wThis looks like a toy mouse, but&it's actually a "
|
||||
"self-propelled time&bomb!\x09\x0A",
|
||||
"\x08%rKrabbelmine 10 Stück 99 Rubine&%wDas ist eine praktische Zeitbombe,&die Du als "
|
||||
"Distanzwaffe&einsetzen kannst!\x09\x0A",
|
||||
"\x08%rMissile 10 unités 99 Rubis&%wProfilée comme une souris&mécanique, cette arme est "
|
||||
"&destructrice!!!\x09\x0A"
|
||||
);
|
||||
msg.AutoFormat();
|
||||
msg.LoadIntoFont();
|
||||
*loadFromMessageTable = false;
|
||||
}
|
||||
|
||||
void BuildShopPromptMessage(uint16_t* textId, bool* loadFromMessageTable) {
|
||||
CustomMessage msg = CustomMessage(
|
||||
"\x08Bombchu 10 pieces 99 Rupees\x09&&\x1B%gBuy&Don't buy%w",
|
||||
"\x08Krabbelmine 10 Stück 99 Rubine\x09&&\x1B%gKaufen!&Nicht kaufen!%w",
|
||||
"\x08Missiles 10 unités 99 Rubis\x09&&\x1B%gAcheter&Ne pas acheter%w"
|
||||
);
|
||||
msg.AutoFormat();
|
||||
msg.LoadIntoFont();
|
||||
*loadFromMessageTable = false;
|
||||
}
|
||||
|
||||
void BetterBombchuShopping_Register() {
|
||||
COND_ID_HOOK(OnOpenText, TEXT_BUY_BOMBCHUS_10_DESC, IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("BetterBombchuShopping"), 0), BuildShopDescMessage);
|
||||
COND_ID_HOOK(OnOpenText, TEXT_BUY_BOMBCHUS_10_PROMPT, IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("BetterBombchuShopping"), 0), BuildShopPromptMessage);
|
||||
}
|
||||
|
||||
RegisterShipInitFunc initFunc(BetterBombchuShopping_Register, { "IS_RANDO", CVAR_ENHANCEMENT("BetterBombchuShopping") });
|
|
@ -2138,10 +2138,7 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
|
|||
const int maxBufferSize = sizeof(font->msgBuf);
|
||||
CustomMessage messageEntry;
|
||||
s16 actorParams = 0;
|
||||
if ((IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("BetterBombchuShopping"), 0)) &&
|
||||
(textId == TEXT_BUY_BOMBCHUS_10_DESC || textId == TEXT_BUY_BOMBCHUS_10_PROMPT)) {
|
||||
messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId, MF_FORMATTED);
|
||||
} else if (textId == TEXT_MARKET_GUARD_NIGHT && CVarGetInteger(CVAR_ENHANCEMENT("MarketSneak"), 0) && play->sceneNum == SCENE_MARKET_ENTRANCE_NIGHT) {
|
||||
if (textId == TEXT_MARKET_GUARD_NIGHT && CVarGetInteger(CVAR_ENHANCEMENT("MarketSneak"), 0) && play->sceneNum == SCENE_MARKET_ENTRANCE_NIGHT) {
|
||||
messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_MARKET_GUARD_NIGHT, MF_FORMATTED);
|
||||
}
|
||||
if (textId == TEXT_FISHERMAN_LEAVE && CVarGetInteger(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 0)) {
|
||||
|
|
|
@ -113,20 +113,6 @@ extern "C" void OTRMessage_Init() {
|
|||
}
|
||||
|
||||
CustomMessageManager::Instance->AddCustomMessageTable(customMessageTableID);
|
||||
CustomMessageManager::Instance->CreateMessage(
|
||||
customMessageTableID, TEXT_BUY_BOMBCHUS_10_DESC,
|
||||
CustomMessage("\x08%rBombchu 10 pieces 99 Rupees&%wThis looks like a toy mouse, but&it's actually a "
|
||||
"self-propelled time&bomb!\x09\x0A",
|
||||
"\x08%rKrabbelmine 10 Stück 99 Rubine&%wDas ist eine praktische Zeitbombe,&die Du als "
|
||||
"Distanzwaffe&einsetzen kannst!\x09\x0A",
|
||||
"\x08%rMissile 10 unités 99 Rubis&%wProfilée comme une souris&mécanique, cette arme est "
|
||||
"&destructrice!!!\x09\x0A"));
|
||||
CustomMessageManager::Instance->CreateMessage(
|
||||
customMessageTableID, TEXT_BUY_BOMBCHUS_10_PROMPT,
|
||||
CustomMessage("\x08"
|
||||
"Bombchu 10 pieces 99 Rupees\x09&&\x1B%gBuy&Don't buy%w",
|
||||
"\x08Krabbelmine 10 Stück 99 Rubine\x09&&\x1B%gKaufen!&Nicht kaufen!%w",
|
||||
"\x08Missiles 10 unités 99 Rubis\x09&&\x1B%gAcheter&Ne pas acheter%w"));
|
||||
CustomMessageManager::Instance->CreateMessage(
|
||||
customMessageTableID, TEXT_MARKET_GUARD_NIGHT,
|
||||
CustomMessage("You look bored. Wanna go out for a&walk?\x1B&%gYes&No%w",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue