From be6576253203529e936a47f56fd27a4b43b82a79 Mon Sep 17 00:00:00 2001 From: spinerak Date: Thu, 6 Jun 2024 16:26:33 +0200 Subject: [PATCH] Version 2.0.3 manual input option max score in logic always 2.0.3 faster gen --- worlds/yachtdice/Options.py | 16 +++++++++++++++- worlds/yachtdice/Rules.py | 3 ++- worlds/yachtdice/__init__.py | 7 ++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/worlds/yachtdice/Options.py b/worlds/yachtdice/Options.py index 87159ae56d..d1ef8cd738 100644 --- a/worlds/yachtdice/Options.py +++ b/worlds/yachtdice/Options.py @@ -229,6 +229,18 @@ class whichStory(Choice): option_random_story = -1 default = -1 +class allowManual(Choice): + """ + Yacht Dice allows players to roll IRL dice. + By sending "manual" in the chat, a input field appears where you can type your dice rolls. + Of course we cannot check anymore if the player is playing fair. + Do you want to allow manual input of rolls? + """ + display_name = "Allow manual inputs" + option_yes_allow = 1 + option_no_dont_allow = 2 + default = 1 + @dataclass class YachtDiceOptions(PerGameCommonOptions): game_difficulty: gameDifficulty @@ -253,4 +265,6 @@ class YachtDiceOptions(PerGameCommonOptions): minimize_extra_items: minimizeExtraItems add_bonus_points: addExtraPoints add_story_chapters: addStoryChapters - which_story: whichStory \ No newline at end of file + which_story: whichStory + + allow_manual_input: allowManual \ No newline at end of file diff --git a/worlds/yachtdice/Rules.py b/worlds/yachtdice/Rules.py index 42f83afc4b..fbd7db26c0 100644 --- a/worlds/yachtdice/Rules.py +++ b/worlds/yachtdice/Rules.py @@ -197,7 +197,8 @@ def dice_simulation_strings(categories, num_dice, num_rolls, fixed_mult, step_mu total_dist = add_distributions(total_dist, dist) #save result into the cache, then return it - yachtdice_cache[tup] = math.floor(sum([percentile_distribution(total_dist, perc) for perc in perc_return]) / len(perc_return)) + outcome = sum([percentile_distribution(total_dist, perc) for perc in perc_return]) / len(perc_return) + yachtdice_cache[tup] = max(5, math.floor(outcome)) return yachtdice_cache[tup] # Returns the feasible score that one can reach with the current state, options and difficulty. diff --git a/worlds/yachtdice/__init__.py b/worlds/yachtdice/__init__.py index 0cb7d7fe52..f0dc86fc90 100644 --- a/worlds/yachtdice/__init__.py +++ b/worlds/yachtdice/__init__.py @@ -40,7 +40,7 @@ class YachtDiceWorld(World): item_name_groups = item_groups - ap_world_version = "2.0.2" + ap_world_version = "2.0.3" def _get_yachtdice_data(self): return { @@ -135,7 +135,7 @@ class YachtDiceWorld(World): already_items = len(self.itempool) + self.extra_plando_items #Yacht Dice needs extra filler items so it doesn't get stuck in generation. - if self.options.minimize_extra_items.value == 2: + if self.options.minimize_extra_items.value: extraPercentage = max(0.1, 0.8 - self.multiworld.players / 10) else: extraPercentage = 0.7 @@ -391,7 +391,8 @@ class YachtDiceWorld(World): "minimize_extra_items", "add_bonus_points", "add_story_chapters", - "which_story" + "which_story", + "allow_manual_input" ) slot_data = {**yacht_dice_data, **yacht_dice_options} #combine the two