Minecraft: dragon egg shards

This commit is contained in:
espeon65536 2021-08-06 17:18:28 -05:00 committed by Fabian Dill
parent b43e99fa20
commit 72acb5509a
5 changed files with 29 additions and 6 deletions

View File

@ -223,7 +223,17 @@ Factorio:
min_expansion_cooldown: 14400 # 1 to 60 min in ticks
max_expansion_cooldown: 216000 # 5 to 180 min in ticks
Minecraft:
advancement_goal: 50 # Number of advancements required (out of 92 total) to spawn the Ender Dragon and complete the game.
advancement_goal: 50 # Number of advancements required (87 max) to spawn the Ender Dragon and complete the game.
egg_shards_required: # Number of dragon egg shards to collect (30 max) before the Ender Dragon will spawn.
0: 1
5: 0
10: 0
20: 0
egg_shards_available: # Number of egg shards available in the pool (30 max).
0: 1
5: 0
10: 0
20: 0
combat_difficulty: # Modifies the level of items logically required for exploring dangerous areas and fighting bosses.
easy: 0
normal: 1

View File

@ -55,15 +55,16 @@ item_table = {
"Structure Compass (Bastion Remnant)": ItemData(45040, True),
"Structure Compass (End City)": ItemData(45041, True),
"Shulker Box": ItemData(45042, False),
"Dragon Egg Shard": ItemData(45043, True),
"Bee Trap (Minecraft)": ItemData(45100, False),
"Victory": ItemData(None, True)
}
# 33 required items
required_items = {
"Archery": 1,
"Progressive Resource Crafting": 2,
# "Resource Blocks": 1,
"Brewing": 1,
"Enchanting": 1,
"Bucket": 1,

View File

@ -20,6 +20,11 @@ class BeeTraps(Range):
range_end = 100
class EggShards(Range):
range_start = 0
range_end = 30
minecraft_options: typing.Dict[str, type(Option)] = {
"advancement_goal": AdvancementGoal,
"combat_difficulty": CombatDifficulty,
@ -28,5 +33,7 @@ minecraft_options: typing.Dict[str, type(Option)] = {
"include_postgame_advancements": Toggle,
"shuffle_structures": Toggle,
"structure_compasses": Toggle,
"bee_traps": BeeTraps
"bee_traps": BeeTraps,
"egg_shards_required": EggShards,
"egg_shards_available": EggShards
}

View File

@ -117,8 +117,9 @@ def set_rules(world: MultiWorld, player: int):
# 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._mc_can_kill_ender_dragon(player)
goal = world.advancement_goal[player]
egg_shards = min(world.egg_shards_required[player], world.egg_shards_available[player])
can_complete = lambda state: len(reachable_locations(state)) >= goal and state.has("Dragon Egg Shard", player, egg_shards) and state.can_reach('The End', 'Region', player) and state._mc_can_kill_ender_dragon(player)
if world.logic[player] != 'nologic':
world.completion_condition[player] = lambda state: state.has('Victory', player)

View File

@ -29,12 +29,14 @@ class MinecraftWorld(World):
exits = [connection[0] for connection in default_connections]
return {
'world_seed': self.world.slot_seeds[self.player].getrandbits(32),
# consistent and doesn't interfere with other generation
'seed_name': self.world.seed_name,
'player_name': self.world.get_player_names(self.player),
'player_id': self.player,
'client_version': client_version,
'structures': {exit: self.world.get_entrance(exit, self.player).connected_region.name for exit in exits},
'advancement_goal': self.world.advancement_goal[self.player],
'egg_shards_required': self.world.egg_shards_required[self.player],
'egg_shards_available': self.world.egg_shards_available[self.player],
'race': self.world.is_race
}
@ -51,6 +53,8 @@ class MinecraftWorld(World):
structures = [connection[1] for connection in default_connections]
for struct_name in structures:
itempool.append(f"Structure Compass ({struct_name})")
# Add dragon egg shards
itempool += ["Dragon Egg Shard"] * self.world.egg_shards_available[self.player]
# Add bee traps if desired
bee_trap_quantity = ceil(self.world.bee_traps[self.player] * (len(self.location_names)-len(itempool)) * 0.01)
itempool += ["Bee Trap (Minecraft)"] * bee_trap_quantity