Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions soh/soh/SohGui/SohMenuEnhancements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@ void SohMenu::AddMenuEnhancements() {
AddWidget(path, "Faster Farore's Wind", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("FastFarores"))
.Options(CheckboxOptions().Tooltip("Greatly decreases cast time of Farore's Wind magic spell."));
AddWidget(path, "Skip Din's Fire Cuscene", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("SkipDinCutscene"));

AddWidget(path, "Bottles", WIDGET_SEPARATOR_TEXT);
AddWidget(path, "Rebottle Blue Fire", WIDGET_CVAR_CHECKBOX)
Expand Down
6 changes: 6 additions & 0 deletions soh/src/code/z_player_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,12 @@ s32 Player_HasMirrorShieldSetToDraw(PlayState* play) {
return (this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && (this->currentShield == PLAYER_SHIELD_MIRROR);
}

/// <summary>
/// Check magicspell value for Din's Fire, Nayru's Love or Farore's Wind
/// </summary>
/// <param name="">state of player</param>
/// <param name="actionParam">item action to check its magicspell value</param>
/// <returns>Return a value beetween 0 and 6 if Din's Fire, Nayru's Love or Farore's Wind. This value can be used with sMagicSpellCosts to know the cost of the spell</returns>
s32 Player_ActionToMagicSpell(Player* this, s32 actionParam) {
s32 magicSpell = actionParam - PLAYER_IA_MAGIC_SPELL_15;

Expand Down
60 changes: 42 additions & 18 deletions soh/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -3397,8 +3397,13 @@ void Player_SetupActionPreserveItemAction(PlayState* play, Player* this, PlayerA
}
}

void func_80835E44(PlayState* play, s16 camSetting) {
if (!func_800C0CB8(play)) {
/// <summary>
/// Change the state of the camera
/// </summary>
/// <param name="play">state of play</param>
/// <param name="camSetting">camera state to set</param>
void Camera_ChangeFocus(PlayState* play, s16 camSetting) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zeldaret/oot#2608

decomp renamed this to Player_RequestCameraSetting

if (!func_800C0CB8(play)) { //Seems like a specific condition for when the camera is fixed in certain locations (HyruleCity)
if (camSetting == CAM_SET_SCENE_TRANSITION) {
Interface_ChangeAlpha(2);
}
Expand All @@ -3407,8 +3412,8 @@ void func_80835E44(PlayState* play, s16 camSetting) {
}
}

void func_80835EA4(PlayState* play, s32 arg1) {
func_80835E44(play, CAM_SET_TURN_AROUND);
void Camera_FocusOnPlayer(PlayState* play, s32 arg1) {
Camera_ChangeFocus(play, CAM_SET_TURN_AROUND);
Camera_SetCameraData(Play_GetCamera(play, 0), 4, NULL, NULL, arg1, 0, 0);
}

Expand Down Expand Up @@ -5220,7 +5225,7 @@ s32 Player_HandleExitsAndVoids(PlayState* play, Player* this, CollisionPoly* pol

this->stateFlags1 |= PLAYER_STATE1_LOADING | PLAYER_STATE1_IN_CUTSCENE;

func_80835E44(play, 0x2F);
Camera_ChangeFocus(play, CAM_SET_SCENE_TRANSITION);

return 1;
} else {
Expand Down Expand Up @@ -5917,6 +5922,22 @@ void func_8083AE40(Player* this, s16 objectId) {
}
}

/// <summary>
/// Check if the current item used has its cutscene skipped in the settings of soh
/// Enhancements => Items
/// </summary>
/// <param name="itemAction">item used</param>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unusual doc comments

/// <returns>True: cutscene is skipped</returns>
bool IsCutsceneSkipped(s8 itemAction) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be handled by time saver hooks

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi thanks for the review. I'll commit corrections when I've a moment.

bool isCutsceneSkipped = false;
switch (itemAction) {
case PLAYER_IA_DINS_FIRE:
isCutsceneSkipped = CVarGetInteger(CVAR_ENHANCEMENT("SkipDinCutscene"), 0);
break;
}
return isCutsceneSkipped;
}

void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) {
Player_SetupActionPreserveItemAction(play, this, Player_Action_808507F4, 0);

Expand All @@ -5940,10 +5961,13 @@ void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) {
LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, &gPlayerAnim_link_magic_tame, 0.83f);
}

if (IsCutsceneSkipped(this->itemAction))
return;

if (magicSpell == 5) {
this->subCamId = OnePointCutscene_Init(play, 1100, -101, NULL, MAIN_CAM);
} else {
func_80835EA4(play, 10);
Camera_FocusOnPlayer(play, 10);
}
}

Expand Down Expand Up @@ -6011,7 +6035,7 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) {
Player_SetupAction(play, this, Player_Action_8085063C, 1);
this->stateFlags1 |= PLAYER_STATE1_IN_ITEM_CS | PLAYER_STATE1_IN_CUTSCENE;
Player_AnimPlayOnce(play, this, Player_GetIdleAnim(this));
func_80835EA4(play, 4);
Camera_FocusOnPlayer(play, 4);
}

func_80832224(this);
Expand Down Expand Up @@ -6069,11 +6093,11 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) {
} else if (sp2C == EXCH_ITEM_LETTER_RUTO) {
this->av1.actionVar1 = 1;
this->actor.textId = 0x4005;
func_80835EA4(play, 1);
Camera_FocusOnPlayer(play, 1);
} else {
this->av1.actionVar1 = 2;
this->actor.textId = 0xCF;
func_80835EA4(play, 4);
Camera_FocusOnPlayer(play, 4);
}

this->actor.flags |= ACTOR_FLAG_TALK;
Expand All @@ -6096,21 +6120,21 @@ s32 Player_ActionHandler_13(Player* this, PlayState* play) {
if (sp2C == 0xC) {
Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EED8, 0);
Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_bug_out);
func_80835EA4(play, 3);
Camera_FocusOnPlayer(play, 3);
} else if ((sp2C > 0) && (sp2C < 4)) {
Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EFC0, 0);
Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_bottle_fish_out);
func_80835EA4(play, (sp2C == 1) ? 1 : 5);
Camera_FocusOnPlayer(play, (sp2C == 1) ? 1 : 5);
} else {
Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EAC0, 0);
Player_AnimChangeOnceMorphAdjusted(play, this, &gPlayerAnim_link_bottle_drink_demo_start);
func_80835EA4(play, 2);
Camera_FocusOnPlayer(play, 2);
}
} else {
Player_SetupActionPreserveItemAction(play, this, Player_Action_8084E3C4, 0);
Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_normal_okarina_start);
this->stateFlags2 |= PLAYER_STATE2_OCARINA_PLAYING;
func_80835EA4(play, (this->unk_6A8 != NULL) ? 0x5B : 0x5A);
Camera_FocusOnPlayer(play, (this->unk_6A8 != NULL) ? 0x5B : 0x5A);
if (this->unk_6A8 != NULL) {
this->stateFlags2 |= PLAYER_STATE2_PLAY_FOR_ACTOR;
Camera_SetParam(Play_GetCamera(play, 0), 8, this->unk_6A8);
Expand Down Expand Up @@ -7372,7 +7396,7 @@ s32 Player_ActionHandler_2(Player* this, PlayState* play) {
if (!(this->stateFlags2 & PLAYER_STATE2_UNDERWATER) || (this->currentBoots == PLAYER_BOOTS_IRON)) {
Player_SetupWaitForPutAway(play, this, func_8083A434);
Player_AnimPlayOnceAdjusted(play, this, &gPlayerAnim_link_demo_get_itemB);
func_80835EA4(play, 9);
Camera_FocusOnPlayer(play, 9);
}

this->stateFlags1 |=
Expand Down Expand Up @@ -14274,7 +14298,7 @@ void Player_Action_8084E1EC(Player* this, PlayState* play) {
if ((this->stateFlags1 & PLAYER_STATE1_GETTING_ITEM) && LinkAnimation_OnFrame(&this->skelAnime, 10.0f)) {
func_808332F4(this, play);
func_80832340(play, this);
func_80835EA4(play, 8);
Camera_FocusOnPlayer(play, 8);
} else if (LinkAnimation_OnFrame(&this->skelAnime, 5.0f)) {
Player_PlayVoiceSfx(this, NA_SE_VO_LI_BREATH_DRINK);
}
Expand Down Expand Up @@ -14444,7 +14468,7 @@ void Player_Action_8084E6D4(Player* this, PlayState* play) {
}

this->av2.actionVar2 = 2;
func_80835EA4(play, 9);
Camera_FocusOnPlayer(play, 9);
}
} else {
if (this->av2.actionVar2 == 0) {
Expand Down Expand Up @@ -14642,7 +14666,7 @@ void Player_Action_SwingBottle(Player* this, PlayState* play) {
Player_UpdateBottleHeld(play, this, catchInfo->itemId, ABS(catchInfo->itemAction));
if (!CVarGetInteger(CVAR_ENHANCEMENT("FastBottles"), 0)) {
Player_AnimPlayOnceAdjusted(play, this, swingEntry->catchAnimation);
func_80835EA4(play, 4);
Camera_FocusOnPlayer(play, 4);
}
}
}
Expand Down Expand Up @@ -16720,6 +16744,6 @@ void Player_StartTalking(PlayState* play, Actor* actor) {

if ((this->naviActor == this->talkActor) && ((this->talkActor->textId & 0xFF00) != 0x200)) {
this->naviActor->flags |= ACTOR_FLAG_TALK;
func_80835EA4(play, 0xB);
Camera_FocusOnPlayer(play, 0xB);
}
}
Loading