Add 5, 6 & 7 item shopsanity. (#4280)

* Format shops.cpp

* Add 5, 6 & 7 item shopsanity

* Guarantee a bombchu refill

* Fish first shop item index

* Clean up NonShopItems

* Split count options

* Improve item ordering

Ensure potions, blue fire and fairy on shopsanity 6 and less.
There are no hearts in the first 28 items (the ones from n64 rando).

* Post-merge fixes
This commit is contained in:
Pepe20129
2024-10-03 01:31:11 +02:00
committed by GitHub
parent 7110e40374
commit 84130b8046
17 changed files with 1095 additions and 892 deletions
@@ -432,7 +432,7 @@ void EnOssan_SpawnItemsOnShelves(EnOssan* this, PlayState* play, ShopItem* shopI
} else {
itemParams = sShopItemReplaceFunc[shopItems->shopItemIndex](shopItems->shopItemIndex);
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) {
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, i);
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, i + 1);
if (shopItemIdentity.randomizerCheck != RC_UNKNOWN_CHECK) {
itemParams = shopItemIdentity.enGirlAShopItem;
@@ -452,7 +452,7 @@ void EnOssan_SpawnItemsOnShelves(EnOssan* this, PlayState* play, ShopItem* shopI
shelves->actor.shape.rot.x, shelves->actor.shape.rot.y + sItemShelfRot[i],
shelves->actor.shape.rot.z, itemParams, true);
if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) {
this->shelfSlots[i]->randoSlotIndex = i;
this->shelfSlots[i]->randoSlotIndex = i + 1;
}
}
}
@@ -1391,7 +1391,7 @@ void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) {
if (!IS_RANDO) {
Actor_OfferGetItem(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f);
} else {
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->cursorIndex);
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->cursorIndex + 1);
// en_ossan/en_girla are also used for the happy mask shop, which never has randomized items
// and returns RC_UNKNOWN_CHECK, in which case we should fall back to vanilla logic
if (shopItemIdentity.randomizerCheck != RC_UNKNOWN_CHECK) {
@@ -1738,7 +1738,7 @@ void EnOssan_State_GiveItemWithFanfare(EnOssan* this, PlayState* play, Player* p
if (!IS_RANDO) {
Actor_OfferGetItem(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f);
} else {
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->cursorIndex);
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->cursorIndex + 1);
// en_ossan/en_girla are also used for the happy mask shop, which never has randomized items
// and returns RC_UNKNOWN_CHECK, in which case we should fall back to vanilla logic
if (shopItemIdentity.randomizerCheck != RC_UNKNOWN_CHECK) {
@@ -1754,7 +1754,7 @@ void EnOssan_State_GiveItemWithFanfare(EnOssan* this, PlayState* play, Player* p
void EnOssan_State_ItemPurchased(EnOssan* this, PlayState* play, Player* player) {
EnGirlA* item;
EnGirlA* itemTemp;
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->cursorIndex);
ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->cursorIndex + 1);
GetItemEntry getItemEntry;
if (shopItemIdentity.randomizerCheck != RC_UNKNOWN_CHECK) {
getItemEntry = Randomizer_GetItemFromKnownCheck(shopItemIdentity.randomizerCheck, shopItemIdentity.ogItemId);