Shipwright/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c

1236 lines
38 KiB
C
Raw Normal View History

/*
* File: z_demo_im.c
* Overlay: Demo_Im
* Description: Impa
*/
#include "z_demo_im.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
#include "scenes/indoors/nakaniwa/nakaniwa_scene.h"
#include "objects/object_im/object_im.h"
#include "vt.h"
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_4)
void DemoIm_Init(Actor* thisx, GlobalContext* globalCtx);
void DemoIm_Destroy(Actor* thisx, GlobalContext* globalCtx);
void DemoIm_Update(Actor* thisx, GlobalContext* globalCtx);
void DemoIm_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_809856F8(DemoIm* this, GlobalContext* globalCtx);
void func_80985718(DemoIm* this, GlobalContext* globalCtx);
void func_80985738(DemoIm* this, GlobalContext* globalCtx);
void func_80985770(DemoIm* this, GlobalContext* globalCtx);
void func_809857B0(DemoIm* this, GlobalContext* globalCtx);
void func_809857F0(DemoIm* this, GlobalContext* globalCtx);
void func_80985830(DemoIm* this, GlobalContext* globalCtx);
void func_80985C10(DemoIm* this, GlobalContext* globalCtx);
void func_80985C40(DemoIm* this, GlobalContext* globalCtx);
void func_80985C94(DemoIm* this, GlobalContext* globalCtx);
void DemoIm_DrawTranslucent(DemoIm* this, GlobalContext* globalCtx);
void func_809863BC(DemoIm* this, GlobalContext* globalCtx);
void func_809863DC(DemoIm* this, GlobalContext* globalCtx);
void func_80986430(DemoIm* this, GlobalContext* globalCtx);
void func_80986494(DemoIm* this, GlobalContext* globalCtx);
void func_809864D4(DemoIm* this, GlobalContext* globalCtx);
void func_809868E8(DemoIm* this, GlobalContext* globalCtx);
void func_80986908(DemoIm* this, GlobalContext* globalCtx);
void func_80986948(DemoIm* this, GlobalContext* globalCtx);
void func_80986D40(DemoIm* this, GlobalContext* globalCtx);
void func_80986DC8(DemoIm* this, GlobalContext* globalCtx);
void func_80986E20(DemoIm* this, GlobalContext* globalCtx);
void func_80986E40(DemoIm* this, GlobalContext* globalCtx);
void func_80986EAC(DemoIm* this, GlobalContext* globalCtx);
void func_80986F08(DemoIm* this, GlobalContext* globalCtx);
void func_80986F28(DemoIm* this, GlobalContext* globalCtx);
void func_80986F88(DemoIm* this, GlobalContext* globalCtx);
void func_80986FA8(DemoIm* this, GlobalContext* globalCtx);
void func_80987288(DemoIm* this, GlobalContext* globalCtx);
void func_809872A8(DemoIm* this, GlobalContext* globalCtx);
void func_809872F0(DemoIm* this, GlobalContext* globalCtx);
void func_80987330(DemoIm* this, GlobalContext* globalCtx);
void DemoIm_DrawNothing(DemoIm* this, GlobalContext* globalCtx);
void DemoIm_DrawSolid(DemoIm* this, GlobalContext* globalCtx);
static void* sEyeTextures[] = {
gImpaEyeOpenTex,
gImpaEyeHalfTex,
gImpaEyeClosedTex,
};
static u32 D_8098783C = 0;
static ColliderCylinderInitType1 sCylinderInit = {
{
COLTYPE_HIT0,
AT_NONE,
AC_NONE,
OC1_ON | OC1_TYPE_PLAYER,
COLSHAPE_CYLINDER,
},
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, 0x00, 0x00, 0x01 },
{ 25, 80, 0, { 0, 0, 0 } },
};
#include "z_demo_im_cutscene_data.c" EARLY
static DemoImActionFunc sActionFuncs[] = {
func_809856F8, func_80985718, func_80985738, func_80985770, func_809857B0, func_809857F0, func_80985830,
func_80985C10, func_80985C40, func_80985C94, func_809863BC, func_809863DC, func_80986430, func_80986494,
func_809864D4, func_809868E8, func_80986908, func_80986948, func_80986D40, func_80986DC8, func_80986E20,
func_80986E40, func_80986EAC, func_80986F08, func_80986F28, func_80986F88, func_80986FA8, func_80987288,
func_809872A8, func_809872F0, func_80987330,
};
static Vec3f D_809887D8 = { 0.0f, 10.0f, 0.0f };
static DemoImDrawFunc sDrawFuncs[] = {
DemoIm_DrawNothing,
DemoIm_DrawSolid,
DemoIm_DrawTranslucent,
};
const ActorInit Demo_Im_InitVars = {
ACTOR_DEMO_IM,
ACTORCAT_NPC,
FLAGS,
OBJECT_IM,
sizeof(DemoIm),
(ActorFunc)DemoIm_Init,
(ActorFunc)DemoIm_Destroy,
(ActorFunc)DemoIm_Update,
(ActorFunc)DemoIm_Draw,
NULL,
};
void func_80984BE0(DemoIm* this) {
s32 pad[3];
s16* blinkTimer = &this->blinkTimer;
s16* eyeIndex = &this->eyeIndex;
if (DECR(*blinkTimer) == 0) {
*blinkTimer = Rand_S16Offset(60, 60);
}
*eyeIndex = *blinkTimer;
if (*eyeIndex >= 3) {
*eyeIndex = 0;
}
}
void func_80984C68(DemoIm* this) {
this->action = 7;
this->drawConfig = 0;
this->alpha = 0;
this->unk_270 = 0;
this->actor.shape.shadowAlpha = 0;
this->unk_268 = 0.0f;
}
void func_80984C8C(DemoIm* this, GlobalContext* globalCtx) {
u32* something = &D_8098783C;
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
if (*something != 0) {
if (this->actor.params == 2) {
func_80984C68(this);
}
*something = 0;
}
} else {
if (*something == 0) {
*something = 1;
}
}
}
void DemoIm_InitCollider(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = (DemoIm*)thisx;
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit);
}
void DemoIm_DestroyCollider(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = (DemoIm*)thisx;
Collider_DestroyCylinder(globalCtx, &this->collider);
}
void DemoIm_UpdateCollider(DemoIm* this, GlobalContext* globalCtx) {
s32 pad[5];
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
void func_80984DB8(DemoIm* this) {
s32 pad[2];
Vec3s* vec1 = &this->unk_2D4.unk_08;
Vec3s* vec2 = &this->unk_2D4.unk_0E;
Math_SmoothStepToS(&vec1->x, 0, 20, 6200, 100);
Math_SmoothStepToS(&vec1->y, 0, 20, 6200, 100);
Math_SmoothStepToS(&vec2->x, 0, 20, 6200, 100);
Math_SmoothStepToS(&vec2->y, 0, 20, 6200, 100);
}
void func_80984E58(DemoIm* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s16 yawDiff;
s16 phi_a3;
this->unk_2D4.unk_18 = player->actor.world.pos;
this->unk_2D4.unk_14 = kREG(16) + 4.0f;
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
phi_a3 = (ABS(yawDiff) < 0x18E3) ? 2 : 1;
func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, phi_a3);
}
void func_80984F10(DemoIm* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
this->unk_2D4.unk_18 = player->actor.world.pos;
this->unk_2D4.unk_14 = kREG(16) + 12.0f;
func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 2);
}
void func_80984F94(DemoIm* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
this->unk_2D4.unk_18 = player->actor.world.pos;
this->unk_2D4.unk_14 = kREG(16) + 4.0f;
func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 4);
}
void DemoIm_UpdateBgCheckInfo(DemoIm* this, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5);
}
s32 DemoIm_UpdateSkelAnime(DemoIm* this) {
return SkelAnime_Update(&this->skelAnime);
}
s32 DemoIm_IsCsStateIdle(GlobalContext* globalCtx) {
if (globalCtx->csCtx.state == CS_STATE_IDLE) {
return true;
} else {
return false;
}
}
CsCmdActorAction* DemoIm_GetNpcAction(GlobalContext* globalCtx, s32 actionIdx) {
s32 pad[2];
CsCmdActorAction* ret = NULL;
if (!DemoIm_IsCsStateIdle(globalCtx)) {
ret = globalCtx->csCtx.npcActions[actionIdx];
}
return ret;
}
s32 func_809850E8(DemoIm* this, GlobalContext* globalCtx, u16 action, s32 actionIdx) {
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, actionIdx);
if (npcAction != NULL) {
if (npcAction->action == action) {
return true;
}
}
return false;
}
s32 func_80985134(DemoIm* this, GlobalContext* globalCtx, u16 action, s32 actionIdx) {
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, actionIdx);
if (npcAction != NULL) {
if (npcAction->action != action) {
return true;
}
}
return false;
}
void func_80985180(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) {
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, actionIdx);
if (npcAction != NULL) {
this->actor.world.pos.x = npcAction->startPos.x;
this->actor.world.pos.y = npcAction->startPos.y;
this->actor.world.pos.z = npcAction->startPos.z;
this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y;
}
}
void func_80985200(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) {
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, actionIdx);
if (npcAction != NULL) {
this->actor.world.pos.x = npcAction->startPos.x;
this->actor.world.pos.y = npcAction->startPos.y;
this->actor.world.pos.z = npcAction->startPos.z;
this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y;
}
}
void DemoIm_ChangeAnim(DemoIm* this, AnimationHeader* animHeaderSeg, u8 animMode, f32 transitionRate,
s32 playBackwards) {
f32 frameCount = Animation_GetLastFrame(animHeaderSeg);
f32 playbackSpeed;
f32 startFrame;
f32 endFrame;
if (!playBackwards) {
startFrame = 0.0f;
endFrame = frameCount;
playbackSpeed = 1.0f;
} else {
endFrame = 0.0f;
startFrame = frameCount;
playbackSpeed = -1.0f;
}
Animation_Change(&this->skelAnime, animHeaderSeg, playbackSpeed, startFrame, endFrame, animMode, transitionRate);
}
void func_80985310(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->actor.shape.yOffset = -10000.0f;
}
void func_80985358(DemoIm* this, GlobalContext* globalCtx) {
f32 posX = this->actor.world.pos.x;
f32 posY = this->actor.world.pos.y;
f32 posZ = this->actor.world.pos.z;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0,
WARP_SAGES);
}
void func_809853B4(DemoIm* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
f32 playerX = player->actor.world.pos.x;
f32 playerY = player->actor.world.pos.y + 80.0f;
f32 playerZ = player->actor.world.pos.z;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, playerX, playerY, playerZ, 0,
0, 0, 0xD);
Item_Give(globalCtx, ITEM_MEDALLION_SHADOW);
}
void func_80985430(DemoIm* this, GlobalContext* globalCtx) {
this->actor.shape.yOffset += 250.0f / 3.0f;
}
void func_8098544C(DemoIm* this, GlobalContext* globalCtx) {
s32 pad[2];
if ((gSaveContext.chamberCutsceneNum == 4) && (gSaveContext.sceneSetupIndex < 4)) {
Player* player = GET_PLAYER(globalCtx);
this->action = 1;
globalCtx->csCtx.segment = D_8098786C;
gSaveContext.cutsceneTrigger = 2;
Item_Give(globalCtx, ITEM_MEDALLION_SHADOW);
player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000;
}
}
void func_809854DC(DemoIm* this, GlobalContext* globalCtx) {
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[5] != NULL) &&
(globalCtx->csCtx.npcActions[5]->action == 2)) {
Animation_Change(&this->skelAnime, &gImpaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaIdleAnim),
ANIMMODE_LOOP, 0.0f);
this->action = 2;
this->drawConfig = 1;
func_80985358(this, globalCtx);
}
}
void func_8098557C(DemoIm* this) {
if (this->actor.shape.yOffset >= 0.0f) {
this->action = 3;
this->actor.shape.yOffset = 0.0f;
}
}
void func_809855A8(DemoIm* this, GlobalContext* globalCtx) {
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[5] != NULL) &&
(globalCtx->csCtx.npcActions[5]->action == 3)) {
Animation_Change(&this->skelAnime, &gImpaRaiseArmsAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaRaiseArmsAnim),
ANIMMODE_ONCE, 4.0f);
this->action = 4;
}
}
void func_80985640(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
Animation_Change(&this->skelAnime, &gImpaPresentShadowMedallionAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gImpaPresentShadowMedallionAnim), ANIMMODE_LOOP, 0.0f);
this->action = 5;
}
}
void func_809856AC(DemoIm* this, GlobalContext* globalCtx) {
if ((globalCtx->csCtx.state != CS_STATE_IDLE) && (globalCtx->csCtx.npcActions[6] != NULL) &&
(globalCtx->csCtx.npcActions[6]->action == 2)) {
this->action = 6;
func_809853B4(this, globalCtx);
}
}
void func_809856F8(DemoIm* this, GlobalContext* globalCtx) {
func_8098544C(this, globalCtx);
}
void func_80985718(DemoIm* this, GlobalContext* globalCtx) {
func_809854DC(this, globalCtx);
}
void func_80985738(DemoIm* this, GlobalContext* globalCtx) {
func_80985430(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_8098557C(this);
}
void func_80985770(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809855A8(this, globalCtx);
}
void func_809857B0(DemoIm* this, GlobalContext* globalCtx) {
s32 sp1C;
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp1C = DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80985640(this, sp1C);
}
void func_809857F0(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809856AC(this, globalCtx);
}
void func_80985830(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
}
void func_80985860(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 7;
this->actor.shape.shadowAlpha = 0;
}
void func_809858A8(void) {
func_800788CC(NA_SE_SY_WHITE_OUT_T);
}
void DemoIm_SpawnLightBall(DemoIm* this, GlobalContext* globalCtx) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x,
(kREG(17) + 24.0f) + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 6);
}
void func_80985948(DemoIm* this, GlobalContext* globalCtx) {
if (func_809850E8(this, globalCtx, 4, 5)) {
Animation_Change(&this->skelAnime, &gImpaPrepareSealGanonAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gImpaPrepareSealGanonAnim), ANIMMODE_ONCE, 0.0f);
this->action = 8;
this->drawConfig = 2;
this->alpha = 0;
this->actor.shape.shadowAlpha = 0;
this->unk_268 = 0.0f;
func_809858A8();
}
}
void func_809859E0(DemoIm* this, GlobalContext* globalCtx) {
f32* unk_268 = &this->unk_268;
s32 alpha = 255;
if (func_809850E8(this, globalCtx, 4, 5)) {
*unk_268 += 1.0f;
if (*unk_268 >= kREG(5) + 10.0f) {
this->action = 9;
this->drawConfig = 1;
*unk_268 = kREG(5) + 10.0f;
this->alpha = this->actor.shape.shadowAlpha = alpha;
return;
}
} else {
*unk_268 -= 1.0f;
if (*unk_268 <= 0.0f) {
this->action = 7;
this->drawConfig = 0;
*unk_268 = 0.0f;
this->alpha = 0;
this->actor.shape.shadowAlpha = 0;
return;
}
}
this->actor.shape.shadowAlpha = this->alpha = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f;
}
void func_80985B34(DemoIm* this, GlobalContext* globalCtx) {
if (func_80985134(this, globalCtx, 4, 5)) {
Animation_Change(&this->skelAnime, &gImpaSealGanonAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaSealGanonAnim),
ANIMMODE_ONCE, -8.0f);
this->action = 8;
this->drawConfig = 2;
this->unk_268 = kREG(5) + 10.0f;
this->alpha = 255;
if (this->unk_270 == 0) {
DemoIm_SpawnLightBall(this, globalCtx);
this->unk_270 = 1;
}
this->actor.shape.shadowAlpha = 0xFF;
}
}
void func_80985C10(DemoIm* this, GlobalContext* globalCtx) {
func_80985948(this, globalCtx);
func_80984C8C(this, globalCtx);
}
void func_80985C40(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809859E0(this, globalCtx);
func_80984C8C(this, globalCtx);
}
void func_80985C94(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80985B34(this, globalCtx);
func_80984C8C(this, globalCtx);
}
void DemoIm_DrawTranslucent(DemoIm* this, GlobalContext* globalCtx) {
s32 pad[2];
s16 eyeIndex = this->eyeIndex;
void* eyeTex = sEyeTextures[eyeIndex];
SkelAnime* skelAnime = &this->skelAnime;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTex));
gSPSegment(POLY_XLU_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(eyeTex));
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
gSPSegment(POLY_XLU_DISP++, 0x0C, &D_80116280[0]);
POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount,
NULL, NULL, NULL, POLY_XLU_DISP);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void func_80985E60(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 10;
this->unk_280 = 1;
}
void func_80985EAC(DemoIm* this, GlobalContext* globalCtx) {
if ((globalCtx->csCtx.frames >= 80) && (globalCtx->csCtx.frames < 243)) {
func_80984F10(this, globalCtx);
} else {
func_80984DB8(this);
}
}
void func_80985EF4(DemoIm* this) {
if (!Animation_OnFrame(&this->skelAnime, Animation_GetLastFrame(&gImpaWhistlingAnim) - 1.0f)) {
DemoIm_UpdateSkelAnime(this);
}
}
void func_80985F54(DemoIm* this) {
this->action = 10;
this->drawConfig = 0;
}
void func_80985F64(DemoIm* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelAnime, &gImpaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaIdleAnim),
ANIMMODE_LOOP, 0.0f);
func_80985180(this, globalCtx, 5);
this->action = 11;
this->drawConfig = 1;
}
void func_80985FE8(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
Animation_Change(&this->skelAnime, &gImpaWhistlingAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaWhistlingAnim),
ANIMMODE_LOOP, -8.0f);
}
}
void func_8098604C(DemoIm* this) {
f32 frameCount = Animation_GetLastFrame(&gImpaStartWhistlingAnim);
Animation_Change(&this->skelAnime, &gImpaStartWhistlingAnim, 1.0f, 0.0f, frameCount, ANIMMODE_ONCE, -8.0f);
this->action = 12;
this->drawConfig = 1;
this->unk_2D0 = 1;
}
void func_809860C8(DemoIm* this) {
this->action = 13;
this->drawConfig = 1;
}
void func_809860DC(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
Animation_Change(&this->skelAnime, &gImpaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaIdleAnim),
ANIMMODE_LOOP, -8.0f);
this->unk_2D0 = 0;
}
}
void func_80986148(DemoIm* this) {
Animation_Change(&this->skelAnime, &gImpaStartWhistlingAnim, -1.0f,
Animation_GetLastFrame(&gImpaStartWhistlingAnim), 0.0f, ANIMMODE_ONCE, -8.0f);
this->action = 14;
this->drawConfig = 1;
}
void func_809861C4(DemoIm* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, 5);
if (npcAction != NULL) {
u32 action = npcAction->action;
u32 unk_274 = this->unk_274;
if (action != unk_274) {
switch (action) {
case 9:
func_80986148(this);
break;
case 7:
Animation_Change(&this->skelAnime, &gImpaWhistlingAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gImpaWhistlingAnim), ANIMMODE_LOOP, -8.0f);
this->action = 12;
break;
default:
osSyncPrintf("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
}
this->unk_274 = action;
}
}
}
void func_8098629C(DemoIm* this, GlobalContext* globalCtx) {
if (DemoIm_IsCsStateIdle(globalCtx)) {
this->action = 21;
this->drawConfig = 1;
this->unk_280 = 1;
}
}
void func_809862E0(DemoIm* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, 5);
if (npcAction != NULL) {
u32 action = npcAction->action;
u32 unk_274 = this->unk_274;
if (action != unk_274) {
switch (action) {
case 1:
func_80985F54(this);
break;
case 2:
func_80985F64(this, globalCtx);
break;
case 7:
func_8098604C(this);
break;
case 8:
func_809860C8(this);
break;
case 9:
func_80986148(this);
break;
default:
osSyncPrintf("Demo_Im_Ocarina_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
}
this->unk_274 = action;
}
}
}
void func_809863BC(DemoIm* this, GlobalContext* globalCtx) {
func_809862E0(this, globalCtx);
}
void func_809863DC(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80985EAC(this, globalCtx);
func_80984BE0(this);
func_809862E0(this, globalCtx);
}
void func_80986430(DemoIm* this, GlobalContext* globalCtx) {
s32 sp24;
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp24 = DemoIm_UpdateSkelAnime(this);
func_80985EAC(this, globalCtx);
func_80984BE0(this);
func_80985FE8(this, sp24);
func_809862E0(this, globalCtx);
}
void func_80986494(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
func_80985EF4(this);
func_80984BE0(this);
func_809861C4(this, globalCtx);
}
void func_809864D4(DemoIm* this, GlobalContext* globalCtx) {
s32 sp24;
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp24 = DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809860DC(this, sp24);
func_8098629C(this, globalCtx);
}
void func_8098652C(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 15;
}
void func_80986570(DemoIm* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, 7.0f) && (this->actor.bgCheckFlags & 1)) {
u32 sfxId = SFX_FLAG;
sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
Audio_PlaySoundGeneral(sfxId, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
}
void func_809865F8(DemoIm* this, GlobalContext* globalCtx, s32 arg2) {
s32 pad[2];
if (arg2 != 0) {
f32* unk_278 = &this->unk_278;
if (*unk_278 >= 0.0f) {
if (this->unk_27C == 0) {
Vec3f* thisPos = &this->actor.world.pos;
s16 shapeRotY = this->actor.shape.rot.y;
f32 spawnPosX = thisPos->x + (Math_SinS(shapeRotY) * 30.0f);
f32 spawnPosY = thisPos->y;
f32 spawnPosZ = thisPos->z + (Math_CosS(shapeRotY) * 30.0f);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, spawnPosX, spawnPosY, spawnPosZ, 0xFA0,
this->actor.shape.rot.y, 0, ARROW_CS_NUT);
this->unk_27C = 1;
}
} else {
*unk_278 += 1.0f;
}
}
}
void func_80986700(DemoIm* this) {
this->action = 15;
this->drawConfig = 0;
}
void func_80986710(DemoIm* this, GlobalContext* globalCtx) {
Animation_Change(&this->skelAnime, &gImpaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gImpaIdleAnim),
ANIMMODE_LOOP, 0.0f);
func_80985180(this, globalCtx, 5);
this->action = 16;
this->drawConfig = 1;
}
void func_80986794(DemoIm* this) {
Animation_Change(&this->skelAnime, &gImpaThrowDekuNutAnim, 1.0f, 0.0f,
Animation_GetLastFrame(&gImpaThrowDekuNutAnim), ANIMMODE_ONCE, -8.0f);
this->action = 17;
this->drawConfig = 1;
}
void func_8098680C(DemoIm* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, 5);
if (npcAction != NULL) {
u32 action = npcAction->action;
u32 unk_274 = this->unk_274;
if (action != unk_274) {
switch (action) {
case 1:
func_80986700(this);
break;
case 2:
func_80986710(this, globalCtx);
break;
case 10:
func_80986794(this);
break;
case 11:
Actor_Kill(&this->actor);
break;
default:
osSyncPrintf("Demo_Im_Spot00_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
}
this->unk_274 = action;
}
}
}
void func_809868E8(DemoIm* this, GlobalContext* globalCtx) {
func_8098680C(this, globalCtx);
}
void func_80986908(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_8098680C(this, globalCtx);
}
void func_80986948(DemoIm* this, GlobalContext* globalCtx) {
s32 sp24;
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp24 = DemoIm_UpdateSkelAnime(this);
func_80986570(this, globalCtx);
func_80984BE0(this);
func_809865F8(this, globalCtx, sp24);
func_8098680C(this, globalCtx);
}
void func_809869B0(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 18;
this->actor.shape.shadowAlpha = 0;
}
s32 func_809869F8(DemoIm* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
f32 playerPosX = player->actor.world.pos.x;
f32 thisPosX = this->actor.world.pos.x;
if ((thisPosX - (kREG(16) + 30.0f) > playerPosX) && !(this->actor.flags & ACTOR_FLAG_6)) {
return true;
} else {
return false;
}
}
s32 func_80986A5C(DemoIm* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
f32 playerPosX = player->actor.world.pos.x;
f32 thisPosX = this->actor.world.pos.x;
if ((thisPosX - (kREG(17) + 130.0f) < playerPosX) && (!Gameplay_InCsMode(globalCtx))) {
return true;
} else {
return false;
}
}
s32 func_80986AD0(DemoIm* this, GlobalContext* globalCtx) {
this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3;
if (!Actor_ProcessTalkRequest(&this->actor, globalCtx)) {
this->actor.textId = 0x708E;
func_8002F2F4(&this->actor, globalCtx);
} else {
return true;
}
return false;
}
void func_80986B2C(GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
Player* player = GET_PLAYER(globalCtx);
globalCtx->nextEntranceIndex = 0xCD;
globalCtx->fadeTransition = 38;
globalCtx->sceneLoadFlag = 0x14;
func_8002DF54(globalCtx, &player->actor, 8);
}
}
void func_80986BA0(DemoIm* this, GlobalContext* globalCtx) {
if (func_809869F8(this, globalCtx)) {
this->action = 21;
this->drawConfig = 1;
this->unk_280 = 1;
this->actor.shape.shadowAlpha = 0xFF;
}
}
void func_80986BE4(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
this->action = 22;
}
}
void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
if (gSaveContext.eventChkInf[4] & 1) {
this->action = 24;
this->drawConfig = 1;
this->unk_280 = 1;
this->actor.shape.shadowAlpha = 0xFF;
}
}
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
void GivePlayerRandoRewardImpa(Actor* impa, GlobalContext* globalCtx, RandomizerCheck check) {
GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_ZELDAS_LULLABY);
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
if (impa->parent != NULL && impa->parent->id == GET_PLAYER(globalCtx)->actor.id &&
!Flags_GetTreasure(globalCtx, 0x1F)) {
Flags_SetTreasure(globalCtx, 0x1F);
} else if (!Flags_GetTreasure(globalCtx, 0x1F) && !Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) {
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
func_8002F434(impa, globalCtx, getItemId, 75.0f, 50.0f);
} else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) {
gSaveContext.eventChkInf[5] |= 0x200;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->nextEntranceIndex = 0x0594;
gSaveContext.nextCutsceneIndex = 0;
}
}
void func_80986C30(DemoIm* this, GlobalContext* globalCtx) {
if (func_80986A5C(this, globalCtx)) {
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
if (gSaveContext.n64ddFlag) {
GivePlayerRandoRewardImpa(this, globalCtx, RC_SONG_FROM_IMPA);
} else {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs);
gSaveContext.cutsceneTrigger = 1;
gSaveContext.eventChkInf[5] |= 0x200;
Item_Give(globalCtx, ITEM_SONG_LULLABY);
func_80985F54(this);
}
}
}
void func_80986CC8(DemoIm* this) {
if (gSaveContext.eventChkInf[4] & 1) {
this->action = 26;
this->drawConfig = 1;
this->unk_280 = 1;
this->actor.shape.shadowAlpha = 0xFF;
}
}
void func_80986CFC(DemoIm* this, GlobalContext* globalCtx) {
if (func_80986A5C(this, globalCtx)) {
gSaveContext.eventChkInf[4] |= 0x1000;
this->action = 19;
}
}
void func_80986D40(DemoIm* this, GlobalContext* globalCtx) {
if (gSaveContext.sceneSetupIndex == 6) {
this->action = 19;
this->drawConfig = 1;
testing out item replacement (#416) * skip learning song of storms * don't set flag when getting goron tunic as child * Initiates prelude check when master sword unloads. Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again. * Stops Shadow Temple lore prompts from appearing in rando. * Skips cutscene of royal tomb explosion in rando. Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here. * Improves visual of exploding gravestone. * Adds some comments explaining the rando differences * Skip ruto text box in jabu blue warp For rando * skip intro cutscene in dodongo's cavern * load spoiler files on boot, fix spoilerfile existing check when making new saves * name entry dropped spoiler logic * make sure to actually init the cvar * no chime on load * uncomment * Skip ganondrof cutscene Skip to scream part of the death animation, skipping the text boxes etc. For rando * Update z_boss_ganondrof.c * skip owl flight cutscenes in rando * Fixes skipped text so it only applies to shadow temple. Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors. * Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case. * TEST: Text for item * Adding ganon flavor text * ADD: AMMO Count * format ganon text/hint text * Autoskip the tower cutscene if settings call for tower collapse. * ganon hint text logic * Improved prelude after time travel fix * swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things. * this is all i did * not the cleanest code ever but it's working * ADD: GS Count * ADD: Wallter (crash for now) * TWEAK: Wallet check * FIX: Use DrawItem instread of DrawUpgrade... b-baka! * Fixes some vanilla bugs introduced by rando code. * Added cutscene skip for zelda escaping Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger * ADD: X Spacing + Placeholders for song * ADD: default case for items * TWEAK: Spacing * FIX: Light Arrow * ADD: Ammo Option * use groups instead * ADD: More spacing logic * songs and names * TWEAK: Color on wallet * colors * Added flags cutscene before nabooru fight * ADD: ChromaKey text * First attempt skip cs after nabooru defeat * Better implementation for specific rando cutscene skips * use pulseaudio defaults * spaces/tabs * move color push/pop to stop crash * make the colors work again * the real bottle fix * pulseaudio values tuned for n64 audio at 44.1khz * update tlength * remove one hardcoded samplerate * Cleaned up and fixed zelda escape skip The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of. * Revert one line to match original nothing functional * another hint line that breaks autonewline logic * don't autospawn epona if we don't have the song/ocarina * Trying to use iron knuckle death effects not working yet * Streamlined OoT cutscene skip for future additions Also cleaned up if statement in general * Made if statement more readable Also added clarity for what cutscene was skipped * Fixed typo in comment * Janky nabooru defeat cs skip * altar text formatting (gonna need help shortening some of the french ones) * more altar text formatting * english altar text formatting complete * make gtg blocking guard check for card not bridge * FIX: Typo! * FIX: Uppercases * FIX: Typo * TWEAK: Alter + some names * TWEAK: More caps! * ADD: Missing string TWEAK more uppercases and namefixe s * Hide nabooru death by covering her in flames * bandaid fix for death crash issue * Twinrova defeat cs skip Skips the animation and manually calls the function to show the "beam" around the sisters * fix crash * fix caps to match * fix great fairy reward mashing/shielding issue * TWEAK : Typo clé to Clé * TWEAK: Some Altar hints TWEAK: Some capitals * TWEAK: Unmatching text + some cap again * TWEAK: More tweaks * fix build * remove extra json.hpp, add hint * Update randomizer_item_tracker.cpp * TWEAK: Double Defense with RedParticles instead of white * make sure we don't optimize out the check to ensure a spoilerfile exists * vanilla ganon boss key hint formatting * TWEAK: FR- better way of the hero text * fix * and again * Initializes dungeonsDone items in gSaveContext to 0. * Replaces sizeof calculation with a NUM_DUNGEONS constant. * Fixes Saria's Gift on the LW Bridge from getting killed when holding shield. * More airtight fix for Saria's Gift on the Bridge. * Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId. * Invalidate text box icon before drawing * Fixes the case where Saria's gift is an Ice Trap. We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine. * Initial commit Might need changing when we change the settings in the future * Fixes Door of Time opening cutscene after warping with prelude. * Initial waterfall skip Very rudimentary way of doing things but it seems to work so :shrug: * inital rework * fixed default rotation for 2D sprites * fix tab/space issues * 3d drops rando merge fix again * Allows Impa to appear in the Lullaby check post drawbridge escape. * Changes Ganon's Trials Count setting to a checkbox The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed. * Sets all Ganon's Trials to incomplete in new saves. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131 * fix castle guards when oot throw cutscene has already played in rando * Properly removes the beams when trials are cleared. * Removes Question Mark from Skip Ganon's Trials UI. * Adds a todo comment about when to change back to slider. * make deku seeds check for bullet bag * Various tweaks TWEAK: Altar Text TWEAK: Hint names TWEAK: Replace more problematic œ to oe * upgrade ocarina on both child and adult equips * FIX: Jabu Item * update equipped hookshot/longshot when obtained as other age * add hint * don't give the bgs check without the claim check * Skips Darunia Cutscene in Fire Temple * Added a TODO note about not skipping the cutscene. There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch. * remove todo * restore fast ocarina option in imgui that was lost in merge * Fixes grey screen issue + tooltip for 2 handed shield * update to use dg instead of g for textures in item tracker * TWEAK: Default color for cosmetic RAND button was not the corect one * fix texture crash, remove unused item tracker code * don't open mask shop until we get zelda's letter * Update README.md * Prevents "correct" chime under incorrect conditions. * Fixes typo in conditional and adds "bonk" sound effect. "Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time. * remove modify dpad equips toggle, replace with checks for dpad menu * remove extra check * add ability to hold c-up to assign to dpad when dpad menuing is enabled * disable d-pad navigation on item menu when holding c-up to equip * dpad+c-up stuff for equipment menu * ADD: Checbox for songs colors * TWEAK: RandoColors for normal songs * kind of quick and dirty but it works * TWEAK: Clarity of the tooltip Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: aMannus <mannusmenting@gmail.com> Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com> Co-authored-by: Dog <5172592+Dog@users.noreply.github.com> Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com> Co-authored-by: Baoulettes <perlouzerie@hotmail.fr> Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
} else if ((gSaveContext.eventChkInf[8] & 1) && !gSaveContext.n64ddFlag) {
Actor_Kill(&this->actor);
} else if (!(gSaveContext.eventChkInf[5] & 0x200)) {
this->action = 23;
} else {
this->action = 20;
}
}
void func_80986DC8(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984E58(this, globalCtx);
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3);
}
void func_80986E20(DemoIm* this, GlobalContext* globalCtx) {
func_80986BA0(this, globalCtx);
}
void func_80986E40(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984E58(this, globalCtx);
DemoIm_UpdateCollider(this, globalCtx);
func_80986BE4(this, func_80986AD0(this, globalCtx));
}
void func_80986EAC(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984F94(this, globalCtx);
DemoIm_UpdateCollider(this, globalCtx);
func_80986B2C(globalCtx);
}
void func_80986F08(DemoIm* this, GlobalContext* globalCtx) {
func_80986BF8(this, globalCtx);
}
void func_80986F28(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984E58(this, globalCtx);
DemoIm_UpdateCollider(this, globalCtx);
func_80986C30(this, globalCtx);
}
void func_80986F88(DemoIm* this, GlobalContext* globalCtx) {
func_80986CC8(this);
}
void func_80986FA8(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80984E58(this, globalCtx);
this->actor.flags &= ~(ACTOR_FLAG_0 | ACTOR_FLAG_3);
DemoIm_UpdateCollider(this, globalCtx);
func_80986CFC(this, globalCtx);
}
void func_80987018(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_ChangeAnim(this, &gImpaIdleAnim, ANIMMODE_LOOP, 0.0f, false);
this->action = 27;
this->drawConfig = 0;
this->actor.shape.shadowAlpha = 0;
}
void func_80987064(DemoIm* this) {
f32* unk_268 = &this->unk_268;
f32 temp;
s32 alpha = 255;
*unk_268 += 1.0f;
temp = kREG(17) + 10.0f;
if (*unk_268 >= temp) {
this->actor.shape.shadowAlpha = this->alpha = alpha;
} else {
this->actor.shape.shadowAlpha = this->alpha = (*unk_268 / temp) * 255.0f;
}
}
void func_809870F0(DemoIm* this, GlobalContext* globalCtx) {
func_80985200(this, globalCtx, 5);
this->action = 28;
this->drawConfig = 2;
}
void func_80987128(DemoIm* this) {
if (this->unk_268 >= kREG(17) + 10.0f) {
this->action = 29;
this->drawConfig = 1;
}
}
void func_80987174(DemoIm* this) {
DemoIm_ChangeAnim(this, &object_im_Anim_0101C8, ANIMMODE_ONCE, -8.0f, false);
this->action = 30;
}
void func_809871B4(DemoIm* this, s32 arg1) {
if (arg1 != 0) {
DemoIm_ChangeAnim(this, &object_im_Anim_00FB10, ANIMMODE_LOOP, 0.0f, false);
}
}
void func_809871E8(DemoIm* this, GlobalContext* globalCtx) {
CsCmdActorAction* npcAction = DemoIm_GetNpcAction(globalCtx, 5);
if (npcAction != NULL) {
u32 action = npcAction->action;
u32 unk_274 = this->unk_274;
if (action != unk_274) {
switch (action) {
case 12:
func_809870F0(this, globalCtx);
break;
case 13:
func_80987174(this);
break;
default:
osSyncPrintf("Demo_Im_inEnding_Check_DemoMode:そんな動作は無い!!!!!!!!\n");
}
this->unk_274 = action;
}
}
}
void func_80987288(DemoIm* this, GlobalContext* globalCtx) {
func_809871E8(this, globalCtx);
}
void func_809872A8(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_80987064(this);
func_80987128(this);
}
void func_809872F0(DemoIm* this, GlobalContext* globalCtx) {
DemoIm_UpdateBgCheckInfo(this, globalCtx);
DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809871E8(this, globalCtx);
}
void func_80987330(DemoIm* this, GlobalContext* globalCtx) {
s32 sp1C;
DemoIm_UpdateBgCheckInfo(this, globalCtx);
sp1C = DemoIm_UpdateSkelAnime(this);
func_80984BE0(this);
func_809871B4(this, sp1C);
}
void DemoIm_Update(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = (DemoIm*)thisx;
if ((this->action < 0) || (this->action >= 31) || (sActionFuncs[this->action] == NULL)) {
osSyncPrintf(VT_FGCOL(RED) "メインモードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return;
}
sActionFuncs[this->action](this, globalCtx);
}
void DemoIm_Init(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = (DemoIm*)thisx;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
DemoIm_InitCollider(thisx, globalCtx);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gImpaSkel, NULL, this->jointTable, this->morphTable, 17);
thisx->flags &= ~ACTOR_FLAG_0;
switch (this->actor.params) {
case 2:
func_80985860(this, globalCtx);
break;
case 3:
func_80985E60(this, globalCtx);
break;
case 4:
func_8098652C(this, globalCtx);
break;
case 5:
func_809869B0(this, globalCtx);
break;
case 6:
func_80987018(this, globalCtx);
break;
default:
func_80985310(this, globalCtx);
}
}
void DemoIm_Destroy(Actor* thisx, GlobalContext* globalCtx) {
DemoIm_DestroyCollider(thisx, globalCtx);
}
s32 DemoIm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx) {
DemoIm* this = (DemoIm*)thisx;
s32* unk_2D0 = &this->unk_2D0;
if (this->unk_280 != 0) {
Vec3s* unk_2D4_unk_0E = &this->unk_2D4.unk_0E;
Vec3s* unk_2D4_unk_08 = &this->unk_2D4.unk_08;
switch (limbIndex) {
case IMPA_LIMB_CHEST:
rot->x += unk_2D4_unk_0E->y;
rot->y -= unk_2D4_unk_0E->x;
break;
case IMPA_LIMB_HEAD:
rot->x += unk_2D4_unk_08->y;
rot->z += unk_2D4_unk_08->x;
break;
}
}
if ((*unk_2D0 != 0) && (limbIndex == IMPA_LIMB_RIGHT_HAND)) {
*dList = gImpaHandPointingDL;
}
return false;
}
void DemoIm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
DemoIm* this = (DemoIm*)thisx;
if (limbIndex == IMPA_LIMB_HEAD) {
Vec3f sp28 = D_809887D8;
Vec3f dest;
Matrix_MultVec3f(&sp28, &dest);
this->actor.focus.pos.x = dest.x;
this->actor.focus.pos.y = dest.y;
this->actor.focus.pos.z = dest.z;
this->actor.focus.rot.x = this->actor.world.rot.x;
this->actor.focus.rot.y = this->actor.world.rot.y;
this->actor.focus.rot.z = this->actor.world.rot.z;
}
}
void DemoIm_DrawNothing(DemoIm* this, GlobalContext* globalCtx) {
}
void DemoIm_DrawSolid(DemoIm* this, GlobalContext* globalCtx) {
s32 pad[2];
s16 eyeIndex = this->eyeIndex;
void* eyeTexture = sEyeTextures[eyeIndex];
SkelAnime* skelAnime = &this->skelAnime;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTexture));
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(eyeTexture));
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
gSPSegment(POLY_OPA_DISP++, 0x0C, &D_80116280[2]);
SkelAnime_DrawFlexOpa(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount,
DemoIm_OverrideLimbDraw, DemoIm_PostLimbDraw, this);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void DemoIm_Draw(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = (DemoIm*)thisx;
if ((this->drawConfig < 0) || (this->drawConfig >= 3) || (sDrawFuncs[this->drawConfig] == NULL)) {
osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST);
return;
}
sDrawFuncs[this->drawConfig](this, globalCtx);
}