Rando: Fix bomb/bombchu shops (#1134)

* Fix bomb shops in rando

* Addressed review comments
This commit is contained in:
aMannus 2022-08-15 05:01:00 +02:00 committed by GitHub
parent 4ea7f8371f
commit 37dd045bd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -633,7 +633,8 @@ s32 EnGirlA_CanBuy_Unk20(GlobalContext* globalCtx, EnGirlA* this) {
}
s32 EnGirlA_CanBuy_Bombchus(GlobalContext* globalCtx, EnGirlA* this) {
if (AMMO(ITEM_BOMBCHU) >= 50) {
// When in rando, don't allow buying bombchus when the player doesn't have a bomb bag
if (AMMO(ITEM_BOMBCHU) >= 50 || (gSaveContext.n64ddFlag && CUR_CAPACITY(UPG_BOMB_BAG) == 0)) {
return CANBUY_RESULT_CANT_GET_NOW;
}
if (gSaveContext.rupees < this->basePrice) {

View File

@ -601,8 +601,9 @@ void EnOssan_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
// Completed Dodongo's Cavern
if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !(gSaveContext.eventChkInf[2] & 0x20)) {
// Don't kill bombchu shop actor in rando, making it so the shop is immediately open
// gSaveContext.eventChkInf[2] & 0x20 - Completed Dodongo's Cavern
if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !(gSaveContext.eventChkInf[2] & 0x20) && !gSaveContext.n64ddFlag) {
Actor_Kill(&this->actor);
return;
}
@ -1469,7 +1470,10 @@ void EnOssan_HandleCanBuyBombs(GlobalContext* globalCtx, EnOssan* this) {
void EnOssan_BuyGoronCityBombs(GlobalContext* globalCtx, EnOssan* this) {
if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
if (!(gSaveContext.eventChkInf[2] & 0x20)) {
// Let players buy the right side of the goron shop in rando regardless of DC completion
// Players will still need a bomb bag to buy bombs (handled by vanilla behaviour)
// gSaveContext.eventChkInf[2] & 0x20 - Completed Dodongo's Cavern
if (!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[2] & 0x20)) {
if (gSaveContext.infTable[15] & 0x1000) {
EnOssan_SetStateCantGetItem(globalCtx, this, 0x302E);
} else {