diff --git a/soh/assets/objects/object_custom_equip/object_custom_equip.h b/soh/assets/objects/object_custom_equip/object_custom_equip.h index 380116a0f99..dced4f04ece 100644 --- a/soh/assets/objects/object_custom_equip/object_custom_equip.h +++ b/soh/assets/objects/object_custom_equip/object_custom_equip.h @@ -7,24 +7,42 @@ #define dgCustomBowDL "__OTR__objects/object_custom_equip/gCustomBowDL" static const ALIGN_ASSET(2) char gCustomBowDL[] = dgCustomBowDL; +#define dgCustomBowFPSDL "__OTR__objects/object_custom_equip/gCustomBowFPSDL" +static const ALIGN_ASSET(2) char gCustomBowFPSDL[] = dgCustomBowFPSDL; + #define dgCustomHammerDL "__OTR__objects/object_custom_equip/gCustomHammerDL" static const ALIGN_ASSET(2) char gCustomHammerDL[] = dgCustomHammerDL; #define dgCustomHookshotDL "__OTR__objects/object_custom_equip/gCustomHookshotDL" static const ALIGN_ASSET(2) char gCustomHookshotDL[] = dgCustomHookshotDL; +#define dgCustomHookshotFPSDL "__OTR__objects/object_custom_equip/gCustomHookshotFPSDL" +static const ALIGN_ASSET(2) char gCustomHookshotFPSDL[] = dgCustomHookshotFPSDL; + #define dgCustomLongshotDL "__OTR__objects/object_custom_equip/gCustomLongshotDL" static const ALIGN_ASSET(2) char gCustomLongshotDL[] = dgCustomLongshotDL; +#define dgCustomLongshotFPSDL "__OTR__objects/object_custom_equip/gCustomLongshotFPSDL" +static const ALIGN_ASSET(2) char gCustomLongshotFPSDL[] = dgCustomLongshotFPSDL; + #define dgCustomHookshotTipDL "__OTR__objects/object_custom_equip/gCustomHookshotTipDL" static const ALIGN_ASSET(2) char gCustomHookshotTipDL[] = dgCustomHookshotTipDL; #define dgCustomHookshotChainDL "__OTR__objects/object_custom_equip/gCustomHookshotChainDL" static const ALIGN_ASSET(2) char gCustomHookshotChainDL[] = dgCustomHookshotChainDL; +#define dgCustomLongshotTipDL "__OTR__objects/object_custom_equip/gCustomLongshotTipDL" +static const ALIGN_ASSET(2) char gCustomLongshotTipDL[] = dgCustomLongshotTipDL; + +#define dgCustomLongshotChainDL "__OTR__objects/object_custom_equip/gCustomLongshotChainDL" +static const ALIGN_ASSET(2) char gCustomLongshotChainDL[] = dgCustomLongshotChainDL; + #define dgCustomSlingshotDL "__OTR__objects/object_custom_equip/gCustomSlingshotDL" static const ALIGN_ASSET(2) char gCustomSlingshotDL[] = dgCustomSlingshotDL; +#define dgCustomSlingshotFPSDL "__OTR__objects/object_custom_equip/gCustomSlingshotFPSDL" +static const ALIGN_ASSET(2) char gCustomSlingshotFPSDL[] = dgCustomSlingshotFPSDL; + #define dgCustomFairyOcarinaDL "__OTR__objects/object_custom_equip/gCustomFairyOcarinaDL" static const ALIGN_ASSET(2) char gCustomFairyOcarinaDL[] = dgCustomFairyOcarinaDL; diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index b799d4a9958..4381089eb14 100644 --- a/soh/soh/Enhancements/customequipment.cpp +++ b/soh/soh/Enhancements/customequipment.cpp @@ -57,6 +57,34 @@ static const char* GetBrokenLongswordInSheathDL() { { gCustomBrokenLongswordInSheathDL, gCustomBreakableLongswordInSheathDL, gCustomLongswordInSheathDL }); } +static const char* GetLongshotDL() { + return ResolveCustomChain({ gCustomLongshotDL, gCustomHookshotDL }); +} + +static const char* GetBowFPSDL() { + return ResolveCustomChain({ gCustomBowFPSDL, gCustomBowDL }); +} + +static const char* GetSlingshotFPSDL() { + return ResolveCustomChain({ gCustomSlingshotFPSDL, gCustomSlingshotDL }); +} + +static const char* GetHookshotFPSDL() { + return ResolveCustomChain({ gCustomHookshotFPSDL, gCustomHookshotDL }); +} + +static const char* GetLongshotFPSDL() { + return ResolveCustomChain({ gCustomLongshotFPSDL, gCustomLongshotDL, gCustomHookshotDL }); +} + +static const char* GetLongshotTipDL() { + return ResolveCustomChain({ gCustomLongshotTipDL, gCustomHookshotTipDL }); +} + +static const char* GetLongshotChainDL() { + return ResolveCustomChain({ gCustomLongshotChainDL, gCustomHookshotChainDL }); +} + static void UpdateCustomEquipmentSetModel(Player* player, u8 ModelGroup) { (void)ModelGroup; @@ -395,26 +423,33 @@ static void ApplyCommonEquipmentPatches() { ApplyPatchEntries({ { gLinkAdultRightHandHoldingHookshotNearDL, gCustomHookshotDL, "customHookshot1", "customHookshot2", "customHookshot3", rightHandClosed }, - { gLinkAdultRightHandHoldingHookshotFarDL, gCustomHookshotDL, "customHookshotFPS1", "customHookshotFPS2", + { gLinkAdultRightHandHoldingHookshotFarDL, GetHookshotFPSDL(), "customHookshotFPS1", "customHookshotFPS2", "customHookshotFPS3", fpsHand }, + { gLinkAdultHookshotTipDL, gCustomHookshotTipDL, "customHookshotTip1", "customHookshotTip2", nullptr, + nullptr }, + { gLinkAdultHookshotChainDL, gCustomHookshotChainDL, "customHookshotChain1", "customHookshotChain2", + nullptr, nullptr }, }); - } - - if (INV_CONTENT(ITEM_LONGSHOT) == ITEM_LONGSHOT) { + } else if (INV_CONTENT(ITEM_LONGSHOT) == ITEM_LONGSHOT) { ApplyPatchEntries({ - { gLinkAdultRightHandHoldingHookshotNearDL, gCustomLongshotDL, "customHookshot1", "customHookshot2", + { gLinkAdultRightHandHoldingHookshotNearDL, GetLongshotDL(), "customHookshot1", "customHookshot2", "customHookshot3", rightHandClosed }, - { gLinkAdultRightHandHoldingHookshotFarDL, gCustomLongshotDL, "customHookshotFPS1", "customHookshotFPS2", + { gLinkAdultRightHandHoldingHookshotFarDL, GetLongshotFPSDL(), "customHookshotFPS1", "customHookshotFPS2", "customHookshotFPS3", fpsHand }, + { gLinkAdultHookshotTipDL, GetLongshotTipDL(), "customHookshotTip1", "customHookshotTip2", nullptr, + nullptr }, + { gLinkAdultHookshotChainDL, GetLongshotChainDL(), "customHookshotChain1", "customHookshotChain2", nullptr, + nullptr }, + }); + } else { + ApplyPatchEntries({ + { gLinkAdultHookshotTipDL, gCustomHookshotTipDL, "customHookshotTip1", "customHookshotTip2", nullptr, + nullptr }, + { gLinkAdultHookshotChainDL, gCustomHookshotChainDL, "customHookshotChain1", "customHookshotChain2", + nullptr, nullptr }, }); } - ApplyPatchEntries({ - { gLinkAdultHookshotTipDL, gCustomHookshotTipDL, "customHookshotTip1", "customHookshotTip2", nullptr, nullptr }, - { gLinkAdultHookshotChainDL, gCustomHookshotChainDL, "customHookshotChain1", "customHookshotChain2", nullptr, - nullptr }, - }); - if (INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY) { ApplyPatchEntries({ { gLinkAdultRightHandHoldingOotNearDL, isChild ? gCustomFairyOcarinaDL : gCustomFairyOcarinaAdultDL, @@ -436,7 +471,7 @@ static void ApplyCommonEquipmentPatches() { "customChildOcarina3", rightHandNear }, { gLinkAdultRightHandHoldingBowNearDL, gCustomBowDL, "customBow1", "customBow2", "customBow3", rightHandClosed }, - { gLinkAdultRightHandHoldingBowFirstPersonDL, gCustomBowDL, "customBowFPS1", "customBowFPS2", "customBowFPS3", + { gLinkAdultRightHandHoldingBowFirstPersonDL, GetBowFPSDL(), "customBowFPS1", "customBowFPS2", "customBowFPS3", fpsHand }, { gLinkAdultLeftHandHoldingHammerNearDL, gCustomHammerDL, "customHammer1", "customHammer2", "customHammer3", leftHandClosed }, @@ -444,7 +479,7 @@ static void ApplyCommonEquipmentPatches() { "customBoomerang3", leftHandClosed }, { gLinkChildRightHandHoldingSlingshotNearDL, gCustomSlingshotDL, "customSlingshot1", "customSlingshot2", "customSlingshot3", rightHandClosed }, - { gLinkChildRightArmStretchedSlingshotDL, gCustomSlingshotDL, "customSlingshotFPS1", "customSlingshotFPS2", + { gLinkChildRightArmStretchedSlingshotDL, GetSlingshotFPSDL(), "customSlingshotFPS1", "customSlingshotFPS2", "customSlingshotFPS3", fpsHand }, }); @@ -457,7 +492,7 @@ static void ApplyCommonEquipmentPatches() { "customBoomerang3", leftHandClosed }, { gLinkChildRightHandHoldingSlingshotNearDL, gCustomSlingshotDL, "customSlingshot1", "customSlingshot2", "customSlingshot3", rightHandClosed }, - { gLinkChildRightArmStretchedSlingshotDL, gCustomSlingshotDL, "customSlingshotFPS1", "customSlingshotFPS2", + { gLinkChildRightArmStretchedSlingshotDL, GetSlingshotFPSDL(), "customSlingshotFPS1", "customSlingshotFPS2", "customSlingshotFPS3", fpsHand }, }); }