mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-24 09:08:52 -05:00
Don't spawn Fado and the carpenter's son at once
This commit is contained in:
parent
282192eb5e
commit
e9354cc9a1
@ -4,6 +4,7 @@
|
||||
#include <z64.h>
|
||||
|
||||
#define ADULT_TRADE_FLAG(itemId) (1 << (itemId - ITEM_POCKET_EGG))
|
||||
#define PLAYER_HAS_SHUFFLED_ADULT_TRADE_ITEM(itemID) (gSaveContext.adultTradeItems & ADULT_TRADE_FLAG(itemID))
|
||||
|
||||
void Randomizer_ConsumeAdultTradeItem(GlobalContext* globalCtx, u8 itemId);
|
||||
u8 Randomizer_GetNextAdultTradeItem();
|
||||
|
@ -2578,7 +2578,7 @@ bool Inventory_HatchPocketCucco(GlobalContext* globalCtx) {
|
||||
return Inventory_ReplaceItem(globalCtx, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO);
|
||||
}
|
||||
|
||||
if (!(gSaveContext.adultTradeItems & ADULT_TRADE_FLAG(ITEM_POCKET_EGG))) {
|
||||
if (!PLAYER_HAS_SHUFFLED_ADULT_TRADE_ITEM(ITEM_POCKET_EGG)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -79,14 +79,25 @@ void EnHs_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
// "chicken shop (adult era)"
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " ヒヨコの店(大人の時) \n" VT_RST);
|
||||
func_80A6E3A0(this, func_80A6E9AC);
|
||||
bool shouldDespawn;
|
||||
bool shouldSpawn;
|
||||
bool tradedMushroom = gSaveContext.itemGetInf[3] & 1;
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
shouldDespawn = tradedMushroom && !(gSaveContext.adultTradeItems & ADULT_TRADE_FLAG(ITEM_COJIRO));
|
||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) {
|
||||
// To explain the logic because Fado and Grog are linked:
|
||||
// - If you have Cojiro, then spawn Grog and not Fado.
|
||||
// - If you don't have Cojiro but do have Odd Potion, spawn Fado and not Grog.
|
||||
// - If you don't have either, spawn Grog if you haven't traded the Odd Mushroom.
|
||||
// - If you don't have either but have traded the mushroom, don't spawn either.
|
||||
if (PLAYER_HAS_SHUFFLED_ADULT_TRADE_ITEM(ITEM_COJIRO)) {
|
||||
shouldSpawn = true;
|
||||
} else if (PLAYER_HAS_SHUFFLED_ADULT_TRADE_ITEM(ITEM_ODD_POTION)) {
|
||||
shouldSpawn = false;
|
||||
} else {
|
||||
shouldSpawn = !tradedMushroom;
|
||||
}
|
||||
} else {
|
||||
shouldDespawn = tradedMushroom;
|
||||
shouldSpawn = !tradedMushroom;
|
||||
}
|
||||
if (shouldDespawn) {
|
||||
if (!shouldSpawn) {
|
||||
// "chicken shop closed"
|
||||
osSyncPrintf(VT_FGCOL(CYAN) " ヒヨコ屋閉店 \n" VT_RST);
|
||||
Actor_Kill(&this->actor);
|
||||
|
@ -1026,7 +1026,20 @@ s32 EnKo_CanSpawn(EnKo* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
case SCENE_SPOT10:
|
||||
return (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_ODD_POTION) ? true : false;
|
||||
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) {
|
||||
// To explain the logic because Fado and Grog are linked:
|
||||
// - If you have Cojiro, then spawn Grog and not Fado.
|
||||
// - If you don't have Cojiro but do have Odd Potion, spawn Fado and not Grog.
|
||||
// - If you don't have either, spawn Grog if you haven't traded the Odd Mushroom.
|
||||
// - If you don't have either but have traded the mushroom, don't spawn either.
|
||||
if (PLAYER_HAS_SHUFFLED_ADULT_TRADE_ITEM(ITEM_COJIRO)) {
|
||||
return false;
|
||||
} else {
|
||||
return PLAYER_HAS_SHUFFLED_ADULT_TRADE_ITEM(ITEM_ODD_POTION);
|
||||
}
|
||||
} else {
|
||||
return (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_ODD_POTION) ? true : false;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user