3 namespace App\DiscordAppCommands;
5 use App\Models\AosSeed;
6 use Discord\Builders\MessageBuilder;
8 use Discord\Parts\Embed\Embed;
9 use Discord\Parts\Embed\Field;
10 use Discord\Parts\Embed\Footer;
11 use Discord\Parts\Interactions\Interaction;
13 class AosrPresetCommand {
15 public static function create(Discord $discord) {
17 foreach (static::$presets as $preset) {
19 'name' => $preset['name'],
20 'value' => $preset['value'],
23 $cmd = $discord->application->commands->create([
26 'description' => 'Generate an AoSRando seed.',
27 'description_localizations' => [
28 'de' => 'Generiert einen AoSRando Seed.',
32 'description' => 'Generate an AoSRando seed from preset.',
33 'description_localizations' => [
34 'de' => 'Generiert einen AoSRando Seed anhand eines Presets.',
39 'description' => 'Which preset to use',
40 'description_localizations' => [
41 'de' => 'Welches Preset genutzt werden soll.',
45 'choices' => $choices,
49 $discord->application->commands->save($cmd);
52 public static function listen(Discord $discord) {
53 $discord->listenCommand(['aosr', 'preset'], function(Interaction $interaction) use ($discord) {
55 ->acknowledgeWithResponse()
56 ->done(function() use($discord, $interaction) {
57 $presetName = $interaction->data->options['preset']->options['preset']->value;
58 $message = MessageBuilder::new();
59 if (isset(static::$presets[$presetName])) {
60 $preset = static::$presets[$presetName];
61 $seed = AosSeed::generateSurge($presetName, $preset['settings']);
63 $embed = new Embed($discord, [
65 new Field($discord, [ 'name' => 'Generator', 'value' => 'This seed has been generated with fusecv\'s randomizer on aosrando.surge.sh.' ]),
66 new Field($discord, [ 'name' => 'Preset', 'value' => $preset['name'], 'inline' => true ]),
67 new Field($discord, [ 'name' => 'Seed', 'value' => $seed->seed, 'inline' => true ]),
68 new Field($discord, [ 'name' => 'Logic', 'value' => $preset['settings']['logic'], 'inline' => true ]),
69 new Field($discord, [ 'name' => 'Area', 'value' => $preset['settings']['area'], 'inline' => true ]),
70 new Field($discord, [ 'name' => 'Boss', 'value' => $preset['settings']['boss'], 'inline' => true ]),
71 new Field($discord, [ 'name' => 'Enemy', 'value' => $preset['settings']['enemy'], 'inline' => true ]),
72 new Field($discord, [ 'name' => 'Permalink', 'value' => $seed->permalink ]),
74 'footer' => new Footer($discord, [
78 'title' => 'AoSRando Seed',
80 'url' => $seed->permalink,
82 $message->addEmbed($embed);
84 $message->setContent('unknown preset '.$presetName);
86 $interaction->updateOriginalResponse($message);
92 private static $presets = [
97 'logic' => 'AreaTechTiers',
99 'panther' => 'Rand70Dup',
102 'enemy' => 'Vanilla',
103 'itempool' => 'Standard',
105 'grahm' => 'BookSouls',
107 'startshop' => 'Vanilla',
108 'shopprice' => 'Vanilla',
109 'shopSouls' => 'Vanilla',
110 'levelexp' => 'Vanilla',
111 'telestart' => 'false',
112 'mapassist' => 'false',
113 'doublechaos' => 'false',
114 'palette' => 'Vanilla',
118 'name' => 'Beginner',
119 'value' => 'Beginner',
121 'logic' => 'AreaTechTiers',
122 'nodupes' => 'false',
123 'panther' => 'FirstAlways',
126 'enemy' => 'Vanilla',
127 'itempool' => 'Standard',
129 'grahm' => 'BookSouls',
131 'startshop' => 'Unlocked30k',
132 'shopprice' => 'Vanilla',
133 'shopSouls' => '2PerGroup',
134 'levelexp' => 'Casual',
135 'telestart' => 'false',
136 'mapassist' => 'true',
137 'doublechaos' => 'false',
138 'palette' => 'Vanilla',
142 'name' => 'Spicy normal',
143 'value' => 'SpicyNormal',
145 'logic' => 'VeryRandom',
147 'panther' => 'Rand70Dup',
149 'boss' => 'Dead-endShuffle',
150 'enemy' => 'RandomPM20',
151 'itempool' => 'Standard',
153 'grahm' => 'BookSouls',
155 'startshop' => 'Unlocked30k',
156 'shopprice' => 'RandHV',
157 'shopSouls' => 'Half',
158 'levelexp' => 'Hard',
159 'telestart' => 'true',
160 'mapassist' => 'false',
161 'doublechaos' => 'false',
162 'palette' => 'Vanilla',
165 'ExtraFastNormal' => [
166 'name' => 'Extra fast normal',
167 'value' => 'ExtraFastNormal',
169 'logic' => 'AreaTechTiers',
170 'nodupes' => 'false',
171 'panther' => 'FirstAlways',
174 'enemy' => 'Vanilla',
175 'itempool' => 'Standard',
177 'grahm' => 'NoCheck',
179 'startshop' => 'Unlocked30k',
180 'shopprice' => 'RandHV',
181 'shopSouls' => 'Half',
182 'levelexp' => 'Vanilla',
183 'telestart' => 'true',
184 'mapassist' => 'false',
185 'doublechaos' => 'false',
186 'palette' => 'Vanilla',
193 'logic' => 'AreaTechTiers',
194 'nodupes' => 'false',
195 'panther' => 'Rand70Dup',
196 'area' => 'AreaRandom',
197 'boss' => 'Dead-endShuffle',
198 'enemy' => 'Vanilla',
199 'itempool' => 'Standard',
201 'grahm' => 'BookSouls',
203 'startshop' => 'Vanilla',
204 'shopprice' => 'Vanilla',
205 'shopSouls' => 'Vanilla',
206 'levelexp' => 'Vanilla',
207 'telestart' => 'false',
208 'mapassist' => 'false',
209 'doublechaos' => 'false',
210 'palette' => 'Vanilla',
214 'name' => 'Area beginner',
215 'value' => 'AreaBeginner',
217 'logic' => 'AreaTechTiers',
218 'nodupes' => 'false',
219 'panther' => 'FirstAlways',
220 'area' => 'AreaRandom',
221 'boss' => 'Dead-endShuffle',
222 'enemy' => 'Vanilla',
223 'itempool' => 'Standard',
225 'grahm' => 'BookSouls',
227 'startshop' => 'Unlocked30k',
228 'shopprice' => 'Vanilla',
229 'shopSouls' => '2PerGroup',
230 'levelexp' => 'Casual',
231 'telestart' => 'false',
232 'mapassist' => 'true',
233 'doublechaos' => 'false',
234 'palette' => 'Vanilla',
238 'name' => 'Area spicy',
239 'value' => 'AreaSpicy',
241 'logic' => 'AreaTechTiers',
243 'panther' => 'Rand70Dup',
244 'area' => 'AreaRandom',
245 'boss' => 'Dead-endShuffle',
246 'enemy' => 'RandomPM20',
247 'itempool' => 'Standard',
249 'grahm' => 'BookSouls',
251 'startshop' => 'Unlocked30k',
252 'shopprice' => 'RandHV',
253 'shopSouls' => 'Half',
254 'levelexp' => 'Hard',
255 'telestart' => 'true',
256 'mapassist' => 'false',
257 'doublechaos' => 'false',
258 'palette' => 'Vanilla',
262 'name' => 'Area all bosses',
263 'value' => 'AreaAllBosses',
265 'logic' => 'AreaTechTiers',
266 'nodupes' => 'false',
267 'panther' => 'Rand70Dup',
268 'area' => 'AreaRandom',
269 'boss' => 'Dead-endShuffle',
270 'enemy' => 'Vanilla',
271 'itempool' => 'Standard',
273 'grahm' => 'AllBosses',
275 'startshop' => 'Unlocked',
276 'shopprice' => 'Vanilla',
277 'shopSouls' => '2PerGroup',
278 'levelexp' => 'Vanilla',
279 'telestart' => 'false',
280 'mapassist' => 'false',
281 'doublechaos' => 'false',
282 'palette' => 'Vanilla',
286 'name' => 'Area extra fast',
287 'value' => 'AreaExtraFast',
289 'logic' => 'AreaTechTiers',
290 'nodupes' => 'false',
291 'panther' => 'FirstAlways',
292 'area' => 'AreaRandom',
293 'boss' => 'Dead-endShuffle',
294 'enemy' => 'Vanilla',
295 'itempool' => 'Standard',
297 'grahm' => 'NoCheck',
299 'startshop' => 'Unlocked30k',
300 'shopprice' => 'RandHV',
301 'shopSouls' => 'Half',
302 'levelexp' => 'Vanilla',
303 'telestart' => 'true',
304 'mapassist' => 'false',
305 'doublechaos' => 'false',
306 'palette' => 'Vanilla',
310 'name' => 'Area expert',
311 'value' => 'AreaExpert',
313 'logic' => 'AreaTechTiers',
315 'panther' => 'NeverExists',
316 'area' => 'AreaRandom',
317 'boss' => 'Dead-endShuffle',
318 'enemy' => 'RandomNoLimit',
319 'itempool' => 'Standard',
321 'grahm' => 'BookSouls',
323 'startshop' => 'Vanilla',
324 'shopprice' => 'Vanilla',
325 'shopSouls' => 'Half',
326 'levelexp' => 'Lvl1',
327 'telestart' => 'false',
328 'mapassist' => 'false',
329 'doublechaos' => 'true',
330 'palette' => 'Vanilla',
333 'DoorAllBossesEasy' => [
334 'name' => 'Door all bosses easy',
335 'value' => 'DoorAllBossesEasy',
337 'logic' => 'AreaTechTiers',
338 'nodupes' => 'false',
339 'panther' => 'Rand70Dup',
340 'area' => 'DoorRandom',
342 'enemy' => 'Vanilla',
343 'itempool' => 'Standard',
345 'grahm' => 'AllBosses',
347 'startshop' => 'Unlocked',
348 'shopprice' => 'Vanilla',
349 'shopSouls' => '2PerGroup',
350 'levelexp' => 'Vanilla',
351 'telestart' => 'true',
352 'mapassist' => 'true',
353 'doublechaos' => 'false',
354 'palette' => 'Vanilla',
358 'name' => 'Door all bosses',
359 'value' => 'DoorAllBosses',
361 'logic' => 'AreaTechTiers',
362 'nodupes' => 'false',
363 'panther' => 'Rand70Dup',
364 'area' => 'DoorRandom',
366 'enemy' => 'RandomPM20',
367 'itempool' => 'Standard',
369 'grahm' => 'AllBosses',
371 'startshop' => 'Vanilla',
372 'shopprice' => 'Vanilla',
373 'shopSouls' => '2PerGroup',
374 'levelexp' => 'Vanilla',
375 'telestart' => 'false',
376 'mapassist' => 'false',
377 'doublechaos' => 'false',
378 'palette' => 'Vanilla',
382 'name' => 'SGLive 2020',
383 'value' => 'SGLive2020',
385 'logic' => 'AreaTechTiers',
386 'nodupes' => 'false',
387 'panther' => 'Rand70Dup',
390 'enemy' => 'Vanilla',
391 'itempool' => 'Standard',
393 'grahm' => 'BookSouls',
395 'startshop' => 'Vanilla',
396 'shopprice' => 'Vanilla',
397 'shopSouls' => 'Vanilla',
398 'levelexp' => 'Vanilla',
399 'telestart' => 'false',
400 'mapassist' => 'false',
401 'doublechaos' => 'false',
402 'palette' => 'Vanilla',
406 'name' => 'SGLive 2021',
407 'value' => 'SGLive2021',
409 'logic' => 'AreaTechTiers',
410 'nodupes' => 'false',
411 'panther' => 'FirstAlways',
412 'area' => 'AreaRandom',
413 'boss' => 'Dead-endShuffle',
414 'enemy' => 'Vanilla',
415 'itempool' => 'Standard',
417 'grahm' => 'BookSouls',
419 'startshop' => 'Unlocked30k',
420 'shopprice' => 'RandHV',
421 'shopSouls' => 'Half',
422 'levelexp' => 'Vanilla',
423 'telestart' => 'false',
424 'mapassist' => 'false',
425 'doublechaos' => 'false',
426 'palette' => 'Vanilla',
429 'Tournament2021' => [
430 'name' => 'Tournament 2021',
431 'value' => 'Tournament2021',
433 'logic' => 'AreaTechTiers',
434 'nodupes' => 'false',
435 'panther' => 'Rand70Dup',
436 'area' => 'AreaRandom',
437 'boss' => 'Dead-endShuffle',
438 'enemy' => 'Vanilla',
439 'itempool' => 'Standard',
441 'grahm' => 'BookSouls',
443 'startshop' => 'Unlocked30k',
444 'shopprice' => 'RandHV',
445 'shopSouls' => 'Half',
446 'levelexp' => 'Vanilla',
447 'telestart' => 'false',
448 'mapassist' => 'false',
449 'doublechaos' => 'false',
450 'palette' => 'Vanilla',
453 'Tournament2022' => [
454 'name' => 'Tournament 2022',
455 'value' => 'Tournament2022',
457 'logic' => 'AreaTechTiers',
458 'nodupes' => 'false',
459 'panther' => 'FirstAlways',
460 'area' => 'AreaRandom',
461 'boss' => 'Dead-endShuffle',
462 'enemy' => 'Vanilla',
463 'itempool' => 'Standard',
465 'grahm' => 'BookSouls',
467 'startshop' => 'Unlocked30k',
468 'shopprice' => 'RandHV',
469 'shopSouls' => 'Half',
470 'levelexp' => 'Vanilla',
471 'telestart' => 'false',
472 'mapassist' => 'false',
473 'doublechaos' => 'false',
474 'palette' => 'Vanilla',