mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-19 21:03:42 -07:00
TWEAK: SoT Time Travel - Allow Swordless (#5716)
* Magic number + more modular * tweak + switch * forgot basic oot * linebreak * c-lang
This commit is contained in:
parent
526d221c56
commit
c597e1c4ce
3 changed files with 26 additions and 5 deletions
|
@ -112,7 +112,9 @@ typedef enum {
|
|||
typedef enum {
|
||||
TIME_TRAVEL_DISABLED,
|
||||
TIME_TRAVEL_OOT,
|
||||
TIME_TRAVEL_OOT_MS,
|
||||
TIME_TRAVEL_ANY,
|
||||
TIME_TRAVEL_ANY_MS
|
||||
} TimeTravelType;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -130,10 +130,27 @@ void RegisterOcarinaTimeTravel() {
|
|||
bool notNearAnySource = !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyDoorOfTime &&
|
||||
!nearbyFrogs && !nearbyGossipStone;
|
||||
bool hasOcarinaOfTime = (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME);
|
||||
bool doesntNeedOcarinaOfTime = CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0) == 2;
|
||||
bool hasMasterSword = CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER);
|
||||
// TODO: Once Swordless Adult is fixed: Remove the Master Sword check
|
||||
if (justPlayedSoT && notNearAnySource && (hasOcarinaOfTime || doesntNeedOcarinaOfTime) && hasMasterSword) {
|
||||
int timeTravelSetting = CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0);
|
||||
bool meetsTimeTravelRequirements = false;
|
||||
|
||||
switch (timeTravelSetting) {
|
||||
case TIME_TRAVEL_ANY:
|
||||
meetsTimeTravelRequirements = true;
|
||||
break;
|
||||
case TIME_TRAVEL_ANY_MS:
|
||||
meetsTimeTravelRequirements = hasMasterSword;
|
||||
break;
|
||||
case TIME_TRAVEL_OOT_MS:
|
||||
meetsTimeTravelRequirements = hasMasterSword && hasOcarinaOfTime;
|
||||
break;
|
||||
case TIME_TRAVEL_OOT:
|
||||
default:
|
||||
meetsTimeTravelRequirements = hasOcarinaOfTime;
|
||||
break;
|
||||
}
|
||||
|
||||
if (justPlayedSoT && notNearAnySource && meetsTimeTravelRequirements) {
|
||||
SwitchAge();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -56,7 +56,9 @@ static const std::unordered_map<int32_t, const char*> chestStyleMatchesContentsO
|
|||
static const std::unordered_map<int32_t, const char*> timeTravelOptions = {
|
||||
{ TIME_TRAVEL_DISABLED, "Disabled" },
|
||||
{ TIME_TRAVEL_OOT, "Ocarina of Time" },
|
||||
{ TIME_TRAVEL_OOT_MS, "Ocarina of Time + Master Sword" },
|
||||
{ TIME_TRAVEL_ANY, "Any Ocarina" },
|
||||
{ TIME_TRAVEL_ANY_MS, "Any Ocarina + Master Sword" },
|
||||
};
|
||||
|
||||
static const std::unordered_map<int32_t, const char*> sleepingWaterfallOptions = {
|
||||
|
@ -783,9 +785,9 @@ void SohMenu::AddMenuEnhancements() {
|
|||
.Tooltip("Allows Link to freely change age by playing the Song of Time.\n"
|
||||
"Time Blocks can still be used properly.\n\n"
|
||||
"Requirements:\n"
|
||||
" - Obtained the Ocarina of Time (depends on selection)\n"
|
||||
" - Obtained the Song of Time\n"
|
||||
" - Obtained the Master Sword\n"
|
||||
" - Obtained the Ocarina of Time (depends on selection)\n"
|
||||
" - Obtained the Master Sword (depends on selection)\n"
|
||||
" - Not within range of a Time Block\n"
|
||||
" - Not within range of Ocarina Playing spots"));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue