Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mod] Turn Nayru's Love into Roc's Feather #16

Closed
wants to merge 5 commits into from
Closed
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
1 change: 1 addition & 0 deletions soh/include/z64player.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ typedef struct Player {
// Upstream TODO: Rename these to be more obviously SoH specific
/* */ PendingFlag pendingFlag;
/* */ GetItemEntry getItemEntry;
/* */ s8 rocUseCount;
// #endregion
// #region SOH [Enhancements]
// Upstream TODO: Rename this to make it more obvious it is apart of an enhancement
Expand Down
1 change: 1 addition & 0 deletions soh/soh/Enhancements/presets.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ const std::vector<const char*> enhancementsCvars = {
"gChestSizeDependsStoneOfAgony",
"gSkipArrowAnimation",
"gSeparateArrows",
"gRocsFeather",
"gCustomizeShootingGallery",
"gInstantShootingGalleryWin",
"gConstantAdultGallery",
Expand Down
5 changes: 5 additions & 0 deletions soh/soh/GameMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,11 @@ namespace GameMenuBar {
UIWidgets::Tooltip("Explosions are now a static size, like in Majora's Mask and OoT3D. Makes bombchu hovering much easier.");
UIWidgets::PaddedEnhancementCheckbox("Prevent Bombchus Forcing First-Person", "gDisableFirstPersonChus", true, false);
UIWidgets::Tooltip("Prevent bombchus from forcing the camera into first-person mode when released.");
UIWidgets::PaddedEnhancementCheckbox("Turn Nayru's Love into Roc's Feather", "gRocsFeather", true, false);
UIWidgets::Tooltip(
"Nayru's Love acts like Roc's Feather from the Indigo romhack instead. Grants a jump that can even be used in the air, "
"but needs to recharge by touching the ground afterwards. Does not require magic to use."
);
ImGui::EndMenu();
}

Expand Down
28 changes: 27 additions & 1 deletion soh/src/overlays/actors/ovl_player_actor/z_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ s32 Player_InflictDamage(PlayState* play, s32 damage);
s32 Player_InflictDamageModified(PlayState* play, s32 damage, u8 modified);
void func_80853148(PlayState* play, Actor* actor);

void func_80838940(Player* this, LinkAnimationHeader* anim, f32 arg2, PlayState* play, u16 sfxId);

// .bss part 1
static s32 D_80858AA0;
static s32 D_80858AA4;
Expand Down Expand Up @@ -2046,6 +2048,10 @@ void func_80833DF8(Player* this, PlayState* play) {
s32 item;
s32 i;

if (this->actor.bgCheckFlags & 1) {
this->rocUseCount = 0;
}

if (this->currentMask != PLAYER_MASK_NONE) {
if (CVarGetInteger("gMMBunnyHood", 0) != 0) {
s32 maskItem = this->currentMask - PLAYER_MASK_KEATON + ITEM_MASK_KEATON;
Expand Down Expand Up @@ -2110,9 +2116,29 @@ void func_80833DF8(Player* this, PlayState* play) {
if ((item < ITEM_NONE_FE) && (Player_ItemToActionParam(item) == this->heldItemAction)) {
D_80853618 = true;
}
} else {
} else if (item != ITEM_NAYRUS_LOVE || !CVarGetInteger("gRocsFeather", 0)) {
this->heldItemButton = i;
func_80835F44(play, this, item);
} else if (this->rocUseCount == 0) {
this->rocUseCount++;
this->linearVelocity = 5.0f;
this->actor.velocity.y = 8.0f;
this->actor.world.rot.y = this->currentYaw = this->actor.shape.rot.y;

func_80838940(this, D_80853D4C[2][0], !(2 & 1) ? 5.8f : 3.5f, play, /* NA_SE_VO_LI_SWORD_N*/ 0);

Vec3f effectsPos = this->actor.home.pos;
effectsPos.y += 3;
f32 effectsScale = 1;
if (!gSaveContext.linkAge) {
effectsScale = 1.5f;
}
EffectSsGRipple_Spawn(play, &effectsPos, 200 * effectsScale, 300 * effectsScale, 1);
EffectSsGSplash_Spawn(play, &effectsPos, NULL, NULL, 0, 150 * effectsScale);

this->stateFlags2 &= ~(PLAYER_STATE2_19);

func_8002F7DC(&this->actor, NA_SE_PL_SKIP);
}
}
}
Expand Down