mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-10 05:28:06 -05:00
use shopsanity enum (#2054)
* enums for rainbow bridge * reorder enum * use enums for shopsanity * remove space Co-authored-by: briaguya <briaguya@alice>
This commit is contained in:
parent
e193f0dc0e
commit
d6c528d9d0
@ -1211,7 +1211,7 @@ void DrawEquipmentTab() {
|
||||
"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) {
|
||||
if (gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS) {
|
||||
const std::string walletName = "Tycoon (999)";
|
||||
walletNamesImpl.push_back(walletName);
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ const std::vector<PresetEntry> hellModePresetEntries = {
|
||||
PRESET_ENTRY_S32("gRandomizeLinksPocket", RO_LINKS_POCKET_NOTHING),
|
||||
PRESET_ENTRY_S32("gRandomizeMqDungeons", 2),
|
||||
PRESET_ENTRY_S32("gRandomizeRainbowBridge", RO_BRIDGE_DUNGEON_REWARDS),
|
||||
PRESET_ENTRY_S32("gRandomizeShopsanity", 5),
|
||||
PRESET_ENTRY_S32("gRandomizeShopsanity", RO_SHOPSANITY_FOUR_ITEMS),
|
||||
PRESET_ENTRY_S32("gRandomizeShuffleAdultTrade", 1),
|
||||
PRESET_ENTRY_S32("gRandomizeShuffleBeans", 1),
|
||||
PRESET_ENTRY_S32("gRandomizeShuffleCows", 1),
|
||||
|
@ -675,19 +675,19 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) {
|
||||
break;
|
||||
case RSK_SHOPSANITY:
|
||||
if(it.value() == "Off") {
|
||||
gSaveContext.randoSettings[index].value = SHOPSANITY_OFF;
|
||||
gSaveContext.randoSettings[index].value = RO_SHOPSANITY_OFF;
|
||||
} else if(it.value() == "0 Items") {
|
||||
gSaveContext.randoSettings[index].value = SHOPSANITY_ZERO;
|
||||
gSaveContext.randoSettings[index].value = RO_SHOPSANITY_ZERO_ITEMS;
|
||||
} else if(it.value() == "1 Item") {
|
||||
gSaveContext.randoSettings[index].value = SHOPSANITY_ONE;
|
||||
gSaveContext.randoSettings[index].value = RO_SHOPSANITY_ONE_ITEM;
|
||||
} else if(it.value() == "2 Items") {
|
||||
gSaveContext.randoSettings[index].value = SHOPSANITY_TWO;
|
||||
gSaveContext.randoSettings[index].value = RO_SHOPSANITY_TWO_ITEMS;
|
||||
} else if(it.value() == "3 Items") {
|
||||
gSaveContext.randoSettings[index].value = SHOPSANITY_THREE;
|
||||
gSaveContext.randoSettings[index].value = RO_SHOPSANITY_THREE_ITEMS;
|
||||
} else if(it.value() == "4 Items") {
|
||||
gSaveContext.randoSettings[index].value = SHOPSANITY_FOUR;
|
||||
gSaveContext.randoSettings[index].value = RO_SHOPSANITY_FOUR_ITEMS;
|
||||
} else if(it.value() == "Random") {
|
||||
gSaveContext.randoSettings[index].value = SHOPSANITY_RANDOM;
|
||||
gSaveContext.randoSettings[index].value = RO_SHOPSANITY_RANDOM;
|
||||
}
|
||||
break;
|
||||
case RSK_SHUFFLE_SCRUBS:
|
||||
@ -1287,7 +1287,7 @@ ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerGet(RandomizerGe
|
||||
// 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;
|
||||
u8 numWallets = GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS ? 3 : 2;
|
||||
switch (randoGet) {
|
||||
case RG_NONE:
|
||||
case RG_TRIFORCE:
|
||||
@ -2588,7 +2588,7 @@ void GenerateRandomizerImgui() {
|
||||
cvarSettings[RSK_SHUFFLE_DUNGEON_REWARDS] = CVar_GetS32("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON);
|
||||
cvarSettings[RSK_SHUFFLE_SONGS] = CVar_GetS32("gRandomizeShuffleSongs", 0);
|
||||
cvarSettings[RSK_SHUFFLE_TOKENS] = CVar_GetS32("gRandomizeShuffleTokens", 0);
|
||||
cvarSettings[RSK_SHOPSANITY] = CVar_GetS32("gRandomizeShopsanity", 0);
|
||||
cvarSettings[RSK_SHOPSANITY] = CVar_GetS32("gRandomizeShopsanity", RO_SHOPSANITY_OFF);
|
||||
cvarSettings[RSK_SHUFFLE_SCRUBS] = CVar_GetS32("gRandomizeShuffleScrubs", 0);
|
||||
cvarSettings[RSK_SHUFFLE_COWS] = CVar_GetS32("gRandomizeShuffleCows", 0);
|
||||
cvarSettings[RSK_SHUFFLE_ADULT_TRADE] = CVar_GetS32("gRandomizeShuffleAdultTrade", 0);
|
||||
|
@ -280,7 +280,7 @@ ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) {
|
||||
case ITEM_WALLET_ADULT:
|
||||
case ITEM_WALLET_GIANT:
|
||||
result.currentCapacity = CUR_CAPACITY(UPG_WALLET);
|
||||
result.maxCapacity = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > 1 ? 999 : 500;
|
||||
result.maxCapacity = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS ? 999 : 500;
|
||||
result.currentAmmo = gSaveContext.rupees;
|
||||
break;
|
||||
case ITEM_BOMBCHU:
|
||||
|
@ -108,7 +108,7 @@ void SaveManager::LoadRandomizerVersion1() {
|
||||
if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) {
|
||||
merchantPricesSize += NUM_SCRUBS;
|
||||
}
|
||||
if (randomizer->GetRandoSettingValue(RSK_SHOPSANITY) > 0) {
|
||||
if (randomizer->GetRandoSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) {
|
||||
merchantPricesSize += NUM_SHOP_ITEMS;
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ void EnGirlA_InitItem(EnGirlA* this, PlayState* play) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gSaveContext.n64ddFlag || !Randomizer_GetSettingValue(RSK_SHOPSANITY)) {
|
||||
if (!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF) {
|
||||
this->objBankIndex = Object_GetIndex(&play->objectCtx, shopItemEntries[params].objID);
|
||||
} else {
|
||||
s16 objectId = shopItemEntries[params].objID;
|
||||
@ -603,7 +603,8 @@ s32 EnGirlA_CanBuy_DekuShield(PlayState* play, EnGirlA* this) {
|
||||
}
|
||||
|
||||
s32 EnGirlA_CanBuy_GoronTunic(PlayState* play, EnGirlA* this) {
|
||||
if (LINK_AGE_IN_YEARS == YEARS_CHILD && (!gSaveContext.n64ddFlag || !Randomizer_GetSettingValue(RSK_SHOPSANITY))) {
|
||||
if (LINK_AGE_IN_YEARS == YEARS_CHILD &&
|
||||
(!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF)) {
|
||||
return CANBUY_RESULT_CANT_GET_NOW;
|
||||
}
|
||||
if (gBitFlags[9] & gSaveContext.inventory.equipment) {
|
||||
@ -619,7 +620,8 @@ s32 EnGirlA_CanBuy_GoronTunic(PlayState* play, EnGirlA* this) {
|
||||
}
|
||||
|
||||
s32 EnGirlA_CanBuy_ZoraTunic(PlayState* play, EnGirlA* this) {
|
||||
if (LINK_AGE_IN_YEARS == YEARS_CHILD && (!gSaveContext.n64ddFlag || !Randomizer_GetSettingValue(RSK_SHOPSANITY))) {
|
||||
if (LINK_AGE_IN_YEARS == YEARS_CHILD &&
|
||||
(!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF)) {
|
||||
return CANBUY_RESULT_CANT_GET_NOW;
|
||||
}
|
||||
if (gBitFlags[10] & gSaveContext.inventory.equipment) {
|
||||
|
@ -427,7 +427,7 @@ void EnOssan_SpawnItemsOnShelves(EnOssan* this, PlayState* play, ShopItem* shopI
|
||||
this->shelfSlots[i] = NULL;
|
||||
} else {
|
||||
itemParams = sShopItemReplaceFunc[shopItems->shopItemIndex](shopItems->shopItemIndex);
|
||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY)) {
|
||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) {
|
||||
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, i);
|
||||
if (shopItemIdentity.randomizerCheck != RC_UNKNOWN_CHECK) {
|
||||
itemParams = shopItemIdentity.enGirlAShopItem;
|
||||
@ -447,7 +447,7 @@ void EnOssan_SpawnItemsOnShelves(EnOssan* this, PlayState* play, ShopItem* shopI
|
||||
shelves->actor.world.pos.y + shopItems->yOffset, shelves->actor.world.pos.z + shopItems->zOffset,
|
||||
shelves->actor.shape.rot.x, shelves->actor.shape.rot.y + sItemShelfRot[i],
|
||||
shelves->actor.shape.rot.z, itemParams);
|
||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY)) {
|
||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) {
|
||||
this->shelfSlots[i]->randoSlotIndex = i;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user