Skip to content

Commit

Permalink
Merge branch 'tcg-keys' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
coavins committed Dec 2, 2023
2 parents e852142 + f14e741 commit 4d93343
Show file tree
Hide file tree
Showing 16 changed files with 209 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ootrando_overworldmap_hamsda/SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,13 @@ This setting determines if Thieves' Hideout Keys are shuffled (non keys variants
- ![Thieves' Hideout Keys not shuffled](images/setting_shuffle_hideoutkeys_no.png "Thieves' Hideout Keys not shuffled") Thieves' Hideout Keys are not shuffled and will always be considered at their maximum.
- ![Thieves' Hideout Keys shuffled](images/setting_shuffle_hideoutkeys_yes.png "Thieves' Hideout Keys shuffled") Thieves' Hideout Keys are shuffled and need to be tracked by the user.

### Shuffle Treasure Chest Game Keys

This setting determines if the keys for the treasure chest game in the market are shuffled (non keys variants will force this off).

* ![Treasure Chest Game Keys not shuffled](images/setting_shuffle_tcgkeys_no.png "Treasure Chest Game Keys not shuffled") Treasure Chest Game Keys are not shuffled and will always be available.
* ![Treasure Chest Game Keys shuffled](images/setting_shuffle_tcgkeys_yes.png "Treasure Chest Game Keys shuffled") Treasure Chest Game Keys are shuffled and need to be tracked by the user.

### Shuffle Boss Keys

This setting determines if Boss Keys are shuffled (non keys variants will force this off).
Expand Down
Binary file added ootrando_overworldmap_hamsda/images/label_tcg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions ootrando_overworldmap_hamsda/items/capture_items.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
"img_mods": "overlay|images/overlay_keys_gtg.png",
"codes": "capture_gtg_small_keys"
},
{
"name": "Treasure Chest Game Keys",
"type": "toggle",
"img": "images/small_key.png",
"img_mods": "overlay|images/overlay_keys_tcg.png",
"codes": "capture_tcg_small_keys"
},
{
"name": "Ganons Castle Small Keys",
"type": "toggle",
Expand Down
13 changes: 13 additions & 0 deletions ootrando_overworldmap_hamsda/items/dungeons.json
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,19 @@
"codes": "th_small_keys,thsmall,thsk",
"max_quantity": 99
},
{
"name": "Treasure Chest Game Label",
"type": "static",
"img": "images/label_tcg.png",
"codes": "tcg_label"
},
{
"name": "Treasure Chest Game Keys",
"type": "consumable",
"img": "images/small_key.png",
"codes": "tcg_small_keys,tcgsmall,tcgsk",
"max_quantity": 6
},
{
"name": "Gerudo Training Ground Label",
"type": "progressive",
Expand Down
18 changes: 18 additions & 0 deletions ootrando_overworldmap_hamsda/items/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,24 @@
}
]
},
{
"name": "Shuffle Treasure Chest Game Keys",
"type": "progressive",
"allow_disabled": false,
"loop": true,
"stages": [
{
"img": "images/setting_shuffle_tcgkeys_no.png",
"img_mods": "@disabled",
"codes": "setting_shuffle_tcgkeys,setting_shuffle_tcgkeys_no"
},
{
"img": "images/setting_shuffle_tcgkeys_yes.png",
"codes": "setting_shuffle_tcgkeys,setting_shuffle_tcgkeys_yes",
"inherit_codes": false
}
]
},
{
"name": "Shuffle Boss Keys",
"type": "progressive",
Expand Down
2 changes: 1 addition & 1 deletion ootrando_overworldmap_hamsda/layouts/capture_items.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"capture_spirit_boss_key",
"capture_shadow_boss_key",
"capture_gc_boss_key",
"",
"capture_tcg_small_keys",
"",
""
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,30 @@
"height": 16
}
]
},
{
"type": "canvas",
"width": 32,
"height": 32,
"margin": "1,2",
"content": [
{
"type": "item",
"item": "tcg_label",
"canvas_depth": 1,
"width": 32,
"height": 12
},
{
"type": "item",
"item": "tcg_small_keys",
"canvas_depth": 1,
"canvas_left": 0,
"canvas_top": 16,
"width": 16,
"height": 16
}
]
}
]
},
Expand Down Expand Up @@ -835,7 +859,38 @@
]
}
]
},
{
"type": "array",
"orientation": "horizontal",
"margin": "5,0",
"content": [
{
"type": "canvas",
"width": 66,
"height": 16,
"margin": "1,2",
"content": [
{
"type": "item",
"item": "tcg_label",
"canvas_depth": 1,
"width": 32,
"height": 12
},
{
"type": "item",
"item": "tcg_small_keys",
"canvas_depth": 1,
"canvas_left": 34,
"canvas_top": 0,
"width": 16,
"height": 16
}
]
}
]
}
]
}
}
}
6 changes: 6 additions & 0 deletions ootrando_overworldmap_hamsda/layouts/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@
"width": 200,
"height": 16
},
{
"type": "item",
"item": "setting_shuffle_tcgkeys",
"width": 200,
"height": 16
},
{
"type": "item",
"item": "setting_shuffle_bosskeys",
Expand Down
68 changes: 67 additions & 1 deletion ootrando_overworldmap_hamsda/locations/overworld.json
Original file line number Diff line number Diff line change
Expand Up @@ -3541,7 +3541,7 @@
"name": "Market Treasure Chest Game Reward",
"short_name": "Reward",
"access_rules": [
"$has_age|child,[$can_use_lens]",
"$has_age|child,tcg_small_keys:5,[$can_use_lens]",
"{$hintable}"
],
"capture_item": true,
Expand All @@ -3551,6 +3551,72 @@
"map_locations": [
{
"map": "child",
"force_invisibility_rules": [
"setting_shuffle_tcgkeys_yes"
],
"x": 1425,
"y": 365
}
]
},
{
"name": "Market Treasure Chest Game",
"sections": [
{
"name": "Market Treasure Chest Room 1",
"short_name": "Room 1",
"access_rules": [
"$has_age|child,tcg_small_keys:1"
],
"item_count": 2
},
{
"name": "Market Treasure Chest Room 2",
"short_name": "Room 2",
"access_rules": [
"$has_age|child,tcg_small_keys:2"
],
"item_count": 2
},
{
"name": "Market Treasure Chest Room 3",
"short_name": "Room 3",
"access_rules": [
"$has_age|child,tcg_small_keys:3"
],
"item_count": 2
},
{
"name": "Market Treasure Chest Room 4",
"short_name": "Room 4",
"access_rules": [
"$has_age|child,tcg_small_keys:4"
],
"item_count": 2
},
{
"name": "Market Treasure Chest Room 5",
"short_name": "Room 5",
"access_rules": [
"$has_age|child,tcg_small_keys:5"
],
"item_count": 2
},
{
"name": "Market Treasure Chest Room 6",
"short_name": "Room 6",
"access_rules": [
"$has_age|child,tcg_small_keys:6"
],
"item_count": 2
}
],
"map_locations": [
{
"map": "child",
"force_invisibility_rules": [
"setting_shuffle_tcgkeys_no"
],
"x": 1425,
"y": 365
}
Expand Down
2 changes: 2 additions & 0 deletions ootrando_overworldmap_hamsda/scripts/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ ScriptHost:LoadScript("scripts/autotracking/auto_events.lua")
ScriptHost:LoadScript("scripts/autotracking/auto_skulltulas.lua")
ScriptHost:LoadScript("scripts/autotracking/auto_globals.lua")
ScriptHost:LoadScript("scripts/autotracking/autotracking.lua")

update_items()
22 changes: 22 additions & 0 deletions ootrando_overworldmap_hamsda/scripts/update_items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local fix_non_map_hideout = true
local keys_settings = {
["setting_shuffle_smallkeys"] = 0,
["setting_shuffle_hideoutkeys"] = 0,
["setting_shuffle_tcgkeys"] = 0,
["setting_shuffle_bosskeys"] = 0,
["setting_shuffle_ganon_bosskey"] = 0
}
Expand Down Expand Up @@ -79,6 +80,7 @@ end

local stored_keycounts = {}
local stored_hideout = nil
local stored_tcg = nil
local stored_bks = {}
local stored_ganon = nil
function update_shuffled_keys()
Expand Down Expand Up @@ -120,6 +122,26 @@ function update_shuffled_keys()
end
end

if has("setting_shuffle_tcgkeys_no") then
local key_object = get_object("tcg_small_keys")
if key_object then
if stored_tcg == nil then
-- Save key count in cache
stored_tcg = key_object.AcquiredCount
end
key_object.AcquiredCount = key_object.MaxCount
end
elseif has("setting_shuffle_tcgkeys_yes") then
if stored_tcg ~= nil then
-- Restore key count from cache
local key_object = get_object("tcg_small_keys")
if key_object then
key_object.AcquiredCount = stored_tcg
end
stored_tcg = nil
end
end

if has("setting_shuffle_bosskeys_no") then
for dungeon, stored_active in pairs(dungeons_with_boss_keys) do
local key_object = get_object(dungeon .. "_boss_key")
Expand Down
4 changes: 4 additions & 0 deletions ootrando_overworldmap_hamsda/scripts/update_maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ local capture_mappings = {
collect_key,
"th_small_keys"
},
["capture_tcg_small_keys"] = {
collect_key,
"tcg_small_keys"
},
["capture_gtg_small_keys"] = {
collect_key,
"gtg_small_keys"
Expand Down
6 changes: 6 additions & 0 deletions ootrando_overworldmap_hamsda/scripts/user_presets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ setting_presets = {
["setting_shuffle_notes"] = 0,
["setting_shuffle_smallkeys"] = 0,
["setting_shuffle_hideoutkeys"] = 0,
["setting_shuffle_tcgkeys"] = 0,
["setting_shuffle_bosskeys"] = 0,
["setting_shuffle_ganon_bosskey"] = 0,
["setting_zelda"] = 0,
Expand Down Expand Up @@ -112,6 +113,7 @@ setting_presets = {
["setting_shuffle_notes"] = 0,
["setting_shuffle_smallkeys"] = 0,
["setting_shuffle_hideoutkeys"] = 0,
["setting_shuffle_tcgkeys"] = 0,
["setting_shuffle_bosskeys"] = 0,
["setting_shuffle_ganon_bosskey"] = 0,
["setting_zelda"] = 1,
Expand Down Expand Up @@ -189,6 +191,7 @@ setting_presets = {
["setting_shuffle_notes"] = 0,
["setting_shuffle_smallkeys"] = 0,
["setting_shuffle_hideoutkeys"] = 0,
["setting_shuffle_tcgkeys"] = 0,
["setting_shuffle_bosskeys"] = 0,
["setting_shuffle_ganon_bosskey"] = 0,
["setting_zelda"] = 1,
Expand Down Expand Up @@ -268,6 +271,7 @@ setting_presets = {
["setting_shuffle_notes"] = 0,
["setting_shuffle_smallkeys"] = 1,
["setting_shuffle_hideoutkeys"] = 1,
["setting_shuffle_tcgkeys"] = 0,
["setting_shuffle_bosskeys"] = 1,
["setting_shuffle_ganon_bosskey"] = 1,
["setting_zelda"] = 0,
Expand Down Expand Up @@ -352,6 +356,7 @@ setting_presets = {
["setting_shuffle_notes"] = 0,
["setting_shuffle_smallkeys"] = 0,
["setting_shuffle_hideoutkeys"] = 0,
["setting_shuffle_tcgkeys"] = 0,
["setting_shuffle_bosskeys"] = 0,
["setting_shuffle_ganon_bosskey"] = 0,
["setting_zelda"] = 1,
Expand Down Expand Up @@ -431,6 +436,7 @@ setting_presets = {
["setting_shuffle_notes"] = 0,
["setting_shuffle_smallkeys"] = 0,
["setting_shuffle_hideoutkeys"] = 0,
["setting_shuffle_tcgkeys"] = 0,
["setting_shuffle_bosskeys"] = 0,
["setting_shuffle_ganon_bosskey"] = 0,
["setting_zelda"] = 1,
Expand Down

0 comments on commit 4d93343

Please sign in to comment.