mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-26 01:58:51 -05:00
Open bombchu shop with chus
This commit is contained in:
parent
8cb50a2ee1
commit
e8df2f2e47
@ -633,8 +633,16 @@ s32 EnGirlA_CanBuy_Unk20(GlobalContext* globalCtx, EnGirlA* this) {
|
||||
}
|
||||
|
||||
s32 EnGirlA_CanBuy_Bombchus(GlobalContext* globalCtx, EnGirlA* this) {
|
||||
// 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)) {
|
||||
// When in rando, don't allow buying bombchus when the player doesn't have required explosives
|
||||
// If bombchus are in logic, the player needs to have bombchus; otherwise they need a bomb bag
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
u8 bombchusInLogic = Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC);
|
||||
if ((!bombchusInLogic && CUR_CAPACITY(UPG_BOMB_BAG) == 0) ||
|
||||
(bombchusInLogic && INV_CONTENT(ITEM_BOMBCHU) == ITEM_NONE)) {
|
||||
return CANBUY_RESULT_CANT_GET_NOW;
|
||||
}
|
||||
}
|
||||
if (AMMO(ITEM_BOMBCHU) >= 50) {
|
||||
return CANBUY_RESULT_CANT_GET_NOW;
|
||||
}
|
||||
if (gSaveContext.rupees < this->basePrice) {
|
||||
@ -861,6 +869,11 @@ void EnGirlA_BuyEvent_ZoraTunic(GlobalContext* globalCtx, EnGirlA* this) {
|
||||
}
|
||||
|
||||
void EnGirlA_BuyEvent_ObtainBombchuPack(GlobalContext* globalCtx, EnGirlA* this) {
|
||||
Rupees_ChangeBy(-this->basePrice);
|
||||
|
||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC)) {
|
||||
return;
|
||||
}
|
||||
switch (this->actor.params) {
|
||||
case SI_BOMBCHU_10_2:
|
||||
gSaveContext.itemGetInf[0] |= 0x40;
|
||||
@ -887,7 +900,6 @@ void EnGirlA_BuyEvent_ObtainBombchuPack(GlobalContext* globalCtx, EnGirlA* this)
|
||||
gSaveContext.itemGetInf[0] |= 0x20;
|
||||
break;
|
||||
}
|
||||
Rupees_ChangeBy(-this->basePrice);
|
||||
}
|
||||
|
||||
void EnGirlA_Noop(EnGirlA* this, GlobalContext* globalCtx) {
|
||||
|
Loading…
Reference in New Issue
Block a user