-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdespots_game.py
More file actions
400 lines (355 loc) · 12.7 KB
/
Copy pathdespots_game.py
File metadata and controls
400 lines (355 loc) · 12.7 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
from __future__ import annotations
from typing import List
from dataclasses import dataclass
from Options import DefaultOnToggle
from ..game import Game
from ..game_objective_template import GameObjectiveTemplate
from ..enums import KeymastersKeepGamePlatforms
@dataclass
class DespotsGameArchipelagoOptions:
despots_include_campaign: DespotsIncludeCampaign
despots_include_endless: DespotsIncludeEndless
despots_include_king_of_the_hill: DespotsIncludeKingOfTheHill
despots_include_challenge_modifiers: DespotsIncludeChallengeModifiers
class DespotsGame(Game):
name = "Despot's Game"
platform = KeymastersKeepGamePlatforms.PC
platforms_other = [
KeymastersKeepGamePlatforms.SW,
KeymastersKeepGamePlatforms.PS4,
KeymastersKeepGamePlatforms.PS5,
KeymastersKeepGamePlatforms.XONE,
KeymastersKeepGamePlatforms.XSX,
]
is_adult_only_or_unrated = False
options_cls = DespotsGameArchipelagoOptions
# Property checks
@property
def include_campaign(self) -> bool:
return self.archipelago_options.despots_include_campaign.value
@property
def include_endless(self) -> bool:
return self.archipelago_options.despots_include_endless.value
@property
def include_king_of_the_hill(self) -> bool:
return self.archipelago_options.despots_include_king_of_the_hill.value
@property
def include_challenge_modifiers(self) -> bool:
return self.archipelago_options.despots_include_challenge_modifiers.value
# Constraints
def optional_game_constraint_templates(self) -> List[GameObjectiveTemplate]:
return [
GameObjectiveTemplate(
label="No shop rerolls",
data={},
is_time_consuming=False,
is_difficult=True,
),
GameObjectiveTemplate(
label="No food purchases",
data={},
is_time_consuming=False,
is_difficult=True,
),
GameObjectiveTemplate(
label="Use only melee classes",
data={},
is_time_consuming=False,
is_difficult=True,
),
GameObjectiveTemplate(
label="Use only ranged classes",
data={},
is_time_consuming=False,
is_difficult=True,
),
GameObjectiveTemplate(
label="No mutations purchased",
data={},
is_time_consuming=False,
is_difficult=True,
),
GameObjectiveTemplate(
label="Limit team to TEAM_SIZE humans",
data={"TEAM_SIZE": (self.team_size_caps, 1)},
is_time_consuming=False,
is_difficult=True,
),
GameObjectiveTemplate(
label="Keep food above FOOD_MIN for the whole run",
data={"FOOD_MIN": (self.food_minimums, 1)},
is_time_consuming=False,
is_difficult=True,
),
GameObjectiveTemplate(
label="No healers in the run",
data={},
is_time_consuming=False,
is_difficult=True,
),
GameObjectiveTemplate(
label="Sacrifice at least 20 humans",
data={},
is_time_consuming=False,
is_difficult=False,
),
GameObjectiveTemplate(
label="Have at least 20 humans active at once",
data={},
is_time_consuming=False,
is_difficult=False,
),
GameObjectiveTemplate(
label="Take the first Tank you find and always keep a Tank alive",
data={},
is_time_consuming=False,
is_difficult=False,
),
GameObjectiveTemplate(
label="Maintain at least 3 different complete alliance bonuses",
data={},
is_time_consuming=False,
is_difficult=False,
),
GameObjectiveTemplate(
label="Save 150 gold at once",
data={},
is_time_consuming=False,
is_difficult=False,
),
GameObjectiveTemplate(
label="After winning, beat 5 King of the Hill opponents",
data={},
is_time_consuming=True,
is_difficult=True,
),
GameObjectiveTemplate(
label="Sacrifice one of your starting units to the pit",
data={},
is_time_consuming=False,
is_difficult=False,
),
]
# Objectives
def game_objective_templates(self) -> List[GameObjectiveTemplate]:
templates: List[GameObjectiveTemplate] = []
if self.include_campaign:
templates.extend([
GameObjectiveTemplate(
label="Beat the campaign with BUILD_THEME focus",
data={"BUILD_THEME": (self.build_themes, 1)},
is_time_consuming=False,
is_difficult=True,
weight=8,
),
GameObjectiveTemplate(
label="Beat the campaign with PRESET preset active",
data={"PRESET": (self.campaign_presets, 1)},
is_time_consuming=False,
is_difficult=True,
weight=7,
),
GameObjectiveTemplate(
label="Reach floor FLOOR_TARGET in the campaign",
data={"FLOOR_TARGET": (self.campaign_floor_targets, 1)},
is_time_consuming=False,
is_difficult=False,
weight=6,
),
GameObjectiveTemplate(
label="Defeat the final boss with at most TEAM_SIZE humans alive",
data={"TEAM_SIZE": (self.team_size_caps, 1)},
is_time_consuming=False,
is_difficult=True,
weight=6,
),
GameObjectiveTemplate(
label="Beat the campaign while fielding only CLASS_FAMILY classes",
data={"CLASS_FAMILY": (self.class_families, 1)},
is_time_consuming=False,
is_difficult=True,
weight=5,
),
])
if self.include_endless:
templates.extend([
GameObjectiveTemplate(
label="Win an Endless run with PRESET preset active",
data={"PRESET": (self.endless_presets, 1)},
is_time_consuming=False,
is_difficult=True,
weight=8,
),
GameObjectiveTemplate(
label="Survive to wave WAVE_TARGET in Endless mode",
data={"WAVE_TARGET": (self.endless_wave_targets, 1)},
is_time_consuming=False,
is_difficult=True,
weight=7,
),
GameObjectiveTemplate(
label="Defeat BOSSES_REQUIRED bosses in Endless mode",
data={"BOSSES_REQUIRED": (self.endless_boss_targets, 1)},
is_time_consuming=False,
is_difficult=True,
weight=5,
),
])
if self.include_king_of_the_hill:
templates.extend([
GameObjectiveTemplate(
label="Win KING_WINS consecutive King of the Hill battles with PRESET preset",
data={
"KING_WINS": (self.king_win_streaks, 1),
"PRESET": (self.king_presets, 1),
},
is_time_consuming=False,
is_difficult=True,
weight=5,
),
GameObjectiveTemplate(
label="Win KING_WINS consecutive King of the Hill battles",
data={"KING_WINS": (self.king_win_streaks, 1)},
is_time_consuming=False,
is_difficult=True,
weight=4,
),
GameObjectiveTemplate(
label="Reach rating RATING_TARGET in King of the Hill",
data={"RATING_TARGET": (self.king_rating_targets, 1)},
is_time_consuming=False,
is_difficult=True,
weight=4,
),
])
if self.include_challenge_modifiers:
templates.extend([
GameObjectiveTemplate(
label="Complete a run with MUTATOR active",
data={"MUTATOR": (self.challenge_modifiers, 1)},
is_time_consuming=False,
is_difficult=True,
weight=5,
),
GameObjectiveTemplate(
label="Win a run with MUTATION_SET mutation set as your core",
data={"MUTATION_SET": (self.mutation_sets, 1)},
is_time_consuming=False,
is_difficult=True,
weight=4,
),
])
return templates
# Data lists
@staticmethod
def build_themes() -> List[str]:
return [
"Fencers and Tricksters",
"Shooters and Throwers",
"Mages and Cultists",
"Tanks and Healers",
"Eggheads and Mimes",
"Mixed synergy (3+ families)"
]
@staticmethod
def class_families() -> List[str]:
return [
"Fencer",
"Trickster",
"Shooter",
"Thrower",
"Mage",
"Cultist",
"Tank",
"Healer",
"Egghead",
"Joker/Mime"
]
@staticmethod
def campaign_floor_targets() -> List[str]:
return ["4", "6", "8", "10"]
@staticmethod
def campaign_presets() -> List[str]:
return [
"Classic",
"Cannon Fodder",
"Sportspeople",
"Medieval",
"Cosplay",
"Special Mages",
"Cooking Show",
"Ultra Violence"
]
@staticmethod
def team_size_caps() -> List[str]:
return ["8", "10", "12", "14"]
@staticmethod
def food_minimums() -> List[str]:
return ["10", "20", "30"]
@staticmethod
def endless_wave_targets() -> List[str]:
return ["20", "30", "40", "50"]
@staticmethod
def endless_presets() -> List[str]:
return [
"Classic",
"Cannon Fodder",
"Sportspeople",
"Medieval",
"Cosplay",
"Special Mages",
"Cooking Show",
"Ultra Violence"
]
@staticmethod
def endless_boss_targets() -> List[str]:
return ["3", "5", "7"]
@staticmethod
def king_win_streaks() -> List[str]:
return ["3", "5", "7"]
@staticmethod
def king_presets() -> List[str]:
return [
"Classic",
"Cannon Fodder",
"Sportspeople",
"Medieval",
"Cosplay",
"Special Mages",
"Cooking Show",
"Ultra Violence"
]
@staticmethod
def king_rating_targets() -> List[str]:
return ["1200", "1400", "1600"]
@staticmethod
def challenge_modifiers() -> List[str]:
return [
"No food shops",
"Fog of war rooms",
"Double room sizes",
"Exploding corpses",
"Random teleports"
]
@staticmethod
def mutation_sets() -> List[str]:
return [
"Summoner synergy",
"Dodge and evasion",
"Armor stacking",
"Attack speed focus",
"Magic damage scaling"
]
# Archipelago Options
class DespotsIncludeCampaign(DefaultOnToggle):
"""Include campaign mode objectives."""
display_name = "Despot's Game Include Campaign"
class DespotsIncludeEndless(DefaultOnToggle):
"""Include Endless mode objectives."""
display_name = "Despot's Game Include Endless"
class DespotsIncludeKingOfTheHill(DefaultOnToggle):
"""Include King of the Hill mode objectives."""
display_name = "Despot's Game Include King of the Hill"
class DespotsIncludeChallengeModifiers(DefaultOnToggle):
"""Include runs with specific mutators/modifiers enabled."""
display_name = "Despot's Game Include Challenge Modifiers"