mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
RoR2: code cleanup and styling consistency (#833)
* build locations dict dynamically from the TotalLocations option. Minor styling cleanup * Minor items styling cleanup. remove unused event items * minor options cleanup. clarify preset toggle slightly better * make items.py more readable. add chaos weights dict to use as reference point for generation * small rules styling and consistency cleanup * create less regions and other init cleanup * move region creation to less function calls and move revivals calculation * typing * use enum instead of hardcoded ints. fix bug i introduced * better typing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import typing
|
||||
from typing import Dict
|
||||
from Options import Option, DefaultOnToggle, Range, Choice
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ class AllowLunarItems(DefaultOnToggle):
|
||||
class StartWithRevive(DefaultOnToggle):
|
||||
"""Start the game with a `Dio's Best Friend` item."""
|
||||
display_name = "Start with a Revive"
|
||||
|
||||
|
||||
|
||||
class FinalStageDeath(DefaultOnToggle):
|
||||
"""Death on the final boss stage counts as a win."""
|
||||
display_name = "Final Stage Death is Win"
|
||||
@@ -124,7 +125,7 @@ class Equipment(Range):
|
||||
|
||||
class ItemPoolPresetToggle(DefaultOnToggle):
|
||||
"""Will use the item weight presets when set to true, otherwise will use the custom set item pool weights."""
|
||||
display_name = "Item Weight Presets"
|
||||
display_name = "Use Item Weight Presets"
|
||||
|
||||
|
||||
class ItemWeights(Choice):
|
||||
@@ -150,7 +151,7 @@ class ItemWeights(Choice):
|
||||
|
||||
|
||||
# define a dictionary for the weights of the generated item pool.
|
||||
ror2_weights: typing.Dict[str, type(Option)] = {
|
||||
ror2_weights: Dict[str, type(Option)] = {
|
||||
"green_scrap": GreenScrap,
|
||||
"red_scrap": RedScrap,
|
||||
"yellow_scrap": YellowScrap,
|
||||
@@ -163,7 +164,7 @@ ror2_weights: typing.Dict[str, type(Option)] = {
|
||||
"equipment": Equipment
|
||||
}
|
||||
|
||||
ror2_options: typing.Dict[str, type(Option)] = {
|
||||
ror2_options: Dict[str, type(Option)] = {
|
||||
"total_locations": TotalLocations,
|
||||
"total_revivals": TotalRevivals,
|
||||
"start_with_revive": StartWithRevive,
|
||||
|
||||
Reference in New Issue
Block a user