Skip to content

Commit

Permalink
Multiworld support (#19)
Browse files Browse the repository at this point in the history
* Support items

* pass in regions

* deal with inspection

* Logic File

* update version of dev

---------

Co-authored-by: PoryGone <98504756+PoryGone@users.noreply.github.com>
  • Loading branch information
Killklli and PoryGone authored Jan 20, 2024
1 parent a915364 commit c944eef
Show file tree
Hide file tree
Showing 6 changed files with 1,229 additions and 44 deletions.
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

0 comments on commit c944eef

Please sign in to comment.