mirror of
https://github.com/HarbourMasters/2ship2harkinian.git
synced 2024-11-27 00:00:32 +00:00
[Enhancement] Enable putaway as Fierce Deity (#717)
Some checks are pending
Some checks are pending
* Add enhancement to enable putaway as Fierce Deity * Fix hooks for putaway and FD sword wield --------- Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
parent
4d3c39224c
commit
bb386e25a0
@ -716,6 +716,8 @@ void DrawEnhancementsMenu() {
|
||||
}
|
||||
UIWidgets::CVarCheckbox("Instant Putaway", "gEnhancements.Player.InstantPutaway",
|
||||
{ .tooltip = "Allows Link to instantly puts away held item without waiting." });
|
||||
UIWidgets::CVarCheckbox("Fierce Deity Putaway", "gEnhancements.Player.FierceDeityPutaway",
|
||||
{ .tooltip = "Allows Fierce Deity Link to put away his sword." });
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
@ -1001,6 +1001,8 @@ void AddEnhancements() {
|
||||
([](widgetInfo& info) { RegisterFastFlowerLaunch(); }) },
|
||||
{ "Instant Putaway", "gEnhancements.Player.InstantPutaway",
|
||||
"Allows Link to instantly puts away held item without waiting.", WIDGET_CVAR_CHECKBOX },
|
||||
{ "Fierce Deity Putaway", "gEnhancements.Player.FierceDeityPutaway",
|
||||
"Allows Fierce Deity Link to put away his sword.", WIDGET_CVAR_CHECKBOX },
|
||||
{ "Climb speed",
|
||||
"gEnhancements.PlayerMovement.ClimbSpeed",
|
||||
"Increases the speed at which Link climbs vines and ladders.",
|
||||
|
@ -54,6 +54,7 @@ void InitEnhancements() {
|
||||
RegisterClimbSpeed();
|
||||
RegisterFastFlowerLaunch();
|
||||
RegisterInstantPutaway();
|
||||
RegisterFierceDeityPutaway();
|
||||
|
||||
// Songs
|
||||
RegisterEnableSunsSong();
|
||||
|
19
mm/2s2h/Enhancements/Player/FierceDeityPutaway.cpp
Normal file
19
mm/2s2h/Enhancements/Player/FierceDeityPutaway.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <libultraship/bridge.h>
|
||||
#include "2s2h/GameInteractor/GameInteractor.h"
|
||||
#include "variables.h"
|
||||
|
||||
void RegisterFierceDeityPutaway() {
|
||||
REGISTER_VB_SHOULD(VB_SHOULD_PUTAWAY, {
|
||||
if (CVarGetInteger("gEnhancements.Player.FierceDeityPutaway", 0)) {
|
||||
Player* player = GET_PLAYER(gPlayState);
|
||||
if (player->transformation == PLAYER_FORM_FIERCE_DEITY)
|
||||
*should = true;
|
||||
}
|
||||
});
|
||||
|
||||
REGISTER_VB_SHOULD(VB_FD_ALWAYS_WIELD_SWORD, {
|
||||
if (CVarGetInteger("gEnhancements.Player.FierceDeityPutaway", 0)) {
|
||||
*should = false;
|
||||
}
|
||||
});
|
||||
}
|
@ -4,5 +4,6 @@
|
||||
void RegisterClimbSpeed();
|
||||
void RegisterFastFlowerLaunch();
|
||||
void RegisterInstantPutaway();
|
||||
void RegisterFierceDeityPutaway();
|
||||
|
||||
#endif // PLAYER_H
|
||||
|
@ -65,6 +65,8 @@ typedef enum {
|
||||
VB_ZTARGET_SPEED_CHECK,
|
||||
VB_THIEF_BIRD_STEAL,
|
||||
VB_PLAY_CREMIA_HUG_CUTSCENE,
|
||||
VB_FD_ALWAYS_WIELD_SWORD,
|
||||
VB_SHOULD_PUTAWAY,
|
||||
VB_ELEGY_CHECK_SCENE,
|
||||
} GIVanillaBehavior;
|
||||
|
||||
|
@ -3761,8 +3761,9 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) {
|
||||
ItemId item;
|
||||
EquipSlot i = func_8082FDC4();
|
||||
|
||||
i = ((i >= EQUIP_SLOT_A) && (this->transformation == PLAYER_FORM_FIERCE_DEITY) &&
|
||||
(this->heldItemAction != PLAYER_IA_SWORD_TWO_HANDED))
|
||||
i = GameInteractor_Should(VB_FD_ALWAYS_WIELD_SWORD, (i >= EQUIP_SLOT_A) &&
|
||||
(this->transformation == PLAYER_FORM_FIERCE_DEITY) &&
|
||||
(this->heldItemAction != PLAYER_IA_SWORD_TWO_HANDED))
|
||||
? EQUIP_SLOT_B
|
||||
: i;
|
||||
|
||||
@ -8115,7 +8116,7 @@ s32 Player_ActionChange_6(Player* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if ((this->putAwayCountdown == 0) && (this->heldItemAction >= PLAYER_IA_SWORD_KOKIRI) &&
|
||||
(this->transformation != PLAYER_FORM_FIERCE_DEITY)) {
|
||||
GameInteractor_Should(VB_SHOULD_PUTAWAY, (this->transformation != PLAYER_FORM_FIERCE_DEITY))) {
|
||||
Player_UseItem(play, this, ITEM_NONE);
|
||||
} else {
|
||||
this->stateFlags2 ^= PLAYER_STATE2_100000;
|
||||
@ -11243,8 +11244,8 @@ void Player_SetDoAction(PlayState* play, Player* this) {
|
||||
} else if ((this->transformation == PLAYER_FORM_DEKU) && !(this->stateFlags1 & PLAYER_STATE1_8000000) &&
|
||||
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
|
||||
doActionA = DO_ACTION_ATTACK;
|
||||
} else if (((this->transformation == PLAYER_FORM_HUMAN) ||
|
||||
(this->transformation == PLAYER_FORM_ZORA)) &&
|
||||
} else if (GameInteractor_Should(VB_SHOULD_PUTAWAY, ((this->transformation == PLAYER_FORM_HUMAN) ||
|
||||
(this->transformation == PLAYER_FORM_ZORA))) &&
|
||||
((this->heldItemAction >= PLAYER_IA_SWORD_KOKIRI) ||
|
||||
((this->stateFlags2 & PLAYER_STATE2_100000) &&
|
||||
(play->actorCtx.targetCtx.fairyActor == NULL)))) {
|
||||
|
Loading…
Reference in New Issue
Block a user