Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiworld support #19

Merged
merged 6 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "worlds/dk64/DK64R"]
path = worlds/dk64/DK64R
url = https://github.com/2dos/DK64-Randomizer.git
branch = dev
2 changes: 1 addition & 1 deletion worlds/dk64/DK64R
Submodule DK64R updated 451 files
30 changes: 19 additions & 11 deletions worlds/dk64/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

from BaseClasses import Item, ItemClassification
from worlds.AutoWorld import World
from types import SimpleNamespace

from randomizer.Lists import Item as DK64RItem
from randomizer.Enums.Items import Items as DK64RItems
from dk64r.randomizer.Lists import Item as DK64RItem
from dk64r.randomizer.Enums.Items import Items as DK64RItems
from dk64r.randomizer.ItemPool import AllItemsUnrestricted

BASE_ID = 0xD64000

Expand Down Expand Up @@ -44,15 +46,21 @@ class DK64Item(Item):
def setup_items(world: World) -> typing.List[DK64Item]:
item_table = []

# DK64_TODO: Pull Active Items from DK64R

# Example item creation
donkey_item = DK64RItem.ItemList[DK64RItems.Donkey]
item_table.append(DK64Item(donkey_item.name, ItemClassification.progression, full_item_table[donkey_item.name], world.player))

gb_item = DK64RItem.ItemList[DK64RItems.GoldenBanana]
for i in range(3):
item_table.append(DK64Item(gb_item.name, ItemClassification.progression, full_item_table[gb_item.name], world.player))
# TODO: This is unrestricted, we should update this to the restricted function based on the actual value
all_items_unrestricted = AllItemsUnrestricted(SimpleNamespace(**{"shockwave_status": False, "starting_kongs_count": 5}))

for seed_item in all_items_unrestricted:
if seed_item.name not in ["TestItem"]:
item = DK64RItem.ItemList[seed_item]
if item.type in [DK64RItems.JunkCrystal, DK64RItems.JunkMelon, DK64RItems.JunkAmmo, DK64RItems.JunkFilm, DK64RItems.JunkOrange, DK64RItems.CrateMelon]:
classification = ItemClassification.filler
elif item.type in [DK64RItems.FakeItem]:
classification = ItemClassification.trap
elif item.playthrough == True:
classification = ItemClassification.progression
else:
classification = ItemClassification.useful
item_table.append(DK64Item(item.name, classification, full_item_table[item.name], world.player))

# Example of accessing Option result
if world.options.goal == "krool":
Expand Down
Loading
Loading