1
- from pathlib import Path
2
- from typing import Dict , List
3
- from BaseClasses import ItemClassification , MultiWorld
4
- import csv
1
+ from typing import Dict , List , NamedTuple
2
+ from BaseClasses import ItemClassification
5
3
6
4
7
-
8
- class TunicItemData :
9
- name : str
5
+ class TunicItemData (NamedTuple ):
10
6
classification : ItemClassification
11
7
quantity_in_item_pool : int
12
- region : str
13
-
14
-
15
- class TunicItems :
16
-
17
- items : List [TunicItemData ] = []
18
- items_lookup : Dict [str , TunicItemData ] = {}
19
-
20
- def populate_items (self ):
21
- item_file_path = (Path (__file__ ).parent / "data/Items.csv" ).resolve ()
22
- with open (item_file_path ) as item_file :
23
- csv_file = csv .reader (item_file )
24
- csv_file .__next__ ()
25
- for line in csv_file :
26
- item = TunicItemData ()
27
- item .name = line [0 ]
28
- item .classification = getattr (ItemClassification , line [1 ])
29
- if item .classification == ItemClassification .filler :
30
- filler_items .append (item .name )
31
- item .quantity_in_item_pool = int (line [4 ])
32
- self .items .append (item )
33
- self .items_lookup [item .name ] = item
34
-
35
- filler_items = []
8
+
9
+
10
+ item_table : Dict [str , TunicItemData ] = {
11
+ "Firecracker x2" : TunicItemData (ItemClassification .filler , 3 ),
12
+ "Firecracker x3" : TunicItemData (ItemClassification .filler , 3 ),
13
+ "Firecracker x4" : TunicItemData (ItemClassification .filler , 3 ),
14
+ "Firecracker x5" : TunicItemData (ItemClassification .filler , 1 ),
15
+ "Firecracker x6" : TunicItemData (ItemClassification .filler , 2 ),
16
+ "Fire Bomb x2" : TunicItemData (ItemClassification .filler , 2 ),
17
+ "Fire Bomb x3" : TunicItemData (ItemClassification .filler , 1 ),
18
+ "Ice Bomb x2" : TunicItemData (ItemClassification .filler , 2 ),
19
+ "Ice Bomb x3" : TunicItemData (ItemClassification .filler , 2 ),
20
+ "Ice Bomb x5" : TunicItemData (ItemClassification .filler , 1 ),
21
+ "Lure" : TunicItemData (ItemClassification .filler , 4 ),
22
+ "Lure x2" : TunicItemData (ItemClassification .filler , 1 ),
23
+ "Pepper x2" : TunicItemData (ItemClassification .filler , 4 ),
24
+ "Ivy x3" : TunicItemData (ItemClassification .filler , 2 ),
25
+ "Effigy" : TunicItemData (ItemClassification .useful , 12 ),
26
+ "HP Berry" : TunicItemData (ItemClassification .filler , 2 ),
27
+ "HP Berry x2" : TunicItemData (ItemClassification .filler , 4 ),
28
+ "HP Berry x3" : TunicItemData (ItemClassification .filler , 2 ),
29
+ "MP Berry" : TunicItemData (ItemClassification .filler , 4 ),
30
+ "MP Berry x2" : TunicItemData (ItemClassification .filler , 2 ),
31
+ "MP Berry x3" : TunicItemData (ItemClassification .filler , 7 ),
32
+ "Fairy" : TunicItemData (ItemClassification .progression , 20 ),
33
+ "Stick" : TunicItemData (ItemClassification .progression , 1 ),
34
+ "Sword" : TunicItemData (ItemClassification .progression , 3 ),
35
+ "Magic Wand" : TunicItemData (ItemClassification .progression , 1 ),
36
+ "Magic Dagger" : TunicItemData (ItemClassification .progression , 1 ),
37
+ "Magic Orb" : TunicItemData (ItemClassification .progression , 1 ),
38
+ "Hero's Laurels" : TunicItemData (ItemClassification .progression , 1 ),
39
+ "Lantern" : TunicItemData (ItemClassification .progression , 1 ),
40
+ "Shotgun" : TunicItemData (ItemClassification .useful , 1 ),
41
+ "Shield" : TunicItemData (ItemClassification .useful , 1 ),
42
+ "Dath Stone" : TunicItemData (ItemClassification .useful , 1 ),
43
+ "Hourglass" : TunicItemData (ItemClassification .useful , 1 ),
44
+ "Old House Key" : TunicItemData (ItemClassification .progression , 1 ),
45
+ "Key" : TunicItemData (ItemClassification .progression , 2 ),
46
+ "Fortress Vault Key" : TunicItemData (ItemClassification .progression , 1 ),
47
+ "Flask Shard" : TunicItemData (ItemClassification .useful , 12 ),
48
+ "Potion Flask" : TunicItemData (ItemClassification .useful , 5 ),
49
+ "Golden Coin" : TunicItemData (ItemClassification .progression , 17 ),
50
+ "Card Slot" : TunicItemData (ItemClassification .useful , 4 ),
51
+ "Red Hexagon" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
52
+ "Green Hexagon" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
53
+ "Blue Hexagon" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
54
+ "Gold Hexagon" : TunicItemData (ItemClassification .progression_skip_balancing , 30 ),
55
+ "ATT Offering" : TunicItemData (ItemClassification .useful , 4 ),
56
+ "DEF Offering" : TunicItemData (ItemClassification .useful , 4 ),
57
+ "Potion Offering" : TunicItemData (ItemClassification .useful , 3 ),
58
+ "HP Offering" : TunicItemData (ItemClassification .useful , 6 ),
59
+ "MP Offering" : TunicItemData (ItemClassification .useful , 3 ),
60
+ "SP Offering" : TunicItemData (ItemClassification .useful , 2 ),
61
+ "Hero Relic - ATT" : TunicItemData (ItemClassification .useful , 1 ),
62
+ "Hero Relic - DEF" : TunicItemData (ItemClassification .useful , 1 ),
63
+ "Hero Relic - HP" : TunicItemData (ItemClassification .useful , 1 ),
64
+ "Hero Relic - MP" : TunicItemData (ItemClassification .useful , 1 ),
65
+ "Hero Relic - POTION" : TunicItemData (ItemClassification .useful , 1 ),
66
+ "Hero Relic - SP" : TunicItemData (ItemClassification .useful , 1 ),
67
+ "Orange Peril Ring" : TunicItemData (ItemClassification .useful , 1 ),
68
+ "Tincture" : TunicItemData (ItemClassification .useful , 1 ),
69
+ "Scavenger Mask" : TunicItemData (ItemClassification .progression , 1 ),
70
+ "Cyan Peril Ring" : TunicItemData (ItemClassification .useful , 1 ),
71
+ "Bracer" : TunicItemData (ItemClassification .useful , 1 ),
72
+ "Dagger Strap" : TunicItemData (ItemClassification .useful , 1 ),
73
+ "Inverted Ash" : TunicItemData (ItemClassification .useful , 1 ),
74
+ "Lucky Cup" : TunicItemData (ItemClassification .useful , 1 ),
75
+ "Magic Echo" : TunicItemData (ItemClassification .useful , 1 ),
76
+ "Anklet" : TunicItemData (ItemClassification .useful , 1 ),
77
+ "Muffling Bell" : TunicItemData (ItemClassification .useful , 1 ),
78
+ "Glass Cannon" : TunicItemData (ItemClassification .useful , 1 ),
79
+ "Perfume" : TunicItemData (ItemClassification .useful , 1 ),
80
+ "Louder Echo" : TunicItemData (ItemClassification .useful , 1 ),
81
+ "Aura's Gem" : TunicItemData (ItemClassification .useful , 1 ),
82
+ "Bone Card" : TunicItemData (ItemClassification .useful , 1 ),
83
+ "Mr Mayor" : TunicItemData (ItemClassification .useful , 1 ),
84
+ "Secret Legend" : TunicItemData (ItemClassification .useful , 1 ),
85
+ "Sacred Geometry" : TunicItemData (ItemClassification .useful , 1 ),
86
+ "Vintage" : TunicItemData (ItemClassification .useful , 1 ),
87
+ "Just Some Pals" : TunicItemData (ItemClassification .useful , 1 ),
88
+ "Regal Weasel" : TunicItemData (ItemClassification .useful , 1 ),
89
+ "Spring Falls" : TunicItemData (ItemClassification .useful , 1 ),
90
+ "Power Up" : TunicItemData (ItemClassification .useful , 1 ),
91
+ "Back To Work" : TunicItemData (ItemClassification .useful , 1 ),
92
+ "Phonomath" : TunicItemData (ItemClassification .useful , 1 ),
93
+ "Dusty" : TunicItemData (ItemClassification .useful , 1 ),
94
+ "Forever Friend" : TunicItemData (ItemClassification .useful , 1 ),
95
+ "Money x1" : TunicItemData (ItemClassification .filler , 3 ),
96
+ "Money x10" : TunicItemData (ItemClassification .filler , 1 ),
97
+ "Money x15" : TunicItemData (ItemClassification .filler , 10 ),
98
+ "Money x16" : TunicItemData (ItemClassification .filler , 1 ),
99
+ "Money x20" : TunicItemData (ItemClassification .filler , 17 ),
100
+ "Money x25" : TunicItemData (ItemClassification .filler , 14 ),
101
+ "Money x30" : TunicItemData (ItemClassification .filler , 4 ),
102
+ "Money x32" : TunicItemData (ItemClassification .filler , 4 ),
103
+ "Money x40" : TunicItemData (ItemClassification .filler , 3 ),
104
+ "Money x48" : TunicItemData (ItemClassification .filler , 1 ),
105
+ "Money x50" : TunicItemData (ItemClassification .filler , 7 ),
106
+ "Money x64" : TunicItemData (ItemClassification .filler , 1 ),
107
+ "Money x100" : TunicItemData (ItemClassification .useful , 5 ),
108
+ "Money x128" : TunicItemData (ItemClassification .useful , 3 ),
109
+ "Money x200" : TunicItemData (ItemClassification .useful , 1 ),
110
+ "Money x255" : TunicItemData (ItemClassification .useful , 1 ),
111
+ "Pages 0-1" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
112
+ "Pages 2-3" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
113
+ "Pages 4-5" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
114
+ "Pages 6-7" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
115
+ "Pages 8-9" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
116
+ "Pages 10-11" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
117
+ "Pages 12-13" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
118
+ "Pages 14-15" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
119
+ "Pages 16-17" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
120
+ "Pages 18-19" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
121
+ "Pages 20-21" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
122
+ "Pages 22-23" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
123
+ "Pages 24-25 (Prayer)" : TunicItemData (ItemClassification .progression , 1 ),
124
+ "Pages 26-27" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
125
+ "Pages 28-29" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
126
+ "Pages 30-31" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
127
+ "Pages 32-33" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
128
+ "Pages 34-35" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
129
+ "Pages 36-37" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
130
+ "Pages 38-39" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
131
+ "Pages 40-41" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
132
+ "Pages 42-43 (Holy Cross)" : TunicItemData (ItemClassification .progression , 1 ),
133
+ "Pages 44-45" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
134
+ "Pages 46-47" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
135
+ "Pages 48-49" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
136
+ "Pages 50-51" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
137
+ "Pages 52-53 (Ice Rod)" : TunicItemData (ItemClassification .progression , 1 ),
138
+ "Pages 54-55" : TunicItemData (ItemClassification .progression_skip_balancing , 1 ),
139
+ }
140
+
141
+
142
+ def item_is_filler (item_name : str ) -> bool :
143
+ return item_table [item_name ].classification == ItemClassification .filler
144
+
145
+
146
+ filler_items : List [str ] = list (filter (item_is_filler , item_table .keys ()))
0 commit comments