diff --git a/ootrando_overworldmap_hamsda.zip b/ootrando_overworldmap_hamsda.zip index 1879275..3414c07 100644 Binary files a/ootrando_overworldmap_hamsda.zip and b/ootrando_overworldmap_hamsda.zip differ diff --git a/ootrando_overworldmap_hamsda/changelog.md b/ootrando_overworldmap_hamsda/changelog.md index dc153ed..68822d5 100644 --- a/ootrando_overworldmap_hamsda/changelog.md +++ b/ootrando_overworldmap_hamsda/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 3.5.0.0 + +- added peeks to ER +- added trials clear logic to ER + ## 3.4.4.0 - added KZ skip to ER diff --git a/ootrando_overworldmap_hamsda/layouts/capture.json b/ootrando_overworldmap_hamsda/layouts/capture_items.json similarity index 100% rename from ootrando_overworldmap_hamsda/layouts/capture.json rename to ootrando_overworldmap_hamsda/layouts/capture_items.json diff --git a/ootrando_overworldmap_hamsda/locations/dungeons.json b/ootrando_overworldmap_hamsda/locations/dungeons.json index 3643f1f..e16950a 100644 --- a/ootrando_overworldmap_hamsda/locations/dungeons.json +++ b/ootrando_overworldmap_hamsda/locations/dungeons.json @@ -764,11 +764,19 @@ "@Dodongos Cavern MQ/Bomb Bag Area,$has_age|adult,hookshot,bow", "@Dodongos Cavern MQ/Bomb Bag Area,$has_age|adult,hookshot,lift1", "@Dodongos Cavern MQ/Bomb Bag Area,$has_age|adult,hookshot,dinsfire,magic", - "@Dodongos Cavern MQ/Bomb Bag Area,$has_age|adult,hookshot,$has_explosives" + "@Dodongos Cavern MQ/Bomb Bag Area,$has_age|adult,hookshot,$has_explosives", + "{@Dodongos Cavern MQ/Bomb Bag Area,$has_age|child,sling,lift1}", + "{@Dodongos Cavern MQ/Bomb Bag Area,$has_age|child,sling,dinsfire,magic}", + "{@Dodongos Cavern MQ/Bomb Bag Area,$has_age|child,sling,$has_bombchus}", + "{@Dodongos Cavern MQ/Bomb Bag Area,$has_age|child,sticks,$has_bombchus}", + "{@Dodongos Cavern MQ/Bomb Bag Area,$has_age|child,sword1,$has_bombchus}", + "{@Dodongos Cavern MQ/Bomb Bag Area,$has_age|adult,bow}", + "{@Dodongos Cavern MQ/Bomb Bag Area,$has_age|adult,$has_bombchus}" ], "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1056,7 +1064,7 @@ "access_rules": [ "@Jabu Jabus Belly/Main,boomerang", "{@Jabu Jabus Belly/Main,sling}", - "{@Jabu Jabus Belly/Main,$has_explosives}" + "{@Jabu Jabus Belly/Main,$has_bombchus}" ], "visibility_rules": [ "setting_tokens_dungeons" @@ -1072,7 +1080,7 @@ "access_rules": [ "@Jabu Jabus Belly/Main,boomerang", "{@Jabu Jabus Belly/Main,sling}", - "{@Jabu Jabus Belly/Main,$has_explosives}" + "{@Jabu Jabus Belly/Main,$has_bombchus}" ], "visibility_rules": [ "setting_tokens_dungeons" @@ -1337,6 +1345,7 @@ "access_rules": [ "hookshot", "{bow}", + "{dinsfire,magic}", "{$has_explosives}" ], "visibility_rules": [ @@ -1372,6 +1381,7 @@ "access_rules": [ "hookshot", "{bow}", + "{dinsfire,magic}", "{$has_explosives}" ], "visibility_rules": [ @@ -1389,6 +1399,7 @@ "hookshot", "[logic_ice_block_gs],hoverboots", "{bow}", + "{dinsfire,magic}", "{$has_explosives}" ], "visibility_rules": [ @@ -1728,6 +1739,7 @@ "access_rules": [ "@Forest Temple/NW Outdoors,longshot", "{@Forest Temple/NW Outdoors,bow}", + "{@Forest Temple/NW Outdoors,$has_bombchus}", "@Forest Temple/Outside Upper Ledge,hookshot" ], "visibility_rules": [ @@ -2983,11 +2995,14 @@ "access_rules": [ "@Water Temple/Dark Link Region,ocarina,time,ironboots,$FTR_or_zora", "@Water Temple/Dark Link Region,ocarina,time,[logic_water_river_gs],longshot,bow", - "@Water Temple/Dark Link Region,ocarina,time,[logic_water_river_gs],longshot,$has_bombchus" + "@Water Temple/Dark Link Region,ocarina,time,[logic_water_river_gs],longshot,$has_bombchus", + "{@Water Temple/Dark Link Region,ocarina,time,bow}", + "{@Water Temple/Dark Link Region,ocarina,time,$has_bombchus}" ], "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -4124,10 +4139,10 @@ "{@Spirit Temple/Central Chamber,$child_colossus,sling,$has_explosives}", "{@Spirit Temple/Central Chamber,bow,$has_age|adult,lift2}" ], - "capture_item": true, "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 diff --git a/ootrando_overworldmap_hamsda/locations/dungeons_entrance.json b/ootrando_overworldmap_hamsda/locations/dungeons_entrance.json index 5c6f5bf..3eb3f1d 100644 --- a/ootrando_overworldmap_hamsda/locations/dungeons_entrance.json +++ b/ootrando_overworldmap_hamsda/locations/dungeons_entrance.json @@ -813,6 +813,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1460,6 +1461,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1490,6 +1492,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1605,6 +1608,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1663,6 +1667,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1685,6 +1690,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1863,6 +1869,9 @@ { "name": "Forest Trial Clear", "short_name": "Forest Trial", + "access_rules": [ + "$access_location|Forest Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -1879,6 +1888,9 @@ { "name": "Water Trial Clear", "short_name": "Water Trial", + "access_rules": [ + "$access_location|Water Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -1903,6 +1915,9 @@ { "name": "Shadow Trial Clear", "short_name": "Shadow Trial", + "access_rules": [ + "$access_location|Shadow Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -1911,6 +1926,9 @@ { "name": "Fire Trial Clear", "short_name": "Fire Trial", + "access_rules": [ + "$access_location|Fire Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -1945,6 +1963,9 @@ { "name": "Light Trial Clear", "short_name": "Light Trial", + "access_rules": [ + "$access_location|Light Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -1969,6 +1990,9 @@ { "name": "Spirit Trial Clear", "short_name": "Spirit Trial", + "access_rules": [ + "$access_location|Spirit Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -2053,6 +2077,9 @@ { "name": "Forest Trial Clear", "short_name": "Forest Trial", + "access_rules": [ + "$access_location|MQ Forest Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -2069,6 +2096,9 @@ { "name": "Water Trial Clear", "short_name": "Water Trial", + "access_rules": [ + "$access_location|MQ Water Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -2094,6 +2124,9 @@ { "name": "Shadow Trial Clear", "short_name": "Shadow Trial", + "access_rules": [ + "$access_location|MQ Shadow Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -2102,6 +2135,9 @@ { "name": "Fire Trial Clear", "short_name": "Fire Trial", + "access_rules": [ + "$access_location|MQ Fire Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -2118,6 +2154,9 @@ { "name": "Light Trial Clear", "short_name": "Light Trial", + "access_rules": [ + "$access_location|MQ Light Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -2151,6 +2190,9 @@ { "name": "Spirit Trial Clear", "short_name": "Spirit Trial", + "access_rules": [ + "$access_location|MQ Spirit Trial Clear" + ], "visibility_rules": [ "setting_trials:1" ], @@ -2702,6 +2744,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -2954,6 +2997,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -3577,6 +3621,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -3617,10 +3662,10 @@ "access_rules": [ "$access_location|Spirit Temple GS Hall After Sun Block Room" ], - "capture_item": true, "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -3885,6 +3930,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -4204,6 +4250,7 @@ "visibility_rules": [ "setting_tokens_dungeons" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 diff --git a/ootrando_overworldmap_hamsda/locations/overworld.json b/ootrando_overworldmap_hamsda/locations/overworld.json index bba45db..8a01fa0 100644 --- a/ootrando_overworldmap_hamsda/locations/overworld.json +++ b/ootrando_overworldmap_hamsda/locations/overworld.json @@ -272,7 +272,7 @@ "short_name": "GS", "access_rules": [ "$has_age|adult,$night_gs,hookshot", - "$has_age|adult,$night_gs,hoverboots,[logic_adult_kokiri_gs]", //TODO: can be done itemless, no trick yet + "$has_age|adult,$night_gs,hoverboots,[logic_adult_kokiri_gs]", "{$has_age|adult,$night_gs,bow}", "{$has_age|adult,$night_gs,dinsfire,magic}" ], @@ -634,11 +634,15 @@ "[logic_lost_woods_gs_bean],longshot", "[logic_lost_woods_gs_bean],hookshot,bow", "[logic_lost_woods_gs_bean],hookshot,$has_bombchus", - "[logic_lost_woods_gs_bean],hookshot,dinsfire,magic" + "[logic_lost_woods_gs_bean],hookshot,dinsfire,magic", + "{bow}", + "{$has_bombchus}", + "{dinsfire,magic}" ], "visibility_rules": [ "setting_tokens_overworld" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1041,9 +1045,10 @@ "short_name": "GS", "access_rules": [ "$has_age|child,$has_explosives,boomerang", - "{$has_age|child,$has_explosives,sling}", "$has_age|adult,hookshot", + "{$has_age|child,$has_explosives}", "{$has_age|adult,bow}", + "{$has_age|adult,$has_explosives}", "{dinsfire,magic}" ], "visibility_rules": [ @@ -1460,11 +1465,13 @@ "name": "LH GS Tree (N)", "short_name": "GS", "access_rules": [ - "$has_age|adult,$night_gs,longshot" + "$has_age|adult,$night_gs,longshot", + "{$has_age|adult,bow}" ], "visibility_rules": [ "setting_tokens_overworld" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -4249,7 +4256,8 @@ "short_name": "GS", "access_rules": [ "hookshot", - "{bow}" + "{bow}", + "{$has_bombchus}" ], "visibility_rules": [ "setting_tokens_overworld" @@ -5047,6 +5055,7 @@ "access_rules": [ "hookshot", "{bow}", + "{$has_explosives}", "{dinsfire,magic}" ], "visibility_rules": [ @@ -5129,7 +5138,7 @@ "$has_age|adult,[hookshot],bombs,shield3", "$has_age|child,ocarina,requiem,[logic_reverse_wasteland],boomerang", "{$has_age|adult}", - "{$can_child_attack,ocarina,requiem}", + "{$has_age|child,ocarina,requiem}", "{$hintable}" ], "visibility_rules": [ @@ -5388,7 +5397,8 @@ "$child_colossus,bean_colossus_yes", "$adult_colossus,longshot", "$adult_colossus,hookshot,[logic_colossus_gs]", - "{$adult_colossus,bow}" + "{$adult_colossus,bow}", + "{$adult_colossus,$has_bombchus}" ], "visibility_rules": [ "setting_tokens_overworld" diff --git a/ootrando_overworldmap_hamsda/locations/overworld_entrance.json b/ootrando_overworldmap_hamsda/locations/overworld_entrance.json index 62b2f30..705fdba 100644 --- a/ootrando_overworldmap_hamsda/locations/overworld_entrance.json +++ b/ootrando_overworldmap_hamsda/locations/overworld_entrance.json @@ -388,6 +388,7 @@ "visibility_rules": [ "setting_tokens_overworld" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -1050,6 +1051,7 @@ "visibility_rules": [ "setting_tokens_overworld" ], + "capture_item": true, "chest_unopened_img": "images/skulltula.png", "chest_opened_img": "images/skulltula_token.png", "item_count": 1 @@ -4453,6 +4455,7 @@ "access_rules": [ "$access_location|LLR Freestanding PoH" ], + "capture_item": true, "chest_unopened_img": "images/HP.png", "chest_opened_img": "images/HP_grey.png", "item_count": 1 diff --git a/ootrando_overworldmap_hamsda/manifest.json b/ootrando_overworldmap_hamsda/manifest.json index 4124a62..bf5c881 100644 --- a/ootrando_overworldmap_hamsda/manifest.json +++ b/ootrando_overworldmap_hamsda/manifest.json @@ -1,7 +1,7 @@ { "name": "OoT Randomizer - Map and Item Tracker", "game_name": "Ocarina of Time Randomizer", - "package_version": "3.4.4.0", + "package_version": "3.5.0.0", "package_uid": "ootrando_overworldmap_hamsda", "author": "Hamsda", "variants": { diff --git a/ootrando_overworldmap_hamsda/scripts/add_section_objects.lua b/ootrando_overworldmap_hamsda/scripts/add_section_objects.lua new file mode 100644 index 0000000..d1f230e --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/add_section_objects.lua @@ -0,0 +1,19 @@ +for region, region_data in pairs(data_per_region) do + if type(region_data.exits) == "table" then + for target, target_data in pairs(region_data.exits) do + if + not region_data.interior and not region_data.special and not region_data.dungeon and not target_data.fixed and + not (region_data.scene and data_per_region[target] and data_per_region[target].scene and + region_data.scene == data_per_region[target].scene) + then + local section = string.format("@%s -> %s/Capture", region, target) + local section_object = get_object(section) + if section_object then + target_data.section_object = section_object + else + print("error! section not found:", section) + end + end + end + end +end diff --git a/ootrando_overworldmap_hamsda/scripts/cached_helpers.lua b/ootrando_overworldmap_hamsda/scripts/cached_helpers.lua new file mode 100644 index 0000000..5e680f1 --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/cached_helpers.lua @@ -0,0 +1,55 @@ +object_cache = {} +function get_object(name) + if object_cache[name] then + return object_cache[name] + end + local object = Tracker:FindObjectForCode(name) + if object then + object_cache[name] = object + return object + end +end + +amount_cache = {} +function clear_amount_cache() + amount_cache = {} +end +function has(item, amount) + if not amount_cache[item] then + amount_cache[item] = Tracker:ProviderCountForCode(item) + end + local count = amount_cache[item] or 0 + amount = tonumber(amount) + if not amount then + amount = 1 + end + return count >= amount +end +function has_exact(item, amount) + if not amount_cache[item] then + amount_cache[item] = Tracker:ProviderCountForCode(item) + end + local count = amount_cache[item] or 0 + amount = tonumber(amount) + if not amount then + print("error! has_exact - missing amount for item:", item) + return false + end + return count == amount +end + +settings_cache = {} +queued_changes = {} +function not_like_cache(setting, current) + if settings_cache[setting] == nil or settings_cache[setting] ~= current then + queued_changes[setting] = current + return true + end + return false +end +function apply_queued_changes() + for setting, value in pairs(queued_changes) do + settings_cache[setting] = value + end + queued_changes = {} +end diff --git a/ootrando_overworldmap_hamsda/scripts/custom_prog_badge.lua b/ootrando_overworldmap_hamsda/scripts/custom_prog_badge.lua index 924ee53..d26da6d 100644 --- a/ootrando_overworldmap_hamsda/scripts/custom_prog_badge.lua +++ b/ootrando_overworldmap_hamsda/scripts/custom_prog_badge.lua @@ -14,10 +14,10 @@ end function ProgBadgeItem:updateIcon() local img_mod = "" if self:getProperty("badgeNum") and self:getProperty("badgeNum") > 0 then - img_mod = "overlay|"..self.badges[self:getProperty("badgeNum")] + img_mod = "overlay|" .. self.badges[self:getProperty("badgeNum")] end if not self:getProperty("active") then - img_mod = img_mod..",@disabled" + img_mod = img_mod .. ",@disabled" end self.ItemInstance.Icon = ImageReference:FromImageReference(self.imageBase, img_mod) end @@ -28,7 +28,7 @@ end function ProgBadgeItem:onRightClick() if self:getProperty("badgeNum") then - if self:getProperty("badgeNum") == #self.badges then + if self:getProperty("badgeNum") >= #self.badges then self:setProperty("badgeNum", 0) else self:setProperty("badgeNum", self:getProperty("badgeNum") + 1) diff --git a/ootrando_overworldmap_hamsda/scripts/regions.lua b/ootrando_overworldmap_hamsda/scripts/data_per_region.lua similarity index 92% rename from ootrando_overworldmap_hamsda/scripts/regions.lua rename to ootrando_overworldmap_hamsda/scripts/data_per_region.lua index 19fa89b..03aba9d 100644 --- a/ootrando_overworldmap_hamsda/scripts/regions.lua +++ b/ootrando_overworldmap_hamsda/scripts/data_per_region.lua @@ -1,24 +1,3 @@ -er_debugging = false -special_regions = { - ["KF Links House"] = { - ["setting"] = "setting_entrance_interiors_all" - }, - ["Temple of Time"] = { - ["setting"] = "setting_entrance_interiors_all" - }, - ["Kak Potion Shop Front"] = { - ["setting"] = "setting_entrance_interiors_all" - }, - ["Kak Potion Shop Back"] = { - ["setting"] = "setting_entrance_interiors_all" - }, - ["Kak Windmill"] = { - ["setting"] = "setting_entrance_interiors_all" - }, - ["Graveyard Dampes Grave"] = { - ["setting"] = "setting_entrance_grottos_shuffle" - } -} data_per_region = { ["Root"] = { ["scene"] = "Root", @@ -305,15 +284,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal - elseif has("hoverboots") then - if has("logic_adult_kokiri_gs") then - return AccessibilityLevel.Normal - end - return AccessibilityLevel.SequenceBreak - end - return AccessibilityLevel.None + local hook = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_adult_kokiri_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local bow = has("bow") and AccessibilityLevel.Inspect or AccessibilityLevel.None + local df = (has("dinsfire") and has("magic")) and AccessibilityLevel.Inspect or AccessibilityLevel.None + + return and_accessibility(night_gs(), or_accessibility(hook, and_accessibility(trick, hb), bow, df)) end } }, @@ -736,16 +713,15 @@ data_per_region = { if has("beans") then bean = access_region("LW Beyond Mido", "child") end - local trick = AccessibilityLevel.SequenceBreak - if has("logic_lost_woods_gs_bean") and has("hookshot") then - if - has("longshot") or has("bow") or (has("dinsfire") and has("magic")) or - (has_bombchus() == AccessibilityLevel.Normal) - then - trick = AccessibilityLevel.Normal - end + local trick = + has("logic_lost_woods_gs_bean") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_bombchus() + if has("longshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return and_accessibility(night_gs(), or_accessibility(bean, trick)) + + return and_accessibility(night_gs(), or_accessibility(bean, and_accessibility(trick, collect, kill))) end }, ["LW GS Bean Patch Near Theater"] = { @@ -886,10 +862,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return night_gs() + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end } }, @@ -1187,7 +1166,7 @@ data_per_region = { if has("scale") then return AccessibilityLevel.Normal end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end, ["adult_access"] = function() return AccessibilityLevel.None @@ -1198,10 +1177,12 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("bow") and ((has("ocarina") and has("scarecrow") and has("longshot")) or has("water")) then - return AccessibilityLevel.Normal - end - return AccessibilityLevel.None + local spawn = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local reach = + ((has("ocarina") and has("scarecrow") and has("longshot")) or has("water")) and AccessibilityLevel.Normal or + AccessibilityLevel.Inspect + + return and_accessibility(spawn, reach) end }, ["LH Freestanding PoH"] = { @@ -1223,15 +1204,15 @@ data_per_region = { }, ["LH GS Lab Wall"] = { ["child_access"] = function() - if has("boomerang") then - return night_gs() - elseif has("sticks") or has("sword1") then - if has("logic_lab_wall_gs") then - return night_gs() - end - return AccessibilityLevel.SequenceBreak + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_lab_wall_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local collect = (has("sticks") or has("sword1")) and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("sticks") or has("sword1") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), or_accessibility(rang, and_accessibility(trick, collect, kill))) end, ["adult_access"] = function() return AccessibilityLevel.None @@ -1252,6 +1233,8 @@ data_per_region = { ["adult_access"] = function() if has("longshot") then return night_gs() + elseif has("bow") then + return AccessibilityLevel.Inspect end return AccessibilityLevel.None end @@ -1460,10 +1443,13 @@ data_per_region = { ["locations"] = { ["GV GS Small Bridge"] = { ["child_access"] = function() - if has("boomerang") then - return night_gs() + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = AccessibilityLevel.None + if has("boomerang") or has("sling") or has("sticks") or has("bombs") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end, ["adult_access"] = function() return AccessibilityLevel.None @@ -1654,10 +1640,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return night_gs() + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end }, ["GV GS Pillar"] = { @@ -1665,10 +1654,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return night_gs() + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_bombchus() + if has("hookshot") or has("bow") then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end } }, @@ -1857,10 +1849,14 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") and has("card") then - return night_gs() + local card = has("card") and AccessibilityLevel.Normal or AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), card, collect, kill) end }, ["GF GS Top Floor"] = { @@ -2003,13 +1999,13 @@ data_per_region = { if has("boomerang") then return AccessibilityLevel.Normal end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end, ["adult_access"] = function() if has("hookshot") then return AccessibilityLevel.Normal end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end } }, @@ -2085,13 +2081,13 @@ data_per_region = { }, ["Colossus Freestanding PoH"] = { ["child_access"] = function() - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end, ["adult_access"] = function() if has("beans") then return access_region("Desert Colossus", "child") end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end }, ["Colossus GS Bean Patch"] = { @@ -2107,10 +2103,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return night_gs() + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end }, ["Colossus GS Hill"] = { @@ -2122,16 +2121,22 @@ data_per_region = { if has("beans") then bean = access_region("Desert Colossus", "child") end - local ranged = AccessibilityLevel.None + local collect = AccessibilityLevel.Inspect if has("longshot") then - ranged = AccessibilityLevel.Normal + collect = AccessibilityLevel.Normal elseif has("hookshot") then if has("logic_colossus_gs") then - ranged = AccessibilityLevel.Normal + collect = AccessibilityLevel.Normal + else + collect = AccessibilityLevel.SequenceBreak end - ranged = AccessibilityLevel.SequenceBreak end - return and_accessibility(night_gs(), or_accessibility(bean, ranged)) + local kill = has_bombchus() + if has("hookshot") or has("bow") then + kill = AccessibilityLevel.Normal + end + + return and_accessibility(night_gs(), or_accessibility(bean, and_accessibility(collect, kill))) end } }, @@ -2709,7 +2714,7 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("bow") and has("ocarina") and has("epona") then + if has("bow") and has("ocarina") and has("epona") then return has_bottle() end return AccessibilityLevel.None @@ -3021,20 +3026,14 @@ data_per_region = { }, ["Kak GS Watchtower"] = { ["child_access"] = function() - local sling = AccessibilityLevel.None - if has("sling") then - sling = AccessibilityLevel.Normal - end - local melee = AccessibilityLevel.None - if has("sticks") or has("sword1") then - local trick = AccessibilityLevel.SequenceBreak - if has("logic_kakariko_tower_gs") then - trick = AccessibilityLevel.Normal - end - melee = and_accessibility(trick, damage_single_instance_ohko()) - end - local kill = or_accessibility(sling, has_bombchus(), melee) - return and_accessibility(kill, night_gs()) + local sling = has("sling") and AccessibilityLevel.Normal or AccessibilityLevel.None + local melee = (has("sticks") or has("sword1")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_kakariko_tower_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return and_accessibility( + night_gs(), + or_accessibility(sling, has_bombchus(), and_accessibility(melee, trick, damage_single_instance_ohko())) + ) end, ["adult_access"] = function() return AccessibilityLevel.None @@ -3513,7 +3512,7 @@ data_per_region = { if has("boomerang") then return AccessibilityLevel.Normal end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end, ["adult_access"] = function() local trick = has("logic_windmill_poh") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak @@ -3674,15 +3673,15 @@ data_per_region = { end return AccessibilityLevel.SequenceBreak end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end, ["adult_access"] = function() - if has("longshot") then - return AccessibilityLevel.Normal - elseif has("beans") then - return access_region("Graveyard", "child") + local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local bean = AccessibilityLevel.None + if has("beans") then + bean = access_region("Graveyard", "child") end - return AccessibilityLevel.None + return or_accessibility(ls, bean, AccessibilityLevel.Inspect) end }, ["Graveyard Dampe Gravedigging Tour"] = { @@ -3695,10 +3694,13 @@ data_per_region = { }, ["Graveyard GS Wall"] = { ["child_access"] = function() - if has("boomerang") then - return night_gs() + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end, ["adult_access"] = function() return AccessibilityLevel.None @@ -4777,24 +4779,19 @@ data_per_region = { ["locations"] = { ["DMC Volcano Freestanding PoH"] = { ["child_access"] = function() - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end, ["adult_access"] = function() - local hovers = AccessibilityLevel.None - if has("hoverboots") then - if has("logic_crater_bean_poh_with_hovers") then - hovers = AccessibilityLevel.Normal - else - hovers = AccessibilityLevel.SequenceBreak - end - end + local hovers = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = + has("logic_crater_bean_poh_with_hovers") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak local bean = AccessibilityLevel.None if has("beans") then bean = access_region("DMC Central Nearby", "child") end - return or_accessibility(bean, hovers) + return or_accessibility(bean, and_accessibility(hovers, trick), AccessibilityLevel.Inspect) end }, ["Sheik in Crater"] = { @@ -5067,10 +5064,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return night_gs() + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end }, ["ZR GS Above Bridge"] = { @@ -5078,10 +5078,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return night_gs() + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_bombchus() + if has("hookshot") or has("bow") then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end } }, @@ -5351,7 +5354,7 @@ data_per_region = { if has("ironboots") then return FTR_or_zora() end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end }, ["ZF GS Tree"] = { @@ -5364,10 +5367,13 @@ data_per_region = { }, ["ZF GS Above the Log"] = { ["child_access"] = function() - if has("boomerang") then - return night_gs() + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end, ["adult_access"] = function() return AccessibilityLevel.None @@ -5378,10 +5384,14 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("lift2") and has("hookshot") then - return and_accessibility(can_blast(), night_gs()) + local lift2 = has("lift2") and AccessibilityLevel.Normal or AccessibilityLevel.None + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(night_gs(), lift2, can_blast(), kill, collect) end } }, @@ -5531,10 +5541,13 @@ data_per_region = { }, ["LLR GS House Window"] = { ["child_access"] = function() - if has("boomerang") then - return night_gs() + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_bombchus() + if has("boomerang") or has("sling") then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end, ["adult_access"] = function() return AccessibilityLevel.None @@ -5542,10 +5555,13 @@ data_per_region = { }, ["LLR GS Back Wall"] = { ["child_access"] = function() - if has("boomerang") then - return night_gs() + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(night_gs(), collect, kill) end, ["adult_access"] = function() return AccessibilityLevel.None @@ -5666,7 +5682,7 @@ data_per_region = { return AccessibilityLevel.Normal end, ["adult_access"] = function() - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end }, ["LLR Tower Cows"] = { @@ -6000,16 +6016,17 @@ data_per_region = { ["locations"] = { ["HF GS Cow Grotto"] = { ["child_access"] = function() - if has("boomerang") and has("dinsfire") and has("magic") then - return AccessibilityLevel.Normal + if has("dinsfire") and has("magic") then + if has("boomerang") then + return AccessibilityLevel.Normal + end + return AccessibilityLevel.Inspect end return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return has_fire() - end - return AccessibilityLevel.None + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + return and_accessibility(has_fire(), hs) end }, ["HF Cow Grotto Cow"] = { @@ -6082,16 +6099,22 @@ data_per_region = { ["locations"] = { ["HF GS Near Kak Grotto"] = { ["child_access"] = function() - if has("boomerang") then - return AccessibilityLevel.Normal + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(collect, kill) end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(collect, kill) end } }, @@ -6115,13 +6138,13 @@ data_per_region = { if has("scale2") then return AccessibilityLevel.Normal end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end, ["adult_access"] = function() if has("scale2") or has("ironboots") then return AccessibilityLevel.Normal end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end } }, @@ -6142,14 +6165,20 @@ data_per_region = { ["locations"] = { ["HC GS Storms Grotto"] = { ["child_access"] = function() - if has("boomerang") then - local trick = - has("logic_castle_storms_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - return or_accessibility(trick, has_explosives()) + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_castle_storms_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local kill = has_explosives() + if has("sticks") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return or_accessibility( + and_accessibility(rang, or_accessibility(has_explosives(), trick)), + and_accessibility(kill, AccessibilityLevel.Inspect) + ) end, ["adult_access"] = function() + --TODO: irrelevant inspect logic if has("hookshot") then return can_blast() end @@ -6754,7 +6783,7 @@ data_per_region = { }, ["Bottom of the Well GS West Inner Room"] = { ["child_access"] = function() - local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect local keys = AccessibilityLevel.None if has("botw_small_keys", 3) then keys = AccessibilityLevel.Normal @@ -6773,7 +6802,7 @@ data_per_region = { }, ["Bottom of the Well GS East Inner Room"] = { ["child_access"] = function() - local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect local keys = AccessibilityLevel.None if has("botw_small_keys", 3) then keys = AccessibilityLevel.Normal @@ -6792,7 +6821,7 @@ data_per_region = { }, ["Bottom of the Well GS Like Like Cage"] = { ["child_access"] = function() - local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect local keys = AccessibilityLevel.None if has("botw_small_keys", 3) then keys = AccessibilityLevel.Normal @@ -7199,31 +7228,28 @@ data_per_region = { ["locations"] = { ["Deku Tree GS Basement Back Room"] = { ["child_access"] = function() - if has("boomerang") then - local fire = - (has("sticks") or (has("dinsfire") and has("magic"))) and AccessibilityLevel.Normal or - AccessibilityLevel.None - local adult = access_region("Deku Tree Basement Backroom", "adult") - local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None - local hammer = has("hammer") and AccessibilityLevel.Normal or AccessibilityLevel.None + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local fire = + (has("sticks") or (has("dinsfire") and has("magic"))) and AccessibilityLevel.Normal or + AccessibilityLevel.None + local adult = access_region("Deku Tree Basement Backroom", "adult") + local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hammer = has("hammer") and AccessibilityLevel.Normal or AccessibilityLevel.None - return and_accessibility( - or_accessibility(fire, and_accessibility(adult, bow)), - or_accessibility(has_explosives(), and_accessibility(adult, hammer)) - ) - end - return AccessibilityLevel.None + return and_accessibility( + rang, + or_accessibility(fire, and_accessibility(adult, bow)), + or_accessibility(has_explosives(), and_accessibility(adult, hammer)) + ) end, ["adult_access"] = function() - if has("hookshot") then - local df = (has("dinsfire") and has("magic")) and AccessibilityLevel.Normal or AccessibilityLevel.None - local sticks = has("sticks") and Normal or AccessibilityLevel.None - local child = access_region("Deku Tree Basement Backroom", "child") - local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local df = (has("dinsfire") and has("magic")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local sticks = has("sticks") and AccessibilityLevel.Normal or AccessibilityLevel.None + local child = access_region("Deku Tree Basement Backroom", "child") + local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None - return and_accessibility(or_accessibility(df, bow, and_accessibility(sticks, child)), can_blast()) - end - return AccessibilityLevel.None + return and_accessibility(hs, or_accessibility(df, bow, and_accessibility(sticks, child)), can_blast()) end } }, @@ -7586,35 +7612,47 @@ data_per_region = { if has("time") and has("boomerang") then return AccessibilityLevel.Normal end + if has("sling") then + return AccessibilityLevel.Inspect + end return AccessibilityLevel.None end, ["adult_access"] = function() if has("longshot") or (has("time") and has("hookshot")) then return AccessibilityLevel.Normal end + if has("bow") then + return AccessibilityLevel.Inspect + end return AccessibilityLevel.None end }, ["Deku Tree MQ GS Basement Back Room"] = { ["child_access"] = function() - if has("boomerang") then - if has("sticks") or (has("dinsfire") and has("magic")) then - return AccessibilityLevel.Normal - elseif has("bow") and has("firearrow") and has("magic") then - return access_region("Deku Tree MQ Basement Back Room", "adult") - end - end - return AccessibilityLevel.None + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local fire = + (has("sticks") or (has("dinsfire") and has("magic"))) and AccessibilityLevel.Normal or + AccessibilityLevel.None + local fa = + (has("bow") and has("firearrow") and has("magic")) and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility( + rang, + or_accessibility(fire, and_accessibility(fa, access_region("Deku Tree MQ Basement Back Room", "adult"))) + ) end, ["adult_access"] = function() - if has("hookshot") then - if (has("dinsfire") and has("magic")) or (has("bow") and has("firearrow") and has("magic")) then - return AccessibilityLevel.Normal - elseif has("sticks") then - return access_region("Deku Tree MQ Basement Back Room", "child") - end - end - return AccessibilityLevel.None + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local fire = + ((has("dinsfire") and has("magic")) or (has("bow") and has("firearrow") and has("magic"))) and + AccessibilityLevel.Normal or + AccessibilityLevel.None + local sticks = has("sticks") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility( + hs, + or_accessibility(fire, and_accessibility(sticks, access_region("Deku Tree MQ Basement Back Room", "child"))) + ) end } }, @@ -8010,16 +8048,22 @@ data_per_region = { }, ["Dodongos Cavern GS Alcove Above Stairs"] = { ["child_access"] = function() - if has("boomerang") then - return AccessibilityLevel.Normal + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(collect, kill) end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + + return and_accessibility(collect, kill) end } }, @@ -8368,26 +8412,35 @@ data_per_region = { }, ["Dodongos Cavern MQ GS Scrub Room"] = { ["child_access"] = function() - if has("boomerang") then - if has("lift1") or (has("dinsfire") and has("magic")) then - return AccessibilityLevel.Normal - end - local bow = AccessibilityLevel.None - if has("bow") then - bow = access_region("Dodongos Cavern MQ Bomb Bag Area", "adult") - end - return or_accessibility(bow, has_explosives()) - end - return AccessibilityLevel.None + local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None + local sling = has("sling") and AccessibilityLevel.Normal or AccessibilityLevel.None + local lift = has("lift1") and AccessibilityLevel.Normal or AccessibilityLevel.None + local df = (has("dinsfire") and has("magic")) and AccessibilityLevel.Normal or AccessibilityLevel.None + + local reach = + or_accessibility( + and_accessibility(bow, access_region("Dodongos Cavern MQ Bomb Bag Area", "adult")), + lift, + df, + has_explosives() + ) + local kill = or_accessibility(rang, sling, has_bombchus()) + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(reach, kill, collect) end, ["adult_access"] = function() - if has("hookshot") then - if has("bow") or has("lift1") or (has("dinsfire") and has("magic")) then - return AccessibilityLevel.Normal - end - return has_explosives() - end - return AccessibilityLevel.None + local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local lift = has("lift1") and AccessibilityLevel.Normal or AccessibilityLevel.None + local df = (has("dinsfire") and has("magic")) and AccessibilityLevel.Normal or AccessibilityLevel.None + + local reach = or_accessibility(bow, lift, df, has_explosives()) + local kill = or_accessibility(hs, bow, has_bombchus()) + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(reach, kill, collect) end } }, @@ -8503,7 +8556,7 @@ data_per_region = { end, ["adult_access"] = function() if has("hammer") then - if not is_keys or has("fire_small_keys", 8) then + if not HAS_KEYS or has("fire_small_keys", 8) then return AccessibilityLevel.Normal elseif has("fire_small_keys", 1) then return AccessibilityLevel.SequenceBreak @@ -8518,7 +8571,7 @@ data_per_region = { end, ["adult_access"] = function() if has("hammer") then - if not is_keys or has("fire_small_keys", 8) then + if not HAS_KEYS or has("fire_small_keys", 8) then return AccessibilityLevel.Normal elseif has("fire_small_keys", 1) then return AccessibilityLevel.SequenceBreak @@ -8557,7 +8610,7 @@ data_per_region = { end, ["adult_access"] = function() if has("hammer") then - if not is_keys or has("fire_small_keys", 8) then + if not HAS_KEYS or has("fire_small_keys", 8) then return AccessibilityLevel.Normal elseif has("fire_small_keys", 1) then return AccessibilityLevel.SequenceBreak @@ -9328,16 +9381,22 @@ data_per_region = { }, ["Forest Temple GS Lobby"] = { ["child_access"] = function() - if has("boomerang") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end } }, @@ -9405,15 +9464,21 @@ data_per_region = { ["locations"] = { ["Forest Temple GS Level Island Courtyard"] = { ["child_access"] = function() - return AccessibilityLevel.Normal - end, - ["adult_access"] = function() - if has("longshot") then - return AccessibilityLevel.Normal - elseif has("hookshot") then - return access_region("Forest Temple Outside Upper Ledge", "adult") + if has("sling") then + return AccessibilityLevel.Inspect end return AccessibilityLevel.None + end, + ["adult_access"] = function() + local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local ledge = access_region("Forest Temple Outside Upper Ledge", "adult") + local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None + + local kill = or_accessibility(ls, and_accessibility(hs, ledge), bow, has_bombchus()) + local collect = or_accessibility(ls, and_accessibility(hs, ledge), AccessibilityLevel.Inspect) + + return and_accessibility(kill, collect) end } }, @@ -9468,23 +9533,28 @@ data_per_region = { }, ["Forest Temple GS Raised Island Courtyard"] = { ["child_access"] = function() - if has("boomerang") then - if has("logic_forest_outdoor_east_gs") then - return AccessibilityLevel.Normal - end - return AccessibilityLevel.SequenceBreak - end - return AccessibilityLevel.None + local trick = + has("logic_forest_outdoor_east_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local kill = (has("boomerang") or has("sling")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(trick, kill, collect) end, ["adult_access"] = function() if has("hookshot") then return AccessibilityLevel.Normal end + + local above = access_region("Forest Temple Falling Room", "adult") + local balcony = access_region("Forest Temple Outdoors High Balconies", "adult") + local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None local df = (has("dinsfire") and has("magic")) and AccessibilityLevel.Normal or AccessibilityLevel.None - return and_accessibility( - access_region("Forest Temple Falling Room", "adult"), - or_accessibility(bow, df, has_explosives()) + + return or_accessibility( + and_accessibility(bow, AccessibilityLevel.Inspect), + and_accessibility(balcony, hb, AccessibilityLevel.Inspect), + and_accessibility(above, or_accessibility(bow, df, has_explosives(), AccessibilityLevel.Inspect)) ) end } @@ -9778,16 +9848,22 @@ data_per_region = { }, ["Forest Temple GS Basement"] = { ["child_access"] = function() - if has("boomerang") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end }, ["Phantom Ganon"] = { @@ -9827,16 +9903,22 @@ data_per_region = { }, ["Forest Temple MQ GS First Hallway"] = { ["child_access"] = function() - if has("boomerang") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end } }, @@ -10131,22 +10213,33 @@ data_per_region = { }, ["Forest Temple MQ GS Raised Island Courtyard"] = { ["child_access"] = function() - if has("boomerang") then - return AccessibilityLevel.Normal + local kill = has_bombchus() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end, ["adult_access"] = function() if has("hookshot") then return AccessibilityLevel.Normal - elseif has("bow") and has("firearrow") and has("magic") then - local sot = (has("ocarina") and has("time")) and AccessibilityLevel.Normal or AccessibilityLevel.None - local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None - local trick = - has("logic_forest_door_frame") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - return or_accessibility(sot, and_accessibility(hb, trick)) end - return AccessibilityLevel.None + + local kill = has_explosives() + if has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal + end + local balcony = + (has("bow") and has("firearrow") and has("magic")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local sot = (has("ocarina") and has("time")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_forest_door_frame") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return or_accessibility( + and_accessibility(kill, AccessibilityLevel.Inspect), + and_accessibility(balcony, or_accessibility(sot, and_accessibility(hb, trick))) + ) end }, ["Forest Temple MQ GS Well"] = { @@ -10471,7 +10564,7 @@ data_per_region = { return AccessibilityLevel.Normal end, ["adult_access"] = function() - return AccessibilityLevel.Normal --TODO: trials logic + return trials_barrier_dispelled() end }, ["Ganons Castle Deku Scrubs"] = { @@ -10505,6 +10598,17 @@ data_per_region = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["Forest Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local fa = has("firearrow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local df = has("dinsfire") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility(can_LA(), or_accessibility(fa, df)) + end + }, ["Ganons Castle Forest Trial Chest"] = { ["child_access"] = function() return AccessibilityLevel.Normal @@ -10517,12 +10621,36 @@ data_per_region = { }, ["Ganons Castle Fire Trial"] = { ["scene"] = "Ganons Castle", - ["dungeon"] = true + ["dungeon"] = true, + ["locations"] = { + ["Fire Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local tunic = has("redtunic") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local lift3 = has("lift3") and AccessibilityLevel.Normal or AccessibilityLevel.None + local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility(tunic, lift3, can_LA(), ls) + end + } + } }, ["Ganons Castle Water Trial"] = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["Water Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local hammer = has("hammer") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility(has_blue_fire(), hammer, can_LA()) + end + }, ["Ganons Castle Water Trial Chests"] = { ["child_access"] = function() return AccessibilityLevel.Normal @@ -10537,6 +10665,30 @@ data_per_region = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["Shadow Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local hammer = has("hammer") and AccessibilityLevel.Normal or AccessibilityLevel.None + local fa = has("firearrow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local lot = + (has("logic_lens_castle") or (has("lens") and has("magic"))) and AccessibilityLevel.Normal or + AccessibilityLevel.SequenceBreak + local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local df = has("dinsfire") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility( + can_LA(), + hammer, + or_accessibility( + and_accessibility(fa, lot), + and_accessibility(ls, or_accessibility(hb, and_accessibility(df, lot))) + ) + ) + end + }, ["Ganons Castle Shadow Trial Front Chest"] = { ["child_access"] = function() return AccessibilityLevel.None @@ -10571,6 +10723,19 @@ data_per_region = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["Spirit Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local shield3 = has("shield3") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = + has("logic_spirit_trial_hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility(can_LA(), shield3, has_bombchus(), or_accessibility(trick, hs)) + end + }, ["Ganons Castle Spirit Trial Crystal Switch Chest"] = { ["child_access"] = function() return AccessibilityLevel.None @@ -10602,6 +10767,20 @@ data_per_region = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["Light Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local keys = has("gc_small_keys", 2) and AccessibilityLevel.Normal or AccessibilityLevel.None + local lot = + (has("logic_lens_castle") or (has("lens") and has("magic"))) and AccessibilityLevel.Normal or + AccessibilityLevel.SequenceBreak + + return and_accessibility(can_LA(), hs, keys, lot) + end + }, ["Ganons Castle Light Trial Chests"] = { ["child_access"] = function() return AccessibilityLevel.None @@ -10716,7 +10895,7 @@ data_per_region = { return AccessibilityLevel.Normal end, ["adult_access"] = function() - return AccessibilityLevel.Normal --TODO: trials logic + return trials_barrier_dispelled() end }, ["Ganons Castle MQ Deku Scrubs"] = { @@ -10750,6 +10929,16 @@ data_per_region = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["MQ Forest Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local sot = (has("ocarina") and has("time")) and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility(can_LA(), sot) + end + }, ["Ganons Castle MQ Forest Trial Eye Switch Chest"] = { ["child_access"] = function() return AccessibilityLevel.None @@ -10777,19 +10966,51 @@ data_per_region = { if has("hookshot") then return AccessibilityLevel.Normal end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end } } }, ["Ganons Castle MQ Fire Trial"] = { ["scene"] = "Ganons Castle", - ["dungeon"] = true + ["dungeon"] = true, + ["locations"] = { + ["MQ Fire Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local tunic = has("redtunic") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local lift3 = has("lift3") and AccessibilityLevel.Normal or AccessibilityLevel.None + local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_fire_trial_mq") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility(tunic, lift3, can_LA(), or_accessibility(ls, hb, and_accessibility(trick, hs))) + end + } + } }, ["Ganons Castle MQ Water Trial"] = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["MQ Water Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local keys = AccessibilityLevel.None + if has("gc_small_keys", 3) then + keys = AccessibilityLevel.Normal + elseif has("gc_small_keys", 1) then + keys = AccessibilityLevel.SequenceBreak + end + + return and_accessibility(has_blue_fire(), can_LA(), keys) + end + }, ["Ganons Castle MQ Water Trial Chest"] = { ["child_access"] = function() return AccessibilityLevel.None @@ -10804,6 +11025,25 @@ data_per_region = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["MQ Shadow Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local lot = + (has("logic_lens_castle_mq") or (has("lens") and has("magic"))) and AccessibilityLevel.Normal or + AccessibilityLevel.SequenceBreak + local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_shadow_trial_mq") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return and_accessibility( + can_LA(), + lot, + or_accessibility(hb, and_accessibility(hs, or_accessibility(has_fire(), trick))) + ) + end + }, ["Ganons Castle MQ Shadow Trial Bomb Flower Chest"] = { ["child_access"] = function() return AccessibilityLevel.None @@ -10848,6 +11088,18 @@ data_per_region = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["MQ Spirit Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local hammer = has("hammer") and AccessibilityLevel.Normal or AccessibilityLevel.None + local fa = has("firearrow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local shield3 = has("shield3") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility(can_LA(), hammer, has_bombchus(), fa, shield3) + end + }, ["Ganons Castle MQ Spirit Trial First Chest"] = { ["child_access"] = function() return AccessibilityLevel.None @@ -10896,6 +11148,26 @@ data_per_region = { ["scene"] = "Ganons Castle", ["dungeon"] = true, ["locations"] = { + ["MQ Light Trial Clear"] = { + ["child_access"] = function() + return AccessibilityLevel.None + end, + ["adult_access"] = function() + local keys = AccessibilityLevel.None + if has("gc_small_keys", 3) then + keys = AccessibilityLevel.Normal + elseif has("gc_small_keys", 2) then + keys = AccessibilityLevel.SequenceBreak + end + local lot = + (has("logic_lens_castle_mq") or (has("lens") and has("magic"))) and AccessibilityLevel.Normal or + AccessibilityLevel.SequenceBreak + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_light_trial_mq") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return and_accessibility(can_LA(), keys, lot, or_accessibility(hs, trick)) + end + }, ["Ganons Castle MQ Light Trial Lullaby Chest"] = { ["child_access"] = function() return AccessibilityLevel.None @@ -11907,47 +12179,70 @@ data_per_region = { }, ["Ice Cavern GS Spinning Scythe Room"] = { ["child_access"] = function() - if has("boomerang") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end }, ["Ice Cavern GS Heart Piece Room"] = { ["child_access"] = function() - if has("boomerang") then - return has_blue_fire() + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(has_blue_fire(), kill, collect) end, ["adult_access"] = function() - if has("hookshot") then - return has_bottle() + local kill = has_explosives() + if has("hookshot") or has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(has_bottle(), kill, collect) end }, ["Ice Cavern GS Push Block Room"] = { ["child_access"] = function() - if has("boomerang") then - return has_blue_fire() + local kill = has_explosives() + if has("boomerang") or has("sling") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(has_blue_fire(), kill, collect) end, ["adult_access"] = function() if has("hookshot") then return has_bottle() - elseif has("hoverboots") then - local trick = has("logic_ice_block_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - return and_accessibility(has_bottle(), trick) end - return AccessibilityLevel.None + + local kill = has_explosives() + if has("bow") or (has("dinsfire") and has("magic")) then + kill = AccessibilityLevel.Normal + end + local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_ice_block_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return and_accessibility( + has_bottle(), + or_accessibility(and_accessibility(hb, trick), and_accessibility(kill, AccessibilityLevel.Inspect)) + ) end } } @@ -12043,16 +12338,17 @@ data_per_region = { }, ["Ice Cavern MQ GS Scarecrow"] = { ["child_access"] = function() + if has("sling") or has_bombchus() ~= AccessibilityLevel.None then + return AccessibilityLevel.Inspect + end return AccessibilityLevel.None end, ["adult_access"] = function() - if - (can_use_scarecrow() == AccessibilityLevel.Normal) or (has("hoverboots") and has("longshot")) or - has("logic_ice_mq_scarecrow") - then - return AccessibilityLevel.Normal - end - return AccessibilityLevel.SequenceBreak + local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_ice_mq_scarecrow") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return or_accessibility(can_use_scarecrow(), and_accessibility(hb, ls), trick) end } } @@ -12074,7 +12370,7 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - return has_explosives() + return or_accessibility(has_explosives(), AccessibilityLevel.Inspect) end }, ["Ice Cavern MQ GS Red Ice"] = { @@ -12171,13 +12467,19 @@ data_per_region = { if has("boomerang") then return AccessibilityLevel.Normal end + if has("sling") or has_bombchus() ~= AccessibilityLevel.None then + return AccessibilityLevel.Inspect + end return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("hookshot") or has("bow") then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end }, ["Jabu Jabus Belly GS Lobby Basement Upper"] = { @@ -12185,13 +12487,19 @@ data_per_region = { if has("boomerang") then return AccessibilityLevel.Normal end + if has("sling") or has_bombchus() ~= AccessibilityLevel.None then + return AccessibilityLevel.Inspect + end return AccessibilityLevel.None end, ["adult_access"] = function() - if has("hookshot") then - return AccessibilityLevel.Normal + local kill = has_explosives() + if has("hookshot") or has("bow") then + kill = AccessibilityLevel.Normal end - return AccessibilityLevel.None + local collect = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + + return and_accessibility(kill, collect) end }, ["Jabu Jabus Belly Deku Scrub"] = { @@ -12426,13 +12734,13 @@ data_per_region = { end return AccessibilityLevel.SequenceBreak end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end, ["adult_access"] = function() if has("ocarina") and has("time") then return AccessibilityLevel.Normal end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end } }, @@ -12757,18 +13065,22 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("shadow_small_keys", 2) and has("hookshot") then - local lot = - (has("logic_lens_shadow_back") or (has("lens") and has("magic"))) and AccessibilityLevel.Normal or - AccessibilityLevel.SequenceBreak - if has("bombs") or has("lift1") then - return lot - end - local trick = - has("logic_shadow_freestanding_key") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - return and_accessibility(lot, trick, has_bombchus()) - end - return AccessibilityLevel.None + local keys = has("shadow_small_keys", 2) and AccessibilityLevel.Normal or AccessibilityLevel.None + local lot = + (has("logic_lens_shadow_back") or (has("lens") and has("magic"))) and AccessibilityLevel.Normal or + AccessibilityLevel.SequenceBreak + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local bombs = has("bombs") and AccessibilityLevel.Normal or AccessibilityLevel.None + local lift1 = has("lift1") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = + has("logic_shadow_freestanding_key") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return and_accessibility( + keys, + lot, + hs, + or_accessibility(bombs, lift1, and_accessibility(trick, has_bombchus())) + ) end }, ["Shadow Temple GS Like Like Room"] = { @@ -12795,13 +13107,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("shadow_small_keys", 2) and has("hookshot") then - if has("logic_lens_shadow_back") or (has("lens") and has("magic")) then - return AccessibilityLevel.Normal - end - return AccessibilityLevel.SequenceBreak - end - return AccessibilityLevel.None + local keys = has("shadow_small_keys", 2) and AccessibilityLevel.Normal or AccessibilityLevel.None + local lot = + (has("logic_lens_shadow_back") or (has("lens") and has("magic"))) and AccessibilityLevel.Normal or + AccessibilityLevel.SequenceBreak + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + + return and_accessibility(keys, lot, hs) end } }, @@ -12847,10 +13159,14 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("longshot") and has("shadow_small_keys", 4) then - return AccessibilityLevel.Normal - end - return AccessibilityLevel.None + local keys = has("shadow_small_keys", 4) and AccessibilityLevel.Normal or AccessibilityLevel.None + local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local bow = has("bow") and AccessibilityLevel.Inspect or AccessibilityLevel.None + + return and_accessibility( + keys, + or_accessibility(ls, bow, and_accessibility(can_use_scarecrow(), AccessibilityLevel.SequenceBreak)) + ) end } }, @@ -13193,7 +13509,7 @@ data_per_region = { end return AccessibilityLevel.SequenceBreak end - return AccessibilityLevel.None + return AccessibilityLevel.Inspect end } }, @@ -13496,8 +13812,9 @@ data_per_region = { local sticks = has("sticks") and AccessibilityLevel.Normal or AccessibilityLevel.None local stun = (has("nuts") or has("boomerang")) and AccessibilityLevel.Normal or AccessibilityLevel.None local armos = (has("sword1") or has("sling")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local df = (has("dinsfire") and has("magic")) and AccessibilityLevel.Inspect or AccessibilityLevel.None return and_accessibility( - or_accessibility(ranged, and_accessibility(has_bombchus(), trick)), + or_accessibility(ranged, and_accessibility(has_bombchus(), trick), df), or_accessibility(sticks, has_explosives(), and_accessibility(stun, armos)) ) end, @@ -13650,16 +13967,13 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("ocarina") and has("time") then - if has("bow") or has("hookshot") then - return AccessibilityLevel.Normal - end - local bombs = has("bombs") and AccessibilityLevel.Normal or AccessibilityLevel.None - local trick = - has("logic_spirit_lower_adult_switch") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - return or_accessibility(has_bombchus(), and_accessibility(bombs, trick)) - end - return AccessibilityLevel.None + local sot = (has("ocarina") and has("time")) and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local ranged = (has("bow") or has("hookshot")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local bombs = has("bombs") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = + has("logic_spirit_lower_adult_switch") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return and_accessibility(or_accessibility(ranged, has_bombchus(), and_accessibility(bombs, trick)), sot) end } }, @@ -13788,47 +14102,101 @@ data_per_region = { ["child_access"] = function() local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None - local keys5 = has("spirit_small_keys", 5) and AccessibilityLevel.Normal or AccessibilityLevel.None + local keys = AccessibilityLevel.None + if has("spirit_small_keys", 5) then + keys = AccessibilityLevel.Normal + elseif has("spirit_small_keys", 1) then + keys = AccessibilityLevel.SequenceBreak + end + return or_accessibility( and_accessibility(has_explosives(), rang, hs), - and_accessibility(rang, keys5, has_explosives()) + and_accessibility(or_accessibility(rang, AccessibilityLevel.Inspect), keys, has_explosives()) ) end, ["adult_access"] = function() local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None local lift2 = has("lift2") and AccessibilityLevel.Normal or AccessibilityLevel.None - local keys3 = has("spirit_small_keys", 3) and AccessibilityLevel.Normal or AccessibilityLevel.None - return or_accessibility(and_accessibility(has_explosives(), rang, hs), and_accessibility(hs, lift2, keys3)) + local keys = AccessibilityLevel.None + if has("spirit_small_keys", 3) then + keys = AccessibilityLevel.Normal + elseif has("spirit_small_keys", 1) then + keys = AccessibilityLevel.SequenceBreak + end + + return or_accessibility( + and_accessibility(has_explosives(), rang, hs), + and_accessibility(or_accessibility(hs, AccessibilityLevel.Inspect), lift2, keys) + ) end }, ["Spirit Temple GS Lobby"] = { ["child_access"] = function() - local keys3 = has("spirit_small_keys", 3) and AccessibilityLevel.Normal or AccessibilityLevel.None - local trick1 = has("logic_spirit_lobby_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local keys3 = AccessibilityLevel.None + if has("spirit_small_keys", 3) then + keys3 = AccessibilityLevel.Normal + elseif has("spirit_small_keys", 1) then + keys3 = AccessibilityLevel.SequenceBreak + end + local keys5 = AccessibilityLevel.None + if has("spirit_small_keys", 5) then + keys5 = AccessibilityLevel.Normal + elseif has("spirit_small_keys", 1) then + keys5 = AccessibilityLevel.SequenceBreak + end + local trick_gs = + has("logic_spirit_lobby_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local trick_jump = + has("logic_spirit_lobby_jump") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None - local trick2 = - has("logic_spirit_lobby_jump") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - local keys5 = has("spirit_small_keys", 5) and AccessibilityLevel.Normal or AccessibilityLevel.None + local kill = has_bombchus() + if has("boomerang") or has("sling") then + kill = AccessibilityLevel.Normal + end + return or_accessibility( - and_accessibility(or_accessibility(has_explosives(), keys3), trick1, rang, or_accessibility(hs, hb, trick2)), - and_accessibility(trick1, keys5, has_explosives(), rang) + and_accessibility( + or_accessibility(has_explosives(), keys3), + trick_gs, + rang, + or_accessibility(hs, hb, trick_jump) + ), + and_accessibility( + trick_gs, + keys5, + has_explosives(), + or_accessibility(rang, AccessibilityLevel.Inspect), + kill + ) ) end, ["adult_access"] = function() - local keys3 = has("spirit_small_keys", 3) and AccessibilityLevel.Normal or AccessibilityLevel.None - local trick1 = has("logic_spirit_lobby_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local keys3 = AccessibilityLevel.None + if has("spirit_small_keys", 3) then + keys3 = AccessibilityLevel.Normal + elseif has("spirit_small_keys", 1) then + keys3 = AccessibilityLevel.SequenceBreak + end + local trick_gs = + has("logic_spirit_lobby_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local trick_jump = + has("logic_spirit_lobby_jump") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None local hb = has("hoverboots") and AccessibilityLevel.Normal or AccessibilityLevel.None - local trick2 = - has("logic_spirit_lobby_jump") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak local lift2 = has("lift2") and AccessibilityLevel.Normal or AccessibilityLevel.None + return or_accessibility( - and_accessibility(or_accessibility(has_explosives(), keys3), trick1, rang, or_accessibility(hs, hb, trick2)), - and_accessibility(keys3, lift2, or_accessibility(hs, hb, trick2)) + and_accessibility( + or_accessibility(has_explosives(), keys3), + trick_gs, + rang, + or_accessibility(hs, hb, trick_jump) + ), + and_accessibility(keys3, lift2, or_accessibility(hs, hb, trick_jump)) ) end } @@ -13876,13 +14244,21 @@ data_per_region = { local keys3 = has("spirit_small_keys", 3) and AccessibilityLevel.Normal or AccessibilityLevel.None local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None local keys5 = has("spirit_small_keys", 5) and AccessibilityLevel.Normal or AccessibilityLevel.None - return or_accessibility(and_accessibility(keys3, ls, has_explosives()), keys5) + local keys2 = has("spirit_small_keys", 2) and AccessibilityLevel.SequenceBreak or AccessibilityLevel.None + + return or_accessibility( + and_accessibility(keys3, ls, has_explosives()), + keys5, + and_accessibility(keys2, has_explosives()) + ) end, ["adult_access"] = function() local keys3 = has("spirit_small_keys", 3) and AccessibilityLevel.Normal or AccessibilityLevel.None local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None local keys5 = has("spirit_small_keys", 5) and AccessibilityLevel.Normal or AccessibilityLevel.None - return or_accessibility(and_accessibility(keys3, ls, has_explosives()), keys5) + local keys2 = has("spirit_small_keys", 2) and AccessibilityLevel.SequenceBreak or AccessibilityLevel.None + + return or_accessibility(and_accessibility(keys3, ls, has_explosives()), keys5, keys2) end }, ["Spirit Temple Mirror Shield Chest"] = { @@ -14413,15 +14789,14 @@ data_per_region = { }, ["Spirit Temple MQ GS Sun Block Room"] = { ["child_access"] = function() - if has("boomerang") then - local trick1 = - has("logic_spirit_mq_sun_block_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - local sot = (has("ocarina") and has("time")) and AccessibilityLevel.Normal or AccessibilityLevel.None - local trick2 = - has("logic_spirit_mq_sun_block_sot") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - return and_accessibility(trick1, or_accessibility(sot, trick2)) - end - return AccessibilityLevel.None + local trick1 = + has("logic_spirit_mq_sun_block_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local sot = (has("ocarina") and has("time")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick2 = + has("logic_spirit_mq_sun_block_sot") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return and_accessibility(trick1, rang, or_accessibility(sot, trick2)) end, ["adult_access"] = function() return AccessibilityLevel.Normal @@ -14834,6 +15209,7 @@ data_per_region = { end }, ["Water Temple GS Central Pillar"] = { + --TODO: peek this gs ["child_access"] = function() return AccessibilityLevel.None end, @@ -14954,48 +15330,33 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("ocarina") and has("lullaby") and has("lift1") then - if has("ironboots") and has("hookshot") then - return AccessibilityLevel.Normal - end - - local adult_dive = AccessibilityLevel.None - if has("ironboots") or has("scale") then - adult_dive = AccessibilityLevel.Normal - end - local adult_range = AccessibilityLevel.None - if has("bow") or has("hookshot") then - adult_range = AccessibilityLevel.Normal - else - adult_range = has_bombchus() - end - local adult_trick = AccessibilityLevel.SequenceBreak - if has("logic_water_dragon_adult") then - adult_trick = AccessibilityLevel.Normal - end - - local child_dive = AccessibilityLevel.None - if has("scale") then - child_dive = AccessibilityLevel.Normal - end - local child_range = AccessibilityLevel.None - if has("sling") or has("boomerang") then - child_range = AccessibilityLevel.Normal - else - child_range = has_bombchus() - end - local child_trick = AccessibilityLevel.SequenceBreak - if has("logic_water_dragon_child") then - child_trick = AccessibilityLevel.Normal - end - local child_acc = access_region("Water Temple Lobby", "child") + local zl = (has("ocarina") and has("lullaby")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local lift1 = has("lift1") and AccessibilityLevel.Normal or AccessibilityLevel.None + local ib = has("ironboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local hs = has("hookshot") and AccessibilityLevel.Normal or AccessibilityLevel.None + local scale = has("scale") and AccessibilityLevel.Normal or AccessibilityLevel.None + local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local sling = has("sling") and AccessibilityLevel.Normal or AccessibilityLevel.None + local rang = has("boomerang") and AccessibilityLevel.Normal or AccessibilityLevel.None + local adult_trick = + has("logic_water_dragon_adult") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + local child_trick = + has("logic_water_dragon_child") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - return or_accessibility( - and_accessibility(adult_dive, adult_range, adult_trick), - and_accessibility(child_dive, child_range, child_trick, child_acc) + return and_accessibility( + zl, + lift1, + or_accessibility( + and_accessibility(ib, hs), + and_accessibility(adult_trick, or_accessibility(has_bombchus(), bow, hs), or_accessibility(scale, ib)), + and_accessibility( + child_trick, + access_region("Water Temple Lobby", "child"), + or_accessibility(has_bombchus(), sling, rang), + scale + ) ) - end - return AccessibilityLevel.None + ) end } } @@ -15113,6 +15474,8 @@ data_per_region = { return AccessibilityLevel.Normal end return AccessibilityLevel.SequenceBreak + elseif has("sling") then + return AccessibilityLevel.Inspect end return AccessibilityLevel.None end, @@ -15124,6 +15487,8 @@ data_per_region = { return AccessibilityLevel.Normal end return AccessibilityLevel.SequenceBreak + elseif has("bow") then + return AccessibilityLevel.Inspect end return AccessibilityLevel.None end @@ -15175,17 +15540,19 @@ data_per_region = { return AccessibilityLevel.None end, ["adult_access"] = function() - if has("ocarina") and has("time") then - local ib = has("ironboots") and AccessibilityLevel.Normal or AccessibilityLevel.None - local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.None - local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None - local trick = has("logic_water_river_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak - return or_accessibility( + local sot = (has("ocarina") and has("time")) and AccessibilityLevel.Normal or AccessibilityLevel.None + local ib = has("ironboots") and AccessibilityLevel.Normal or AccessibilityLevel.None + local ls = has("longshot") and AccessibilityLevel.Normal or AccessibilityLevel.Inspect + local bow = has("bow") and AccessibilityLevel.Normal or AccessibilityLevel.None + local trick = has("logic_water_river_gs") and AccessibilityLevel.Normal or AccessibilityLevel.SequenceBreak + + return and_accessibility( + sot, + or_accessibility( and_accessibility(ib, FTR_or_zora()), and_accessibility(trick, ls, or_accessibility(bow, has_bombchus())) ) - end - return AccessibilityLevel.None + ) end } }, @@ -15450,207 +15817,3 @@ data_per_region = { } } } - -access_per_region_per_age = {} -function invalidate_regions() - access_per_region_per_age[1] = {} - access_per_region_per_age[2] = {} - for region, _ in pairs(data_per_region) do - access_per_region_per_age[1][region] = AccessibilityLevel.None - access_per_region_per_age[2][region] = AccessibilityLevel.None - end -end -invalidate_regions() - -location_access_per_age = {} -function invalidate_locations() - location_access_per_age[1] = {} - location_access_per_age[2] = {} -end -invalidate_locations() - -function set_region_access(age, target_region, target_new_access, origin_access) - if access_level[origin_access] < access_level[target_new_access] then - target_new_access = origin_access - end - local target_old_access = access_per_region_per_age[age][target_region] - if access_level[target_old_access] < access_level[target_new_access] then - if er_debugging then - print("| | +--set access", age, target_new_access, target_region) - end - changed_access = true - access_per_region_per_age[age][target_region] = target_new_access - end -end - -function set_location_access(age, location, target_new_access, origin_access) - if access_level[origin_access] < access_level[target_new_access] then - target_new_access = origin_access - end - local target_old_access = location_access_per_age[age][location] or AccessibilityLevel.None - if access_level[target_old_access] < access_level[target_new_access] then - if er_debugging then - print("| | +--location", age, target_new_access, location) - end - changed_access = true - location_access_per_age[age][location] = target_new_access - end -end - -function build_regions() - invalidate_regions() - invalidate_locations() - - access_per_region_per_age[1]["Root"] = AccessibilityLevel.Normal - access_per_region_per_age[2]["Root"] = AccessibilityLevel.Normal - - changed_access = true - while changed_access do - changed_access = false - for age = 1, 2 do - if er_debugging then - print("+--age", age) - end - for region, access in pairs(access_per_region_per_age[age]) do - if access ~= AccessibilityLevel.None then - local region_data = data_per_region[region] - if er_debugging then - print("| +--region", region) - end - if type(region_data.locations) == "table" then - for location, location_data in pairs(region_data.locations) do - local age_func = (age == 1) and "child_access" or "adult_access" - local new_access = location_data[age_func]() - - set_location_access(age, location, new_access, access) - end - end - if type(region_data.exits) == "table" then - for exit, exit_data in pairs(region_data.exits) do - local age_func = (age == 1) and "child_access" or "adult_access" - local new_access = exit_data[age_func]() - - local same_scene = - region_data.scene and data_per_region[exit] and data_per_region[exit].scene and - region_data.scene == data_per_region[exit].scene - - if region_data.special and (not same_scene) then - if not has(special_regions[region].setting) then - set_region_access(age, exit, new_access, access) - elseif special_regions[region].origin then - set_region_access(age, special_regions[region].origin, access, access) - end - else - if exit_data.fixed or same_scene then - set_region_access(age, exit, new_access, access) - elseif not same_scene and not region_data.dungeon and not region_data.interior then - if exit_data.setting and not has(exit_data.setting) then - set_region_access(age, exit, new_access, access) - elseif exit_data.capture and data_per_region[exit_data.capture] then - set_region_access(age, exit_data.capture, new_access, access) - end - end - end - end - end - end - end - end - end - if er_debugging then - for age = 1, 2 do - print(age) - for location, access in pairs(location_access_per_age[age]) do - if access ~= AccessibilityLevel.None then - print(location, access) - end - end - end - print("---------------") - end -end - -function access_region(region, age) - age = age or "" - region = region or "" - - local region_child = access_per_region_per_age[1][region] - local region_adult = access_per_region_per_age[2][region] - - if age == "both" then - return and_accessibility(region_child, region_adult) - elseif age == "child" then - return region_child - elseif age == "adult" then - return region_adult - else --either - return or_accessibility(region_child, region_adult) - end - return AccessibilityLevel.None -end - -function access_exit(region, exit, age) - if not region or not exit then - return 0, AccessibilityLevel.None - end - age = age or "" - - local region_child = access_per_region_per_age[1][region] - local region_adult = access_per_region_per_age[2][region] - local exit_child = - data_per_region[region].exits and data_per_region[region].exits[exit] and - data_per_region[region].exits[exit].child_access() - local exit_adult = - data_per_region[region].exits and data_per_region[region].exits[exit] and - data_per_region[region].exits[exit].adult_access() - if not exit_child or not exit_adult then - print("error! exit not found:", region, exit, age) - return 0, AccessibilityLevel.None - end - - local access = AccessibilityLevel.None - - if age == "both" then - access = and_accessibility(region_child, exit_child, region_adult, exit_adult) - elseif age == "child" then - access = and_accessibility(region_child, exit_child) - elseif age == "adult" then - access = and_accessibility(region_adult, exit_adult) - else --either - access = or_accessibility(and_accessibility(region_child, exit_child), and_accessibility(region_adult, exit_adult)) - end - - local level = access_level[access] - if level > 0 then - return 1, access - end - return 0, AccessibilityLevel.None -end - -function access_location(location, age) - if not location then - return 0, AccessibilityLevel.None - end - age = age or "" - - local location_child = location_access_per_age[1][location] or AccessibilityLevel.None - local location_adult = location_access_per_age[2][location] or AccessibilityLevel.None - - local access = AccessibilityLevel.None - - if age == "both" then - access = and_accessibility(location_child, location_adult) - elseif age == "child" then - access = location_child - elseif age == "adult" then - access = location_adult - else --either - access = or_accessibility(location_child, location_adult) - end - - local level = access_level[access] - if level > 0 then - return 1, access - end - return 0, AccessibilityLevel.None -end diff --git a/ootrando_overworldmap_hamsda/scripts/globals.lua b/ootrando_overworldmap_hamsda/scripts/globals.lua new file mode 100644 index 0000000..9da73f4 --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/globals.lua @@ -0,0 +1,4 @@ +VARIANT = Tracker.ActiveVariantUID +HAS_MAP = VARIANT ~= "var_minimalist" and (not VARIANT:find("itemsonly")) +HAS_KEYS = VARIANT:find("keysanity") +HAS_ER = VARIANT:find("entrance") diff --git a/ootrando_overworldmap_hamsda/scripts/init.lua b/ootrando_overworldmap_hamsda/scripts/init.lua index 1e3d0fb..cd48bff 100644 --- a/ootrando_overworldmap_hamsda/scripts/init.lua +++ b/ootrando_overworldmap_hamsda/scripts/init.lua @@ -1,156 +1,8 @@ -object_cache = {} -function get_object(name) - if object_cache[name] then - return object_cache[name] - end - local object = Tracker:FindObjectForCode(name) - if object then - object_cache[name] = object - return object - end -end - -amount_cache = {} -function clear_amount_cache() - amount_cache = {} -end -function has(item, amount) - if not amount_cache[item] then - amount_cache[item] = Tracker:ProviderCountForCode(item) - end - local count = amount_cache[item] or 0 - amount = tonumber(amount) - if not amount then - amount = 1 - end - return count >= amount -end -function has_exact(item, amount) - if not amount_cache[item] then - amount_cache[item] = Tracker:ProviderCountForCode(item) - end - local count = amount_cache[item] or 0 - amount = tonumber(amount) - if not amount then - print("error! has_exact - missing amount for item:", item) - return false - end - return count == amount -end - -settings_cache = {} -queued_changes = {} -function not_like_cache(setting, current) - if settings_cache[setting] == nil or settings_cache[setting] ~= current then - queued_changes[setting] = current - return true - end - return false -end -function apply_queued_changes() - for setting, value in pairs(queued_changes) do - settings_cache[setting] = value - end - queued_changes = {} -end - -variant = Tracker.ActiveVariantUID -has_map = variant ~= "var_minimalist" and (not variant:find("itemsonly")) -is_keys = variant:find("keysanity") -is_er = variant:find("entrance") - -ScriptHost:LoadScript("scripts/sdk/class.lua") -ScriptHost:LoadScript("scripts/sdk/custom_item.lua") - -if has_map then - if is_er then - Tracker:AddItems("items/capture_entrance.json") - Tracker:AddItems("items/options_entrance.json") - else - Tracker:AddItems("items/sequences.json") - Tracker:AddItems("items/capture_spawns.json") - end - Tracker:AddItems("items/capture_items.json") - Tracker:AddItems("items/tricks.json") - Tracker:AddItems("items/options.json") -end -Tracker:AddItems("items/counters.json") -Tracker:AddItems("items/quest.json") -Tracker:AddItems("items/equipment.json") -Tracker:AddItems("items/items.json") -Tracker:AddItems("items/dungeons.json") - -ScriptHost:LoadScript("scripts/custom_prog_badge.lua") -local song_badges = {"images/overlay_song_zelda.png", "images/overlay_song_epona.png", "images/overlay_song_saria.png", "images/overlay_song_sun.png", "images/overlay_song_time.png", "images/overlay_song_storms.png", "images/overlay_song_minuet.png", "images/overlay_song_bolero.png", "images/overlay_song_serenade.png", "images/overlay_song_requiem.png", "images/overlay_song_nocturne.png", "images/overlay_song_prelude.png"} -ProgBadgeItem("Zelda's Lullaby", "lullaby", "images/song_zelda.png", song_badges) -ProgBadgeItem("Epona's Song", "epona", "images/song_epona.png", song_badges) -ProgBadgeItem("Saria's Song", "saria", "images/song_saria.png", song_badges) -ProgBadgeItem("Sun's Song", "sun", "images/song_sun.png", song_badges) -ProgBadgeItem("Song of Time", "time", "images/song_time.png", song_badges) -ProgBadgeItem("Song of Storms", "storm", "images/song_storms.png", song_badges) -ProgBadgeItem("Minuet of Forest", "minuet", "images/song_minuet.png", song_badges) -ProgBadgeItem("Bolero of Fire", "bolero", "images/song_bolero.png", song_badges) -ProgBadgeItem("Serenade of Water", "serenade", "images/song_serenade.png", song_badges) -ProgBadgeItem("Requiem of Spirit", "requiem", "images/song_requiem.png", song_badges) -ProgBadgeItem("Nocturne of Shadow", "nocturne", "images/song_nocturne.png", song_badges) -ProgBadgeItem("Prelude of Light", "prelude", "images/song_prelude.png", song_badges) - -if is_er then - ScriptHost:LoadScript("scripts/regions.lua") - ScriptHost:LoadScript("scripts/logic_entrance.lua") -else - ScriptHost:LoadScript("scripts/logic.lua") -end - -if has_map then - Tracker:AddLayouts("layouts/tricks.json") - if is_er then - Tracker:AddMaps("maps/maps_entrance.json") - Tracker:AddLocations("locations/overworld_entrance.json") - Tracker:AddLocations("locations/exits_entrance.json") - Tracker:AddLocations("locations/dungeons_entrance.json") - Tracker:AddLayouts("layouts/options_entrance.json") - else - Tracker:AddMaps("maps/maps.json") - Tracker:AddLocations("locations/overworld.json") - Tracker:AddLocations("locations/dungeons.json") - Tracker:AddLayouts("layouts/options.json") - end - - ScriptHost:LoadScript("scripts/update_shared.lua") - if is_er then - ScriptHost:LoadScript("scripts/update_entrance.lua") - else - ScriptHost:LoadScript("scripts/update.lua") - end - tracker_on_accessibility_updated() -end - -if is_keys then - Tracker:AddLayouts("layouts/dungeon_grids_keysanity.json") -else - Tracker:AddLayouts("layouts/dungeon_grids.json") -end -Tracker:AddLayouts("layouts/item_grids.json") -if has_map then - if is_er then - Tracker:AddLayouts("layouts/counters_entrance.json") - Tracker:AddLayouts("layouts/layouts_entrance.json") - Tracker:AddLayouts("layouts/capture_entrance.json") - else - Tracker:AddLayouts("layouts/counters.json") - Tracker:AddLayouts("layouts/layouts.json") - Tracker:AddLayouts("layouts/capture_spawns.json") - end -end -Tracker:AddLayouts("layouts/capture.json") -Tracker:AddLayouts("layouts/tracker.json") -Tracker:AddLayouts("layouts/broadcast.json") - ---change GF key counter in this variant only going to 1 because of the default settings for GF -if variant == "var_itemsonly_keysanity" then - local gf = get_object("setting_gerudo") - if gf then - gf.CurrentStage = 0 - end -end +ScriptHost:LoadScript("scripts/user_settings.lua") +ScriptHost:LoadScript("scripts/globals.lua") +ScriptHost:LoadScript("scripts/cached_helpers.lua") + +ScriptHost:LoadScript("scripts/loading/load_items.lua") +ScriptHost:LoadScript("scripts/loading/load_locations.lua") +ScriptHost:LoadScript("scripts/loading/load_updaters.lua") +ScriptHost:LoadScript("scripts/loading/load_layouts.lua") diff --git a/ootrando_overworldmap_hamsda/scripts/loading/load_items.lua b/ootrando_overworldmap_hamsda/scripts/loading/load_items.lua new file mode 100644 index 0000000..dd119f2 --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/loading/load_items.lua @@ -0,0 +1,52 @@ +if HAS_MAP then + if HAS_ER then + Tracker:AddItems("items/capture_entrance.json") + Tracker:AddItems("items/options_entrance.json") + else + Tracker:AddItems("items/capture_spawns.json") + end + Tracker:AddItems("items/sequences.json") + Tracker:AddItems("items/capture_items.json") + Tracker:AddItems("items/tricks.json") + Tracker:AddItems("items/options.json") + Tracker:AddItems("items/counters.json") +end +Tracker:AddItems("items/quest.json") +Tracker:AddItems("items/equipment.json") +Tracker:AddItems("items/items.json") +Tracker:AddItems("items/dungeons.json") + +--CUSTOM ITEMS +ScriptHost:LoadScript("scripts/sdk/class.lua") +ScriptHost:LoadScript("scripts/sdk/custom_item.lua") +ScriptHost:LoadScript("scripts/custom_prog_badge.lua") + +local badge_images = + USE_SONG_CHECKMARK_ONLY and {"images/check.png"} or + { + "images/overlay_song_zelda.png", + "images/overlay_song_epona.png", + "images/overlay_song_saria.png", + "images/overlay_song_sun.png", + "images/overlay_song_time.png", + "images/overlay_song_storms.png", + "images/overlay_song_minuet.png", + "images/overlay_song_bolero.png", + "images/overlay_song_serenade.png", + "images/overlay_song_requiem.png", + "images/overlay_song_nocturne.png", + "images/overlay_song_prelude.png" + } + +ProgBadgeItem("Zelda's Lullaby", "lullaby", "images/song_zelda.png", badge_images) +ProgBadgeItem("Epona's Song", "epona", "images/song_epona.png", badge_images) +ProgBadgeItem("Saria's Song", "saria", "images/song_saria.png", badge_images) +ProgBadgeItem("Sun's Song", "sun", "images/song_sun.png", badge_images) +ProgBadgeItem("Song of Time", "time", "images/song_time.png", badge_images) +ProgBadgeItem("Song of Storms", "storm", "images/song_storms.png", badge_images) +ProgBadgeItem("Minuet of Forest", "minuet", "images/song_minuet.png", badge_images) +ProgBadgeItem("Bolero of Fire", "bolero", "images/song_bolero.png", badge_images) +ProgBadgeItem("Serenade of Water", "serenade", "images/song_serenade.png", badge_images) +ProgBadgeItem("Requiem of Spirit", "requiem", "images/song_requiem.png", badge_images) +ProgBadgeItem("Nocturne of Shadow", "nocturne", "images/song_nocturne.png", badge_images) +ProgBadgeItem("Prelude of Light", "prelude", "images/song_prelude.png", badge_images) diff --git a/ootrando_overworldmap_hamsda/scripts/loading/load_layouts.lua b/ootrando_overworldmap_hamsda/scripts/loading/load_layouts.lua new file mode 100644 index 0000000..63b3e53 --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/loading/load_layouts.lua @@ -0,0 +1,23 @@ +if HAS_KEYS then + Tracker:AddLayouts("layouts/dungeon_grids_keysanity.json") +else + Tracker:AddLayouts("layouts/dungeon_grids.json") +end +Tracker:AddLayouts("layouts/item_grids.json") +if HAS_MAP then + Tracker:AddLayouts("layouts/tricks.json") + if HAS_ER then + Tracker:AddLayouts("layouts/options_entrance.json") + Tracker:AddLayouts("layouts/counters_entrance.json") + Tracker:AddLayouts("layouts/layouts_entrance.json") + Tracker:AddLayouts("layouts/capture_entrance.json") + else + Tracker:AddLayouts("layouts/options.json") + Tracker:AddLayouts("layouts/counters.json") + Tracker:AddLayouts("layouts/layouts.json") + Tracker:AddLayouts("layouts/capture_spawns.json") + end + Tracker:AddLayouts("layouts/capture_items.json") +end +Tracker:AddLayouts("layouts/tracker.json") +Tracker:AddLayouts("layouts/broadcast.json") diff --git a/ootrando_overworldmap_hamsda/scripts/loading/load_locations.lua b/ootrando_overworldmap_hamsda/scripts/loading/load_locations.lua new file mode 100644 index 0000000..8deca38 --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/loading/load_locations.lua @@ -0,0 +1,22 @@ +if HAS_MAP then + if HAS_ER then + ScriptHost:LoadScript("scripts/data_per_region.lua") + ScriptHost:LoadScript("scripts/region_building.lua") + ScriptHost:LoadScript("scripts/logic_helpers_entrance.lua") + + Tracker:AddMaps("maps/maps_entrance.json") + + Tracker:AddLocations("locations/overworld_entrance.json") + Tracker:AddLocations("locations/exits_entrance.json") + Tracker:AddLocations("locations/dungeons_entrance.json") + + ScriptHost:LoadScript("scripts/add_section_objects.lua") + else + ScriptHost:LoadScript("scripts/logic_helpers.lua") + + Tracker:AddMaps("maps/maps.json") + + Tracker:AddLocations("locations/overworld.json") + Tracker:AddLocations("locations/dungeons.json") + end +end diff --git a/ootrando_overworldmap_hamsda/scripts/loading/load_updaters.lua b/ootrando_overworldmap_hamsda/scripts/loading/load_updaters.lua new file mode 100644 index 0000000..aac4eed --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/loading/load_updaters.lua @@ -0,0 +1,40 @@ +ScriptHost:LoadScript("scripts/update_items.lua") +if HAS_MAP then + ScriptHost:LoadScript("scripts/update_maps.lua") + if HAS_ER then + ScriptHost:LoadScript("scripts/update_entrance.lua") + else + ScriptHost:LoadScript("scripts/update.lua") + end +end + +loading_save_file = false +function tracker_on_begin_loading_save_file() + loading_save_file = true +end + +function tracker_on_finish_loading_save_file() + loading_save_file = false +end + +function tracker_on_accessibility_updated() + if not loading_save_file then + clear_amount_cache() + + if update_items then + update_items() + end + if update_maps then + update_maps() + end + if update_version_specific then + update_version_specific() + end + + apply_queued_changes() + + get_object("dummy").Active = not get_object("dummy").Active + end +end + +tracker_on_accessibility_updated() diff --git a/ootrando_overworldmap_hamsda/scripts/logic.lua b/ootrando_overworldmap_hamsda/scripts/logic_helpers.lua similarity index 99% rename from ootrando_overworldmap_hamsda/scripts/logic.lua rename to ootrando_overworldmap_hamsda/scripts/logic_helpers.lua index f9169f3..f6c3a51 100644 --- a/ootrando_overworldmap_hamsda/scripts/logic.lua +++ b/ootrando_overworldmap_hamsda/scripts/logic_helpers.lua @@ -910,7 +910,6 @@ function trials_barrier_dispelled() if setting_trials == 0 or trials_cleared >= setting_trials then return 1, AccessibilityLevel.Normal - else - return 0, AccessibilityLevel.None end + return 0, AccessibilityLevel.None end diff --git a/ootrando_overworldmap_hamsda/scripts/logic_entrance.lua b/ootrando_overworldmap_hamsda/scripts/logic_helpers_entrance.lua similarity index 96% rename from ootrando_overworldmap_hamsda/scripts/logic_entrance.lua rename to ootrando_overworldmap_hamsda/scripts/logic_helpers_entrance.lua index 18a1e0e..ed8e8b7 100644 --- a/ootrando_overworldmap_hamsda/scripts/logic_entrance.lua +++ b/ootrando_overworldmap_hamsda/scripts/logic_helpers_entrance.lua @@ -160,6 +160,13 @@ function has_fire() return AccessibilityLevel.None end +function can_LA() + if has("bow") and has("magic") and has("lightarrow") then + return AccessibilityLevel.Normal + end + return AccessibilityLevel.None +end + function can_child_attack() if has("sling") or has("boomerang") or has("sticks") or has("sword1") or (has("dinsfire") and has("magic")) then return AccessibilityLevel.Normal @@ -494,3 +501,13 @@ function can_trigger_lacs() return AccessibilityLevel.None end + +function trials_barrier_dispelled() + local trials_cleared = Tracker:ProviderCountForCode("trial_cleared") + local setting_trials = get_object("setting_trials") and get_object("setting_trials").AcquiredCount or 0 + + if setting_trials == 0 or trials_cleared >= setting_trials then + return AccessibilityLevel.Normal + end + return AccessibilityLevel.None +end diff --git a/ootrando_overworldmap_hamsda/scripts/region_building.lua b/ootrando_overworldmap_hamsda/scripts/region_building.lua new file mode 100644 index 0000000..7ef5779 --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/region_building.lua @@ -0,0 +1,224 @@ +special_regions = { + ["KF Links House"] = { + ["setting"] = "setting_entrance_interiors_all" + }, + ["Temple of Time"] = { + ["setting"] = "setting_entrance_interiors_all" + }, + ["Kak Potion Shop Front"] = { + ["setting"] = "setting_entrance_interiors_all" + }, + ["Kak Potion Shop Back"] = { + ["setting"] = "setting_entrance_interiors_all" + }, + ["Kak Windmill"] = { + ["setting"] = "setting_entrance_interiors_all" + }, + ["Graveyard Dampes Grave"] = { + ["setting"] = "setting_entrance_grottos_shuffle" + } +} + +access_per_region_per_age = {} +function invalidate_regions() + access_per_region_per_age[1] = {} + access_per_region_per_age[2] = {} + for region, _ in pairs(data_per_region) do + access_per_region_per_age[1][region] = AccessibilityLevel.None + access_per_region_per_age[2][region] = AccessibilityLevel.None + end +end +invalidate_regions() + +location_access_per_age = {} +function invalidate_locations() + location_access_per_age[1] = {} + location_access_per_age[2] = {} +end +invalidate_locations() + +function set_region_access(age, target_region, target_new_access, origin_access) + if access_level[origin_access] < access_level[target_new_access] then + target_new_access = origin_access + end + local target_old_access = access_per_region_per_age[age][target_region] + if access_level[target_old_access] < access_level[target_new_access] then + if ER_DEBUGGING then + print("| | +--set access", age, target_new_access, target_region) + end + changed_access = true + access_per_region_per_age[age][target_region] = target_new_access + end +end + +function set_location_access(age, location, target_new_access, origin_access) + if access_level[origin_access] < access_level[target_new_access] then + target_new_access = origin_access + end + local target_old_access = location_access_per_age[age][location] or AccessibilityLevel.None + if access_level[target_old_access] < access_level[target_new_access] then + if ER_DEBUGGING then + print("| | +--location", age, target_new_access, location) + end + changed_access = true + location_access_per_age[age][location] = target_new_access + end +end + +function build_regions() + invalidate_regions() + invalidate_locations() + + access_per_region_per_age[1]["Root"] = AccessibilityLevel.Normal + access_per_region_per_age[2]["Root"] = AccessibilityLevel.Normal + + changed_access = true + while changed_access do + changed_access = false + for age = 1, 2 do + if ER_DEBUGGING then + print("+--age", age) + end + for region, access in pairs(access_per_region_per_age[age]) do + if access ~= AccessibilityLevel.None then + local region_data = data_per_region[region] + if ER_DEBUGGING then + print("| +--region", region) + end + if type(region_data.locations) == "table" then + for location, location_data in pairs(region_data.locations) do + local age_func = (age == 1) and "child_access" or "adult_access" + local new_access = location_data[age_func]() + + set_location_access(age, location, new_access, access) + end + end + if type(region_data.exits) == "table" then + for exit, exit_data in pairs(region_data.exits) do + local age_func = (age == 1) and "child_access" or "adult_access" + local new_access = exit_data[age_func]() + + local same_scene = + region_data.scene and data_per_region[exit] and data_per_region[exit].scene and + region_data.scene == data_per_region[exit].scene + + if region_data.special and (not same_scene) then + if not has(special_regions[region].setting) then + set_region_access(age, exit, new_access, access) + elseif special_regions[region].origin then + set_region_access(age, special_regions[region].origin, access, access) + end + else + if exit_data.fixed or same_scene then + set_region_access(age, exit, new_access, access) + elseif not same_scene and not region_data.dungeon and not region_data.interior then + if exit_data.setting and not has(exit_data.setting) then + set_region_access(age, exit, new_access, access) + elseif exit_data.capture and data_per_region[exit_data.capture] then + set_region_access(age, exit_data.capture, new_access, access) + end + end + end + end + end + end + end + end + end + if ER_DEBUGGING then + for age = 1, 2 do + print(age) + for location, access in pairs(location_access_per_age[age]) do + if access ~= AccessibilityLevel.None then + print(location, access) + end + end + end + print("---------------") + end +end + +function access_region(region, age) + age = age or "" + region = region or "" + + local region_child = access_per_region_per_age[1][region] + local region_adult = access_per_region_per_age[2][region] + + if age == "both" then + return and_accessibility(region_child, region_adult) + elseif age == "child" then + return region_child + elseif age == "adult" then + return region_adult + else --either + return or_accessibility(region_child, region_adult) + end + return AccessibilityLevel.None +end + +function access_exit(region, exit, age) + if not region or not exit then + return 0, AccessibilityLevel.None + end + age = age or "" + + local region_child = access_per_region_per_age[1][region] + local region_adult = access_per_region_per_age[2][region] + local exit_child = + data_per_region[region].exits and data_per_region[region].exits[exit] and + data_per_region[region].exits[exit].child_access() + local exit_adult = + data_per_region[region].exits and data_per_region[region].exits[exit] and + data_per_region[region].exits[exit].adult_access() + if not exit_child or not exit_adult then + print("error! exit not found:", region, exit, age) + return 0, AccessibilityLevel.None + end + + local access = AccessibilityLevel.None + + if age == "both" then + access = and_accessibility(region_child, exit_child, region_adult, exit_adult) + elseif age == "child" then + access = and_accessibility(region_child, exit_child) + elseif age == "adult" then + access = and_accessibility(region_adult, exit_adult) + else --either + access = or_accessibility(and_accessibility(region_child, exit_child), and_accessibility(region_adult, exit_adult)) + end + + local level = access_level[access] + if level > 0 then + return 1, access + end + return 0, AccessibilityLevel.None +end + +function access_location(location, age) + if not location then + return 0, AccessibilityLevel.None + end + age = age or "" + + local location_child = location_access_per_age[1][location] or AccessibilityLevel.None + local location_adult = location_access_per_age[2][location] or AccessibilityLevel.None + + local access = AccessibilityLevel.None + + if age == "both" then + access = and_accessibility(location_child, location_adult) + elseif age == "child" then + access = location_child + elseif age == "adult" then + access = location_adult + else --either + access = or_accessibility(location_child, location_adult) + end + + local level = access_level[access] + if level > 0 then + return 1, access + end + return 0, AccessibilityLevel.None +end diff --git a/ootrando_overworldmap_hamsda/scripts/update.lua b/ootrando_overworldmap_hamsda/scripts/update.lua index f159740..0b7ad11 100644 --- a/ootrando_overworldmap_hamsda/scripts/update.lua +++ b/ootrando_overworldmap_hamsda/scripts/update.lua @@ -1,4 +1,4 @@ -skulltula_locations = { +local skulltula_locations = { --overworld ["setting_tokens_overworld"] = { "@KF Know It All House/KF GS Know It All House (N)", diff --git a/ootrando_overworldmap_hamsda/scripts/update_entrance.lua b/ootrando_overworldmap_hamsda/scripts/update_entrance.lua index 65adb5f..6ddd337 100644 --- a/ootrando_overworldmap_hamsda/scripts/update_entrance.lua +++ b/ootrando_overworldmap_hamsda/scripts/update_entrance.lua @@ -1,23 +1,3 @@ -for region, region_data in pairs(data_per_region) do - if type(region_data.exits) == "table" then - for target, target_data in pairs(region_data.exits) do - if - not region_data.interior and not region_data.special and not region_data.dungeon and not target_data.fixed and - not (region_data.scene and data_per_region[target] and data_per_region[target].scene and - region_data.scene == data_per_region[target].scene) - then - local section = string.format("@%s -> %s/Capture", region, target) - local section_object = get_object(section) - if section_object then - target_data.section_object = section_object - else - print("error! section not found:", section) - end - end - end - end -end - function get_capture_per_section(section_object) if section_object then local capture = section_object.CapturedItem @@ -39,7 +19,7 @@ function update_region_captures() target_data.capture = get_capture_per_section(target_data.section_object) if target_data.capture and special_regions[target_data.capture] and region_data.scene ~= "Root" then special_regions[target_data.capture].origin = region - if er_debugging then + if ER_DEBUGGING then print("special:", target_data.capture, "at", region) end end diff --git a/ootrando_overworldmap_hamsda/scripts/update_items.lua b/ootrando_overworldmap_hamsda/scripts/update_items.lua new file mode 100644 index 0000000..6ee48c3 --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/update_items.lua @@ -0,0 +1,57 @@ +local dungeons_with_keys = { + "forest", + "fire", + "water", + "spirit", + "shadow", + "botw", + "gtg", + "gc" +} +local key_counts = { + vanilla = { + forest = 5, + fire = 8, + water = 6, + spirit = 5, + shadow = 5, + botw = 3, + gtg = 9, + gc = 2 + }, + mq = { + forest = 6, + fire = 5, + water = 2, + spirit = 7, + shadow = 6, + botw = 2, + gtg = 3, + gc = 3 + } +} +function update_keycounts() + for _, dungeon in ipairs(dungeons_with_keys) do + local key_object = get_object(dungeon .. "_small_keys") + if key_object then + if has(dungeon .. "_reg") then + key_object.MaxCount = key_counts["vanilla"][dungeon] + elseif has(dungeon .. "_mq") then + key_object.MaxCount = key_counts["mq"][dungeon] + else + key_object.MaxCount = math.max(key_counts["vanilla"][dungeon], key_counts["mq"][dungeon]) + end + if not HAS_KEYS then + key_object.AcquiredCount = key_object.MaxCount + local bk = get_object(dungeon .. "_boss_key") + if bk then + bk.Active = true + end + end + end + end +end + +function update_items() + update_keycounts() +end diff --git a/ootrando_overworldmap_hamsda/scripts/update_shared.lua b/ootrando_overworldmap_hamsda/scripts/update_maps.lua similarity index 71% rename from ootrando_overworldmap_hamsda/scripts/update_shared.lua rename to ootrando_overworldmap_hamsda/scripts/update_maps.lua index 32b1fce..848fa32 100644 --- a/ootrando_overworldmap_hamsda/scripts/update_shared.lua +++ b/ootrando_overworldmap_hamsda/scripts/update_maps.lua @@ -1,58 +1,4 @@ -dungeons_with_keys = { - "forest", - "fire", - "water", - "spirit", - "shadow", - "botw", - "gtg", - "gc" -} -key_counts = { - vanilla = { - forest = 5, - fire = 8, - water = 6, - spirit = 5, - shadow = 5, - botw = 3, - gtg = 9, - gc = 2 - }, - mq = { - forest = 6, - fire = 5, - water = 2, - spirit = 7, - shadow = 6, - botw = 2, - gtg = 3, - gc = 3 - } -} -function update_keycounts() - for _, dungeon in ipairs(dungeons_with_keys) do - local key_object = get_object(dungeon .. "_small_keys") - if key_object then - if has(dungeon .. "_reg") then - key_object.MaxCount = key_counts["vanilla"][dungeon] - elseif has(dungeon .. "_mq") then - key_object.MaxCount = key_counts["mq"][dungeon] - else - key_object.MaxCount = math.max(key_counts["vanilla"][dungeon], key_counts["mq"][dungeon]) - end - if not is_keys then - key_object.AcquiredCount = key_object.MaxCount - local bk = get_object(dungeon .. "_boss_key") - if bk then - bk.Active = true - end - end - end - end -end - -max_amount_per_bridge_stage = {0, 0, 3, 6, 9, 100} +local max_amount_per_bridge_stage = {0, 0, 3, 6, 9, 100} function update_bridge_amount_max() local setting_bridge = get_object("setting_bridge") local setting_bridge_amount = get_object("setting_bridge_amount") @@ -61,7 +7,7 @@ function update_bridge_amount_max() end end -max_amount_per_lacs_stage = {0, 3, 6, 9, 100} +local max_amount_per_lacs_stage = {0, 3, 6, 9, 100} function update_lacs_amount_max() local setting_lacs = get_object("setting_lacs") local setting_lacs_amount = get_object("setting_lacs_amount") @@ -87,7 +33,7 @@ function update_fortress() elseif setting_normal then item_gf_keys.MaxCount = 4 end - if not is_keys then + if not HAS_KEYS then item_gf_keys.AcquiredCount = item_gf_keys.MaxCount end end @@ -126,7 +72,7 @@ function get_adult_trade() end return nil end -capture_mappings = { +local capture_mappings = { ["capture_bottle"] = { 1, get_first_free_bottle @@ -246,16 +192,14 @@ function update_collected_capture() end function update_minimal_bottle() - if has_map then - local minimal_bottle = get_object("bottleminimal") - if minimal_bottle then - if has("ruto") then - minimal_bottle.CurrentStage = 2 - elseif has("bottle") then - minimal_bottle.CurrentStage = 1 - else - minimal_bottle.CurrentStage = 0 - end + local minimal_bottle = get_object("bottleminimal") + if minimal_bottle then + if has("ruto") then + minimal_bottle.CurrentStage = 2 + elseif has("bottle") then + minimal_bottle.CurrentStage = 1 + else + minimal_bottle.CurrentStage = 0 end end end @@ -268,7 +212,7 @@ function update_free_zelda() end end -vanilla_captures = { +local vanilla_captures = { ["setting_shuffle_sword1_yes"] = { ["@KF Kokiri Sword Chest/Dodge Boulder"] = "sword1" }, @@ -306,32 +250,12 @@ function update_vanilla_captures() end end -loading_save_file = false -function tracker_on_begin_loading_save_file() - loading_save_file = true -end - -function tracker_on_finish_loading_save_file() - loading_save_file = false -end - -function tracker_on_accessibility_updated() - if not loading_save_file then - clear_amount_cache() - - update_keycounts() - update_bridge_amount_max() - update_lacs_amount_max() - update_fortress() - update_collected_capture() - update_minimal_bottle() - update_free_zelda() - update_vanilla_captures() - - update_version_specific() - - apply_queued_changes() - - get_object("dummy").Active = not get_object("dummy").Active - end +function update_maps() + update_bridge_amount_max() + update_lacs_amount_max() + update_fortress() + update_collected_capture() + update_minimal_bottle() + update_free_zelda() + update_vanilla_captures() end diff --git a/ootrando_overworldmap_hamsda/scripts/user_settings.lua b/ootrando_overworldmap_hamsda/scripts/user_settings.lua new file mode 100644 index 0000000..71e1a2a --- /dev/null +++ b/ootrando_overworldmap_hamsda/scripts/user_settings.lua @@ -0,0 +1,2 @@ +USE_SONG_CHECKMARK_ONLY = false +ER_DEBUGGING = false diff --git a/repository.json b/repository.json index f73e0f4..df699ae 100644 --- a/repository.json +++ b/repository.json @@ -10,7 +10,7 @@ "pins", "chathud" ], - "version": "3.4.4.0", + "version": "3.5.0.0", "uid": "ootrando_overworldmap_hamsda", "link": "https://hamsda.github.io/EmoTrackerPacks/ootrando_overworldmap_hamsda.zip", "documentation_url": "https://github.com/Hamsda/EmoTrackerPacks/blob/master/ootrando_overworldmap_hamsda/README.md",