Skip to content

Commit

Permalink
Wargroove 2: implemented PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FlySniper committed Aug 8, 2024
2 parents 746cdf5 + 6803c37 commit 4e8d13a
Show file tree
Hide file tree
Showing 48 changed files with 2,832 additions and 665 deletions.
20 changes: 11 additions & 9 deletions BaseClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ def set_item_links(self):

def link_items(self) -> None:
"""Called to link together items in the itempool related to the registered item link groups."""
from worlds import AutoWorld

for group_id, group in self.groups.items():
def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
Optional[Dict[int, Dict[str, int]]], Optional[Dict[str, int]]
Expand All @@ -300,15 +302,15 @@ def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
if item.player in counters and item.name in shared_pool:
counters[item.player][item.name] += 1
classifications[item.name] |= item.classification

for player in players.copy():
if all([counters[player][item] == 0 for item in shared_pool]):
players.remove(player)
del (counters[player])

if not players:
return None, None

for item in shared_pool:
count = min(counters[player][item] for player in players)
if count:
Expand All @@ -318,19 +320,19 @@ def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
for player in players:
del (counters[player][item])
return counters, classifications

common_item_count, classifications = find_common_pool(group["players"], group["item_pool"])
if not common_item_count:
continue

new_itempool: List[Item] = []
for item_name, item_count in next(iter(common_item_count.values())).items():
for _ in range(item_count):
new_item = group["world"].create_item(item_name)
# mangle together all original classification bits
new_item.classification |= classifications[item_name]
new_itempool.append(new_item)

region = Region("Menu", group_id, self, "ItemLink")
self.regions.append(region)
locations = region.locations
Expand All @@ -341,16 +343,16 @@ def find_common_pool(players: Set[int], shared_pool: Set[str]) -> Tuple[
None, region)
loc.access_rule = lambda state, item_name = item.name, group_id_ = group_id, count_ = count: \
state.has(item_name, group_id_, count_)

locations.append(loc)
loc.place_locked_item(item)
common_item_count[item.player][item.name] -= 1
else:
new_itempool.append(item)

itemcount = len(self.itempool)
self.itempool = new_itempool

while itemcount > len(self.itempool):
items_to_add = []
for player in group["players"]:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Currently, the following games are supported:
* Aquaria
* Yu-Gi-Oh! Ultimate Masters: World Championship Tournament 2006
* A Hat in Time
* Old School Runescape
* Wargroove 2

For setup and instructions check out our [tutorials page](https://archipelago.gg/tutorial/).
Expand Down
3 changes: 3 additions & 0 deletions docs/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@
# Ocarina of Time
/worlds/oot/ @espeon65536

# Old School Runescape
/worlds/osrs @digiholic

# Overcooked! 2
/worlds/overcooked2/ @toasterparty

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
"Adventure",
"ArchipIDLE",
"Archipelago",
"ChecksFinder",
"Clique",
"Final Fantasy",
"Lufia II Ancient Cave",
Expand Down
2 changes: 1 addition & 1 deletion worlds/aquaria/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, id: int, count: int, type: ItemType, group: ItemGroup):
"Mutant Costume": ItemData(698020, 1, ItemType.JUNK, ItemGroup.COLLECTIBLE), # collectible_mutant_costume
"Baby Nautilus": ItemData(698021, 1, ItemType.NORMAL, ItemGroup.UTILITY), # collectible_nautilus
"Baby Piranha": ItemData(698022, 1, ItemType.NORMAL, ItemGroup.UTILITY), # collectible_piranha
"Arnassi Armor": ItemData(698023, 1, ItemType.NORMAL, ItemGroup.UTILITY), # collectible_seahorse_costume
"Arnassi Armor": ItemData(698023, 1, ItemType.PROGRESSION, ItemGroup.UTILITY), # collectible_seahorse_costume
"Seed Bag": ItemData(698024, 1, ItemType.JUNK, ItemGroup.COLLECTIBLE), # collectible_seed_bag
"King's Skull": ItemData(698025, 1, ItemType.JUNK, ItemGroup.COLLECTIBLE), # collectible_skull
"Song Plant Spore": ItemData(698026, 1, ItemType.JUNK, ItemGroup.COLLECTIBLE), # collectible_spore_seed
Expand Down
20 changes: 16 additions & 4 deletions worlds/aquaria/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AquariaLocations:
"Home Water, bulb below the grouper fish": 698058,
"Home Water, bulb in the path below Nautilus Prime": 698059,
"Home Water, bulb in the little room above the grouper fish": 698060,
"Home Water, bulb in the end of the left path from the Verse Cave": 698061,
"Home Water, bulb in the end of the path close to the Verse Cave": 698061,
"Home Water, bulb in the top left path": 698062,
"Home Water, bulb in the bottom left room": 698063,
"Home Water, bulb close to Naija's Home": 698064,
Expand All @@ -67,7 +67,7 @@ class AquariaLocations:

locations_song_cave = {
"Song Cave, Erulian spirit": 698206,
"Song Cave, bulb in the top left part": 698071,
"Song Cave, bulb in the top right part": 698071,
"Song Cave, bulb in the big anemone room": 698072,
"Song Cave, bulb in the path to the singing statues": 698073,
"Song Cave, bulb under the rock in the path to the singing statues": 698074,
Expand Down Expand Up @@ -152,6 +152,9 @@ class AquariaLocations:

locations_arnassi_path = {
"Arnassi Ruins, Arnassi Statue": 698164,
}

locations_arnassi_cave_transturtle = {
"Arnassi Ruins, Transturtle": 698217,
}

Expand Down Expand Up @@ -269,9 +272,12 @@ class AquariaLocations:
}

locations_forest_bl = {
"Kelp Forest bottom left area, Transturtle": 698212,
}

locations_forest_bl_sc = {
"Kelp Forest bottom left area, bulb close to the spirit crystals": 698054,
"Kelp Forest bottom left area, Walker Baby": 698186,
"Kelp Forest bottom left area, Transturtle": 698212,
}

locations_forest_br = {
Expand Down Expand Up @@ -370,7 +376,7 @@ class AquariaLocations:

locations_sun_temple_r = {
"Sun Temple, first bulb of the temple": 698091,
"Sun Temple, bulb on the left part": 698092,
"Sun Temple, bulb on the right part": 698092,
"Sun Temple, bulb in the hidden room of the right part": 698093,
"Sun Temple, Sun Key": 698182,
}
Expand Down Expand Up @@ -402,6 +408,9 @@ class AquariaLocations:
"Abyss right area, bulb in the middle path": 698110,
"Abyss right area, bulb behind the rock in the middle path": 698111,
"Abyss right area, bulb in the left green room": 698112,
}

locations_abyss_r_transturtle = {
"Abyss right area, Transturtle": 698214,
}

Expand Down Expand Up @@ -499,6 +508,7 @@ class AquariaLocations:
**AquariaLocations.locations_skeleton_path_sc,
**AquariaLocations.locations_arnassi,
**AquariaLocations.locations_arnassi_path,
**AquariaLocations.locations_arnassi_cave_transturtle,
**AquariaLocations.locations_arnassi_crab_boss,
**AquariaLocations.locations_sun_temple_l,
**AquariaLocations.locations_sun_temple_r,
Expand All @@ -509,6 +519,7 @@ class AquariaLocations:
**AquariaLocations.locations_abyss_l,
**AquariaLocations.locations_abyss_lb,
**AquariaLocations.locations_abyss_r,
**AquariaLocations.locations_abyss_r_transturtle,
**AquariaLocations.locations_energy_temple_1,
**AquariaLocations.locations_energy_temple_2,
**AquariaLocations.locations_energy_temple_3,
Expand All @@ -530,6 +541,7 @@ class AquariaLocations:
**AquariaLocations.locations_forest_tr,
**AquariaLocations.locations_forest_tr_fp,
**AquariaLocations.locations_forest_bl,
**AquariaLocations.locations_forest_bl_sc,
**AquariaLocations.locations_forest_br,
**AquariaLocations.locations_forest_boss,
**AquariaLocations.locations_forest_boss_entrance,
Expand Down
Loading

0 comments on commit 4e8d13a

Please sign in to comment.