mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 01:12:19 -05:00
Fix skeleton key (#4296)
This commit is contained in:
parent
07babaa17b
commit
b6554a8409
@ -32,6 +32,7 @@
|
||||
#include "src/overlays/actors/ovl_Fishing/z_fishing.h"
|
||||
#include "src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h"
|
||||
#include "src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h"
|
||||
#include "src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.h"
|
||||
#include "src/overlays/actors/ovl_En_Door/z_en_door.h"
|
||||
#include "objects/object_link_boy/object_link_boy.h"
|
||||
#include "objects/object_link_child/object_link_child.h"
|
||||
@ -1754,11 +1755,12 @@ void RegisterRandomizerCompasses() {
|
||||
});
|
||||
}
|
||||
|
||||
extern "C" void func_8099485C(DoorGerudo* gerudoDoor, PlayState* play);
|
||||
|
||||
void RegisterSkeletonKey() {
|
||||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorUpdate>([](void* refActor) {
|
||||
Actor* actor = static_cast<Actor*>(refActor);
|
||||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_HAS_SKELETON_KEY)) {
|
||||
Actor* actor = static_cast<Actor*>(refActor);
|
||||
if (actor->id == ACTOR_EN_DOOR) {
|
||||
EnDoor* door = (EnDoor*)actor;
|
||||
door->lockTimer = 0;
|
||||
@ -1767,6 +1769,10 @@ void RegisterSkeletonKey() {
|
||||
if (shutterDoor->doorType == SHUTTER_KEY_LOCKED) {
|
||||
shutterDoor->unk_16E = 0;
|
||||
}
|
||||
} else if (actor->id == ACTOR_DOOR_GERUDO) {
|
||||
DoorGerudo* gerudoDoor = (DoorGerudo*)actor;
|
||||
gerudoDoor->actionFunc = func_8099485C;
|
||||
gerudoDoor->dyna.actor.world.pos.y = gerudoDoor->dyna.actor.home.pos.y + 200.0f;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -563,7 +563,7 @@ Color_RGBA8 GetSkeletonKeyColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
int test = 0;
|
||||
int skeletonKeyRotation = 0;
|
||||
|
||||
extern "C" void Randomizer_DrawSkeletonKey(PlayState* play, GetItemEntry* getItemEntry) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
@ -572,24 +572,24 @@ extern "C" void Randomizer_DrawSkeletonKey(PlayState* play, GetItemEntry* getIte
|
||||
|
||||
Gfx_SetupDL_25Opa(play->state.gfxCtx);
|
||||
|
||||
test += 1;
|
||||
skeletonKeyRotation += 1;
|
||||
|
||||
if (test > 40) {
|
||||
test -= 80;
|
||||
if (skeletonKeyRotation > 40) {
|
||||
skeletonKeyRotation -= 80;
|
||||
}
|
||||
|
||||
Matrix_RotateZ(M_PI / 40 * test, MTXMODE_APPLY);
|
||||
Matrix_RotateY(M_PI / 40 * test, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(M_PI / 40 * skeletonKeyRotation, MTXMODE_APPLY);
|
||||
Matrix_RotateY(M_PI / 40 * skeletonKeyRotation, MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
|
||||
gDPSetGrayscaleColor(POLY_OPA_DISP++, color.r, color.g, color.b, color.a);
|
||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||
|
||||
|
||||
gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gGiSmallKeyDL);
|
||||
|
||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||
|
||||
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
@ -382,7 +382,7 @@ void EnDaiku_Jailed(EnDaiku* this, PlayState* play) {
|
||||
void EnDaiku_WaitFreedom(EnDaiku* this, PlayState* play) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) {
|
||||
if (Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F) || (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_HAS_SKELETON_KEY))) {
|
||||
this->actor.flags |= ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY;
|
||||
EnDaiku_UpdateText(this, play);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user