Skip to content

Commit 80780b8

Browse files
committed
Location table no longer relies on csv, removed data folder, renamed tunic doc to pass unit tests
1 parent 7cea29d commit 80780b8

File tree

7 files changed

+321
-460
lines changed

7 files changed

+321
-460
lines changed

worlds/tunic/Locations.py

+307-20
Large diffs are not rendered by default.

worlds/tunic/Options.py

+8
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,24 @@ class SwordProgression(DefaultOnToggle):
77
"""Option to play with sword progression. Sword Progression adds four possible upgrades to find that will
88
level up your sword in the order of Stick -> Sword -> Lvl 3 Sword -> Lvl 4 Sword."""
99

10+
1011
class StartWithSword(Toggle):
1112
"""Option to start with a sword in the player's inventory."""
1213
display_name = "Start With Sword"
1314

15+
1416
class KeysBehindBosses(Toggle):
1517
"""Option to choose if the three hexagon keys are placed randomly or behind their respective boss fight"""
1618
display_name = "Keys Behind Bosses"
1719

20+
1821
class AbilityShuffling(Toggle):
1922
"""Choose whether to lock the usage of Prayer, Holy Cross*, and Ice Rod until the relevant poge of the manual is found.
2023
*Certain Holy Cross usages are still allowed, such as free bombs, the seeking spell and other player-facing codes.
2124
"""
2225
display_name = "Ability Shuffling"
26+
27+
2328
'''
2429
class BonusUpgrades(Toggle):
2530
"""Makes the Hero Relics and Golden Trophy Collectibles award bonus stat upgrades when found. (Can also be turned
@@ -35,11 +40,14 @@ class FoolTraps(Choice):
3540
option_double = 2
3641
option_onslaught = 3
3742
'''
43+
44+
3845
class HexagonQuest(Toggle):
3946
"""Choose whether to play the Hexagon Quest game mode. This mode shuffles 30 Golden Hexagons into the item pool and
4047
allows the game to be ended after collecting 20 of them."""
4148
display_name = "Hexagon Quest"
4249

50+
4351
tunic_options: typing.Dict[str, type(Option)] = {
4452
"sword_progression": SwordProgression,
4553
"start_with_sword": StartWithSword,

worlds/tunic/__init__.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from BaseClasses import Region, Location, Item, Tutorial, ItemClassification
44
from .Items import filler_items, item_table
5-
from .Locations import TunicLocations
5+
from .Locations import location_table
66
from .Rules import set_location_rules, set_region_rules, hexagon_quest_abilities, set_abilities
77
from .Regions import tunic_regions
88
from .Options import tunic_options
@@ -43,8 +43,7 @@ class TunicWorld(World):
4343

4444
data_version = 1
4545
tunic_items = item_table
46-
tunic_locations = TunicLocations()
47-
tunic_locations.populate_locations()
46+
tunic_locations = location_table
4847
option_definitions = tunic_options
4948

5049
item_name_to_id = {}
@@ -56,8 +55,8 @@ class TunicWorld(World):
5655
item_name_to_id[item_name] = item_base_id
5756
item_base_id += 1
5857

59-
for location in tunic_locations.locations:
60-
location_name_to_id[location.name] = location_base_id
58+
for location_name, location_data in location_table.items():
59+
location_name_to_id[location_name] = location_base_id
6160
location_base_id += 1
6261

6362
def create_item(self, name: str) -> TunicItem:
@@ -66,7 +65,6 @@ def create_item(self, name: str) -> TunicItem:
6665
return TunicItem(name, item_data.classification, self.item_name_to_id[name], self.player)
6766

6867
def create_items(self):
69-
7068
hexagon_locations: Dict[str, str] = {
7169
"Red Hexagon": "Fortress Arena - Siege Engine/Vault Key Pickup",
7270
"Green Hexagon": "Librarian - Hexagon Green",
@@ -91,6 +89,7 @@ def create_items(self):
9189

9290
for i in range(0, item_data.quantity_in_item_pool):
9391
items.append(self.create_item(item_name))
92+
# adding a money x1 to even out the pool with this option
9493
items.append(self.create_item("Money x1"))
9594
elif self.multiworld.hexagon_quest[self.player].value and \
9695
("Pages" in item_name or item_name in ["Red Hexagon", "Green Hexagon", "Blue Hexagon"]):
@@ -115,8 +114,7 @@ def create_regions(self):
115114
region.add_exits(tunic_regions[region_name])
116115

117116
for location_name in self.location_name_to_id:
118-
region = self.multiworld.get_region(self.tunic_locations.locations_lookup[location_name].region,
119-
self.player)
117+
region = self.multiworld.get_region(location_table[location_name].region, self.player)
120118
location = TunicLocation(self.player, location_name, self.location_name_to_id[location_name], region)
121119
region.locations.append(location)
122120

worlds/tunic/data/Items.csv

-129
This file was deleted.

0 commit comments

Comments
 (0)