Changed advancement_goal to a Range option

This commit is contained in:
espeon65536 2021-06-08 08:58:16 -05:00
parent 622f8f8158
commit 6e33181f05
4 changed files with 11 additions and 18 deletions

View File

@ -386,11 +386,10 @@ factorio_options: typing.Dict[str, type(Option)] = {"max_science_pack": MaxScien
"recipe_time": RecipeTime}
class AdvancementGoal(Choice):
option_few = 0
option_normal = 1
option_many = 2
default = 1
class AdvancementGoal(Range):
range_start = 0
range_end = 87
default = 30
class CombatDifficulty(Choice):

View File

@ -92,10 +92,7 @@ starting_items:
burner-mining-drill: 19
stone-furnace: 19
# Minecraft options:
advancement_goal: # Number of advancements required (out of 92 total) to spawn the Ender Dragon and complete the game.
few: 0 # 30 advancements
normal: 1 # 50
many: 0 # 70
advancement_goal: 50 # Number of advancements required to spawn the Ender Dragon and complete the game (currently 87 max)
combat_difficulty: # Modifies the level of items logically required for exploring dangerous areas and fighting bosses.
easy: 0
normal: 1
@ -109,7 +106,7 @@ include_insane_advancements: # Junk-fills extremely difficult advancements; this
include_postgame_advancements: # Some advancements require defeating the Ender Dragon; this will junk-fill them so you won't have to finish to send some items.
on: 0
off: 1
shuffle_structures: # CURRENTLY DISABLED; enables shuffling of villages, outposts, fortresses, bastions, and end cities.
shuffle_structures: # Enables shuffling of villages, outposts, fortresses, bastions, and end cities.
on: 0
off: 1
# A Link to the Past options:

View File

@ -31,7 +31,7 @@ class TestMinecraft(TestBase):
exclusion_pools = ['hard', 'insane', 'postgame']
for pool in exclusion_pools:
setattr(self.world, f"include_{pool}_advancements", [False, False])
setattr(self.world, "advancement_goal", [0, Options.AdvancementGoal(value=0)])
setattr(self.world, "advancement_goal", [0, Options.AdvancementGoal(value=30)])
setattr(self.world, "shuffle_structures", [False, False])
setattr(self.world, "combat_difficulty", [0, Options.CombatDifficulty(value=1)])
minecraft_create_regions(self.world, 1)

View File

@ -15,13 +15,10 @@ def set_rules(world: MultiWorld, player: int):
(location.name not in postgame_advancements) and
location.can_reach(state)]
# 92 total advancements, 16 are typically excluded, 1 is Free the End. Goal is to complete X advancements and then Free the End.
goal_map = {
'few': 30,
'normal': 50,
'many': 70
}
goal = goal_map[getattr(world, 'advancement_goal')[player].get_option_name()]
# 92 total advancements. Goal is to complete X advancements and then Free the End.
# There are 5 advancements which cannot be included for dragon spawning (4 postgame, Free the End)
# Hence the true maximum is (92 - 5) = 87
goal = int(world.advancement_goal[player].value)
can_complete = lambda state: len(reachable_locations(state)) >= goal and state.can_reach('The End', 'Region', player) and state.can_kill_ender_dragon(player)
if world.logic[player] != 'nologic':