3 namespace App\DiscordAppCommands;
5 use Discord\Builders\MessageBuilder;
7 use Discord\Parts\Embed\Embed;
8 use Discord\Parts\Embed\Field;
9 use Discord\Parts\Embed\Footer;
10 use Discord\Parts\Interactions\Interaction;
12 class AosrPresetCommand {
14 public static function create(Discord $discord) {
16 foreach (static::$presets as $preset) {
18 'name' => $preset['name'],
19 'value' => $preset['value'],
22 $cmd = $discord->application->commands->create([
25 'description' => '(testing) Generate an AoSRando seed.',
26 'description_localizations' => [
27 'de' => '(test) Generiert einen AoSRando Seed.',
31 'description' => '(testing) Generate an AoSRando seed from preset.',
32 'description_localizations' => [
33 'de' => '(test) Generiert einen AoSRando Seed anhand eines Presets.',
38 'description' => 'Which preset to use',
39 'description_localizations' => [
40 'de' => 'Welches Preset genutzt werden soll.',
44 'choices' => $choices,
48 $discord->application->commands->save($cmd);
51 public static function listen(Discord $discord) {
52 $discord->listenCommand(['aosr', 'preset'], function(Interaction $interaction) use ($discord) {
53 $presetName = $interaction->data->options['preset']->options['preset']->value;
54 $message = MessageBuilder::new();
55 if (isset(static::$presets[$presetName])) {
56 $preset = static::$presets[$presetName];
57 $seed = strval(random_int(-2147483648, 2147483647));
58 $params = array_merge(['seed' => $seed], $preset['settings']);
59 $url = 'https://aosrando.surge.sh/?'.http_build_query($params, '', '&');
60 $embed = new Embed($discord, [
62 new Field($discord, [ 'name' => 'Preset', 'value' => $preset['name'], 'inline' => true ]),
63 new Field($discord, [ 'name' => 'Seed', 'value' => $seed, 'inline' => true ]),
64 new Field($discord, [ 'name' => 'Logic', 'value' => $preset['settings']['logic'], 'inline' => true ]),
65 new Field($discord, [ 'name' => 'Area', 'value' => $preset['settings']['area'], 'inline' => true ]),
66 new Field($discord, [ 'name' => 'Boss', 'value' => $preset['settings']['boss'], 'inline' => true ]),
67 new Field($discord, [ 'name' => 'Enemy', 'value' => $preset['settings']['enemy'], 'inline' => true ]),
68 new Field($discord, [ 'name' => 'Link', 'value' => $url ]),
70 'footer' => new Footer($discord, [
74 'title' => 'AoSRando Seed',
78 $message->addEmbed($embed);
80 $message->setContent('unknown preset '.$presetName);
82 $interaction->respondWithMessage($message);
87 private static $presets = [
92 'logic' => 'AreaTechTiers',
94 'panther' => 'Rand70Dup',
98 'itempool' => 'Standard',
100 'grahm' => 'BookSouls',
102 'startshop' => 'Vanilla',
103 'shopprice' => 'Vanilla',
104 'shopSouls' => 'Vanilla',
105 'levelexp' => 'Vanilla',
106 'telestart' => 'false',
107 'mapassist' => 'false',
108 'doublechaos' => 'false',
109 'palette' => 'Vanilla',
113 'name' => 'Beginner',
114 'value' => 'Beginner',
116 'logic' => 'AreaTechTiers',
117 'nodupes' => 'false',
118 'panther' => 'FirstAlways',
121 'enemy' => 'Vanilla',
122 'itempool' => 'Standard',
124 'grahm' => 'BookSouls',
126 'startshop' => 'Unlocked30k',
127 'shopprice' => 'Vanilla',
128 'shopSouls' => '2PerGroup',
129 'levelexp' => 'Casual',
130 'telestart' => 'false',
131 'mapassist' => 'true',
132 'doublechaos' => 'false',
133 'palette' => 'Vanilla',
137 'name' => 'Spicy normal',
138 'value' => 'SpicyNormal',
140 'logic' => 'VeryRandom',
142 'panther' => 'Rand70Dup',
144 'boss' => 'Dead-endShuffle',
145 'enemy' => 'RandomPM20',
146 'itempool' => 'Standard',
148 'grahm' => 'BookSouls',
150 'startshop' => 'Unlocked30k',
151 'shopprice' => 'RandHV',
152 'shopSouls' => 'Half',
153 'levelexp' => 'Hard',
154 'telestart' => 'true',
155 'mapassist' => 'false',
156 'doublechaos' => 'false',
157 'palette' => 'Vanilla',
160 'ExtraFastNormal' => [
161 'name' => 'Extra fast normal',
162 'value' => 'ExtraFastNormal',
164 'logic' => 'AreaTechTiers',
165 'nodupes' => 'false',
166 'panther' => 'FirstAlways',
169 'enemy' => 'Vanilla',
170 'itempool' => 'Standard',
172 'grahm' => 'NoCheck',
174 'startshop' => 'Unlocked30k',
175 'shopprice' => 'RandHV',
176 'shopSouls' => 'Half',
177 'levelexp' => 'Vanilla',
178 'telestart' => 'true',
179 'mapassist' => 'false',
180 'doublechaos' => 'false',
181 'palette' => 'Vanilla',
188 'logic' => 'AreaTechTiers',
189 'nodupes' => 'false',
190 'panther' => 'Rand70Dup',
191 'area' => 'AreaRandom',
192 'boss' => 'Dead-endShuffle',
193 'enemy' => 'Vanilla',
194 'itempool' => 'Standard',
196 'grahm' => 'BookSouls',
198 'startshop' => 'Vanilla',
199 'shopprice' => 'Vanilla',
200 'shopSouls' => 'Vanilla',
201 'levelexp' => 'Vanilla',
202 'telestart' => 'false',
203 'mapassist' => 'false',
204 'doublechaos' => 'false',
205 'palette' => 'Vanilla',
209 'name' => 'Area beginner',
210 'value' => 'AreaBeginner',
212 'logic' => 'AreaTechTiers',
213 'nodupes' => 'false',
214 'panther' => 'FirstAlways',
215 'area' => 'AreaRandom',
216 'boss' => 'Dead-endShuffle',
217 'enemy' => 'Vanilla',
218 'itempool' => 'Standard',
220 'grahm' => 'BookSouls',
222 'startshop' => 'Unlocked30k',
223 'shopprice' => 'Vanilla',
224 'shopSouls' => '2PerGroup',
225 'levelexp' => 'Casual',
226 'telestart' => 'false',
227 'mapassist' => 'true',
228 'doublechaos' => 'false',
229 'palette' => 'Vanilla',
233 'name' => 'Area spicy',
234 'value' => 'AreaSpicy',
236 'logic' => 'AreaTechTiers',
238 'panther' => 'Rand70Dup',
239 'area' => 'AreaRandom',
240 'boss' => 'Dead-endShuffle',
241 'enemy' => 'RandomPM20',
242 'itempool' => 'Standard',
244 'grahm' => 'BookSouls',
246 'startshop' => 'Unlocked30k',
247 'shopprice' => 'RandHV',
248 'shopSouls' => 'Half',
249 'levelexp' => 'Hard',
250 'telestart' => 'true',
251 'mapassist' => 'false',
252 'doublechaos' => 'false',
253 'palette' => 'Vanilla',
257 'name' => 'Area all bosses',
258 'value' => 'AreaAllBosses',
260 'logic' => 'AreaTechTiers',
261 'nodupes' => 'false',
262 'panther' => 'Rand70Dup',
263 'area' => 'AreaRandom',
264 'boss' => 'Dead-endShuffle',
265 'enemy' => 'Vanilla',
266 'itempool' => 'Standard',
268 'grahm' => 'AllBosses',
270 'startshop' => 'Unlocked',
271 'shopprice' => 'Vanilla',
272 'shopSouls' => '2PerGroup',
273 'levelexp' => 'Vanilla',
274 'telestart' => 'false',
275 'mapassist' => 'false',
276 'doublechaos' => 'false',
277 'palette' => 'Vanilla',
281 'name' => 'Area extra fast',
282 'value' => 'AreaExtraFast',
284 'logic' => 'AreaTechTiers',
285 'nodupes' => 'false',
286 'panther' => 'FirstAlways',
287 'area' => 'AreaRandom',
288 'boss' => 'Dead-endShuffle',
289 'enemy' => 'Vanilla',
290 'itempool' => 'Standard',
292 'grahm' => 'NoCheck',
294 'startshop' => 'Unlocked30k',
295 'shopprice' => 'RandHV',
296 'shopSouls' => 'Half',
297 'levelexp' => 'Vanilla',
298 'telestart' => 'true',
299 'mapassist' => 'false',
300 'doublechaos' => 'false',
301 'palette' => 'Vanilla',
305 'name' => 'Area expert',
306 'value' => 'AreaExpert',
308 'logic' => 'AreaTechTiers',
310 'panther' => 'NeverExists',
311 'area' => 'AreaRandom',
312 'boss' => 'Dead-endShuffle',
313 'enemy' => 'RandomNoLimit',
314 'itempool' => 'Standard',
316 'grahm' => 'BookSouls',
318 'startshop' => 'Vanilla',
319 'shopprice' => 'Vanilla',
320 'shopSouls' => 'Half',
321 'levelexp' => 'Lvl1',
322 'telestart' => 'false',
323 'mapassist' => 'false',
324 'doublechaos' => 'true',
325 'palette' => 'Vanilla',
328 'DoorAllBossesEasy' => [
329 'name' => 'Door all bosses easy',
330 'value' => 'DoorAllBossesEasy',
332 'logic' => 'AreaTechTiers',
333 'nodupes' => 'false',
334 'panther' => 'Rand70Dup',
335 'area' => 'DoorRandom',
337 'enemy' => 'Vanilla',
338 'itempool' => 'Standard',
340 'grahm' => 'AllBosses',
342 'startshop' => 'Unlocked',
343 'shopprice' => 'Vanilla',
344 'shopSouls' => '2PerGroup',
345 'levelexp' => 'Vanilla',
346 'telestart' => 'true',
347 'mapassist' => 'true',
348 'doublechaos' => 'false',
349 'palette' => 'Vanilla',
353 'name' => 'Door all bosses',
354 'value' => 'DoorAllBosses',
356 'logic' => 'AreaTechTiers',
357 'nodupes' => 'false',
358 'panther' => 'Rand70Dup',
359 'area' => 'DoorRandom',
361 'enemy' => 'RandomPM20',
362 'itempool' => 'Standard',
364 'grahm' => 'AllBosses',
366 'startshop' => 'Vanilla',
367 'shopprice' => 'Vanilla',
368 'shopSouls' => '2PerGroup',
369 'levelexp' => 'Vanilla',
370 'telestart' => 'false',
371 'mapassist' => 'false',
372 'doublechaos' => 'false',
373 'palette' => 'Vanilla',
377 'name' => 'SGLive 2020',
378 'value' => 'SGLive2020',
380 'logic' => 'AreaTechTiers',
381 'nodupes' => 'false',
382 'panther' => 'Rand70Dup',
385 'enemy' => 'Vanilla',
386 'itempool' => 'Standard',
388 'grahm' => 'BookSouls',
390 'startshop' => 'Vanilla',
391 'shopprice' => 'Vanilla',
392 'shopSouls' => 'Vanilla',
393 'levelexp' => 'Vanilla',
394 'telestart' => 'false',
395 'mapassist' => 'false',
396 'doublechaos' => 'false',
397 'palette' => 'Vanilla',
401 'name' => 'SGLive 2021',
402 'value' => 'SGLive2021',
404 'logic' => 'AreaTechTiers',
405 'nodupes' => 'false',
406 'panther' => 'FirstAlways',
407 'area' => 'AreaRandom',
408 'boss' => 'Dead-endShuffle',
409 'enemy' => 'Vanilla',
410 'itempool' => 'Standard',
412 'grahm' => 'BookSouls',
414 'startshop' => 'Unlocked30k',
415 'shopprice' => 'RandHV',
416 'shopSouls' => 'Half',
417 'levelexp' => 'Vanilla',
418 'telestart' => 'false',
419 'mapassist' => 'false',
420 'doublechaos' => 'false',
421 'palette' => 'Vanilla',
424 'Tournament2021' => [
425 'name' => 'Tournament 2021',
426 'value' => 'Tournament2021',
428 'logic' => 'AreaTechTiers',
429 'nodupes' => 'false',
430 'panther' => 'Rand70Dup',
431 'area' => 'AreaRandom',
432 'boss' => 'Dead-endShuffle',
433 'enemy' => 'Vanilla',
434 'itempool' => 'Standard',
436 'grahm' => 'BookSouls',
438 'startshop' => 'Unlocked30k',
439 'shopprice' => 'RandHV',
440 'shopSouls' => 'Half',
441 'levelexp' => 'Vanilla',
442 'telestart' => 'false',
443 'mapassist' => 'false',
444 'doublechaos' => 'false',
445 'palette' => 'Vanilla',
448 'Tournament2022' => [
449 'name' => 'Tournament 2022',
450 'value' => 'Tournament2022',
452 'logic' => 'AreaTechTiers',
453 'nodupes' => 'false',
454 'panther' => 'FirstAlways',
455 'area' => 'AreaRandom',
456 'boss' => 'Dead-endShuffle',
457 'enemy' => 'Vanilla',
458 'itempool' => 'Standard',
460 'grahm' => 'BookSouls',
462 'startshop' => 'Unlocked30k',
463 'shopprice' => 'RandHV',
464 'shopSouls' => 'Half',
465 'levelexp' => 'Vanilla',
466 'telestart' => 'false',
467 'mapassist' => 'false',
468 'doublechaos' => 'false',
469 'palette' => 'Vanilla',