Skip to content

Commit 473d82d

Browse files
WIP: Started adding docs and Hexagon Quest logic
1 parent 46dfce6 commit 473d82d

File tree

9 files changed

+296
-127
lines changed

9 files changed

+296
-127
lines changed

worlds/tunic/Items.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from pathlib import Path
2-
from typing import Dict, Set, NamedTuple, List
3-
from BaseClasses import Item, ItemClassification
2+
from typing import Dict, List
3+
from BaseClasses import ItemClassification, MultiWorld
44
import csv
55

66

7+
78
class TunicItemData:
89
name: str
910
classification: ItemClassification
@@ -12,6 +13,7 @@ class TunicItemData:
1213

1314

1415
class TunicItems:
16+
1517
items: List[TunicItemData] = []
1618
items_lookup: Dict[str, TunicItemData] = {}
1719

@@ -24,6 +26,10 @@ def populate_items(self):
2426
item = TunicItemData()
2527
item.name = line[0]
2628
item.classification = getattr(ItemClassification, line[1])
29+
if item.classification == ItemClassification.filler:
30+
filler_items.append(item.name)
2731
item.quantity_in_item_pool = int(line[4])
2832
self.items.append(item)
2933
self.items_lookup[item.name] = item
34+
35+
filler_items = []

worlds/tunic/Locations.py

-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
class TunicLocationData:
77
region: str
88
name: str
9-
code: int
109

1110

1211
class TunicLocations:
@@ -15,14 +14,12 @@ class TunicLocations:
1514

1615
def populate_locations(self):
1716
locations_file_path = (Path(__file__).parent / "data/Locations.csv").resolve()
18-
location_id = 3000
1917
with open(locations_file_path) as location_file:
2018
csv_file = csv.reader(location_file)
2119
csv_file.__next__()
2220
for line in csv_file:
2321
location: TunicLocationData = TunicLocationData()
2422
location.region = line[0]
2523
location.name = line[1]
26-
location.code = len(self.locations) + location_id
2724
self.locations.append(location)
2825
self.locations_lookup[line[1]] = location

worlds/tunic/Options.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import typing
22

3-
from Options import Option, DefaultOnToggle, Toggle
3+
from Options import Option, DefaultOnToggle, Toggle, StartInventoryPool, Choice
4+
45

56
class SwordProgression(DefaultOnToggle):
67
"""Option to play with sword progression. Sword Progression adds four possible upgrades to find that will
@@ -19,7 +20,21 @@ class AbilityShuffling(Toggle):
1920
*Certain Holy Cross usages are still allowed, such as free bombs, the seeking spell and other player-facing codes.
2021
"""
2122
display_name = "Ability Shuffling"
23+
'''
24+
class BonusUpgrades(Toggle):
25+
"""Makes the Hero Relics and Golden Trophy Collectibles award bonus stat upgrades when found. (Can also be turned
26+
on or off from in-game.)"""
27+
display_name = "Bonus Upgrades"
2228
29+
class FoolTraps(Choice):
30+
"""Replaces lower-value money rewards with various traps that damage the player. Increasing the setting increases
31+
the threshold of money drops that get turned into traps. (Can be adjusted or turned off once in-game as well.)"""
32+
display_name = "Fool Traps"
33+
option_none = 0
34+
option_normal = 1
35+
option_double = 2
36+
option_onslaught = 3
37+
'''
2338
class HexagonQuest(Toggle):
2439
"""Choose whether to play the Hexagon Quest game mode. This mode shuffles 30 Golden Hexagons into the item pool and
2540
allows the game to be ended after collecting 20 of them."""
@@ -30,5 +45,6 @@ class HexagonQuest(Toggle):
3045
"start_with_sword": StartWithSword,
3146
"keys_behind_bosses": KeysBehindBosses,
3247
"ability_shuffling": AbilityShuffling,
33-
"hexagon_quest": HexagonQuest
34-
}
48+
"hexagon_quest": HexagonQuest,
49+
"start_inventory_from_pool": StartInventoryPool
50+
}

worlds/tunic/Regions.py

+3-55
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
from typing import Dict, Set
2-
from BaseClasses import MultiWorld
3-
4-
5-
class TunicEntrance:
6-
name: str
7-
rule: bool
8-
9-
def __init__(self, name, rule):
10-
self.name = name
11-
self.rule = rule
12-
132

143
tunic_regions: Dict[str, Set[str]] = {
154
"Menu": {"Overworld"},
165
"Overworld": {"Menu", "Overworld Holy Cross", "East Forest", "Dark Tomb", "Bottom of the Well", "West Garden",
17-
"Ruined Atoll", "Eastern Vault Fortress", "Beneath the Vault", "Quarry", "Swamp", "Boss Arena"},
6+
"Ruined Atoll", "Eastern Vault Fortress", "Beneath the Vault", "Quarry", "Swamp", "Spirit Arena"},
187
"Overworld Holy Cross": {"Overworld"},
198
"East Forest": {"Overworld", "Eastern Vault Fortress"},
209
"Dark Tomb": {"Overworld", "West Garden"},
@@ -30,46 +19,5 @@ def __init__(self, name, rule):
3019
"Rooted Ziggurat": {"Lower Quarry"},
3120
"Swamp": {"Overworld", "Cathedral"},
3221
"Cathedral": {"Swamp"},
33-
"Boss Arena": {"Overworld"}
34-
}
35-
36-
37-
38-
def set_region_rules(multiworld: MultiWorld, player: int):
39-
laurels = "Hero's Laurels"
40-
grapple = "Magic Orb"
41-
lantern = "Lantern"
42-
mask = "Scavenger Mask"
43-
prayer = "Pages 24-25 (Prayer)"
44-
holy_cross = "Pages 42-43 (Holy Cross)"
45-
red_hexagon = "Red Hexagon"
46-
green_hexagon = "Green Hexagon"
47-
blue_hexagon = "Blue Hexagon"
48-
49-
ability_shuffle = multiworld.ability_shuffling[player].value
50-
51-
if ability_shuffle:
52-
multiworld.get_entrance("Overworld -> Overworld Holy Cross", player).access_rule = lambda state: state.has(holy_cross, player)
53-
multiworld.get_entrance("Library -> Ruined Atoll", player).access_rule = lambda state: state.has(prayer, player)
54-
multiworld.get_entrance("Overworld -> Beneath the Vault", player).access_rule = lambda state: state.has(lantern, player) and state.has(prayer, player)
55-
multiworld.get_entrance("Lower Quarry -> Rooted Ziggurat", player).access_rule = lambda state: state.has(grapple, player) and state.has(prayer, player)
56-
multiworld.get_entrance("Swamp -> Cathedral", player).access_rule = lambda state: state.has(laurels, player) and state.has(prayer, player)
57-
multiworld.get_entrance("Ruined Atoll -> Library", player).access_rule = lambda state: (state.has(grapple, player) or state.has(laurels, player)) and state.has(prayer, player)
58-
multiworld.get_entrance("Overworld -> Boss Arena", player).access_rule = lambda state: state.has(prayer, player) and state.has(red_hexagon, player) and state.has(green_hexagon, player) and state.has(blue_hexagon, player)
59-
else:
60-
multiworld.get_entrance("Overworld -> Beneath the Vault", player).access_rule = lambda state: state.has(lantern, player)
61-
multiworld.get_entrance("Lower Quarry -> Rooted Ziggurat", player).access_rule = lambda state: state.has(grapple, player)
62-
multiworld.get_entrance("Swamp -> Cathedral", player).access_rule = lambda state: state.has(laurels, player)
63-
multiworld.get_entrance("Ruined Atoll -> Library", player).access_rule = lambda state: state.has(grapple, player) or state.has(laurels, player)
64-
multiworld.get_entrance("Overworld -> Boss Arena", player).access_rule = lambda state: state.has(red_hexagon, player) and state.has(green_hexagon, player) and state.has(blue_hexagon, player)
65-
66-
multiworld.get_entrance("Overworld -> Dark Tomb", player).access_rule = lambda state: state.has(lantern, player)
67-
multiworld.get_entrance("Overworld -> West Garden", player).access_rule = lambda state: state.has(laurels, player)
68-
multiworld.get_entrance("Overworld -> Eastern Vault Fortress", player).access_rule = lambda state: state.has(laurels, player)
69-
multiworld.get_entrance("East Forest -> Eastern Vault Fortress", player).access_rule = lambda state: state.has(laurels, player)
70-
multiworld.get_entrance("Bottom of the Well -> Dark Tomb", player).access_rule = lambda state: state.has(lantern, player)
71-
multiworld.get_entrance("West Garden -> Dark Tomb", player).access_rule = lambda state: state.has(lantern, player)
72-
multiworld.get_entrance("Eastern Vault Fortress -> Beneath the Vault", player).access_rule = lambda state: state.has(lantern, player)
73-
multiworld.get_entrance("Quarry -> Lower Quarry", player).access_rule = lambda state: state.has(mask, player)
74-
75-
22+
"Spirit Arena": {"Overworld"}
23+
}

0 commit comments

Comments
 (0)