Merge pull request #1769 from HarbourMasters/develop-zhora

zhora -> dev
This commit is contained in:
briaguya 2022-10-13 14:55:19 -04:00 committed by GitHub
commit 350315a5d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 112 additions and 58 deletions

View file

@ -2502,13 +2502,6 @@ u8 Item_CheckObtainability(u8 item) {
} else {
return ITEM_NONE;
}
} else if ( gSaveContext.n64ddFlag &&
((item >= RG_GERUDO_FORTRESS_SMALL_KEY) && (item <= RG_GANONS_CASTLE_SMALL_KEY) ||
(item >= RG_FOREST_TEMPLE_BOSS_KEY) && (item <= RG_GANONS_CASTLE_BOSS_KEY) ||
(item >= RG_DEKU_TREE_MAP) && (item <= RG_ICE_CAVERN_MAP) ||
(item >= RG_DEKU_TREE_COMPASS) && (item <= RG_ICE_CAVERN_COMPASS))
) {
return ITEM_NONE;
} else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
return ITEM_NONE;
} else if (item == ITEM_KEY_SMALL) {

View file

@ -577,6 +577,14 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) {
BossGanon2_SetObjectSegment(this, globalCtx, OBJECT_GANON_ANIME3, false);
func_8002DF54(globalCtx, &this->actor, 0x54);
this->unk_314 = 3;
// At this point, the actor has Ganon's skeleton but is still playing an animation for Ganondorf. This
// causes issues when trying to access the limb posotions as Ganon has more limbs than Ganondorf. When
// animating, data from past the end of the animation data is accessed. This is a hack solution so
// that we are at least playing an animation meant for Ganon. There is no visible change since Ganon is
// off-screen. There is actually 1 frame where he is visible, and in the vanilla game he is an
// explosion of limbs since half of them are in random positions from the junk data accessed.
Animation_PlayOnce(&this->skelAnime, &gGanonUncurlAndFlailAnim);
}
// fake, tricks the compiler into using stack the way we need it to
if (zero) {

View file

@ -249,28 +249,30 @@ s32 EnGe3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
case GELDB_LIMB_HEAD:
rot->x += this->headRot.y;
// This is a hack to fix the color-changing clothes this Gerudo has on N64 versions
default:
OPEN_DISPS(globalCtx->state.gfxCtx);
switch (limbIndex) {
case GELDB_LIMB_NECK:
break;
case GELDB_LIMB_HEAD:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 80, 60, 10, 255);
break;
case GELDB_LIMB_R_SWORD:
case GELDB_LIMB_L_SWORD:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 140, 170, 230, 255);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
break;
default:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 140, 0, 0, 255);
break;
if (CVar_GetS32("gGerudoWarriorClothingFix", 0)) {
// This is a hack to fix the color-changing clothes this Gerudo has on N64 versions
OPEN_DISPS(globalCtx->state.gfxCtx);
switch (limbIndex) {
case GELDB_LIMB_NECK:
break;
case GELDB_LIMB_HEAD:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 80, 60, 10, 255);
break;
case GELDB_LIMB_R_SWORD:
case GELDB_LIMB_L_SWORD:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 140, 170, 230, 255);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
break;
default:
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, 140, 0, 0, 255);
break;
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
break;
}
return false;

View file

@ -401,7 +401,7 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) {
} else {
// TODO: get-item-rework Adult trade sequence
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
gSaveContext.itemGetInf[2] |= 0x1000;
}
this->actionFunc = func_80ABAC00;
@ -431,7 +431,14 @@ void func_80ABAB08(EnNiwLady* this, GlobalContext* globalCtx) {
case 0:
Message_CloseTextbox(globalCtx);
this->actor.parent = NULL;
func_8002F434(&this->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f);
if (!gSaveContext.n64ddFlag) {
func_8002F434(&this->actor, globalCtx, GI_COJIRO, 200.0f, 100.0f);
} else {
// TODO: get-item-rework Adult trade sequence
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO);
Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_POCKET_CUCCO);
gSaveContext.itemGetInf[2] |= 0x4000;
}
this->actionFunc = func_80ABAC00;
break;
case 1:
@ -455,18 +462,14 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) {
} else {
getItemId = this->getItemId;
if (LINK_IS_ADULT) {
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
if (gSaveContext.n64ddFlag) {
if (getItemId == GI_POCKET_EGG) {
// TODO: get-item-rework Adult trade sequence
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG);
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
} else {
this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO);
Randomizer_ConsumeAdultTradeItem(globalCtx, ITEM_POCKET_CUCCO);
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
}
if (!gSaveContext.n64ddFlag) {
getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO;
} else {
// TODO: get-item-rework Adult trade sequence
getItemId = this->getItemEntry.getItemId;
GiveItemEntryFromActor(&this->actor, globalCtx, this->getItemEntry, 200.0f, 100.0f);
// Skip setting item flags because that was done earlier
this->actionFunc = func_80ABA778;
}
}
if (this->getItemEntry.getItemId == GI_NONE) {

View file

@ -820,6 +820,19 @@ void func_80AF3F20(EnRu2* this, GlobalContext* globalCtx) {
void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnRu2* this = (EnRu2*)thisx;
// FAST3D: This is a hack for the issue of both TEXEL0 and TEXEL1 using the same texture with different settings.
// Ruto's earring uses both TEXEL0 and TEXEL1 to render. The issue is that it never loads anything into TEXEL1, so
// it reuses whatever happens to be there, which is the water temple brick texture. It just so happens that the
// earring texture loads into the same place in tmem as the brick texture, so when it comes to rendering, TEXEL1
// uses the earring texture with diffrent clamp settings, and it displays without noticeable error. However, both
// texel samplers are not intended to be used for the same texture with different settings, so this misuse confuses
// our texture cache, and we load the wrong settings for the earrings texture. This patch is a hack that replaces
// TEXEL1 with TEXEL0, which is most likely the original intention, and all is well.
Gfx* gfx = ResourceMgr_LoadGfxByName(gAdultRutoHeadDL);
Gfx patch = gsDPSetCombineLERP(TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, ENVIRONMENT, 0, 0, 0, 0, COMBINED, TEXEL0, 0,
PRIM_LOD_FRAC, COMBINED);
gfx[0xA2] = patch;
if ((this->drawConfig < 0) || (this->drawConfig >= ARRAY_COUNT(sDrawFuncs)) ||
(sDrawFuncs[this->drawConfig] == 0)) {
// "Draw Mode is improper!"

View file

@ -6252,21 +6252,27 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
}
}
// Skip cutscenes from picking up items when they come from bushes/rocks/etc, but nowhere else.
uint8_t skipItemCutscene = CVar_GetS32("gFastDrops", 0) && interactedActor->id == ACTOR_EN_ITEM00 &&
interactedActor->params != 6 && interactedActor->params != 17;
// Show the cutscene for picking up an item. In vanilla, this happens in bombchu bowling alley (because getting bombchus need to show the cutscene)
// and whenever the player doesn't have the item yet. In rando, we're overruling this because we need to keep showing the cutscene
// because those items can be randomized and thus it's important to keep showing the cutscene.
uint8_t showItemCutscene = globalCtx->sceneNum == SCENE_BOWLING || Item_CheckObtainability(giEntry.itemId) == ITEM_NONE || gSaveContext.n64ddFlag;
// Same as above but for rando. We need this specifically for rando because we need to be enable the cutscenes everywhere else in the game
// because the items are randomized and thus it's important to show the get item animation.
uint8_t skipItemCutsceneRando = gSaveContext.n64ddFlag &&
Item_CheckObtainability(giEntry.itemId) != ITEM_NONE &&
interactedActor->id == ACTOR_EN_ITEM00 &&
interactedActor->params != 6 && interactedActor->params != 17;
// Only skip cutscenes for drops when they're items/consumables from bushes/rocks/enemies.
uint8_t isDropToSkip = (interactedActor->id == ACTOR_EN_ITEM00 && interactedActor->params != 6 && interactedActor->params != 17) ||
interactedActor->id == ACTOR_EN_KAREBABA ||
interactedActor->id == ACTOR_EN_DEKUBABA;
// Show cutscene when picking up a item that the player doesn't own yet.
// We want to ALWAYS show "get item animations" for items when they're randomized to account for
// randomized freestanding items etc, but we still don't want to show it every time you pick up a consumable from a pot/bush etc.
if ((globalCtx->sceneNum == SCENE_BOWLING || Item_CheckObtainability(giEntry.itemId) == ITEM_NONE || gSaveContext.n64ddFlag) && !skipItemCutscene && !skipItemCutsceneRando) {
// Skip cutscenes from picking up consumables with "Fast Pickup Text" enabled, even when the player never picked it up before.
// But only for bushes/rocks/enemies because otherwise it can lead to softlocks in deku mask theatre and potentially other places.
uint8_t skipItemCutscene = CVar_GetS32("gFastDrops", 0) && isDropToSkip;
// Same as above but for rando. Rando is different because we want to enable cutscenes for items that the player already has because
// those items could be a randomized item coming from scrubs, freestanding PoH's and keys. So we need to once again overrule
// this specifically for items coming from bushes/rocks/enemies when the player has already picked that item up.
uint8_t skipItemCutsceneRando = gSaveContext.n64ddFlag && Item_CheckObtainability(giEntry.itemId) != ITEM_NONE && isDropToSkip;
// Show cutscene when picking up a item.
if (showItemCutscene && !skipItemCutscene && !skipItemCutsceneRando) {
func_808323B4(globalCtx, this);
func_8083AE40(this, giEntry.objectId);
@ -6282,7 +6288,7 @@ s32 func_8083E5A8(Player* this, GlobalContext* globalCtx) {
return 1;
}
// Don't show cutscene when picking up an item
// Don't show cutscene when picking up an item.
func_8083E4C4(globalCtx, this, &giEntry);
this->getItemId = GI_NONE;
this->getItemEntry = (GetItemEntry)GET_ITEM_NONE;