Skip to content

Commit

Permalink
RoR2: Add Support for New Stage (ArchipelagoMW#3436)
Browse files Browse the repository at this point in the history
* add support for the new stage added to RoR2

* Fix stage being unreachable

* add option groups

* reorder option groups
  • Loading branch information
kindasneaki authored and wu4 committed Jun 6, 2024
1 parent 1df74a2 commit 1e67af4
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
6 changes: 4 additions & 2 deletions worlds/ror2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
environment_sotv_orderedstages_table, environment_sotv_table, collapse_dict_list_vertical, shift_by_offset

from BaseClasses import Item, ItemClassification, Tutorial
from .options import ItemWeights, ROR2Options
from .options import ItemWeights, ROR2Options, ror2_option_groups
from worlds.AutoWorld import World, WebWorld
from .regions import create_explore_regions, create_classic_regions
from typing import List, Dict, Any
Expand All @@ -23,6 +23,8 @@ class RiskOfWeb(WebWorld):
["Ijwu", "Kindasneaki"]
)]

option_groups = ror2_option_groups


class RiskOfRainWorld(World):
"""
Expand All @@ -44,7 +46,7 @@ class RiskOfRainWorld(World):
}
location_name_to_id = item_pickups

required_client_version = (0, 4, 5)
required_client_version = (0, 5, 0)
web = RiskOfWeb()
total_revivals: int

Expand Down
46 changes: 42 additions & 4 deletions worlds/ror2/options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from Options import Toggle, DefaultOnToggle, DeathLink, Range, Choice, PerGameCommonOptions
from Options import Toggle, DefaultOnToggle, DeathLink, Range, Choice, PerGameCommonOptions, OptionGroup


# NOTE be aware that since the range of item ids that RoR2 uses is based off of the maximums of checks
Expand Down Expand Up @@ -350,7 +350,7 @@ class ItemPoolPresetToggle(Toggle):


class ItemWeights(Choice):
"""Set item_pool_presets to true if you want to use one of these presets.
"""Set Use Item Weight Presets to yes if you want to use one of these presets.
Preset choices for determining the weights of the item pool.
- New is a test for a potential adjustment to the default weights.
- Uncommon puts a large number of uncommon items in the pool.
Expand All @@ -375,6 +375,44 @@ class ItemWeights(Choice):
option_void = 9


ror2_option_groups = [
OptionGroup("Explore Mode Options", [
ChestsPerEnvironment,
ShrinesPerEnvironment,
ScavengersPerEnvironment,
ScannersPerEnvironment,
AltarsPerEnvironment,
RequireStages,
ProgressiveStages,
]),
OptionGroup("Classic Mode Options", [
TotalLocations,
], start_collapsed=True),
OptionGroup("Weighted Choices", [
ItemWeights,
ItemPoolPresetToggle,
WhiteScrap,
GreenScrap,
YellowScrap,
RedScrap,
CommonItem,
UncommonItem,
LegendaryItem,
BossItem,
LunarItem,
VoidItem,
Equipment,
Money,
LunarCoin,
Experience,
MountainTrap,
TimeWarpTrap,
CombatTrap,
TeleportTrap,
]),
]


@dataclass
class ROR2Options(PerGameCommonOptions):
goal: Goal
Expand All @@ -399,10 +437,10 @@ class ROR2Options(PerGameCommonOptions):
item_weights: ItemWeights
item_pool_presets: ItemPoolPresetToggle
# define the weights of the generated item pool.
white_scrap: WhiteScrap
green_scrap: GreenScrap
red_scrap: RedScrap
yellow_scrap: YellowScrap
white_scrap: WhiteScrap
red_scrap: RedScrap
common_item: CommonItem
uncommon_item: UncommonItem
legendary_item: LegendaryItem
Expand Down
4 changes: 3 additions & 1 deletion worlds/ror2/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ def create_explore_regions(ror2_world: "RiskOfRainWorld") -> None:
# Default Locations
non_dlc_regions: Dict[str, RoRRegionData] = {
"Menu": RoRRegionData(None, ["Distant Roost", "Distant Roost (2)",
"Titanic Plains", "Titanic Plains (2)"]),
"Titanic Plains", "Titanic Plains (2)",
"Verdant Falls"]),
"Distant Roost": RoRRegionData([], ["OrderedStage_1"]),
"Distant Roost (2)": RoRRegionData([], ["OrderedStage_1"]),
"Titanic Plains": RoRRegionData([], ["OrderedStage_1"]),
"Titanic Plains (2)": RoRRegionData([], ["OrderedStage_1"]),
"Verdant Falls": RoRRegionData([], ["OrderedStage_1"]),
"Abandoned Aqueduct": RoRRegionData([], ["OrderedStage_2"]),
"Wetland Aspect": RoRRegionData([], ["OrderedStage_2"]),
"Rallypoint Delta": RoRRegionData([], ["OrderedStage_3"]),
Expand Down
1 change: 1 addition & 0 deletions worlds/ror2/ror2environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"Distant Roost (2)": 8, # blackbeach2
"Titanic Plains": 15, # golemplains
"Titanic Plains (2)": 16, # golemplains2
"Verdant Falls": 28, # lakes
}
environment_vanilla_orderedstage_2_table: Dict[str, int] = {
"Abandoned Aqueduct": 17, # goolake
Expand Down

0 comments on commit 1e67af4

Please sign in to comment.