forked from OoTRandomizer/OoT-Randomizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DungeonList.py
128 lines (117 loc) · 3.41 KB
/
DungeonList.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import random
import os
from Dungeon import Dungeon
from Item import ItemFactory
from Utils import data_path
dungeon_table = [
{
'name': 'Deku Tree',
'boss_key': 0,
'small_key': 0,
'small_key_mq': 0,
'dungeon_item': 1,
},
{
'name': 'Dodongos Cavern',
'hint': 'Dodongo\'s Cavern',
'boss_key': 0,
'small_key': 0,
'small_key_mq': 0,
'dungeon_item': 1,
},
{
'name': 'Jabu Jabus Belly',
'hint': 'Jabu Jabu\'s Belly',
'boss_key': 0,
'small_key': 0,
'small_key_mq': 0,
'dungeon_item': 1,
},
{
'name': 'Forest Temple',
'boss_key': 1,
'small_key': 5,
'small_key_mq': 6,
'dungeon_item': 1,
},
{
'name': 'Bottom of the Well',
'boss_key': 0,
'small_key': 3,
'small_key_mq': 2,
'dungeon_item': 1,
},
{
'name': 'Fire Temple',
'boss_key': 1,
'small_key': 8,
'small_key_mq': 5,
'dungeon_item': 1,
},
{
'name': 'Ice Cavern',
'boss_key': 0,
'small_key': 0,
'small_key_mq': 0,
'dungeon_item': 1,
},
{
'name': 'Water Temple',
'boss_key': 1,
'small_key': 6,
'small_key_mq': 2,
'dungeon_item': 1,
},
{
'name': 'Shadow Temple',
'boss_key': 1,
'small_key': 5,
'small_key_mq': 6,
'dungeon_item': 1,
},
{
'name': 'Gerudo Training Grounds',
'boss_key': 0,
'small_key': 9,
'small_key_mq': 3,
'dungeon_item': 0,
},
{
'name': 'Spirit Temple',
'boss_key': 1,
'small_key': 5,
'small_key_mq': 7,
'dungeon_item': 1,
},
{
'name': 'Ganons Castle',
'hint': 'Ganon\'s Castle',
'boss_key': 1,
'small_key': 2,
'small_key_mq': 3,
'dungeon_item': 0,
},
]
def create_dungeons(world):
for dungeon_info in dungeon_table:
name = dungeon_info['name']
hint = dungeon_info['hint'] if 'hint' in dungeon_info else name
if world.settings.logic_rules == 'glitched':
if not world.dungeon_mq[name]:
dungeon_json = os.path.join(data_path('Glitched World'), name + '.json')
else:
dungeon_json = os.path.join(data_path('Glitched World'), name + ' MQ.json')
else:
if not world.dungeon_mq[name]:
dungeon_json = os.path.join(data_path('World'), name + '.json')
else:
dungeon_json = os.path.join(data_path('World'), name + ' MQ.json')
world.load_regions_from_json(dungeon_json)
boss_keys = ItemFactory(['Boss Key (%s)' % name] * dungeon_info['boss_key'])
if not world.dungeon_mq[dungeon_info['name']]:
small_keys = ItemFactory(['Small Key (%s)' % name] * dungeon_info['small_key'])
else:
small_keys = ItemFactory(['Small Key (%s)' % name] * dungeon_info['small_key_mq'])
dungeon_items = ItemFactory(['Map (%s)' % name,
'Compass (%s)' % name] * dungeon_info['dungeon_item'])
world.dungeons.append(Dungeon(world, name, hint, boss_keys, small_keys, dungeon_items))