Merge pull request #3 from leggettc18/pr/garrettjoecox/1329

Implement's Tycoon Wallet.
This commit is contained in:
Garrett Cox 2022-09-04 14:30:47 -05:00 committed by GitHub
commit adb7ce773e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 9 deletions

View File

@ -1201,11 +1201,19 @@ void DrawEquipmentTab() {
DrawUpgradeIcon("Strength", UPG_STRENGTH, strengthValues); DrawUpgradeIcon("Strength", UPG_STRENGTH, strengthValues);
// There is no icon for child wallet, so default to a text list // There is no icon for child wallet, so default to a text list
const std::vector<std::string> walletNames = { // this was const, but I needed to append to it depending in rando settings.
std::vector<std::string> walletNamesImpl = {
"Child (99)", "Child (99)",
"Adult (200)", "Adult (200)",
"Giant (500)", "Giant (500)",
}; };
// only display Tycoon wallet if you're in a save file that would allow it.
if (gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > 1) {
const std::string walletName = "Tycoon (999)";
walletNamesImpl.push_back(walletName);
}
// copy it to const value for display in ImGui.
const std::vector<std::string> walletNames = walletNamesImpl;
DrawUpgrade("Wallet", UPG_WALLET, walletNames); DrawUpgrade("Wallet", UPG_WALLET, walletNames);
const std::vector<std::string> stickNames = { const std::vector<std::string> stickNames = {

View File

@ -1435,6 +1435,11 @@ ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerCheck(Randomizer
} }
ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerGet(RandomizerGet randoGet) { ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerGet(RandomizerGet randoGet) {
// Shopsanity with at least one item shuffled allows for a third wallet upgrade.
// This is needed since Plentiful item pool also adds a third progressive wallet
// but we should *not* get Tycoon's Wallet in that mode.
u8 numWallets = GetRandoSettingValue(RSK_SHOPSANITY) > 1 ? 3 : 2;
switch (randoGet) { switch (randoGet) {
case RG_NONE: case RG_NONE:
case RG_TRIFORCE: case RG_TRIFORCE:
@ -1625,7 +1630,7 @@ ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerGet(RandomizerGe
case RG_PROGRESSIVE_STRENGTH: case RG_PROGRESSIVE_STRENGTH:
return CUR_UPG_VALUE(UPG_STRENGTH) < 3 ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE; return CUR_UPG_VALUE(UPG_STRENGTH) < 3 ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE;
case RG_PROGRESSIVE_WALLET: case RG_PROGRESSIVE_WALLET:
return CUR_UPG_VALUE(UPG_WALLET) < 2 ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE; return CUR_UPG_VALUE(UPG_WALLET) < numWallets ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE;
case RG_PROGRESSIVE_SCALE: case RG_PROGRESSIVE_SCALE:
return CUR_UPG_VALUE(UPG_SCALE) < 2 ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE; return CUR_UPG_VALUE(UPG_SCALE) < 2 ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE;
case RG_PROGRESSIVE_MAGIC_METER: case RG_PROGRESSIVE_MAGIC_METER:
@ -2017,6 +2022,8 @@ GetItemID Randomizer::GetItemIdFromRandomizerGet(RandomizerGet randoGet, GetItem
return GI_WALLET_ADULT; return GI_WALLET_ADULT;
case 1: case 1:
return GI_WALLET_GIANT; return GI_WALLET_GIANT;
case 2:
return (GetItemID)RG_TYCOON_WALLET;
} }
case RG_PROGRESSIVE_SCALE: case RG_PROGRESSIVE_SCALE:
switch (CUR_UPG_VALUE(UPG_SCALE)) { switch (CUR_UPG_VALUE(UPG_SCALE)) {
@ -2187,7 +2194,6 @@ bool Randomizer::IsItemVanilla(RandomizerGet randoGet) {
case RG_PROGRESSIVE_BOMB_BAG: case RG_PROGRESSIVE_BOMB_BAG:
case RG_PROGRESSIVE_BOW: case RG_PROGRESSIVE_BOW:
case RG_PROGRESSIVE_SLINGSHOT: case RG_PROGRESSIVE_SLINGSHOT:
case RG_PROGRESSIVE_WALLET:
case RG_PROGRESSIVE_SCALE: case RG_PROGRESSIVE_SCALE:
case RG_PROGRESSIVE_NUT_UPGRADE: case RG_PROGRESSIVE_NUT_UPGRADE:
case RG_PROGRESSIVE_STICK_UPGRADE: case RG_PROGRESSIVE_STICK_UPGRADE:
@ -2256,6 +2262,12 @@ bool Randomizer::IsItemVanilla(RandomizerGet randoGet) {
case RG_BUY_RED_POTION_40: case RG_BUY_RED_POTION_40:
case RG_BUY_RED_POTION_50: case RG_BUY_RED_POTION_50:
return true; return true;
case RG_PROGRESSIVE_WALLET:
if (CUR_UPG_VALUE(UPG_WALLET) < 2) {
return true;
} else {
return false;
}
case RG_FOREST_TEMPLE_SMALL_KEY: case RG_FOREST_TEMPLE_SMALL_KEY:
case RG_FIRE_TEMPLE_SMALL_KEY: case RG_FIRE_TEMPLE_SMALL_KEY:
case RG_WATER_TEMPLE_SMALL_KEY: case RG_WATER_TEMPLE_SMALL_KEY:
@ -5481,7 +5493,9 @@ void Randomizer::CreateCustomMessages() {
GIMESSAGE(RG_MAGIC_BEAN_PACK, ITEM_BEAN, GIMESSAGE(RG_MAGIC_BEAN_PACK, ITEM_BEAN,
"You got a %rPack of Magic Beans%w!&Find a suitable spot for a garden&and plant them. Then, wait for&something fun to happen!", "You got a %rPack of Magic Beans%w!&Find a suitable spot for a garden&and plant them. Then, wait for&something fun to happen!",
"Du hast eine %rPackung&Magic Beans%w! Finde&einen geeigneten Platz fur einen&Garten und pflanze sie. Dann^warte auf etwas Lustiges passiert!", "Du hast eine %rPackung&Magic Beans%w! Finde&einen geeigneten Platz fur einen&Garten und pflanze sie. Dann^warte auf etwas Lustiges passiert!",
"Vous avez un %rPack de&haricots magiques%w ! Trouvez&un endroit convenable pour un&jardin et plantez-les.^Ensuite, attendez quelque&chose d'amusant doit arriver !") "Vous avez un %rPack de&haricots magiques%w ! Trouvez&un endroit convenable pour un&jardin et plantez-les.^Ensuite, attendez quelque&chose d'amusant doit arriver !"),
GIMESSAGE_UNTRANSLATED(RG_TYCOON_WALLET, ITEM_WALLET_GIANT,
"You got a %rTycoon's Wallet%w!&It's gigantic! Now you can carry&up to %y999 rupees%w!")
}; };
CreateGetItemMessages(getItemMessages); CreateGetItemMessages(getItemMessages);
CreateRupeeMessages(); CreateRupeeMessages();
@ -5580,7 +5594,8 @@ void InitRandoItemTable() {
GET_ITEM(RG_SHADOW_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_COMPASS), GET_ITEM(RG_SHADOW_TEMPLE_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_SHADOW_TEMPLE_COMPASS),
GET_ITEM(RG_BOTTOM_OF_THE_WELL_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_COMPASS), GET_ITEM(RG_BOTTOM_OF_THE_WELL_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_BOTTOM_OF_THE_WELL_COMPASS),
GET_ITEM(RG_ICE_CAVERN_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_ICE_CAVERN_COMPASS), GET_ITEM(RG_ICE_CAVERN_COMPASS, OBJECT_GI_COMPASS, GID_COMPASS, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_ICE_CAVERN_COMPASS),
GET_ITEM(RG_MAGIC_BEAN_PACK, OBJECT_GI_BEAN, GID_BEAN, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_MAGIC_BEAN_PACK) GET_ITEM(RG_MAGIC_BEAN_PACK, OBJECT_GI_BEAN, GID_BEAN, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_MAGIC_BEAN_PACK),
GET_ITEM(RG_TYCOON_WALLET, OBJECT_GI_PURSE, GID_WALLET_GIANT, TEXT_RANDOMIZER_CUSTOM_ITEM, 0x80, CHEST_ANIM_LONG, MOD_RANDOMIZER, RG_TYCOON_WALLET),
}; };
ItemTableManager::Instance->AddItemTable(MOD_RANDOMIZER); ItemTableManager::Instance->AddItemTable(MOD_RANDOMIZER);
for (int i = 0; i < ARRAY_COUNT(extendedVanillaGetItemTable); i++) { for (int i = 0; i < ARRAY_COUNT(extendedVanillaGetItemTable); i++) {

View File

@ -961,6 +961,7 @@ typedef enum {
RG_BUY_RED_POTION_50, RG_BUY_RED_POTION_50,
RG_TRIFORCE, RG_TRIFORCE,
RG_HINT, RG_HINT,
RG_TYCOON_WALLET,
RG_MAX RG_MAX
} RandomizerGet; } RandomizerGet;

View File

@ -27,7 +27,7 @@ u16 gUpgradeCapacities[][4] = {
{ 0, 20, 30, 40 }, // Bomb Bags { 0, 20, 30, 40 }, // Bomb Bags
{ 0, 0, 0, 0 }, // Unused (Scale) { 0, 0, 0, 0 }, // Unused (Scale)
{ 0, 0, 0, 0 }, // Unused (Strength) { 0, 0, 0, 0 }, // Unused (Strength)
{ 99, 200, 500, 500 }, // Wallets { 99, 200, 500, 999 }, // Wallets
{ 0, 30, 40, 50 }, // Deku Seed Bullet Bags { 0, 30, 40, 50 }, // Deku Seed Bullet Bags
{ 0, 10, 20, 30 }, // Deku Stick Upgrades { 0, 10, 20, 30 }, // Deku Stick Upgrades
{ 0, 20, 30, 40 }, // Deku Nut Upgrades { 0, 20, 30, 40 }, // Deku Nut Upgrades

View File

@ -2392,6 +2392,14 @@ u16 Randomizer_Item_Give(GlobalContext* globalCtx, GetItemEntry giEntry) {
} }
} }
if (item == RG_TYCOON_WALLET) {
Inventory_ChangeUpgrade(UPG_WALLET, 3);
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) {
Rupees_ChangeBy(999);
}
return RG_NONE;
}
temp = gSaveContext.inventory.items[slot]; temp = gSaveContext.inventory.items[slot];
osSyncPrintf("Item_Register(%d)=%d %d\n", slot, item, temp); osSyncPrintf("Item_Register(%d)=%d %d\n", slot, item, temp);
INV_CONTENT(item) = item; INV_CONTENT(item) = item;
@ -4626,14 +4634,15 @@ void Interface_Draw(GlobalContext* globalCtx) {
static s16 D_80125B1C[][3] = { static s16 D_80125B1C[][3] = {
{ 0, 150, 0 }, { 100, 255, 0 }, { 255, 255, 255 }, { 0, 0, 0 }, { 255, 255, 255 }, { 0, 150, 0 }, { 100, 255, 0 }, { 255, 255, 255 }, { 0, 0, 0 }, { 255, 255, 255 },
}; };
static s16 rupeeDigitsFirst[] = { 1, 0, 0 }; static s16 rupeeDigitsFirst[] = { 1, 0, 0, 0 };
static s16 rupeeDigitsCount[] = { 2, 3, 3 }; static s16 rupeeDigitsCount[] = { 2, 3, 3, 3 };
// courtesy of https://github.com/TestRunnerSRL/OoT-Randomizer/blob/Dev/ASM/c/hud_colors.c // courtesy of https://github.com/TestRunnerSRL/OoT-Randomizer/blob/Dev/ASM/c/hud_colors.c
static s16 rupeeWalletColors[3][3] = { static s16 rupeeWalletColors[4][3] = {
{ 0xC8, 0xFF, 0x64 }, // Base Wallet (Green) { 0xC8, 0xFF, 0x64 }, // Base Wallet (Green)
{ 0x82, 0x82, 0xFF }, // Adult's Wallet (Blue) { 0x82, 0x82, 0xFF }, // Adult's Wallet (Blue)
{ 0xFF, 0x64, 0x64 }, // Giant's Wallet (Red) { 0xFF, 0x64, 0x64 }, // Giant's Wallet (Red)
{ 0xFF, 0x5A, 0xFF }, // Tycoon's Wallet (Purple). Only used in rando shopsanity.
}; };
Color_RGB8 rColor_ori = { 200, 255, 100 }; Color_RGB8 rColor_ori = { 200, 255, 100 };
Color_RGB8 rColor; Color_RGB8 rColor;