Merge branch 'develop' into aManchipelago

This commit is contained in:
aMannus
2025-05-30 23:49:18 +02:00
258 changed files with 5160 additions and 5264 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ void func_800AA15C(void) {
D_80160FD0.unk_104 = 2;
}
void func_800AA16C(void) {
void Rumble_ClearRequests(void) {
D_80160FD0.unk_104 = 0;
}
+20 -1
View File
@@ -7,6 +7,8 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "objects/object_bdoor/object_bdoor.h"
#include "soh/ObjectExtension/ObjectExtension.h"
#include "soh/ObjectExtension/ActorListIndex.h"
#include "soh/frame_interpolation.h"
#include "soh/Enhancements/cosmetics/cosmeticsTypes.h"
#include "soh/Enhancements/enemyrandomizer.h"
@@ -2574,7 +2576,11 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
if (play->numSetupActors != 0) {
actorEntry = &play->setupActorList[0];
for (i = 0; i < play->numSetupActors; i++) {
Actor_SpawnEntry(&play->actorCtx, actorEntry++, play);
Actor* spawnedActor = Actor_SpawnEntry(&play->actorCtx, actorEntry++, play);
// #region SOH [ObjectExtension] ActorListIndex tracking
SetActorListIndex(spawnedActor, (s16)i);
// #endregion
}
play->numSetupActors = 0;
GameInteractor_ExecuteOnSceneSpawnActors();
@@ -3352,6 +3358,10 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
return NULL;
}
// #region SOH [ObjectExtension]
SetActorListIndex(actor, -1);
// #endregion
assert(dbEntry->numLoaded < 255);
dbEntry->numLoaded++;
@@ -3391,6 +3401,8 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos
Actor_Init(actor, play);
gSegments[6] = temp;
GameInteractor_ExecuteOnActorSpawn(actor);
return actor;
}
@@ -3466,6 +3478,9 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) {
player = GET_PLAYER(play);
// Execute before actor memory is freed
GameInteractor_ExecuteOnActorDestroy(actor);
dbEntry = ActorDB_Retrieve(actor->id);
if (HREG(20) != 0) {
@@ -3494,6 +3509,10 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) {
newHead = Actor_RemoveFromCategory(play, actorCtx, actor);
// #region SOH [ObjectExtension]
ObjectExtension_Free(actor);
// #endregion
ZELDA_ARENA_FREE_DEBUG(actor);
dbEntry->numLoaded--;
+1 -1
View File
@@ -892,7 +892,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
if ((((void)0, gSaveContext.gameMode) != GAMEMODE_NORMAL) &&
(((void)0, gSaveContext.gameMode) != GAMEMODE_END_CREDITS)) {
func_800AA16C(play);
Rumble_ClearRequests();
}
if (pauseCtx->state == 0) {
+2 -1
View File
@@ -4113,7 +4113,8 @@ void Interface_DrawItemButtons(PlayState* play) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.CDownButton.UseMargins"), 0) != 0) {
X_Margins_CD = Left_HUD_Margin;
};
C_Down_BTN_Pos[0] = (CVarGetInteger(CVAR_COSMETIC("HUD.CDownButton.PosX"), 0) + X_Margins_CD);
C_Down_BTN_Pos[0] =
OTRGetDimensionFromLeftEdge(CVarGetInteger(CVAR_COSMETIC("HUD.CDownButton.PosX"), 0) + X_Margins_CD);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.CDownButton.PosType"), 0) == ANCHOR_RIGHT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.CDownButton.UseMargins"), 0) != 0) {
X_Margins_CD = Right_HUD_Margin;
+2 -2
View File
@@ -1289,12 +1289,12 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
D_80160000 = &this->meleeWeaponInfo[2].base;
if (!LINK_IS_ADULT) {
if (!(this->skelAnime.moveFlags & 4) || (this->skelAnime.moveFlags & 1)) {
if (!(this->skelAnime.movementFlags & 4) || (this->skelAnime.movementFlags & 1)) {
pos->x *= 0.64f;
pos->z *= 0.64f;
}
if (!(this->skelAnime.moveFlags & 4) || (this->skelAnime.moveFlags & 2)) {
if (!(this->skelAnime.movementFlags & 4) || (this->skelAnime.movementFlags & 2)) {
pos->y *= 0.64f;
}
}
+14 -14
View File
@@ -1170,9 +1170,9 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade
*/
void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime) {
if (skelAnime->mode <= ANIMMODE_LOOP_INTERP) {
skelAnime->update = LinkAnimation_Loop;
skelAnime->update.link = LinkAnimation_Loop;
} else {
skelAnime->update = LinkAnimation_Once;
skelAnime->update.link = LinkAnimation_Once;
}
skelAnime->morphWeight = 0.0f;
}
@@ -1182,7 +1182,7 @@ void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime) {
* finishes.
*/
s32 LinkAnimation_Update(PlayState* play, SkelAnime* skelAnime) {
return skelAnime->update(play, skelAnime);
return skelAnime->update.link(play, skelAnime);
}
/**
@@ -1294,7 +1294,7 @@ void LinkAnimation_Change(PlayState* play, SkelAnime* skelAnime, LinkAnimationHe
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
morphFrames = -morphFrames;
} else {
skelAnime->update = LinkAnimation_Morph;
skelAnime->update.link = LinkAnimation_Morph;
AnimationContext_SetLoadFrame(play, animation, (s32)startFrame, skelAnime->limbCount,
skelAnime->morphTable);
}
@@ -1559,11 +1559,11 @@ s32 SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* sk
*/
void SkelAnime_SetUpdate(SkelAnime* skelAnime) {
if (skelAnime->mode <= ANIMMODE_LOOP_INTERP) {
skelAnime->update = SkelAnime_LoopFull;
skelAnime->update.normal = SkelAnime_LoopFull;
} else if (skelAnime->mode <= ANIMMODE_ONCE_INTERP) {
skelAnime->update = SkelAnime_Once;
skelAnime->update.normal = SkelAnime_Once;
} else {
skelAnime->update = SkelAnime_LoopPartial;
skelAnime->update.normal = SkelAnime_LoopPartial;
}
}
@@ -1572,7 +1572,7 @@ void SkelAnime_SetUpdate(SkelAnime* skelAnime) {
* finishes.
*/
s32 SkelAnime_Update(SkelAnime* skelAnime) {
return skelAnime->update(skelAnime);
return skelAnime->update.normal(skelAnime);
}
/**
@@ -1741,10 +1741,10 @@ void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32
morphFrames = -morphFrames;
} else {
if (taper != ANIMTAPER_NONE) {
skelAnime->update = SkelAnime_MorphTaper;
skelAnime->update.normal = SkelAnime_MorphTaper;
skelAnime->taper = taper;
} else {
skelAnime->update = SkelAnime_Morph;
skelAnime->update.normal = SkelAnime_Morph;
}
SkelAnime_GetFrameData(animation, startFrame, skelAnime->limbCount, skelAnime->morphTable);
}
@@ -1895,7 +1895,7 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) {
f32 sin;
f32 cos;
if (skelAnime->moveFlags & ANIM_FLAG_NOMOVE) {
if (skelAnime->movementFlags & ANIM_FLAG_NOMOVE) {
diff->x = diff->z = 0.0f;
} else {
x = skelAnime->jointTable[0].x;
@@ -1917,8 +1917,8 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) {
skelAnime->jointTable[0].x = skelAnime->baseTransl.x;
skelAnime->prevTransl.z = skelAnime->jointTable[0].z;
skelAnime->jointTable[0].z = skelAnime->baseTransl.z;
if (skelAnime->moveFlags & ANIM_FLAG_UPDATEY) {
if (skelAnime->moveFlags & ANIM_FLAG_NOMOVE) {
if (skelAnime->movementFlags & ANIM_FLAG_UPDATEY) {
if (skelAnime->movementFlags & ANIM_FLAG_NOMOVE) {
diff->y = 0.0f;
} else {
diff->y = skelAnime->jointTable[0].y - skelAnime->prevTransl.y;
@@ -1929,7 +1929,7 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) {
diff->y = 0.0f;
skelAnime->prevTransl.y = skelAnime->jointTable[0].y;
}
skelAnime->moveFlags &= ~ANIM_FLAG_NOMOVE;
skelAnime->movementFlags &= ~ANIM_FLAG_NOMOVE;
}
/**
@@ -6,6 +6,7 @@
#include "z_bg_mori_kaitenkabe.h"
#include "objects/object_mori_objects/object_mori_objects.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS 0
@@ -97,7 +98,9 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, PlayState* play) {
if ((this->timer > (28 - CVarGetInteger(CVAR_ENHANCEMENT("FasterBlockPush"), 0) * 4)) &&
!Player_InCsMode(play)) {
BgMoriKaitenkabe_SetupRotate(this);
Player_SetCsActionWithHaltedActors(play, &this->dyna.actor, 8);
if (GameInteractor_Should(VB_FREEZE_LINK_FOR_FOREST_PILLARS, true)) {
Player_SetCsActionWithHaltedActors(play, &this->dyna.actor, 8);
}
Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.world.pos);
push.x = Math_SinS(this->dyna.unk_158);
push.y = 0.0f;
@@ -131,7 +134,9 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, PlayState* play) {
Math_StepToF(&this->rotSpeed, 0.6f, 0.02f);
if (Math_StepToF(&this->rotYdeg, this->rotDirection * 45.0f, this->rotSpeed)) {
BgMoriKaitenkabe_SetupWait(this);
Player_SetCsActionWithHaltedActors(play, thisx, 7);
if (GameInteractor_Should(VB_FREEZE_LINK_FOR_FOREST_PILLARS, true)) {
Player_SetCsActionWithHaltedActors(play, thisx, 7);
}
if (this->rotDirection > 0.0f) {
thisx->home.rot.y += 0x2000;
} else {
@@ -148,7 +153,9 @@ void BgMoriKaitenkabe_Rotate(BgMoriKaitenkabe* this, PlayState* play) {
this->dyna.unk_150 = 0.0f;
player->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY;
}
Math_Vec3f_Copy(&player->actor.world.pos, &this->lockedPlayerPos);
if (GameInteractor_Should(VB_FREEZE_LINK_FOR_FOREST_PILLARS, true)) {
Math_Vec3f_Copy(&player->actor.world.pos, &this->lockedPlayerPos);
}
}
void BgMoriKaitenkabe_Update(Actor* thisx, PlayState* play) {
@@ -175,19 +175,19 @@ void DemoEc_UpdateBgFlags(DemoEc* this, PlayState* play) {
}
void func_8096D594(DemoEc* this, PlayState* play) {
this->skelAnime.moveFlags |= 3;
this->skelAnime.movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
void func_8096D5D4(DemoEc* this, PlayState* play) {
this->skelAnime.baseTransl = this->skelAnime.jointTable[0];
this->skelAnime.prevTransl = this->skelAnime.jointTable[0];
this->skelAnime.moveFlags |= 3;
this->skelAnime.movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
void func_8096D64C(DemoEc* this, PlayState* play) {
this->skelAnime.moveFlags |= 3;
this->skelAnime.movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
@@ -55,12 +55,12 @@ s32 DemoIk_CheckCue(PlayState* play, u16 action, s32 index) {
}
void DemoIk_SetMove(DemoIk* this, PlayState* play) {
this->skelAnime.moveFlags |= 1;
this->skelAnime.movementFlags |= 1;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
void DemoIk_EndMove(DemoIk* this) {
this->skelAnime.moveFlags &= ~1;
this->skelAnime.movementFlags &= ~1;
}
f32 DemoIk_GetCurFrame(DemoIk* this) {
@@ -7,6 +7,7 @@
#include "z_demo_kekkai.h"
#include "objects/object_demo_kekkai/object_demo_kekkai.h"
#include "scenes/dungeons/ganontika/ganontika_scene.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/ResourceManagerHelpers.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
@@ -257,13 +258,15 @@ void DemoKekkai_TrialBarrierIdle(Actor* thisx, PlayState* play) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider1.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base);
if (this->collider2.base.acFlags & AC_HIT) {
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
// "I got it"
LOG_STRING("当ったよ");
this->actor.update = DemoKekkai_TrialBarrierDispel;
this->timer = 0;
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(sSageCutscenes[this->actor.params]);
gSaveContext.cutsceneTrigger = 1;
if (GameInteractor_Should(VB_PLAY_DISPEL_BARRIER_CS, true, this)) {
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
// "I got it"
LOG_STRING("当ったよ");
this->actor.update = DemoKekkai_TrialBarrierDispel;
this->timer = 0;
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(sSageCutscenes[this->actor.params]);
gSaveContext.cutsceneTrigger = 1;
}
}
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider2.base);
func_8002F974(&this->actor, NA_SE_EV_TOWER_ENERGY - SFX_FLAG);
@@ -6,7 +6,7 @@
struct DemoKekkai;
typedef void (*DemoKekkaiUpdateFunc)(struct DemoKekkai* this, PlayState* play);
typedef void (*DemoKekkaiUpdateFunc)(struct DemoKekkai* thisx, PlayState* play);
typedef struct DemoKekkai {
/* 0x0000 */ Actor actor;
@@ -154,17 +154,6 @@ void EnFu_WaitChild(EnFu* this, PlayState* play) {
}
}
void GivePlayerRandoRewardSongOfStorms(EnFu* windmillGuy, PlayState* play, RandomizerCheck check) {
if (windmillGuy->actor.parent != NULL && windmillGuy->actor.parent->id == GET_PLAYER(play)->actor.id &&
!Flags_GetTreasure(play, 0x1F)) {
Flags_SetTreasure(play, 0x1F);
windmillGuy->actionFunc = func_80A1DBD4;
} else if (!Flags_GetTreasure(play, 0x1F)) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_STORMS);
GiveItemEntryFromActor(&windmillGuy->actor, play, getItemEntry, 10000.0f, 100.0f);
}
}
void func_80A1DB60(EnFu* this, PlayState* play) {
if (play->csCtx.state == CS_STATE_IDLE) {
this->actionFunc = EnFu_WaitAdult;
+15 -13
View File
@@ -288,19 +288,21 @@ void func_80A2F83C(EnGb* this, PlayState* play) {
}
}
if (Actor_ProcessTalkRequest(&this->dyna.actor, play)) {
switch (func_8002F368(play)) {
case EXCH_ITEM_NONE:
func_80A2F180(this);
this->actionFunc = func_80A2F94C;
break;
case EXCH_ITEM_POE:
player->actor.textId = 0x70F6;
this->actionFunc = func_80A2F9C0;
break;
case EXCH_ITEM_BIG_POE:
player->actor.textId = 0x70F7;
this->actionFunc = func_80A2FA50;
break;
if (GameInteractor_Should(VB_SELL_POES_TO_POE_COLLECTOR, true, this)) {
switch (func_8002F368(play)) {
case EXCH_ITEM_NONE:
func_80A2F180(this);
this->actionFunc = func_80A2F94C;
break;
case EXCH_ITEM_POE:
player->actor.textId = 0x70F6;
this->actionFunc = func_80A2F9C0;
break;
case EXCH_ITEM_BIG_POE:
player->actor.textId = 0x70F7;
this->actionFunc = func_80A2FA50;
break;
}
}
return;
}
+2 -1
View File
@@ -47,6 +47,7 @@ typedef struct EnGb {
/* 0x0388 */ EnGbCagedSoul cagedSouls[4];
} EnGb; // size = 0x0438
void func_80A2FC0C(EnGb* actor, PlayState* play);
void func_80A2FB40(EnGb* actor, PlayState* play);
void func_80A2F83C(EnGb* actor, PlayState* play);
#endif
@@ -314,19 +314,21 @@ void func_80A5372C(EnHeishi2* this, PlayState* play) {
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->unk_2F2[0] = 200;
this->cameraId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->cameraId, CAM_STAT_ACTIVE);
this->unk_280.x = 947.0f;
this->unk_280.y = 1195.0f;
this->unk_280.z = 2682.0f;
if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, false)) {
this->unk_2F2[0] = 200;
this->cameraId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->cameraId, CAM_STAT_ACTIVE);
this->unk_280.x = 947.0f;
this->unk_280.y = 1195.0f;
this->unk_280.z = 2682.0f;
this->unk_28C.x = 1164.0f;
this->unk_28C.y = 1145.0f;
this->unk_28C.z = 3014.0f;
this->unk_28C.x = 1164.0f;
this->unk_28C.y = 1145.0f;
this->unk_28C.z = 3014.0f;
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
}
this->actionFunc = func_80A53850;
}
@@ -334,11 +336,15 @@ void func_80A53850(EnHeishi2* this, PlayState* play) {
BgSpot15Saku* gate;
SkelAnime_Update(&this->skelAnime);
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, false)) {
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
}
gate = (BgSpot15Saku*)this->gate;
if ((this->unk_2F2[0] == 0) || (gate->unk_168 == 0)) {
Play_ClearCamera(play, this->cameraId);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE);
if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, true)) {
Play_ClearCamera(play, this->cameraId);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE);
}
Message_CloseTextbox(play);
this->unk_30C = 1;
Player_SetCsActionWithHaltedActors(play, NULL, 7);
@@ -479,23 +485,25 @@ void func_80A53DF8(EnHeishi2* this, PlayState* play) {
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
this->unk_2F2[0] = 200;
this->cameraId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->cameraId, CAM_STAT_ACTIVE);
this->unk_2BC.x = -71.0f;
this->unk_280.x = -71.0f;
this->unk_2BC.y = 571.0f;
this->unk_280.y = 571.0f;
this->unk_2BC.z = -1487.0f;
this->unk_280.z = -1487.0f;
this->unk_298.x = 181.0f;
this->unk_28C.x = 181.0f;
this->unk_298.y = 417.0f;
this->unk_28C.y = 417.0f;
this->unk_298.z = -1079.0f;
this->unk_28C.z = -1079.0f;
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, false)) {
this->unk_2F2[0] = 200;
this->cameraId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->cameraId, CAM_STAT_ACTIVE);
this->unk_2BC.x = -71.0f;
this->unk_280.x = -71.0f;
this->unk_2BC.y = 571.0f;
this->unk_280.y = 571.0f;
this->unk_2BC.z = -1487.0f;
this->unk_280.z = -1487.0f;
this->unk_298.x = 181.0f;
this->unk_28C.x = 181.0f;
this->unk_298.y = 417.0f;
this->unk_28C.y = 417.0f;
this->unk_298.z = -1079.0f;
this->unk_28C.z = -1079.0f;
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
}
this->actionFunc = func_80A53F30;
}
@@ -503,11 +511,15 @@ void func_80A53F30(EnHeishi2* this, PlayState* play) {
BgGateShutter* gate;
SkelAnime_Update(&this->skelAnime);
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, false)) {
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
}
gate = (BgGateShutter*)this->gate;
if ((this->unk_2F2[0] == 0) || (gate->openingState == 0)) {
Play_ClearCamera(play, this->cameraId);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE);
if (GameInteractor_Should(VB_PLAY_GATE_OPENING_OR_CLOSING_CS, true, this, true)) {
Play_ClearCamera(play, this->cameraId);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE);
}
if ((this->unk_30A != 2)) {
if (this->unk_30A == 0) {
this->actor.textId = 0x2015;
+1 -1
View File
@@ -342,7 +342,7 @@ void func_80A795C8(EnIn* this, PlayState* play) {
void func_80A79690(SkelAnime* skelAnime, EnIn* this, PlayState* play) {
if (skelAnime->baseTransl.y < skelAnime->jointTable[0].y) {
skelAnime->moveFlags |= 3;
skelAnime->movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, skelAnime, 1.0f);
}
}
+1 -1
View File
@@ -743,7 +743,7 @@ void EnNb_InitDemo6KInConfrontation(EnNb* this, PlayState* play) {
}
void func_80AB2688(EnNb* this, PlayState* play) {
this->skelAnime.moveFlags |= 1;
this->skelAnime.movementFlags |= 1;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
@@ -712,7 +712,7 @@ void EnPoField_SoulInteract(EnPoField* this, PlayState* play) {
if (this->actor.params == 0) {
Item_Give(play, ITEM_POE);
this->actor.textId = 0x5008;
} else {
} else if (GameInteractor_Should(VB_BOTTLE_BIG_POE, true, this)) {
this->actor.textId = 0x508F;
Item_Give(play, ITEM_BIG_POE);
Flags_SetSwitch(play, sEnPoFieldSpawnSwitchFlags[this->spawnFlagIndex]);
@@ -8,6 +8,8 @@
#include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h"
#include "objects/object_tk/object_tk.h"
#include "soh/ResourceManagerHelpers.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
@@ -197,7 +199,7 @@ void EnPoRelay_Race(EnPoRelay* this, PlayState* play) {
if (this->actionTimer != 0) {
this->actionTimer--;
}
if (this->actionTimer == 0 && Rand_ZeroOne() < 0.03f) {
if (GameInteractor_Should(VB_DAMPE_DROP_FLAME, this->actionTimer == 0 && Rand_ZeroOne() < 0.03f, this)) {
this->actionTimer = 32;
if (this->pathIndex < 23) {
speed = Rand_ZeroOne() * 3.0f;
@@ -393,17 +393,17 @@ s32 EnRu1_UpdateSkelAnime(EnRu1* this) {
}
void func_80AEB364(EnRu1* this, PlayState* play) {
this->skelAnime.moveFlags |= 1;
this->skelAnime.movementFlags |= 1;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
void func_80AEB3A4(EnRu1* this, PlayState* play) {
this->skelAnime.moveFlags |= 1;
this->skelAnime.movementFlags |= 1;
func_80AEB364(this, play);
}
void func_80AEB3CC(EnRu1* this) {
this->skelAnime.moveFlags &= ~0x1;
this->skelAnime.movementFlags &= ~0x1;
}
void func_80AEB3DC(EnRu1* this, PlayState* play) {
@@ -464,7 +464,7 @@ void func_80AEB6E0(EnRu1* this, PlayState* play) {
SkelAnime* skelAnime = &this->skelAnime;
if (skelAnime->baseTransl.y < skelAnime->jointTable[0].y) {
skelAnime->moveFlags |= 3;
skelAnime->movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, skelAnime, 1.0f);
}
}
@@ -475,13 +475,13 @@ void func_80AEB738(EnRu1* this, PlayState* play) {
skelAnime->baseTransl = skelAnime->jointTable[0];
skelAnime->prevTransl = skelAnime->jointTable[0];
if (skelAnime->baseTransl.y < skelAnime->jointTable[0].y) {
skelAnime->moveFlags |= 3;
skelAnime->movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, skelAnime, 1.0f);
}
}
void func_80AEB7D0(EnRu1* this) {
this->skelAnime.moveFlags &= ~0x3;
this->skelAnime.movementFlags &= ~0x3;
}
f32 func_80AEB7E0(CsCmdActorCue* csCmdNPCAction, PlayState* play) {
@@ -1595,7 +1595,7 @@ void func_8086318C(EnTest* this, PlayState* play) {
void EnTest_SetupRecoil(EnTest* this) {
this->meleeWeaponState = 0;
this->skelAnime.moveFlags = 2;
this->skelAnime.movementFlags = 2;
this->unk_7C8 = 0x13;
this->skelAnime.playSpeed = -1.0f;
this->skelAnime.startFrame = this->skelAnime.curFrame;
+4 -4
View File
@@ -249,25 +249,25 @@ void func_80B3C8CC(EnXc* this, PlayState* play) {
SkelAnime* skelAnime = &this->skelAnime;
if (skelAnime->jointTable[0].y >= skelAnime->baseTransl.y) {
skelAnime->moveFlags |= 3;
skelAnime->movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, skelAnime, 1.0f);
}
}
void func_80B3C924(EnXc* this, PlayState* play) {
this->skelAnime.moveFlags |= 3;
this->skelAnime.movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
void func_80B3C964(EnXc* this, PlayState* play) {
this->skelAnime.baseTransl = this->skelAnime.jointTable[0];
this->skelAnime.prevTransl = this->skelAnime.jointTable[0];
this->skelAnime.moveFlags |= 3;
this->skelAnime.movementFlags |= 3;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
void func_80B3C9DC(EnXc* this) {
this->skelAnime.moveFlags &= ~0x3;
this->skelAnime.movementFlags &= ~0x3;
}
void func_80B3C9EC(EnXc* this) {
@@ -348,7 +348,7 @@ void func_80B4B834(CsCmdActorCue* npcAction, Vec3f* pos) {
}
void func_80B4B874(EnZl1* this, PlayState* play) {
this->skelAnime.moveFlags |= 1;
this->skelAnime.movementFlags |= 1;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
@@ -305,7 +305,7 @@ void EnZl4_UpdateFace(EnZl4* this) {
}
void EnZl4_SetMove(EnZl4* this, PlayState* play) {
this->skelAnime.moveFlags |= 1;
this->skelAnime.movementFlags |= 1;
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime, 1.0f);
}
@@ -53,12 +53,12 @@ void ObjHsblock_SetupAction(ObjHsblock* this, ObjHsblockActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision, s32 moveFlags) {
void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision, s32 movementFlags) {
s32 pad;
CollisionHeader* colHeader = NULL;
s32 pad2[2];
DynaPolyActor_Init(&this->dyna, moveFlags);
DynaPolyActor_Init(&this->dyna, movementFlags);
CollisionHeader_GetVirtual(collision, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
if (this->dyna.bgId == BG_ACTOR_MAX) {
@@ -7,6 +7,8 @@
#include "z_obj_makekinsuta.h"
#include "vt.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
void ObjMakekinsuta_Init(Actor* thisx, PlayState* play);
@@ -47,7 +49,7 @@ void ObjMakekinsuta_Init(Actor* thisx, PlayState* play) {
void func_80B98320(ObjMakekinsuta* this, PlayState* play) {
if (this->unk_152 != 0) {
if (this->timer >= 60 && !func_8002DEEC(GET_PLAYER(play))) {
if (GameInteractor_Should(VB_SPAWN_BEAN_SKULLTULA, this->timer >= 60) && !func_8002DEEC(GET_PLAYER(play))) {
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SW, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, (this->actor.params | 0x8000), true);
this->actionFunc = ObjMakekinsuta_DoNothing;
@@ -1926,14 +1926,14 @@ void Player_ZeroRootLimbYaw(Player* this) {
* it can also be called within action functions to change animations in the middle of an action.
*/
void Player_FinishAnimMovement(Player* this) {
if (this->skelAnime.moveFlags != 0) {
if (this->skelAnime.movementFlags != 0) {
Player_ApplyYawFromAnim(this);
this->skelAnime.jointTable[0].x = this->skelAnime.baseTransl.x;
this->skelAnime.jointTable[0].z = this->skelAnime.baseTransl.z;
if (this->skelAnime.moveFlags & 8) {
if (this->skelAnime.moveFlags & 2) {
if (this->skelAnime.movementFlags & 8) {
if (this->skelAnime.movementFlags & 2) {
this->skelAnime.jointTable[0].y = this->skelAnime.prevTransl.y;
}
} else {
@@ -1942,7 +1942,7 @@ void Player_FinishAnimMovement(Player* this) {
Player_ResetAnimMovement(this);
this->skelAnime.moveFlags = 0;
this->skelAnime.movementFlags = 0;
}
}
@@ -1958,7 +1958,7 @@ void Player_FinishAnimMovement(Player* this) {
void Player_ApplyAnimMovementScaledByAge(Player* this, s32 movementFlags) {
Vec3f diff;
this->skelAnime.moveFlags = movementFlags;
this->skelAnime.movementFlags = movementFlags;
this->skelAnime.prevTransl = this->skelAnime.baseTransl;
SkelAnime_UpdateTranslation(&this->skelAnime, &diff, this->actor.shape.rot.y);
@@ -2005,7 +2005,7 @@ void Player_ApplyAnimMovementScaledByAge(Player* this, s32 movementFlags) {
void Player_StartAnimMovement(PlayState* play, Player* this, s32 flags) {
if (flags & PLAYER_ANIM_MOVEMENT_RESET_BY_AGE) {
Player_ResetAnimMovementScaledByAge(this);
} else if ((flags & PLAYER_ANIM_MOVEMENT_RESET) || (this->skelAnime.moveFlags != 0)) {
} else if ((flags & PLAYER_ANIM_MOVEMENT_RESET) || (this->skelAnime.movementFlags != 0)) {
// If AnimMovement is already in use when this function is called and
// `PLAYER_ANIM_MOVEMENT_RESET_BY_AGE` is not set, then this case will be used.
Player_ResetAnimMovement(this);
@@ -2017,7 +2017,7 @@ void Player_StartAnimMovement(PlayState* play, Player* this, s32 flags) {
}
// Remove Player specific flags by masking the lower byte before setting to `skelAnime.movementFlags`
this->skelAnime.moveFlags = flags /*&& 0xFF*/;
this->skelAnime.movementFlags = flags /*&& 0xFF*/;
Player_ZeroSpeedXZ(this);
AnimationContext_DisableQueue(play);
@@ -3138,7 +3138,7 @@ s32 func_80835588(Player* this, PlayState* play) {
void Player_SetParallel(Player* this) {
this->stateFlags1 |= PLAYER_STATE1_PARALLEL;
if (!(this->skelAnime.moveFlags & 0x80) && (this->actor.bgCheckFlags & 0x200) &&
if (!(this->skelAnime.movementFlags & 0x80) && (this->actor.bgCheckFlags & 0x200) &&
(sShapeYawToTouchedWall < 0x2000)) {
// snap to the wall
this->yaw = this->actor.shape.rot.y = this->actor.wallYaw + 0x8000;
@@ -3362,14 +3362,14 @@ s32 Player_SetupAction(PlayState* play, Player* this, PlayerActionFunc actionFun
void Player_SetupActionPreserveAnimMovement(PlayState* play, Player* this, PlayerActionFunc actionFunc, s32 flags) {
s32 savedMovementFlags;
savedMovementFlags = this->skelAnime.moveFlags;
savedMovementFlags = this->skelAnime.movementFlags;
// Setting `skelAnime.movementFlags` to 0 will prevent `Player_FinishAnimMovement` from ending
// AnimMovement when `Player_SetupAction` is called.
this->skelAnime.moveFlags = 0;
this->skelAnime.movementFlags = 0;
Player_SetupAction(play, this, actionFunc, flags);
this->skelAnime.moveFlags = savedMovementFlags;
this->skelAnime.movementFlags = savedMovementFlags;
}
/**
@@ -5779,7 +5779,7 @@ void func_8083AA10(Player* this, PlayState* play) {
return;
}
if (!(this->stateFlags3 & PLAYER_STATE3_MIDAIR) && !(this->skelAnime.moveFlags & 0x80) &&
if (!(this->stateFlags3 & PLAYER_STATE3_MIDAIR) && !(this->skelAnime.movementFlags & 0x80) &&
(Player_Action_8084411C != this->actionFunc) && (Player_Action_80844A44 != this->actionFunc)) {
if ((sPrevFloorProperty == 7) || (this->meleeWeaponState != 0)) {
@@ -6927,7 +6927,7 @@ void func_8083D53C(PlayState* play, Player* this) {
}
} else if ((this->stateFlags1 & PLAYER_STATE1_IN_WATER) &&
(this->actor.yDistToWater < this->ageProperties->unk_24)) {
if ((this->skelAnime.moveFlags == 0) && (this->currentBoots != PLAYER_BOOTS_IRON)) {
if ((this->skelAnime.movementFlags == 0) && (this->currentBoots != PLAYER_BOOTS_IRON)) {
Player_SetupTurnInPlace(play, this, this->actor.shape.rot.y);
}
func_8083D0A8(play, this, this->actor.velocity.y);
@@ -12059,7 +12059,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
func_8084FF7C(this);
}
if (!(this->skelAnime.moveFlags & 0x80)) {
if (!(this->skelAnime.movementFlags & 0x80)) {
if (((this->actor.bgCheckFlags & 1) && (sFloorType == 5) && (this->currentBoots != PLAYER_BOOTS_IRON)) ||
((this->currentBoots == PLAYER_BOOTS_HOVER || GameInteractor_GetSlipperyFloorActive()) &&
!(this->stateFlags1 & (PLAYER_STATE1_IN_WATER | PLAYER_STATE1_IN_CUTSCENE)))) {
@@ -12246,9 +12246,9 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
Player_UpdateCamAndSeqModes(play, this);
if (this->skelAnime.moveFlags & 8) {
if (this->skelAnime.movementFlags & 8) {
AnimationContext_SetMoveActor(play, &this->actor, &this->skelAnime,
(this->skelAnime.moveFlags & 4) ? 1.0f : this->ageProperties->unk_08);
(this->skelAnime.movementFlags & 4) ? 1.0f : this->ageProperties->unk_08);
}
Player_UpdateShapeYaw(this, play);
@@ -13113,7 +13113,7 @@ void Player_Action_Talk(Player* this, PlayState* play) {
} else if (func_808332B8(this)) {
Player_Action_8084D610(this, play);
} else if (!Player_CheckHostileLockOn(this) && LinkAnimation_Update(play, &this->skelAnime)) {
if (this->skelAnime.moveFlags != 0) {
if (this->skelAnime.movementFlags != 0) {
Player_FinishAnimMovement(this);
if ((this->talkActor->category == ACTORCAT_NPC) && (this->heldItemAction != PLAYER_IA_FISHING_POLE)) {
@@ -13551,8 +13551,8 @@ void Player_Action_8084C760(Player* this, PlayState* play) {
if (LinkAnimation_Update(play, &this->skelAnime)) {
if (!(this->stateFlags1 & PLAYER_STATE1_LOADING)) {
if (this->skelAnime.moveFlags != 0) {
this->skelAnime.moveFlags = 0;
if (this->skelAnime.movementFlags != 0) {
this->skelAnime.movementFlags = 0;
return;
}
@@ -14752,6 +14752,8 @@ static AnimSfxEntry D_80854A34[] = {
void Player_Action_8084EFC0(Player* this, PlayState* play) {
Player_DecelerateToZero(this);
GameInteractor_Should(VB_EMPTYING_BOTTLE, true, this);
if (LinkAnimation_Update(play, &this->skelAnime)) {
func_8083C0E8(this, play);
func_8005B1A4(Play_GetCamera(play, 0));
@@ -15259,7 +15261,7 @@ void Player_Action_808502D0(Player* this, PlayState* play) {
if (LinkAnimation_Update(play, &this->skelAnime)) {
if (!Player_ActionHandler_7(this, play)) {
u8 sp43 = this->skelAnime.moveFlags;
u8 sp43 = this->skelAnime.movementFlags;
LinkAnimationHeader* sp3C;
if (Player_CheckHostileLockOn(this)) {
@@ -15269,7 +15271,7 @@ void Player_Action_808502D0(Player* this, PlayState* play) {
}
func_80832318(this);
this->skelAnime.moveFlags = 0;
this->skelAnime.movementFlags = 0;
if ((sp3C == &gPlayerAnim_link_fighter_Lpower_jump_kiru_end) &&
(this->modelAnimType != PLAYER_ANIMTYPE_3)) {
@@ -15278,7 +15280,7 @@ void Player_Action_808502D0(Player* this, PlayState* play) {
func_8083A098(this, sp3C, play);
this->skelAnime.moveFlags = sp43;
this->skelAnime.movementFlags = sp43;
this->stateFlags3 |= PLAYER_STATE3_FINISHED_ATTACKING;
}
} else if (this->heldItemAction == PLAYER_IA_HAMMER) {
@@ -16551,7 +16553,7 @@ void func_80852A54(PlayState* play, Player* this, CsCmdActorCue* cue) {
func_808529D0(play, this, cue);
}
this->skelAnime.moveFlags = 0;
this->skelAnime.movementFlags = 0;
Player_ZeroRootLimbYaw(this);
}
@@ -16562,7 +16564,7 @@ void func_80852B4C(PlayState* play, Player* this, CsCmdActorCue* cue, struct_808
arg3->func(play, this, cue);
}
if ((D_80858AA0 & 4) && !(this->skelAnime.moveFlags & 4)) {
if ((D_80858AA0 & 4) && !(this->skelAnime.movementFlags & 4)) {
this->skelAnime.morphTable[0].y /= this->ageProperties->unk_08;
D_80858AA0 = 0;
}
@@ -16601,7 +16603,7 @@ void func_80852C50(PlayState* play, Player* this, CsCmdActorCue* cue) {
}
}
D_80858AA0 = this->skelAnime.moveFlags;
D_80858AA0 = this->skelAnime.movementFlags;
Player_FinishAnimMovement(this);
osSyncPrintf("TOOL MODE=%d\n", sp24);
@@ -16624,7 +16626,7 @@ void func_80852C50(PlayState* play, Player* this, CsCmdActorCue* cue) {
void Player_Action_CsAction(Player* this, PlayState* play) {
if (this->csAction != this->prevCsAction) {
D_80858AA0 = this->skelAnime.moveFlags;
D_80858AA0 = this->skelAnime.movementFlags;
Player_FinishAnimMovement(this);
this->prevCsAction = this->csAction;
@@ -1093,10 +1093,6 @@ static s16 sLastFileChooseButtonIndex;
* Update function for `CM_MAIN_MENU`
*/
void FileChoose_UpdateMainMenu(GameState* thisx) {
static u8 emptyName[] = { 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x3E };
static u8 emptyNameNES[] = { 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
static u8 linkName[] = { 0x15, 0x2C, 0x31, 0x2E, 0x3E, 0x3E, 0x3E, 0x3E };
static u8 linkNameNES[] = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF };
FileChooseContext* this = (FileChooseContext*)thisx;
Input* input = &this->state.input[0];
bool dpad = CVarGetInteger(CVAR_SETTING("DpadInText"), 0);
@@ -1307,6 +1303,7 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) {
static u8 emptyNameNES[] = { 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
static u8 linkName[] = { 0x15, 0x2C, 0x31, 0x2E, 0x3E, 0x3E, 0x3E, 0x3E };
static u8 linkNameNES[] = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF };
static u8 linkNameJP[] = { 0x81, 0x87, 0x61, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
FileChoose_UpdateStickDirectionPromptAnim(thisx);
FileChooseContext* this = (FileChooseContext*)thisx;
Input* input = &this->state.input[0];
@@ -1376,6 +1373,14 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) {
this->nameEntryBoxAlpha = 0;
if (ResourceMgr_GetGameRegion(0) == GAME_REGION_PAL && gSaveContext.language != LANGUAGE_JPN) {
defaultName = CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? &linkName : &emptyName;
} else if (gSaveContext.language == LANGUAGE_JPN) { // Japanese
if (CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) != 0) {
// Set player name to "リンク" ("Link" in Katakana, 3 characters long) when playing in Japanese.
defaultName = &linkNameJP;
this->newFileNameCharCount = 3;
} else {
defaultName = &emptyNameNES;
}
} else { // GAME_REGION_NTSC
defaultName = CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? &linkNameNES : &emptyNameNES;
}
@@ -1551,6 +1556,7 @@ void FileChoose_UpdateRandomizerMenu(GameState* thisx) {
static u8 emptyNameNES[] = { 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
static u8 linkName[] = { 0x15, 0x2C, 0x31, 0x2E, 0x3E, 0x3E, 0x3E, 0x3E };
static u8 linkNameNES[] = { 0xB6, 0xB3, 0xB8, 0xB5, 0xDF, 0xDF, 0xDF, 0xDF };
static u8 linkNameJP[] = { 0x81, 0x87, 0x61, 0xDF, 0xDF, 0xDF, 0xDF, 0xDF };
u8* defaultName;
this->prevConfigMode = this->configMode;
@@ -1568,6 +1574,14 @@ void FileChoose_UpdateRandomizerMenu(GameState* thisx) {
this->nameEntryBoxAlpha = 0;
if (ResourceMgr_GetGameRegion(0) == GAME_REGION_PAL && gSaveContext.language != LANGUAGE_JPN) {
defaultName = CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? &linkName : &emptyName;
} else if (gSaveContext.language == LANGUAGE_JPN) { // Japanese
if (CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) != 0) {
// Set player name to "リンク" ("Link" in Katakana, 3 characters long) when playing in Japanese.
defaultName = &linkNameJP;
this->newFileNameCharCount = 3;
} else {
defaultName = &emptyNameNES;
}
} else { // GAME_REGION_NTSC
defaultName = CVarGetInteger(CVAR_ENHANCEMENT("LinkDefaultName"), 0) ? &linkNameNES : &emptyNameNES;
}