Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions reframework/autorun/randomizer/Archipelago.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ function Archipelago.SlotDataHandler(slot_data)
Archipelago.death_link = slot_data.death_link
end

Lookups.Load(slot_data.character, slot_data.scenario, string.lower(slot_data.difficulty))
Lookups.Load(string.lower(slot_data.difficulty))
Storage.Load()

GUI.AddTexts({
{ message='AP Scenario: ' },
{ message=Lookups.character:gsub("^%l", string.upper) .. ' ' .. string.upper(Lookups.scenario) .. ' ' .. string.upper(Lookups.difficulty), color="green" }
{ message=string.upper(Lookups.difficulty), color="green" }
})

for t, typewriter_name in pairs(slot_data.unlocked_typewriters) do
Expand Down Expand Up @@ -645,10 +645,10 @@ function Archipelago._GetLocationFromLocationData(location_data, include_sent_lo

local translated_location = {}
local scenario_suffixes = {
standard = " (" .. string.upper(string.sub(Lookups.character, 1, 1) .. Lookups.scenario) .. ")",
hardcore = " (" .. string.upper(string.sub(Lookups.character, 1, 1) .. Lookups.scenario) .. "H)",
nightmare = " (" .. string.upper(string.sub(Lookups.character, 1, 1) .. Lookups.scenario) .. "N)",
inferno = " (" .. string.upper(string.sub(Lookups.character, 1, 1) .. Lookups.scenario) .. "I)"
standard = "",
hardcore = " (" .. "H)",
nightmare = " (" .. "N)",
inferno = " (" .. "I)"
}

if location_data['id'] and not location_data['name'] then
Expand Down
25 changes: 8 additions & 17 deletions reframework/autorun/randomizer/Lookups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,24 @@ Lookups.items = {}
Lookups.all_items = {}
Lookups.locations = {}
Lookups.typewriters = {}
Lookups.character = nil
Lookups.scenario = nil
Lookups.difficulty = nil

function Lookups.Load(character, scenario, difficulty)
function Lookups.Load(difficulty)
-- If this was already loaded and not cleared, don't load again
if #Lookups.items > 0 and #Lookups.locations > 0 then
return
end

Lookups.character = character
Lookups.scenario = scenario
Lookups.difficulty = difficulty

character = string.lower(character)
scenario = string.lower(scenario)
local item_file = Lookups.filepath .. "/items.json"
local location_file = Lookups.filepath .. "/locations.json"
local location_hardcore_file = Lookups.filepath .. "/locations_hardcore.json"
local location_nightmare_file = Lookups.filepath .. "/locations_nightmare.json"
local location_inferno_file = Lookups.filepath .. "/locations_inferno.json"
local typewriter_file = Lookups.filepath .. "/typewriters.json"

local jill_file = Lookups.filepath .. "/jill/items.json"
local location_file = Lookups.filepath .. character .. "/" .. scenario .. "/locations.json"
local location_hardcore_file = Lookups.filepath .. character .. "/" .. scenario .. "/locations_hardcore.json"
local location_nightmare_file = Lookups.filepath .. character .. "/" .. scenario .. "/locations_nightmare.json"
local location_inferno_file = Lookups.filepath .. character .. "/" .. scenario .. "/locations_inferno.json"
local typewriter_file = Lookups.filepath .. character .. "/" .. scenario .. "/typewriters.json"

Lookups.items = json.load_file(jill_file) or {}
Lookups.items = json.load_file(item_file) or {}
Lookups.locations = json.load_file(location_file) or {}
Lookups.typewriters = json.load_file(typewriter_file) or {}

Expand Down Expand Up @@ -70,8 +63,6 @@ function Lookups.Reset()
Lookups.items = {}
Lookups.locations = {}
Lookups.typewriters = {}
Lookups.character = nil
Lookups.scenario = nil
Lookups.difficulty = nil
end

Expand Down
7 changes: 3 additions & 4 deletions reframework/autorun/randomizer/Tools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ function Tools.ShowGUI()
local deathlink_color = AP_REF.HexToImguiColor('FFFFFF')

-- if the lookups contain data, then we're connected, so do everything that needs connection
if Lookups.character and Lookups.scenario then
scenario_text = " " .. Lookups.character:gsub("^%l", string.upper) .. " " .. string.upper(Lookups.scenario) ..
" - " .. Lookups.difficulty:gsub("^%l", string.upper)
if Lookups.difficulty then
scenario_text = " " .. " - " .. Lookups.difficulty:gsub("^%l", string.upper)

if Archipelago.death_link then
deathlink_text = " On"
Expand Down Expand Up @@ -56,7 +55,7 @@ function Tools.ShowGUI()
imgui.text(" - Various Fixes")
imgui.new_line()

if Lookups.character and Lookups.scenario then
if Lookups.difficulty then
imgui.text_colored("Missing Items?", -10825765)
imgui.text("If you were sent items at the ")
imgui.text("start and didn't receive them,")
Expand Down
5 changes: 2 additions & 3 deletions reframework/autorun/randomizer/Typewriters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Typewriters.AddUnlockedText(name, item_name, no_save_warning)
end

if #typewriterText > 0 then
if typewriterText == "RPD - Lobby" and string.lower(Lookups.scenario) == "a" and not Storage.talkedToMarvin then
if typewriterText == "RPD - Lobby" and not Storage.talkedToMarvin then -- Marvin exist in RE3R ??
GUI.AddText("Lobby Typewriter will unlock after you talk to Marvin for the first time.")
else
GUI.AddTexts({
Expand Down Expand Up @@ -91,7 +91,7 @@ function Typewriters.DisplayWarpMenu()
for t, typewriter in pairs(Lookups.typewriters) do
local typewriter_disabled = false

if typewriter["name"] == "RPD - Lobby" and string.lower(Lookups.scenario) == "a" and not Storage.talkedToMarvin then
if typewriter["name"] == "RPD - Lobby" and not Storage.talkedToMarvin then -- Marvin exist in RE3R ??
typewriter_disabled = true
end

Expand Down Expand Up @@ -134,7 +134,6 @@ function Typewriters.DisplayWarpMenu()
Typewriters.UnlockAll()
end

-- Warping while Ada and triggering any cutscenes breaks the game

imgui.pop_font()
imgui.end_window()
Expand Down
Loading