From 6837cd2917df56a6c5e09413aefb7c6f95a8181a Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Fri, 25 Jun 2021 12:43:59 -0500 Subject: [PATCH] Require the ability to respawn the dragon for all dragon-related advancements --- BaseClasses.py | 12 +++++++----- worlds/minecraft/Rules.py | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 59e16b44..9dfccb25 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -888,13 +888,15 @@ class CollectionState(object): return self.fortress_loot(player) and normal_kill def can_kill_ender_dragon(self, player: int): + # Since it is possible to kill the dragon without getting any of the advancements related to it, we need to require that it can be respawned. + respawn_dragon = self.can_reach('The Nether', 'Region', player) and self.has('Ingot Crafting', player) if self.combat_difficulty(player) == 'easy': - return self.has("Progressive Weapons", player, 3) and self.has("Progressive Armor", player, 2) and self.has('Archery', player) and \ - self.can_brew_potions(player) and self.can_enchant(player) + return respawn_dragon and self.has("Progressive Weapons", player, 3) and self.has("Progressive Armor", player, 2) and \ + self.has('Archery', player) and self.can_brew_potions(player) and self.can_enchant(player) if self.combat_difficulty(player) == 'hard': - return (self.has('Progressive Weapons', player, 2) and self.has('Progressive Armor', player)) or \ - (self.has('Progressive Weapons', player, 1) and self.has('Bed', player)) - return self.has('Progressive Weapons', player, 2) and self.has('Progressive Armor', player) and self.has('Archery', player) + return respawn_dragon and ((self.has('Progressive Weapons', player, 2) and self.has('Progressive Armor', player)) or \ + (self.has('Progressive Weapons', player, 1) and self.has('Bed', player))) + return respawn_dragon and self.has('Progressive Weapons', player, 2) and self.has('Progressive Armor', player) and self.has('Archery', player) def collect(self, item: Item, event: bool = False, location: Location = None) -> bool: diff --git a/worlds/minecraft/Rules.py b/worlds/minecraft/Rules.py index b1c4da8f..2051189d 100644 --- a/worlds/minecraft/Rules.py +++ b/worlds/minecraft/Rules.py @@ -41,7 +41,7 @@ def set_rules(world, player): set_rule(world.get_location("Very Very Frightening", player), lambda state: state.has("Channeling Book", player) and state.can_use_anvil(player) and state.can_enchant(player) and \ ((world.get_region('Village', player).entrances[0].parent_region.name != 'The End' and state.can_reach('Village', 'Region', player)) or state.can_reach('Zombie Doctor', 'Location', player))) # need villager into the overworld for lightning strike set_rule(world.get_location("Hot Stuff", player), lambda state: state.has("Bucket", player) and state.has_iron_ingots(player)) - set_rule(world.get_location("Free the End", player), lambda state: can_complete(state) and state.has('Ingot Crafting', player) and state.can_reach('The Nether', 'Region', player)) + set_rule(world.get_location("Free the End", player), lambda state: can_complete(state)) set_rule(world.get_location("A Furious Cocktail", player), lambda state: state.can_brew_potions(player) and state.has("Fishing Rod", player) and # Water Breathing state.can_reach('The Nether', 'Region', player) and # Regeneration, Fire Resistance, gold nuggets @@ -84,7 +84,7 @@ def set_rules(world, player): set_rule(world.get_location("Total Beelocation", player), lambda state: state.has("Silk Touch Book", player) and state.can_use_anvil(player) and state.can_enchant(player)) set_rule(world.get_location("Arbalistic", player), lambda state: state.craft_crossbow(player) and state.has("Piercing IV Book", player) and state.can_use_anvil(player) and state.can_enchant(player)) - set_rule(world.get_location("The End... Again...", player), lambda state: can_complete(state) and state.has("Ingot Crafting", player) and state.can_reach('The Nether', 'Region', player)) # furnace for glass, nether for ghast tears + set_rule(world.get_location("The End... Again...", player), lambda state: can_complete(state)) set_rule(world.get_location("Acquire Hardware", player), lambda state: state.has_iron_ingots(player)) set_rule(world.get_location("Not Quite \"Nine\" Lives", player), lambda state: state.can_piglin_trade(player) and state.has("Resource Blocks", player)) set_rule(world.get_location("Cover Me With Diamonds", player), lambda state: state.has("Progressive Armor", player, 2) and state.can_reach("Diamonds!", "Location", player))