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,
48 'description' => 'Generate race ROM, seed will be hidden',
49 'description_localizations' => [
50 'de' => 'Race ROM generieren, Seed wird versteckt.',
57 $discord->application->commands->save($cmd);
60 public static function listen(Discord $discord) {
61 $discord->listenCommand(['aosr', 'preset'], function(Interaction $interaction) use ($discord) {
63 ->acknowledgeWithResponse()
64 ->done(function() use($discord, $interaction) {
65 $presetName = $interaction->data->options['preset']->options['preset']->value;
66 $race = isset($interaction->data->options['preset']->options['race'])
67 ? $interaction->data->options['preset']->options['race']->value : false;
68 $message = MessageBuilder::new();
69 if (isset(static::$presets[$presetName])) {
70 $preset = static::$presets[$presetName];
71 $seed = AosSeed::generateSurge($presetName, $preset['settings'], $race);
73 $embed = new Embed($discord, [
75 new Field($discord, [ 'name' => 'Generator', 'value' => 'This seed has been generated with fusecv\'s randomizer on aosrando.surge.sh.' ]),
76 new Field($discord, [ 'name' => 'Preset', 'value' => $preset['name'], 'inline' => true ]),
77 new Field($discord, [ 'name' => 'Seed', 'value' => $race ? 'secret' : $seed->seed, 'inline' => true ]),
78 new Field($discord, [ 'name' => 'Logic', 'value' => $preset['settings']['logic'], 'inline' => true ]),
79 new Field($discord, [ 'name' => 'Area', 'value' => $preset['settings']['area'], 'inline' => true ]),
80 new Field($discord, [ 'name' => 'Boss', 'value' => $preset['settings']['boss'], 'inline' => true ]),
81 new Field($discord, [ 'name' => 'Enemy', 'value' => $preset['settings']['enemy'], 'inline' => true ]),
82 new Field($discord, [ 'name' => 'Permalink', 'value' => $seed->permalink ]),
84 'footer' => new Footer($discord, [
88 'title' => 'AoSRando Seed',
90 'url' => $seed->permalink,
92 $message->addEmbed($embed);
94 $message->setContent('unknown preset '.$presetName);
96 $interaction->updateOriginalResponse($message);
102 private static $presets = [
107 'logic' => 'AreaTechTiers',
108 'nodupes' => 'false',
109 'panther' => 'Rand70Dup',
112 'enemy' => 'Vanilla',
113 'itempool' => 'Standard',
115 'grahm' => 'BookSouls',
117 'startshop' => 'Vanilla',
118 'shopprice' => 'Vanilla',
119 'shopSouls' => 'Vanilla',
120 'levelexp' => 'Vanilla',
121 'telestart' => 'false',
122 'mapassist' => 'false',
123 'doublechaos' => 'false',
124 'palette' => 'Vanilla',
128 'name' => 'Beginner',
129 'value' => 'Beginner',
131 'logic' => 'AreaTechTiers',
132 'nodupes' => 'false',
133 'panther' => 'FirstAlways',
136 'enemy' => 'Vanilla',
137 'itempool' => 'Standard',
139 'grahm' => 'BookSouls',
141 'startshop' => 'Unlocked30k',
142 'shopprice' => 'Vanilla',
143 'shopSouls' => '2PerGroup',
144 'levelexp' => 'Casual',
145 'telestart' => 'false',
146 'mapassist' => 'true',
147 'doublechaos' => 'false',
148 'palette' => 'Vanilla',
152 'name' => 'Spicy normal',
153 'value' => 'SpicyNormal',
155 'logic' => 'VeryRandom',
157 'panther' => 'Rand70Dup',
159 'boss' => 'Dead-endShuffle',
160 'enemy' => 'RandomPM20',
161 'itempool' => 'Standard',
163 'grahm' => 'BookSouls',
165 'startshop' => 'Unlocked30k',
166 'shopprice' => 'RandHV',
167 'shopSouls' => 'Half',
168 'levelexp' => 'Hard',
169 'telestart' => 'true',
170 'mapassist' => 'false',
171 'doublechaos' => 'false',
172 'palette' => 'Vanilla',
175 'ExtraFastNormal' => [
176 'name' => 'Extra fast normal',
177 'value' => 'ExtraFastNormal',
179 'logic' => 'AreaTechTiers',
180 'nodupes' => 'false',
181 'panther' => 'FirstAlways',
184 'enemy' => 'Vanilla',
185 'itempool' => 'Standard',
187 'grahm' => 'NoCheck',
189 'startshop' => 'Unlocked30k',
190 'shopprice' => 'RandHV',
191 'shopSouls' => 'Half',
192 'levelexp' => 'Vanilla',
193 'telestart' => 'true',
194 'mapassist' => 'false',
195 'doublechaos' => 'false',
196 'palette' => 'Vanilla',
203 'logic' => 'AreaTechTiers',
204 'nodupes' => 'false',
205 'panther' => 'Rand70Dup',
206 'area' => 'AreaRandom',
207 'boss' => 'Dead-endShuffle',
208 'enemy' => 'Vanilla',
209 'itempool' => 'Standard',
211 'grahm' => 'BookSouls',
213 'startshop' => 'Vanilla',
214 'shopprice' => 'Vanilla',
215 'shopSouls' => 'Vanilla',
216 'levelexp' => 'Vanilla',
217 'telestart' => 'false',
218 'mapassist' => 'false',
219 'doublechaos' => 'false',
220 'palette' => 'Vanilla',
224 'name' => 'Area beginner',
225 'value' => 'AreaBeginner',
227 'logic' => 'AreaTechTiers',
228 'nodupes' => 'false',
229 'panther' => 'FirstAlways',
230 'area' => 'AreaRandom',
231 'boss' => 'Dead-endShuffle',
232 'enemy' => 'Vanilla',
233 'itempool' => 'Standard',
235 'grahm' => 'BookSouls',
237 'startshop' => 'Unlocked30k',
238 'shopprice' => 'Vanilla',
239 'shopSouls' => '2PerGroup',
240 'levelexp' => 'Casual',
241 'telestart' => 'false',
242 'mapassist' => 'true',
243 'doublechaos' => 'false',
244 'palette' => 'Vanilla',
248 'name' => 'Area spicy',
249 'value' => 'AreaSpicy',
251 'logic' => 'AreaTechTiers',
253 'panther' => 'Rand70Dup',
254 'area' => 'AreaRandom',
255 'boss' => 'Dead-endShuffle',
256 'enemy' => 'RandomPM20',
257 'itempool' => 'Standard',
259 'grahm' => 'BookSouls',
261 'startshop' => 'Unlocked30k',
262 'shopprice' => 'RandHV',
263 'shopSouls' => 'Half',
264 'levelexp' => 'Hard',
265 'telestart' => 'true',
266 'mapassist' => 'false',
267 'doublechaos' => 'false',
268 'palette' => 'Vanilla',
272 'name' => 'Area all bosses',
273 'value' => 'AreaAllBosses',
275 'logic' => 'AreaTechTiers',
276 'nodupes' => 'false',
277 'panther' => 'Rand70Dup',
278 'area' => 'AreaRandom',
279 'boss' => 'Dead-endShuffle',
280 'enemy' => 'Vanilla',
281 'itempool' => 'Standard',
283 'grahm' => 'AllBosses',
285 'startshop' => 'Unlocked',
286 'shopprice' => 'Vanilla',
287 'shopSouls' => '2PerGroup',
288 'levelexp' => 'Vanilla',
289 'telestart' => 'false',
290 'mapassist' => 'false',
291 'doublechaos' => 'false',
292 'palette' => 'Vanilla',
296 'name' => 'Area extra fast',
297 'value' => 'AreaExtraFast',
299 'logic' => 'AreaTechTiers',
300 'nodupes' => 'false',
301 'panther' => 'FirstAlways',
302 'area' => 'AreaRandom',
303 'boss' => 'Dead-endShuffle',
304 'enemy' => 'Vanilla',
305 'itempool' => 'Standard',
307 'grahm' => 'NoCheck',
309 'startshop' => 'Unlocked30k',
310 'shopprice' => 'RandHV',
311 'shopSouls' => 'Half',
312 'levelexp' => 'Vanilla',
313 'telestart' => 'true',
314 'mapassist' => 'false',
315 'doublechaos' => 'false',
316 'palette' => 'Vanilla',
320 'name' => 'Area expert',
321 'value' => 'AreaExpert',
323 'logic' => 'AreaTechTiers',
325 'panther' => 'NeverExists',
326 'area' => 'AreaRandom',
327 'boss' => 'Dead-endShuffle',
328 'enemy' => 'RandomNoLimit',
329 'itempool' => 'Standard',
331 'grahm' => 'BookSouls',
333 'startshop' => 'Vanilla',
334 'shopprice' => 'Vanilla',
335 'shopSouls' => 'Half',
336 'levelexp' => 'Lvl1',
337 'telestart' => 'false',
338 'mapassist' => 'false',
339 'doublechaos' => 'true',
340 'palette' => 'Vanilla',
343 'DoorAllBossesEasy' => [
344 'name' => 'Door all bosses easy',
345 'value' => 'DoorAllBossesEasy',
347 'logic' => 'AreaTechTiers',
348 'nodupes' => 'false',
349 'panther' => 'Rand70Dup',
350 'area' => 'DoorRandom',
352 'enemy' => 'Vanilla',
353 'itempool' => 'Standard',
355 'grahm' => 'AllBosses',
357 'startshop' => 'Unlocked',
358 'shopprice' => 'Vanilla',
359 'shopSouls' => '2PerGroup',
360 'levelexp' => 'Vanilla',
361 'telestart' => 'true',
362 'mapassist' => 'true',
363 'doublechaos' => 'false',
364 'palette' => 'Vanilla',
368 'name' => 'Door all bosses',
369 'value' => 'DoorAllBosses',
371 'logic' => 'AreaTechTiers',
372 'nodupes' => 'false',
373 'panther' => 'Rand70Dup',
374 'area' => 'DoorRandom',
376 'enemy' => 'RandomPM20',
377 'itempool' => 'Standard',
379 'grahm' => 'AllBosses',
381 'startshop' => 'Vanilla',
382 'shopprice' => 'Vanilla',
383 'shopSouls' => '2PerGroup',
384 'levelexp' => 'Vanilla',
385 'telestart' => 'false',
386 'mapassist' => 'false',
387 'doublechaos' => 'false',
388 'palette' => 'Vanilla',
392 'name' => 'SGLive 2020',
393 'value' => 'SGLive2020',
395 'logic' => 'AreaTechTiers',
396 'nodupes' => 'false',
397 'panther' => 'Rand70Dup',
400 'enemy' => 'Vanilla',
401 'itempool' => 'Standard',
403 'grahm' => 'BookSouls',
405 'startshop' => 'Vanilla',
406 'shopprice' => 'Vanilla',
407 'shopSouls' => 'Vanilla',
408 'levelexp' => 'Vanilla',
409 'telestart' => 'false',
410 'mapassist' => 'false',
411 'doublechaos' => 'false',
412 'palette' => 'Vanilla',
416 'name' => 'SGLive 2021',
417 'value' => 'SGLive2021',
419 'logic' => 'AreaTechTiers',
420 'nodupes' => 'false',
421 'panther' => 'FirstAlways',
422 'area' => 'AreaRandom',
423 'boss' => 'Dead-endShuffle',
424 'enemy' => 'Vanilla',
425 'itempool' => 'Standard',
427 'grahm' => 'BookSouls',
429 'startshop' => 'Unlocked30k',
430 'shopprice' => 'RandHV',
431 'shopSouls' => 'Half',
432 'levelexp' => 'Vanilla',
433 'telestart' => 'false',
434 'mapassist' => 'false',
435 'doublechaos' => 'false',
436 'palette' => 'Vanilla',
439 'Tournament2021' => [
440 'name' => 'Tournament 2021',
441 'value' => 'Tournament2021',
443 'logic' => 'AreaTechTiers',
444 'nodupes' => 'false',
445 'panther' => 'Rand70Dup',
446 'area' => 'AreaRandom',
447 'boss' => 'Dead-endShuffle',
448 'enemy' => 'Vanilla',
449 'itempool' => 'Standard',
451 'grahm' => 'BookSouls',
453 'startshop' => 'Unlocked30k',
454 'shopprice' => 'RandHV',
455 'shopSouls' => 'Half',
456 'levelexp' => 'Vanilla',
457 'telestart' => 'false',
458 'mapassist' => 'false',
459 'doublechaos' => 'false',
460 'palette' => 'Vanilla',
463 'Tournament2022' => [
464 'name' => 'Tournament 2022',
465 'value' => 'Tournament2022',
467 'logic' => 'AreaTechTiers',
468 'nodupes' => 'false',
469 'panther' => 'FirstAlways',
470 'area' => 'AreaRandom',
471 'boss' => 'Dead-endShuffle',
472 'enemy' => 'Vanilla',
473 'itempool' => 'Standard',
475 'grahm' => 'BookSouls',
477 'startshop' => 'Unlocked30k',
478 'shopprice' => 'RandHV',
479 'shopSouls' => 'Half',
480 'levelexp' => 'Vanilla',
481 'telestart' => 'false',
482 'mapassist' => 'false',
483 'doublechaos' => 'false',
484 'palette' => 'Vanilla',