Skip to content

Commit

Permalink
Changes for RSL Season 5
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkirby committed Jul 27, 2022
1 parent c27f780 commit df75e63
Show file tree
Hide file tree
Showing 5 changed files with 687 additions and 11 deletions.
4 changes: 2 additions & 2 deletions RandomSettingsGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
LOG_ERRORS = True

# Please set the weights file you with to load
WEIGHTS = "RSL" # The default Random Settings League Season 4 weights
WEIGHTS = "RSL" # The default Random Settings League Season 5 weights
# Every setting with even weights
# WEIGHTS = "full-random"
# Provide your own weights file. If the specified file does not exist, this will create it
Expand Down Expand Up @@ -89,7 +89,7 @@ def main():

# If we only want to check for new/changed settings
if check_new_settings:
_, _, rslweights = rs.load_weights_file("rsl_season4.json")
_, _, rslweights = rs.load_weights_file("rsl_season5.json")
tools.check_for_setting_changes(rslweights, rs.generate_balanced_weights(None))
return

Expand Down
23 changes: 17 additions & 6 deletions conditionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ def dynamic_skulltula_wincon(random_settings, **kwargs):


def dynamic_heart_wincon(random_settings, **kwargs):
""" Rolls skull win condition seperately. Takes extra inputs [weight of skull win con, "bridge%/gbk%/both"] """
chance_of_skull_wincon = int(kwargs['cparams'][0])
""" Rolls heart win condition seperately. Takes extra inputs [weight of skheartull win con, "bridge%/gbk%/both"] """
chance_of_heart_wincon = int(kwargs['cparams'][0])
weights = [int(x) for x in kwargs['cparams'][1].split('/')]

# Roll for a skull win condition
skull_wincon = random.choices([True, False], weights=[chance_of_skull_wincon, 100-chance_of_skull_wincon])[0]
if not skull_wincon:
# Roll for a heart win condition
heart_wincon = random.choices([True, False], weights=[chance_of_heart_wincon, 100-chance_of_heart_wincon])[0]
if not heart_wincon:
return

# Roll for bridge/bosskey/both
Expand Down Expand Up @@ -132,4 +132,15 @@ def shuffle_goal_hints(random_settings, **kwargs):
woth = {**distroin['distribution']['woth']}
distroin['distribution']['woth'] = distroin['distribution']['goal']
distroin['distribution']['goal'] = woth
random_settings['hint_dist_user'] = distroin
random_settings['hint_dist_user'] = distroin


def replace_dampe_diary_hint_with_lightarrow(random_settings, **kwargs):
""" Replace the dampe diary hint with a Light Arrow hint """
current_distro = random_settings['hint_dist']

# Load the distro and change the misc hint
with open(os.path.join('randomizer', 'data', 'Hints', current_distro+'.json')) as fin:
distroin = json.load(fin)
distroin['misc_hint_items'] = { 'dampe_diary': "Light Arrows" }
random_settings['hint_dist_user'] = distroin
7 changes: 5 additions & 2 deletions roll_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import random
import conditionals as conds
from version import version_hash_1, version_hash_2
from version import version_hash_1, version_hash_2, __version__
sys.path.append("randomizer")
from randomizer.SettingsList import get_settings_from_tab, get_settings_from_section, get_setting_info
from randomizer.StartingItems import inventory, songs, equipment
Expand Down Expand Up @@ -146,7 +146,7 @@ def draw_dungeon_shortcuts(random_settings):
def generate_weights_override(weights, override_weights_fname):
# Load the weight dictionary
if weights == "RSL":
weight_options, weight_multiselect, weight_dict = load_weights_file("rsl_season4.json")
weight_options, weight_multiselect, weight_dict = load_weights_file("rsl_season5.json")
elif weights == "full-random":
weight_options = None
weight_dict = generate_balanced_weights(None)
Expand Down Expand Up @@ -267,6 +267,9 @@ def generate_plando(weights, override_weights_fname, no_seed):
# Remove conflicting "dead" settings since rando won't ignore them anymore
remove_redundant_settings(random_settings)

# Add the RSL Script version to the plando
random_settings['user_message'] = f'RSL Script v{__version__}'

# Save the output plando
output = {
"settings": random_settings,
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.3.0"
__version__ = "2.3.1"
version_hash_1 = "Map"
version_hash_2 = "Map"

Expand Down
Loading

0 comments on commit df75e63

Please sign in to comment.