mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 21:33:40 -07:00
tweak + switch
This commit is contained in:
parent
faa96b30c2
commit
216e9b3eb3
1 changed files with 19 additions and 3 deletions
|
@ -131,13 +131,29 @@ void RegisterOcarinaTimeTravel() {
|
||||||
bool notNearAnySource = !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyDoorOfTime &&
|
bool notNearAnySource = !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyDoorOfTime &&
|
||||||
!nearbyFrogs && !nearbyGossipStone;
|
!nearbyFrogs && !nearbyGossipStone;
|
||||||
bool hasOcarinaOfTime = (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME);
|
bool hasOcarinaOfTime = (INV_CONTENT(ITEM_OCARINA_TIME) == ITEM_OCARINA_TIME);
|
||||||
|
bool hasMasterSword = CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER);
|
||||||
int timeTravelSetting = CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0);
|
int timeTravelSetting = CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0);
|
||||||
bool doesntNeedOcarinaOfTime = timeTravelSetting == TIME_TRAVEL_ANY || timeTravelSetting == TIME_TRAVEL_ANY_MS;
|
bool meetsTimeTravelRequirements = false;
|
||||||
bool needMasterSwordAndOcarina = timeTravelSetting == TIME_TRAVEL_ANY_MS || timeTravelSetting == TIME_TRAVEL_OOT_MS;
|
|
||||||
|
|
||||||
if (justPlayedSoT && notNearAnySource && (hasOcarinaOfTime || doesntNeedOcarinaOfTime || needMasterSwordAndOcarina)) {
|
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;
|
||||||
|
default:
|
||||||
|
meetsTimeTravelRequirements = hasOcarinaOfTime;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (justPlayedSoT && notNearAnySource && meetsTimeTravelRequirements) {
|
||||||
SwitchAge();
|
SwitchAge();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue