remove unused functions (#4313)

This commit is contained in:
Pepper0ni 2024-09-27 00:26:33 +01:00 committed by GitHub
parent da5cf11449
commit 159d0872d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 519 deletions

View File

@ -146,7 +146,7 @@ Randomizer::Randomizer() {
SpoilerfileAreaNameToEnum["the Graveyard"] = RCAREA_GRAVEYARD;
SpoilerfileAreaNameToEnum["Haunted Wasteland"] = RCAREA_WASTELAND;
SpoilerfileAreaNameToEnum["outside Ganon's Castle"] = RCAREA_HYRULE_CASTLE;
for (int c = 0; c < Rando::StaticData::hintTypeNames.size(); c++) {
for (size_t c = 0; c < Rando::StaticData::hintTypeNames.size(); c++) {
SpoilerfileHintTypeNameToEnum[Rando::StaticData::hintTypeNames[(HintType)c].GetEnglish(MF_CLEAN)] = (HintType)c;
}
}
@ -729,520 +729,6 @@ ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerGet(RandomizerGe
}
}
GetItemID Randomizer::GetItemIdFromRandomizerGet(RandomizerGet randoGet, GetItemID ogItemId) {
// 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.
bool tycoonWallet = GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS;
// Same thing with the infinite upgrades, if we're not shuffling them
//and we're using the Plentiful item pool, we should prevent the infinite
//upgrades from being gotten
u8 infiniteUpgrades = GetRandoSettingValue(RSK_INFINITE_UPGRADES);
switch (randoGet) {
case RG_NONE:
return ogItemId;
case RG_TRIFORCE:
case RG_HINT:
case RG_MAX:
case RG_SOLD_OUT:
return GI_NONE;
// Equipment
case RG_KOKIRI_SWORD:
return GI_SWORD_KOKIRI;
case RG_PROGRESSIVE_GORONSWORD: //todo progressive?
return GI_SWORD_BGS;
case RG_GIANTS_KNIFE:
return GI_SWORD_KNIFE;
case RG_BIGGORON_SWORD:
return GI_SWORD_BGS;
case RG_DEKU_SHIELD:
case RG_BUY_DEKU_SHIELD:
return GI_SHIELD_DEKU;
case RG_HYLIAN_SHIELD:
case RG_BUY_HYLIAN_SHIELD:
return GI_SHIELD_HYLIAN;
case RG_MIRROR_SHIELD:
return GI_SHIELD_MIRROR;
case RG_GORON_TUNIC:
case RG_BUY_GORON_TUNIC:
return GI_TUNIC_GORON;
case RG_ZORA_TUNIC:
case RG_BUY_ZORA_TUNIC:
return GI_TUNIC_ZORA;
case RG_IRON_BOOTS:
return GI_BOOTS_IRON;
case RG_HOVER_BOOTS:
return GI_BOOTS_HOVER;
// Inventory Items
case RG_PROGRESSIVE_STICK_UPGRADE:
switch (CUR_UPG_VALUE(UPG_STICKS)) {
case 0:
case 1:
return GI_STICK_UPGRADE_20;
case 2:
return GI_STICK_UPGRADE_30;
case 3:
case 4:
return infiniteUpgrades == RO_INF_UPGRADES_PROGRESSIVE ? (GetItemID)RG_STICK_UPGRADE_INF : GI_STICK_UPGRADE_30;
}
case RG_PROGRESSIVE_NUT_UPGRADE:
switch (CUR_UPG_VALUE(UPG_NUTS)) {
case 0:
case 1:
return GI_NUT_UPGRADE_30;
case 2:
return GI_NUT_UPGRADE_40;
case 3:
case 4:
return infiniteUpgrades == RO_INF_UPGRADES_PROGRESSIVE ? (GetItemID)RG_NUT_UPGRADE_INF : GI_NUT_UPGRADE_40;
}
case RG_PROGRESSIVE_BOMB_BAG:
switch (CUR_UPG_VALUE(UPG_BOMB_BAG)) {
case 0:
return GI_BOMB_BAG_20;
case 1:
return GI_BOMB_BAG_30;
case 2:
return GI_BOMB_BAG_40;
case 3:
case 4:
return infiniteUpgrades == RO_INF_UPGRADES_PROGRESSIVE ? (GetItemID)RG_BOMB_BAG_INF : GI_BOMB_BAG_40;
}
case RG_BOMBS_5:
case RG_BUY_BOMBS_525:
case RG_BUY_BOMBS_535:
return GI_BOMBS_5;
case RG_BOMBS_10:
case RG_BUY_BOMBS_10:
return GI_BOMBS_10;
case RG_BOMBS_20:
case RG_BUY_BOMBS_20:
return GI_BOMBS_20;
case RG_BUY_BOMBS_30:
return GI_BOMBS_30;
case RG_PROGRESSIVE_BOW:
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
case 0:
return GI_BOW;
case 1:
return GI_QUIVER_40;
case 2:
return GI_QUIVER_50;
case 3:
case 4:
return infiniteUpgrades == RO_INF_UPGRADES_PROGRESSIVE ? (GetItemID)RG_QUIVER_INF : GI_QUIVER_50;
}
case RG_ARROWS_5:
case RG_BUY_ARROWS_10:
return GI_ARROWS_SMALL;
case RG_ARROWS_10:
case RG_BUY_ARROWS_30:
return GI_ARROWS_MEDIUM;
case RG_ARROWS_30:
case RG_BUY_ARROWS_50:
return GI_ARROWS_LARGE;
case RG_PROGRESSIVE_SLINGSHOT:
switch (CUR_UPG_VALUE(UPG_BULLET_BAG)) {
case 0:
return GI_SLINGSHOT;
case 1:
return GI_BULLET_BAG_40;
case 2:
return GI_BULLET_BAG_50;
case 3:
case 4:
return infiniteUpgrades == RO_INF_UPGRADES_PROGRESSIVE ? (GetItemID)RG_BULLET_BAG_INF : GI_BULLET_BAG_50;
}
case RG_DEKU_SEEDS_30:
case RG_BUY_DEKU_SEEDS_30:
return GI_SEEDS_30;
case RG_PROGRESSIVE_OCARINA:
switch (INV_CONTENT(ITEM_OCARINA_FAIRY)) {
case ITEM_NONE:
return GI_OCARINA_FAIRY;
case ITEM_OCARINA_FAIRY:
case ITEM_OCARINA_TIME:
return GI_OCARINA_OOT;
}
case RG_BOMBCHU_5:
case RG_BOMBCHU_10:
case RG_BUY_BOMBCHUS_10:
return GI_BOMBCHUS_10;
case RG_BOMBCHU_20:
case RG_BUY_BOMBCHUS_20:
return GI_BOMBCHUS_20;
case RG_PROGRESSIVE_BOMBCHUS:
if (INV_CONTENT(ITEM_BOMBCHU) == ITEM_NONE) {
return (GetItemID)RG_PROGRESSIVE_BOMBCHUS;
} else if (infiniteUpgrades != RO_INF_UPGRADES_OFF) {
return (GetItemID)RG_BOMBCHU_INF;
} else if (AMMO(ITEM_BOMBCHU) < 5) {
return GI_BOMBCHUS_10;
} else {
return GI_BOMBCHUS_5;
}
case RG_PROGRESSIVE_HOOKSHOT:
switch (INV_CONTENT(ITEM_HOOKSHOT)) {
case ITEM_NONE:
return GI_HOOKSHOT;
case ITEM_HOOKSHOT:
case ITEM_LONGSHOT:
return GI_LONGSHOT;
}
case RG_BOOMERANG:
return GI_BOOMERANG;
case RG_LENS_OF_TRUTH:
return GI_LENS;
case RG_MAGIC_BEAN:
return GI_BEAN;
case RG_MEGATON_HAMMER:
return GI_HAMMER;
case RG_FIRE_ARROWS:
return GI_ARROW_FIRE;
case RG_ICE_ARROWS:
return GI_ARROW_ICE;
case RG_LIGHT_ARROWS:
return GI_ARROW_LIGHT;
case RG_DINS_FIRE:
return GI_DINS_FIRE;
case RG_FARORES_WIND:
return GI_FARORES_WIND;
case RG_NAYRUS_LOVE:
return GI_NAYRUS_LOVE;
// Bottles
case RG_EMPTY_BOTTLE:
return GI_BOTTLE;
case RG_BOTTLE_WITH_MILK:
return GI_MILK_BOTTLE;
case RG_RUTOS_LETTER:
return GI_LETTER_RUTO;
// Bottle Refills
case RG_MILK:
return GI_MILK;
case RG_RED_POTION_REFILL:
case RG_BUY_RED_POTION_30:
case RG_BUY_RED_POTION_40:
case RG_BUY_RED_POTION_50:
return GI_POTION_RED;
case RG_GREEN_POTION_REFILL:
case RG_BUY_GREEN_POTION:
return GI_POTION_GREEN;
case RG_BLUE_POTION_REFILL:
case RG_BUY_BLUE_POTION:
return GI_POTION_BLUE;
case RG_FISH:
case RG_BUY_FISH:
return GI_FISH;
case RG_BUY_BLUE_FIRE:
return GI_BLUE_FIRE;
case RG_BUY_BOTTLE_BUG:
return GI_BUGS;
case RG_BUY_POE:
return GI_POE;
case RG_BUY_FAIRYS_SPIRIT:
return GI_FAIRY;
// Trade Items
case RG_WEIRD_EGG:
return GI_WEIRD_EGG;
case RG_ZELDAS_LETTER:
return GI_LETTER_ZELDA;
case RG_POCKET_EGG:
return GI_POCKET_EGG;
case RG_COJIRO:
return GI_COJIRO;
case RG_ODD_MUSHROOM:
return GI_ODD_MUSHROOM;
case RG_ODD_POTION:
return GI_ODD_POTION;
case RG_POACHERS_SAW:
return GI_SAW;
case RG_BROKEN_SWORD:
return GI_SWORD_BROKEN;
case RG_PRESCRIPTION:
return GI_PRESCRIPTION;
case RG_EYEBALL_FROG:
return GI_FROG;
case RG_EYEDROPS:
return GI_EYEDROPS;
case RG_CLAIM_CHECK:
return GI_CLAIM_CHECK;
// Misc Items
case RG_STONE_OF_AGONY:
return GI_STONE_OF_AGONY;
case RG_GERUDO_MEMBERSHIP_CARD:
return GI_GERUDO_CARD;
case RG_GOLD_SKULLTULA_TOKEN:
return GI_SKULL_TOKEN;
case RG_PROGRESSIVE_STRENGTH:
switch (CUR_UPG_VALUE(UPG_STRENGTH)) {
case 0:
return GI_BRACELET;
case 1:
return GI_GAUNTLETS_SILVER;
case 2:
case 3:
return GI_GAUNTLETS_GOLD;
}
case RG_PROGRESSIVE_WALLET:
if (!Flags_GetRandomizerInf(RAND_INF_HAS_WALLET)) {
return (GetItemID)RG_CHILD_WALLET;
}
switch (CUR_UPG_VALUE(UPG_WALLET)) {
case 0:
return GI_WALLET_ADULT;
case 1:
return GI_WALLET_GIANT;
case 2:
return tycoonWallet ? (GetItemID)RG_TYCOON_WALLET : infiniteUpgrades != RO_INF_UPGRADES_OFF ? (GetItemID)RG_WALLET_INF : GI_WALLET_GIANT;
case 3:
case 4:
return infiniteUpgrades != RO_INF_UPGRADES_OFF ? (GetItemID)RG_WALLET_INF : tycoonWallet ? (GetItemID)RG_TYCOON_WALLET : GI_WALLET_GIANT;
}
case RG_PROGRESSIVE_SCALE:
if (!Flags_GetRandomizerInf(RAND_INF_CAN_SWIM)) {
return (GetItemID)RG_BRONZE_SCALE;
}
switch (CUR_UPG_VALUE(UPG_SCALE)) {
case 0:
return GI_SCALE_SILVER;
case 1:
case 2:
return GI_SCALE_GOLD;
}
case RG_PROGRESSIVE_MAGIC_METER:
switch (gSaveContext.magicLevel) {
case 0:
return (GetItemID)RG_MAGIC_SINGLE;
case 1:
return (GetItemID)RG_MAGIC_DOUBLE;
case 2:
case 3:
return infiniteUpgrades != RO_INF_UPGRADES_OFF ? (GetItemID)RG_MAGIC_INF : (GetItemID)RG_MAGIC_DOUBLE;
}
case RG_RECOVERY_HEART:
case RG_BUY_HEART:
return GI_HEART;
case RG_GREEN_RUPEE:
return GI_RUPEE_GREEN;
case RG_BLUE_RUPEE:
return GI_RUPEE_BLUE;
case RG_RED_RUPEE:
return GI_RUPEE_RED;
case RG_PURPLE_RUPEE:
return GI_RUPEE_PURPLE;
case RG_HUGE_RUPEE:
return GI_RUPEE_GOLD;
case RG_PIECE_OF_HEART:
return GI_HEART_PIECE;
case RG_HEART_CONTAINER:
return GI_HEART_CONTAINER;
case RG_DEKU_NUTS_5:
case RG_BUY_DEKU_NUTS_5:
return GI_NUTS_5;
case RG_DEKU_NUTS_10:
case RG_BUY_DEKU_NUTS_10:
return GI_NUTS_10;
case RG_DEKU_STICK_1:
case RG_BUY_DEKU_STICK_1:
return GI_STICKS_1;
case RG_TREASURE_GAME_SMALL_KEY:
return GI_DOOR_KEY;
case RG_TREASURE_GAME_HEART:
return GI_HEART_PIECE_WIN;
case RG_TREASURE_GAME_GREEN_RUPEE:
return GI_RUPEE_GREEN_LOSE;
//Ocarina Buttons
case RG_OCARINA_A_BUTTON:
return (GetItemID)RG_OCARINA_A_BUTTON;
case RG_OCARINA_C_LEFT_BUTTON:
return (GetItemID)RG_OCARINA_C_LEFT_BUTTON;
case RG_OCARINA_C_RIGHT_BUTTON:
return (GetItemID)RG_OCARINA_C_RIGHT_BUTTON;
case RG_OCARINA_C_UP_BUTTON:
return (GetItemID)RG_OCARINA_C_UP_BUTTON;
case RG_OCARINA_C_DOWN_BUTTON:
return (GetItemID)RG_OCARINA_C_DOWN_BUTTON;
default:
if (!IsItemVanilla(randoGet)) {
return (GetItemID)randoGet;
}
return ogItemId;
}
}
bool Randomizer::IsItemVanilla(RandomizerGet randoGet) {
switch (randoGet) {
case RG_NONE:
case RG_KOKIRI_SWORD:
case RG_GIANTS_KNIFE:
case RG_BIGGORON_SWORD:
case RG_DEKU_SHIELD:
case RG_HYLIAN_SHIELD:
case RG_MIRROR_SHIELD:
case RG_GORON_TUNIC:
case RG_ZORA_TUNIC:
case RG_IRON_BOOTS:
case RG_HOVER_BOOTS:
case RG_BOOMERANG:
case RG_LENS_OF_TRUTH:
case RG_MEGATON_HAMMER:
case RG_STONE_OF_AGONY:
case RG_DINS_FIRE:
case RG_FARORES_WIND:
case RG_NAYRUS_LOVE:
case RG_FIRE_ARROWS:
case RG_ICE_ARROWS:
case RG_LIGHT_ARROWS:
case RG_GERUDO_MEMBERSHIP_CARD:
case RG_MAGIC_BEAN:
case RG_WEIRD_EGG:
case RG_ZELDAS_LETTER:
case RG_RUTOS_LETTER:
case RG_POCKET_EGG:
case RG_COJIRO:
case RG_ODD_MUSHROOM:
case RG_ODD_POTION:
case RG_POACHERS_SAW:
case RG_BROKEN_SWORD:
case RG_PRESCRIPTION:
case RG_EYEBALL_FROG:
case RG_EYEDROPS:
case RG_CLAIM_CHECK:
case RG_GOLD_SKULLTULA_TOKEN:
case RG_PROGRESSIVE_HOOKSHOT:
case RG_PROGRESSIVE_STRENGTH:
return true;
case RG_PROGRESSIVE_BOMB_BAG:
if (CUR_UPG_VALUE(UPG_BOMB_BAG) < 3) {
return true;
} else {
return false;
}
case RG_PROGRESSIVE_BOW:
if (CUR_UPG_VALUE(UPG_QUIVER) < 3) {
return true;
} else {
return false;
}
case RG_PROGRESSIVE_SLINGSHOT:
if (CUR_UPG_VALUE(UPG_BULLET_BAG) < 3) {
return true;
} else {
return false;
}
case RG_PROGRESSIVE_NUT_UPGRADE:
if (CUR_UPG_VALUE(UPG_NUTS) < 3) {
return true;
} else {
return false;
}
case RG_PROGRESSIVE_STICK_UPGRADE:
if (CUR_UPG_VALUE(UPG_STICKS) < 3) {
return true;
} else {
return false;
}
case RG_PROGRESSIVE_OCARINA:
case RG_PROGRESSIVE_GORONSWORD:
case RG_EMPTY_BOTTLE:
case RG_BOTTLE_WITH_MILK:
case RG_RECOVERY_HEART:
case RG_GREEN_RUPEE:
case RG_BLUE_RUPEE:
case RG_RED_RUPEE:
case RG_PURPLE_RUPEE:
case RG_HUGE_RUPEE:
case RG_PIECE_OF_HEART:
case RG_HEART_CONTAINER:
case RG_MILK:
case RG_FISH:
case RG_BOMBS_5:
case RG_BOMBS_10:
case RG_BOMBS_20:
case RG_BOMBCHU_5:
case RG_BOMBCHU_10:
case RG_BOMBCHU_20:
return true;
case RG_PROGRESSIVE_BOMBCHUS:
return INV_CONTENT(ITEM_BOMBCHU) != ITEM_NONE && !GetRandoSettingValue(RSK_INFINITE_UPGRADES);
case RG_ARROWS_5:
case RG_ARROWS_10:
case RG_ARROWS_30:
case RG_DEKU_NUTS_5:
case RG_DEKU_NUTS_10:
case RG_DEKU_SEEDS_30:
case RG_DEKU_STICK_1:
case RG_RED_POTION_REFILL:
case RG_GREEN_POTION_REFILL:
case RG_BLUE_POTION_REFILL:
case RG_TREASURE_GAME_HEART:
case RG_TREASURE_GAME_GREEN_RUPEE:
case RG_BUY_DEKU_NUTS_5:
case RG_BUY_ARROWS_30:
case RG_BUY_ARROWS_50:
case RG_BUY_BOMBS_525:
case RG_BUY_DEKU_NUTS_10:
case RG_BUY_DEKU_STICK_1:
case RG_BUY_BOMBS_10:
case RG_BUY_FISH:
case RG_BUY_RED_POTION_30:
case RG_BUY_GREEN_POTION:
case RG_BUY_BLUE_POTION:
case RG_BUY_HYLIAN_SHIELD:
case RG_BUY_DEKU_SHIELD:
case RG_BUY_GORON_TUNIC:
case RG_BUY_ZORA_TUNIC:
case RG_BUY_HEART:
case RG_BUY_BOMBCHUS_10:
case RG_BUY_BOMBCHUS_20:
case RG_BUY_DEKU_SEEDS_30:
case RG_SOLD_OUT:
case RG_BUY_BLUE_FIRE:
case RG_BUY_BOTTLE_BUG:
case RG_BUY_POE:
case RG_BUY_FAIRYS_SPIRIT:
case RG_BUY_ARROWS_10:
case RG_BUY_BOMBS_20:
case RG_BUY_BOMBS_30:
case RG_BUY_BOMBS_535:
case RG_BUY_RED_POTION_40:
case RG_BUY_RED_POTION_50:
return true;
case RG_PROGRESSIVE_SCALE:
if (!Flags_GetRandomizerInf(RAND_INF_CAN_SWIM)) {
return false;
}
return true;
case RG_PROGRESSIVE_WALLET:
if (!Flags_GetRandomizerInf(RAND_INF_HAS_WALLET)) {
return false;
}
if (CUR_UPG_VALUE(UPG_WALLET) < 2) {
return true;
} else {
return false;
}
default:
return false;
}
}
bool Randomizer::CheckContainsVanillaItem(RandomizerCheck randoCheck) {
RandomizerGet randoGet = Rando::Context::GetInstance()->GetItemLocation(randoCheck)->GetPlacedRandomizerGet();
return IsItemVanilla(randoGet);
}
// There has been some talk about potentially just using the RC identifier to store flags rather than randomizer inf, so
// for now we're not going to store randomzierInf in the randomizer check objects, we're just going to map them 1:1 here
std::map<RandomizerCheck, RandomizerInf> rcToRandomizerInf = {
@ -2525,7 +2011,7 @@ CustomMessage Randomizer::GetMerchantMessage(RandomizerInf randomizerInf, u16 te
RandomizerCheck rc = GetCheckFromRandomizerInf(randomizerInf);
RandomizerGet shopItemGet = ctx->GetItemLocation(rc)->GetPlacedRandomizerGet();
CustomMessage shopItemName;
if (mysterious|| CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)) {
if (mysterious || CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)) {
if (randomizerInf >= RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1 && randomizerInf <= RAND_INF_SHOP_ITEMS_MARKET_BOMBCHU_SHOP_ITEM_8) {
shopItemName = {
"Mysterious Item",

View File

@ -25,7 +25,6 @@
class Randomizer {
private:
std::unordered_map<RandomizerSettingKey, u8> randoSettings;
bool IsItemVanilla(RandomizerGet randoGet);
public:
Randomizer();
@ -56,7 +55,6 @@ class Randomizer {
FishIdentity IdentifyFish(s32 sceneNum, s32 actorParams);
GetItemEntry GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogItemId, bool checkObtainability = true);
GetItemEntry GetItemFromActor(s16 actorId, s16 sceneNum, s16 actorParams, GetItemID ogItemId, bool checkObtainability = true);
GetItemID GetItemIdFromRandomizerGet(RandomizerGet randoGet, GetItemID ogItemId);
ItemObtainability GetItemObtainabilityFromRandomizerCheck(RandomizerCheck randomizerCheck);
ItemObtainability GetItemObtainabilityFromRandomizerGet(RandomizerGet randomizerCheck);
CustomMessage GetSheikMessage(s16 scene, u16 originalTextId);
@ -69,7 +67,6 @@ class Randomizer {
static CustomMessage GetRupeeMessage(u16 rupeeTextId);
static CustomMessage GetIceTrapMessage();
static CustomMessage GetTriforcePieceMessage();
bool CheckContainsVanillaItem(RandomizerCheck randoCheck);
};
#ifdef __cplusplus