mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-11 14:08:20 -05:00
Minor adjustments from feedback and rename CanObtain to ItemObtainability
This commit is contained in:
parent
676f8945ab
commit
c7a7059db4
@ -1212,7 +1212,7 @@ s16 Randomizer::GetItemFromActor(s16 actorId, s16 actorParams, s16 sceneNum, Get
|
||||
return GetItemIDFromRandomizerGet(this->itemLocations[GetCheckFromActor(sceneNum, actorId, actorParams)], ogItemId);
|
||||
}
|
||||
|
||||
CanObtainResult Randomizer::GetCanObtainFromRandomizerCheck(RandomizerCheck randomizerCheck) {
|
||||
ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerCheck(RandomizerCheck randomizerCheck) {
|
||||
switch (this->itemLocations[randomizerCheck]) {
|
||||
case RG_NONE:
|
||||
case RG_TRIFORCE:
|
||||
@ -1294,16 +1294,22 @@ CanObtainResult Randomizer::GetCanObtainFromRandomizerCheck(RandomizerCheck rand
|
||||
default:
|
||||
return CANT_OBTAIN_ALREADY_HAVE;
|
||||
}
|
||||
case RG_PROGRESSIVE_BOMBCHUS:
|
||||
return INV_CONTENT(ITEM_BOMBCHU) == ITEM_NONE ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE;
|
||||
case RG_BOMBCHU_5:
|
||||
case RG_BOMBCHU_10:
|
||||
case RG_BOMBCHU_20:
|
||||
case RG_BOMBCHU_DROP:
|
||||
case RG_PROGRESSIVE_BOMBCHUS:
|
||||
return CAN_OBTAIN;
|
||||
case RG_BUY_BOMBCHU_10:
|
||||
case RG_BUY_BOMBCHU_20:
|
||||
case RG_BUY_BOMBCHU_5:
|
||||
// TODO: We'll need to account for GetRandoSettingValue(RSK_BOMBCHUS_IN_LOGIC) whenever that's added
|
||||
// If Bombchus aren't in logic, you need a bomb bag to purchase them
|
||||
// If they are in logic, you need to have already obtained them somewhere else
|
||||
if (GetRandoSettingValue(RSK_BOMBCHUS_IN_LOGIC)) {
|
||||
return INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU ? CAN_OBTAIN : CANT_OBTAIN_NEED_UPGRADE;
|
||||
} else {
|
||||
return CUR_UPG_VALUE(UPG_BOMB_BAG) ? CAN_OBTAIN : CANT_OBTAIN_NEED_UPGRADE;
|
||||
}
|
||||
case RG_BOMBCHU_DROP:
|
||||
return INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU ? CAN_OBTAIN : CANT_OBTAIN_NEED_UPGRADE;
|
||||
case RG_PROGRESSIVE_HOOKSHOT:
|
||||
switch (INV_CONTENT(ITEM_HOOKSHOT)) {
|
||||
|
@ -58,7 +58,7 @@ class Randomizer {
|
||||
ScrubIdentity IdentifyScrub(s32 sceneNum, s32 actorParams, s32 respawnData);
|
||||
s16 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId);
|
||||
s16 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum);
|
||||
CanObtainResult GetCanObtainFromRandomizerCheck(RandomizerCheck randomizerCheck);
|
||||
ItemObtainability GetItemObtainabilityFromRandomizerCheck(RandomizerCheck randomizerCheck);
|
||||
static void CreateCustomMessages();
|
||||
static std::string RandomizeRupeeName(std::string message, int language);
|
||||
static CustomMessageEntry GetRupeeMessage(u16 rupeeTextId);
|
||||
|
@ -1027,7 +1027,7 @@ typedef enum {
|
||||
CANT_OBTAIN_ALREADY_HAVE,
|
||||
CANT_OBTAIN_NEED_UPGRADE,
|
||||
CANT_OBTAIN_NEED_EMPTY_BOTTLE,
|
||||
} CanObtainResult;
|
||||
} ItemObtainability;
|
||||
|
||||
typedef struct ScrubIdentity {
|
||||
RandomizerInf randomizerInf;
|
||||
|
@ -1640,7 +1640,7 @@ extern "C" GetItemEntry Randomizer_GetRandomizedItem(GetItemID ogId, s16 actorId
|
||||
s16 itemID = OTRGlobals::Instance->gRandomizer->GetRandomizedItemId(ogId, actorId, actorParams, sceneNum);
|
||||
|
||||
// This feels awkward, maybe in the future each mod will have it's own obtainability check
|
||||
if (OTRGlobals::Instance->gRandomizer->GetCanObtainFromRandomizerCheck(randomizerCheck) != CAN_OBTAIN) {
|
||||
if (OTRGlobals::Instance->gRandomizer->GetItemObtainabilityFromRandomizerCheck(randomizerCheck) != CAN_OBTAIN) {
|
||||
return ItemTable_RetrieveEntry(MOD_NONE, GI_RUPEE_BLUE);
|
||||
}
|
||||
|
||||
@ -1657,7 +1657,7 @@ extern "C" GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomi
|
||||
s16 itemID = OTRGlobals::Instance->gRandomizer->GetRandomizedItemIdFromKnownCheck(randomizerCheck, ogId);
|
||||
|
||||
// This feels awkward, maybe in the future each mod will have it's own obtainability check
|
||||
if (OTRGlobals::Instance->gRandomizer->GetCanObtainFromRandomizerCheck(randomizerCheck) != CAN_OBTAIN) {
|
||||
if (OTRGlobals::Instance->gRandomizer->GetItemObtainabilityFromRandomizerCheck(randomizerCheck) != CAN_OBTAIN) {
|
||||
return ItemTable_RetrieveEntry(MOD_NONE, GI_RUPEE_BLUE);
|
||||
}
|
||||
|
||||
|
@ -2559,17 +2559,12 @@ s32 Inventory_HasEmptyBottle(void) {
|
||||
bool Inventory_HasEmptyBottleSlot(void) {
|
||||
u8* items = gSaveContext.inventory.items;
|
||||
|
||||
if (items[SLOT_BOTTLE_1] == ITEM_NONE) {
|
||||
return true;
|
||||
} else if (items[SLOT_BOTTLE_2] == ITEM_NONE) {
|
||||
return true;
|
||||
} else if (items[SLOT_BOTTLE_3] == ITEM_NONE) {
|
||||
return true;
|
||||
} else if (items[SLOT_BOTTLE_4] == ITEM_NONE) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
items[SLOT_BOTTLE_1] == ITEM_NONE ||
|
||||
items[SLOT_BOTTLE_2] == ITEM_NONE ||
|
||||
items[SLOT_BOTTLE_3] == ITEM_NONE ||
|
||||
items[SLOT_BOTTLE_4] == ITEM_NONE
|
||||
);
|
||||
}
|
||||
|
||||
s32 Inventory_HasSpecificBottle(u8 bottleItem) {
|
||||
|
Loading…
Reference in New Issue
Block a user