Skip to content

Commit 5a89afd

Browse files
committed
Merge remote-tracking branch 'Seatori/1.21-advancements' into minecraft-neoforge
# Conflicts: # worlds/minecraft/Rules.py # worlds/minecraft/data/excluded_locations.json # worlds/minecraft/data/locations.json # worlds/minecraft/test/TestAdvancements.py
2 parents 182b8cc + 5c99b3e commit 5a89afd

File tree

4 files changed

+88
-159
lines changed

4 files changed

+88
-159
lines changed

worlds/minecraft/Rules.py

Lines changed: 77 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ def can_excavate(world: "MinecraftWorld", state: CollectionState, player: int) -
6767
and can_adventure(world, state, player)
6868
)
6969

70-
def can_do_trials(world: "MinecraftWorld", state: CollectionState, player: int) -> bool:
71-
return (state.can_reach_location("Minecraft: Trial(s) Edition", player)
72-
and basic_combat(world, state, player)
73-
)
74-
7570

7671
def can_brew_potions(world: "MinecraftWorld", state: CollectionState, player: int) -> bool:
7772
return state.has('Blaze Rods', player) and state.has('Brewing', player) and has_bottle(world, state, player)
@@ -102,6 +97,11 @@ def enter_stronghold(world: "MinecraftWorld", state: CollectionState, player: in
10297
return state.has('Blaze Rods', player) and state.has('Brewing', player) and state.has('3 Ender Pearls', player)
10398

10499

100+
def has_explorer_maps(world: "MinecraftWorld", state: CollectionState, player: int) -> bool:
101+
return (overworld_villager(world, state, player) and state.has("Progressive Tools", player, 2) and
102+
has_iron_ingots(world, state, player))
103+
104+
105105
# Difficulty-dependent functions
106106
def combat_difficulty(world: "MinecraftWorld", state: CollectionState, player: int) -> str:
107107
return world.options.combat_difficulty.current_key
@@ -135,6 +135,33 @@ def basic_combat(world: "MinecraftWorld", state: CollectionState, player: int) -
135135
)
136136

137137

138+
def ominous_vaults(world: "MinecraftWorld", state: CollectionState, player: int) -> bool:
139+
trial_chambers = (has_explorer_maps(world, state, player) and can_adventure(world, state, player))
140+
if combat_difficulty(world, state, player) == 'easy':
141+
return (trial_chambers
142+
and state.has('Progressive Weapons', player, 3)
143+
and state.has('Progressive Armor', player, 2)
144+
and state.has('Shield', player)
145+
and state.has('Progressive Tools', player, 2)
146+
and has_iron_ingots(world, state, player)
147+
)
148+
elif combat_difficulty(world, state, player) == 'hard':
149+
return (trial_chambers
150+
and state.has('Progressive Weapons', player, 2)
151+
and has_iron_ingots(world, state, player)
152+
and (
153+
state.has('Progressive Armor', player)
154+
or state.has('Shield', player)
155+
)
156+
)
157+
return (trial_chambers
158+
and state.has('Progressive Weapons', player, 2)
159+
and has_iron_ingots(world, state, player)
160+
and state.has('Progressive Armor', player)
161+
and state.has('Shield', player)
162+
)
163+
164+
138165
def complete_raid(world: "MinecraftWorld", state: CollectionState, player: int) -> bool:
139166
reach_regions = (state.can_reach_region('Village', player)
140167
and state.can_reach_region('Pillager Outpost', player))
@@ -267,7 +294,9 @@ def get_rules_lookup(world, player: int):
267294
and state.has("Fishing Rod", player) # Water Breathing
268295
and state.can_reach_region("The Nether", player) # Regeneration, Fire Resistance, gold nuggets
269296
and state.can_reach_region("Village", player) # Night Vision, Invisibility
270-
and state.can_reach_location("Bring Home the Beacon", player)),
297+
and state.can_reach_location("Bring Home the Beacon", player)
298+
and can_adventure(world, state, player)
299+
and has_explorer_maps(world, state, player)), # Wind Charged
271300
# Resistance
272301
"Bring Home the Beacon": lambda state: can_kill_wither(world, state, player)
273302
and has_diamond_pickaxe(world, state, player)
@@ -297,8 +326,8 @@ def get_rules_lookup(world, player: int):
297326
and state.can_reach_location("Bring Home the Beacon", player) # Haste
298327
and state.can_reach_location("Hero of the Village", player)), # Hero of the Village
299328
"Bullseye": lambda state: state.has("Archery", player)
300-
and state.has("Progressive Tools", player, 2)
301-
and has_iron_ingots(world, state, player),
329+
and state.has("Progressive Tools", player, 2)
330+
and has_iron_ingots(world, state, player),
302331
"Spooky Scary Skeleton": lambda state: basic_combat(world, state, player),
303332
"Two by Two": lambda state: has_iron_ingots(world, state, player)
304333
and state.has("Bucket", player)
@@ -370,9 +399,8 @@ def get_rules_lookup(world, player: int):
370399
and state.can_reach_location("Overpowered", player) # gapple, notch apple
371400
and state.can_reach_region('The End', player)), # chorus fruit
372401
"Subspace Bubble": lambda state: has_diamond_pickaxe(world, state, player),
373-
"Country Lode, Take Me Home": lambda state: state.can_reach_location("Hidden in the Depths", player)
374-
and state.has("8 Netherite Scrap", player)
375-
and has_gold_ingots(world, state, player),
402+
"Country Lode, Take Me Home": lambda state: state.has("Progressive Tools", player, 2)
403+
and has_iron_ingots(world, state, player),
376404
"Bee Our Guest": lambda state: state.has("Campfire", player)
377405
and has_bottle(world, state, player),
378406
"Uneasy Alliance": lambda state: has_diamond_pickaxe(world, state, player)
@@ -398,11 +426,17 @@ def get_rules_lookup(world, player: int):
398426
and state.has("Saddle", player)
399427
and state.has("Fishing Rod", player)
400428
and can_adventure(world, state, player),
401-
"Overkill": lambda state: can_brew_potions(world, state, player)
429+
"Overkill": lambda state: (
430+
can_brew_potions(world, state, player)
402431
and (
403432
state.has("Progressive Weapons", player)
404433
or state.can_reach_region('The Nether', player)
405-
),
434+
)
435+
)
436+
or (
437+
state.can_reach_location("Over-Overkill", player)
438+
and world.options.include_hard_advancements
439+
),
406440
"Librarian": lambda state: state.has("Enchanting", player),
407441
"Overpowered": lambda state: has_iron_ingots(world, state, player)
408442
and state.has('Progressive Tools', player, 2)
@@ -492,7 +526,7 @@ def get_rules_lookup(world, player: int):
492526
),
493527
"Smithing with Style": lambda state: can_excavate(world, state, player) # Wayfinder Armor Trim
494528
and fortress_loot(world, state, player) # Rib Armor Trim
495-
and overworld_villager(world, state, player) # Explorer Maps for the Vex and Tide Armor Trims
529+
and has_explorer_maps(world, state, player) # Vex and Tide Armor Trims
496530
and state.can_reach_region("Bastion Remnant", player) # Snout Armor Trim
497531
and state.can_reach_region("End City", player) # Spire Armor Trim
498532
and state.has("Progressive Tools", player, 2) # Ward and Silence Armor Trims; Compass for Explorer Maps
@@ -509,28 +543,40 @@ def get_rules_lookup(world, player: int):
509543
"Respecting the Remnants": lambda state: can_excavate(world, state, player),
510544
"Careful Restoration": lambda state: can_excavate(world, state, player),
511545
"The Power of Books": lambda state: state.has("Progressive Tools", player, 2),
512-
"Isn't It Scute?": lambda state: state.has("Brush", player),
513-
"Shear Brilliance": lambda state: has_iron_ingots(world, state, player),
514-
"Good as New": lambda state: state.has("Brush", player),
546+
"Isn't It Scute?": lambda state: can_adventure(world, state, player)
547+
and has_copper_ingots(world, state, player)
548+
and state.has("Brush", player),
549+
"Shear Brilliance": lambda state: can_adventure(world, state, player)
550+
and has_copper_ingots(world, state, player)
551+
and state.has("Brush", player),
552+
"Good as New": lambda state: can_adventure(world, state, player)
553+
and has_copper_ingots(world, state, player)
554+
and state.has("Brush", player),
515555
"The Whole Pack": lambda state: can_adventure(world, state, player),
516-
# "Minecraft: Trial(s) Edition": lambda state: basic_combat(world, state, player),
517-
"Under Lock and Key": lambda state: can_do_trials(world, state, player),
518-
"Blowback": lambda state: can_do_trials(world, state, player),
519-
"Who Needs Rockets?": lambda state: can_do_trials(world, state, player),
556+
"Minecraft: Trial(s) Edition": lambda state: can_adventure(world, state, player)
557+
and has_explorer_maps(world, state, player),
558+
"Under Lock and Key": lambda state: can_adventure(world, state, player)
559+
and has_explorer_maps(world, state, player)
560+
and basic_combat(world, state, player),
561+
"Blowback": lambda state: can_adventure(world, state, player)
562+
and has_explorer_maps(world, state, player)
563+
and basic_combat(world, state, player),
564+
"Who Needs Rockets?": lambda state: can_adventure(world, state, player)
565+
and has_explorer_maps(world, state, player)
566+
and basic_combat(world, state, player),
520567
"Crafters Crafting Crafters": lambda state: has_iron_ingots(world, state, player)
521568
and state.has("Progressive Tools", player, 2),
522569
"Lighten Up": lambda state: (
523-
( # can craft Copper Bulb
524-
state.has("Progressive Tools", player, 2)
525-
and state.has("Brewing", player)
526-
)
527-
or ( # can find Copper Bulb in trial chamber
528-
state.can_reach_location("Minecraft: Trial(s) Edition", player)
529-
and state.has("Progressive Tools", player)
530-
)
570+
fortress_loot(world, state, player)
571+
and state.has("Progressive Tools", player, 2)
572+
and state.has("Progressive Resource Crafting", player, 2)
573+
)
574+
or (
575+
can_adventure(world, state, player)
576+
and has_explorer_maps(world, state, player)
531577
),
532-
"Revaulting": lambda state: can_do_trials(world, state, player),
533-
"Over-Overkill": lambda state: state.can_reach_location("Revaulting", player),
578+
"Over-Overkill": lambda state: ominous_vaults(world, state, player),
579+
"Revaulting": lambda state: ominous_vaults(world, state, player)
534580
}
535581
}
536582
return rules_lookup

worlds/minecraft/data/excluded_locations.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"With Our Powers Combined!",
1919
"Smithing with Style",
2020
"Careful Restoration",
21+
"The Whole Pack",
22+
"Blowback",
2123
"Over-Overkill"
2224
],
2325
"unreasonable": [

worlds/minecraft/data/locations.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
"Adventuring Time",
170170
"A Seedy Place",
171171
"Husbandry",
172+
"Country Lode, Take Me Home",
172173
"Bee Our Guest",
173174
"Diamonds!",
174175
"A Throwaway Joke",
@@ -217,9 +218,7 @@
217218
"Blowback",
218219
"Who Needs Rockets?",
219220
"Crafters Crafting Crafters",
220-
"Lighten Up",
221-
"Over-Overkill",
222-
"Revaulting"
221+
"Lighten Up"
223222
],
224223
"The Nether": [
225224
"Hot Tourist Destinations",
@@ -231,7 +230,6 @@
231230
"Return to Sender",
232231
"Hidden in the Depths",
233232
"Subspace Bubble",
234-
"Country Lode, Take Me Home",
235233
"Uneasy Alliance",
236234
"Is It a Balloon?",
237235
"Feels Like Home",
@@ -272,7 +270,9 @@
272270
"Who's the Pillager Now?",
273271
"Voluntary Exile",
274272
"Birthday Song",
275-
"You've Got a Friend in Me"
273+
"You've Got a Friend in Me",
274+
"Over-Overkill",
275+
"Revaulting"
276276
],
277277
"Bastion Remnant": [
278278
"War Pigs",

0 commit comments

Comments
 (0)