Skip to content

Commit

Permalink
Randomize tinman's strength ring chest item
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Apr 17, 2018
1 parent 40272bb commit 91bb7f3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
3 changes: 3 additions & 0 deletions progressreqs/ooe_pickup_requirements.txt
Expand Up @@ -436,6 +436,9 @@ Rooms:
08-02-05:
room: mineraend
00 (Falcis):
08-02-06:
room: mineraend
01 (Strength Ring) (No progression): # Must kill Tin Man
08-02-07:
room: mineraend
02 (Glyph Sleeve):
Expand Down
9 changes: 7 additions & 2 deletions progressreqs/ooe_room_requirements.txt
Expand Up @@ -96,8 +96,9 @@ No glyph locations:
- 11-00-09_00
- 12-00-07_00
No progression locations:
- 00-06-1C_01
- 12-00-08_00
- 00-06-1C_01 # Generator puzzle from mechanical tower
- 08-02-06_01 # Tin Man summoned by the searchlights
- 12-00-08_00 # Falling block puzzle
Warp connections:
# none
World map exits:
Expand Down Expand Up @@ -1929,7 +1930,11 @@ Rooms:
e00-003:
08-02-06:
000-001:
000-e01: # Must kill Tin Man
001-000:
001-e01:
e01-000:
e01-001:
08-02-07:
000-e02:
e02-000:
Expand Down
25 changes: 24 additions & 1 deletion randomizers/pickup_randomizer.rb
Expand Up @@ -575,6 +575,9 @@ def place_non_progression_pickups
elsif ["dos", "por"].include?(GAME) && (checker.event_locations.include?(location) || checker.easter_egg_locations.include?(location))
# Event item
pickup_global_id = get_unplaced_non_progression_item()
elsif GAME == "ooe" && location == "08-02-06_01"
# Tin man's strength ring blue chest. Can't be a glyph.
pickup_global_id = get_unplaced_non_progression_item_that_can_be_an_arm_shifted_immediate()
elsif GAME == "dos" && checker.mirror_locations.include?(location)
# Soul candles shouldn't be placed in mirrors, as they will appear even outside the mirror.
pickup_global_id = get_unplaced_non_progression_item()
Expand Down Expand Up @@ -680,6 +683,14 @@ def filter_locations_valid_for_pickup(locations, pickup_global_id)
# Don't let events give you items in OoE.
locations -= checker.event_locations
end
if GAME == "ooe" && !ITEM_GLOBAL_ID_RANGE.include?(pickup_global_id)
# Glyphs/villagers can't be in the special blue chest spawned by the searchlights when you kill a Tin Man.
locations -= ["08-02-06_01"]
end
if GAME == "ooe" && (!pickup_global_id.is_a?(Integer) || !game.fs.check_integer_can_be_an_arm_shifted_immediate?(pickup_global_id))
# The pickup ID is a hardcoded arm shifted immediate for the special blue chest spawned by the searchlights when you kill a Tin Man.
locations -= ["08-02-06_01"]
end
if GAME == "ooe" && (0x6F..0x74).include?(pickup_global_id)
# Don't let relics be inside breakable walls in OoE.
# This is because they need to be inside a chest, and chests can't be hidden.
Expand Down Expand Up @@ -767,6 +778,12 @@ def get_unplaced_non_progression_item
return get_unplaced_non_progression_pickup(valid_ids: ITEM_GLOBAL_ID_RANGE.to_a)
end

def get_unplaced_non_progression_item_that_can_be_an_arm_shifted_immediate
valid_ids = ITEM_GLOBAL_ID_RANGE.to_a
valid_ids.select!{|item_id| game.fs.check_integer_can_be_an_arm_shifted_immediate?(item_id)}
return get_unplaced_non_progression_pickup(valid_ids: valid_ids)
end

def get_unplaced_non_progression_skill
return get_unplaced_non_progression_pickup(valid_ids: SKILL_GLOBAL_ID_RANGE.to_a)
end
Expand Down Expand Up @@ -821,7 +838,13 @@ def change_entity_location_to_pickup_global_id(location, pickup_global_id)
return
end

if RANDOMIZABLE_VILLAGER_NAMES.include?(pickup_global_id)
if GAME == "ooe" && location == "08-02-06_01" # Strength Ring blue chest spawned by the searchlights after you kill the Tin Man
if entity.var_a != 2
raise "Searchlights are not of type 2 (Tin Man spawn)"
end

game.fs.replace_arm_shifted_immediate_integer(0x022A194C, pickup_global_id+1)
elsif RANDOMIZABLE_VILLAGER_NAMES.include?(pickup_global_id)
# Villager

if GAME != "ooe"
Expand Down

0 comments on commit 91bb7f3

Please sign in to comment.