-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathswogi.js
6570 lines (6516 loc) · 211 KB
/
swogi.js
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import {
GameState,
card_name_to_id_fuzzy,
swogi,
format_card,
CHARACTER_ID_TO_NAME,
guess_character
} from "./gamestate.js";
import os from 'os';
// a generator that takes an array and k and generates all k-combinations of the array's elements
function* k_combinations(arr, k) {
if (k === 0) {
yield [];
return;
}
if (arr.length < k) {
return;
}
let head = arr[0];
let tail = arr.slice(1);
for (let subcombo of k_combinations(tail, k-1)) {
yield [head, ...subcombo];
}
for (let subcombo of k_combinations(tail, k)) {
yield subcombo;
}
}
const copies_to_levels = [
[],
[[3]],
[[3,3]],
[[3,2,2]],
[[3,2,1,1],[2,2,2,2]],
];
const p5_copies_to_levels = [
[],
[[3]],
[[3,2]],
[[3,1,1],[2,2,2]],
[[2,2,1,1]],
];
const meru_copies_to_levels = [
[],
[[3],[2],[1]],
[[3,3],[3,2],[3,1],[2,2],[2,1],[1,1]],
[[3,2,2],[3,2,1],[3,1,1],[2,2,2],[2,2,1],[2,1,1],[1,1,1]],
];
const zongzi_ids = [];
// for each key in swogi, if it starts with 8 and ends with 3, add it to zongzi_ids
for (let key in swogi) {
if (key.startsWith("8") && key.endsWith("3") && ((0+key[2])>1)) {
zongzi_ids.push(key);
}
}
// console.log("zongzi_ids: " + zongzi_ids);
function upgradedd(deck) {
let ret = [];
for (let card_id of deck) {
let new_card_id = card_id.slice(0, -1) + "3";
ret.push(new_card_id);
}
// sort the deck
ret.sort();
return ret;
}
function sortedd(deck) {
let ret = [];
for (let card_id of deck) {
let new_card_id = card_id;
ret.push(new_card_id);
}
// sort the deck
ret.sort();
return ret;
}
function upgradestringifiedd(deck) {
const ret = upgradedd(deck);
return ret.join();
}
function stringifiedd(deck) {
const ret = sortedd(deck);
return ret.join();
}
function str_to_arr(str) {
return str.split(",");
}
// read the contents of blah.json
//const fs = require('fs');
//const data = fs.readFileSync('blah.json');
//const blah = JSON.parse(data);
const blah = {};
// a generator that takes a deck of max level cards and downgrades some cards if needed
function* downgraded(max_level_deck) {
let cards = [];
let copies = [];
let idx = 0;
let sofar = [];
for (let card_id of max_level_deck) {
// if it's in cards, increment copies
if (cards.includes(card_id)) {
copies[cards.indexOf(card_id)] += 1;
} else {
// if it's not in cards, add it to cards and set copies to 1
cards.push(card_id);
copies.push(1);
}
}
for (let result of downgrade_inner(cards, copies, sofar, idx)) {
yield result;
}
}
function* downgrade_inner(cards, copies, sofar, idx) {
if (idx === cards.length) {
yield sofar;
return;
}
let card_id = cards[idx];
//console.log("cards: " + cards);
//console.log("copies: " + copies);
//console.log("sofar: " + sofar);
//console.log("idx: " + idx);
let copy = copies[idx];
let my_copies_to_levels = copies_to_levels;
if ((card_id === "804063") || (card_id === "355033") ||
(card_id === "375023") || (card_id === "245023")) {
my_copies_to_levels = meru_copies_to_levels;
} else if (card_id[2] === "5") {
my_copies_to_levels = p5_copies_to_levels;
}
if (copy >= my_copies_to_levels.length) {
return;
}
for (let levels_arr of my_copies_to_levels[copy]) {
let new_sofar = sofar.slice();
for (let level of levels_arr) {
// trim the last digit of the card_id and replace it with the level
const new_card_id = card_id.slice(0, -1) + level;
new_sofar.push(new_card_id);
}
for (let result of downgrade_inner(cards, copies, new_sofar, idx+1)) {
yield result;
}
}
}
// a generator that takes a deck of zongzi and generates all adjacent decks of zongzi
function* adjacent_decks(deck, small_radius) {
// for each zongzi_id, make a bigger deck containing deck + zongzi_id
for (let zongzi_id of zongzi_ids) {
const bigger_deck = deck.slice();
bigger_deck.push(zongzi_id);
for (let subcombo of k_combinations(bigger_deck, 8)) {
for (let downgraded_subcombo of downgraded(subcombo)) {
yield downgraded_subcombo;
}
}
}
// for each two zongzi_id's, make a bigger deck containing deck + zongzi_id_a + zongzi_id_b
if (!small_radius) {
for (let zongzi_id_a of zongzi_ids) {
for (let zongzi_id_b of zongzi_ids) {
const bigger_deck = deck.slice();
bigger_deck.push(zongzi_id_a);
bigger_deck.push(zongzi_id_b);
for (let subcombo of k_combinations(bigger_deck, 8)) {
for (let downgraded_subcombo of downgraded(subcombo)) {
yield downgraded_subcombo;
}
}
}
}
}
}
let riddles = {};
function fixup_deck(deck) {
for (let i=0; i<deck.length; i++) {
if (swogi[deck[i]] == undefined) {
deck[i] = card_name_to_id_fuzzy(deck[i]);
}
}
}
const deck_to_hp = blah;
const searched_from_deck = {};
function handle_response(riddle, response) {
const winning_decks = response.winning_decks;
const winning_margins = response.winning_margins;
const winning_logs = response.winning_logs;
console.log("got response with " + winning_decks.length + " winning decks");
for (let i=0; i<winning_decks.length; i++) {
if (winning_margins[i] > riddle.best_winning_margin) {
riddle.best_winning_margin = winning_margins[i];
for (let j=0; j<winning_decks[i].length; j++) {
winning_decks[i][j] = format_card(winning_decks[i][j]);
}
console.log(winning_logs[i].join("\n"));
//const deck_str = stringifiedd(winning_decks[i]);
//console.log("\"" + deck_str + "\": "+winning_margins[i]+",");
//deck_to_hp[deck_str] = winning_margins[i];
console.log("winning deck: " + JSON.stringify(winning_decks[i]));
console.log("winning margin: " + winning_margins[i]);
}
}
riddle.try_idx += response.try_idx;
console.log("handled response");
}
async function do_riddle(riddle) {
const numCores = os.cpus().length;
const workers = [];
const messages_outstanding = [];
for (let i = 0; i < numCores; i++) {
const worker = new Worker('./worker.js');
workers.push(worker);
messages_outstanding.push(0);
// Add error event listener to each worker
worker.addEventListener('error', (event) => {
console.error(`Error in worker ${i}:`, event.message);
});
}
function createMessageHandler(workers) {
const messageQueue = [];
let resolvePromise = null;
const messageHandler = (event) => {
messageQueue.push(event.data);
if (resolvePromise) {
const ret = messageQueue.shift();
messages_outstanding[ret.worker_idx] -= 1;
resolvePromise(ret);
resolvePromise = null;
}
};
// Attach the message event listener to all workers
workers.forEach((worker) => {
worker.addEventListener('message', messageHandler);
});
return async function getFirstMessage() {
if (messageQueue.length > 0) {
const ret = messageQueue.shift();
messages_outstanding[ret.worker_idx] -= 1;
return ret;
}
return new Promise((resolve) => {
resolvePromise = resolve;
});
};
}
const getMessage = createMessageHandler(workers);
const my_idx = riddle.my_idx;
const enemy_idx = 1 - my_idx;
const my_cards = riddle.players[my_idx].cards;
const enemy_cards = riddle.players[enemy_idx].cards;
riddle.best_winning_margin = -99999;
riddle.try_idx = 0;
fixup_deck(my_cards);
fixup_deck(enemy_cards);
if (riddle.players[my_idx].character === undefined) {
riddle.players[my_idx].character = guess_character(riddle.players[my_idx]);
}
if (riddle.players[enemy_idx].character === undefined) {
riddle.players[enemy_idx].character = guess_character(riddle.players[enemy_idx]);
}
if (riddle.just_run) {
riddle.players[my_idx].cards = my_cards;
riddle.players[enemy_idx].cards = enemy_cards;
riddle.worker_idx = 0;
messages_outstanding[0] += 1;
workers[0].postMessage(riddle);
} else {
let combo_idx = 0;
const tried_combos = {};
for (let combo of k_combinations(my_cards, 8)) {
//for (let combo of adjacent_decks(my_cards, riddle.small_radius)) {
combo_idx += 1;
// sort the combo
combo.sort();
let combo_id = combo.join(",");
//if (deck_to_hp[combo_id] !== undefined) {
// continue;
//}
if (tried_combos[combo_id]) {
continue;
}
tried_combos[combo_id] = true;
// if this combo has 3 or more continuous/consumption cards, skip it
let normal_attack_count = 0;
let concon_count = 0;
for (let i=0; i<combo.length; i++) {
if (swogi[combo[i]].is_continuous || swogi[combo[i]].is_consumption) {
concon_count += 1;
}
if (swogi[combo[i]].name === "Normal Attack") {
normal_attack_count += 1;
}
}
if (concon_count >= 3) {
continue;
}
console.log("combo_idx: " + combo_idx);
console.log("concon_count: " + concon_count);
// if there is a ready worker, send the message
let worker_idx = -1;
for (let i=0; i<numCores; i++) {
if (messages_outstanding[i] == 0) {
worker_idx = i;
break;
}
}
if (worker_idx == -1) {
// wait for a message to come back
let response = await getMessage();
worker_idx = response.worker_idx;
handle_response(riddle, response);
}
riddle.players[my_idx].cards = combo;
riddle.worker_idx = worker_idx;
console.log("sending message to worker_idx: " + worker_idx);
messages_outstanding[worker_idx] += 1;
workers[worker_idx].postMessage(riddle);
}
}
// wait for all messages to come back
let total_messages_outstanding = 0;
for (let i=0; i<numCores; i++) {
total_messages_outstanding += messages_outstanding[i];
}
console.log("total_messages_outstanding: " + total_messages_outstanding);
while (total_messages_outstanding > 0) {
let response = await getMessage();
handle_response(riddle, response);
total_messages_outstanding -= 1;
}
// shut down the workers
for (let i = 0; i < numCores; i++) {
workers[i].terminate();
}
console.log("try_idx: " + riddle.try_idx);
}
async function doo_riddle(riddle) {
const my_idx = riddle.my_idx;
const enemy_idx = 1 - my_idx;
const my_cards = riddle.players[my_idx].cards;
const enemy_cards = riddle.players[enemy_idx].cards;
riddle.best_winning_margin = -99999;
riddle.try_idx = 0;
fixup_deck(my_cards);
fixup_deck(enemy_cards);
if (riddle.players[my_idx].character === undefined) {
riddle.players[my_idx].character = guess_character(riddle.players[my_idx]);
}
if (riddle.players[enemy_idx].character === undefined) {
riddle.players[enemy_idx].character = guess_character(riddle.players[enemy_idx]);
}
if (riddle.just_run) {
riddle.players[my_idx].cards = my_cards;
riddle.players[enemy_idx].cards = enemy_cards;
riddle.worker_idx = 0;
// Create fake event object
const fakeEvent = { data: riddle };
onmessage(fakeEvent);
} else {
let combo_idx = 0;
const tried_combos = {};
for (let combo of k_combinations(my_cards, 8)) {
combo_idx += 1;
combo.sort();
let combo_id = combo.join(",");
if (tried_combos[combo_id]) {
continue;
}
tried_combos[combo_id] = true;
let normal_attack_count = 0;
let concon_count = 0;
for (let i = 0; i < combo.length; i++) {
if (swogi[combo[i]].is_continuous || swogi[combo[i]].is_consumption) {
concon_count += 1;
}
if (swogi[combo[i]].name === "Normal Attack") {
normal_attack_count += 1;
}
if (swogi[combo[i]].name === "Space Spiritual Field" && i > 5) {
concon_count += 99;
}
}
if (concon_count >= 3) {
continue;
}
console.log("combo_idx: " + combo_idx);
console.log("concon_count: " + concon_count);
riddle.players[my_idx].cards = combo;
riddle.worker_idx = 0;
// Create fake event object
const fakeEvent = { data: riddle };
//await new Promise(resolve => setTimeout(resolve, 0))
onmessage(fakeEvent);
}
}
console.log("try_idx: " + riddle.try_idx);
// while(true) {
// await new Promise(resolve => setTimeout(resolve, 1));
// }
}
riddles["99"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 118;
players[enemy_idx].cultivation = 102;
players[enemy_idx].physique = 0;
players[my_idx].hp = 133;
players[my_idx].cultivation = 90;
players[my_idx].physique = 0;
players[my_idx].cards = [
"kun wu metal ring",
"metal spirit shuttle 2",
"flying brush",
"finishing touch 2",
"earth spirit combine world 2",
"flying brush",
"earth spirit steep 2",
"earth spirit landslide",
//
"earth spirit dust 2",
"earth spirit dust",
"earth spirit formation 2",
"five elements heavenly marrow rhythm",
];
players[enemy_idx].cards = [
"spiritage elixir 3",
"ultimate world formation 3",
"wood spirit willow leaf 3",
"wood spirit fragrant 2",
"wood spirit forest guard 2",
"wood spirit thorn 3",
"five elements circulation 3",
"fire spirit blazing prairie 2",
];
players[enemy_idx].mark_of_five_elements_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
riddles["201"] = async () => {
const players = [{},{}];
const my_idx = 0;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 115;
players[enemy_idx].cultivation = 103;
players[enemy_idx].physique = 0;
players[my_idx].hp = 115;
players[my_idx].cultivation = 104;
players[my_idx].physique = 0;
players[my_idx].cards = [
"kun wu metal ring",
"metal spirit shuttle 2",
"flying brush",
"finishing touch 2",
"earth spirit combine world 2",
"flying brush",
"earth spirit steep 2",
"earth spirit landslide",
//
"earth spirit dust 2",
"earth spirit dust",
"earth spirit formation 2",
"five elements heavenly marrow rhythm",
];
players[enemy_idx].cards = [
"spiritage elixir 3",
"ultimate world formation 3",
"wood spirit willow leaf 3",
"wood spirit fragrant 2",
"wood spirit forest guard 2",
"wood spirit thorn 3",
"five elements circulation 3",
"fire spirit blazing prairie 2",
];
players[enemy_idx].sword_in_sheathed_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
riddles["202"] = async () => {
const players = [{},{}];
const my_idx = 0;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 113;
players[enemy_idx].cultivation = 76;
players[enemy_idx].physique = 88;
players[enemy_idx].max_physique = 93;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 115;
players[my_idx].cultivation = 104;
players[my_idx].physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"spirit gather citta dharma 3",
"finishing touch 2",
"sky delicate bracelet",
"rule sky sword formation 3",
"chain sword formation 2",
"flying brush",
"raven spirit sword 3",
"mirror flower sword formation",
//
"pierce the star 3",
"egret sword 2",
"moon water sword 2",
"kun spirit sword 3",
"echo formation",
"dharma spirit sword",
"flying spirit shade sword 2",
];
players[enemy_idx].cards = [
"crane footwork 3",
"devouring ancient vine 3",
"exercise soul 2",
"exercise soul 2",
"exercise soul 2",
"exercise soul",
"exercise soul",
"realm killing palm",
];
players[enemy_idx].p3_regenerating_body_stacks = 1;
players[enemy_idx].p4_firmness_body_stacks = 1;
players[enemy_idx].stance_of_fierce_attack_stacks = 1;
players[my_idx].p4_sword_rhyme_cultivate_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["202"]();
riddles["203"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 70;
players[enemy_idx].cultivation = 85;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 129;
players[my_idx].cultivation = 75;
players[my_idx].physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"kun wu metal ring",
"metal spirit shuttle 2",
"flying brush",
"earth spirit formation 2",
"earth spirit combine world 2",
"flying brush",
"earth spirit steep",
"earth spirit landslide",
//
"earth spirit dust 3",
"earth spirit cliff 3",
"earth spirit quicksand 2",
"earth spirit combine world",
"heavenly marrow rhythm 2",
];
players[enemy_idx].cards = [
"hard bamboo 3",
"hard bamboo 3",
"earth spirit secret seal",
"earth spirit dust 3",
"metal spirit shuttle 2",
"earth spirit combine world 2",
"metal spirit shuttle 2",
"earth spirit steep 2",
];
players[enemy_idx].flame_soul_rebirth_stacks = 1;
players[enemy_idx].swift_burning_seal_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["203"]();
riddles["204"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 120;
players[enemy_idx].cultivation = 119;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 115;
players[my_idx].cultivation = 104;
players[my_idx].physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"finishing touch 2",
"spirit gather citta dharma 2",
"sky delicate bracelet",
"moon water sword 3",
"rule sky sword formation 2",
"flying brush 3",
"raven spirit sword 3",
"mirror flower sword formation 3",
//
"chain sword formation 2",
"rule sky sword formation",
"chain sword formation 3",
"qi perfusion 3",
"egret sword 3",
"sky spirit tune",
];
players[enemy_idx].cards = [
"polaris 3",
"propitious 2",
"astral fly 3",
"rotary 2",
"heaven hexagram 2",
"five thunders 3",
"astral fly 2",
"astral tiger 3",
];
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["204"]();
riddles["205"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 120;
players[enemy_idx].cultivation = 119;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 115;
players[my_idx].cultivation = 104;
players[my_idx].physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"spirit gather citta dharma 2",
"finishing touch 2",
"sky delicate bracelet",
"moon water sword 3",
"rule sky sword formation 2",
"chain sword formation 3",
"chain sword formation 2",
"mirror flower sword formation 3",
//
];
players[enemy_idx].cards = [
"polaris 3",
"propitious 2",
"astral fly 3",
"rotary 2",
"heaven hexagram 2",
"five thunders 3",
"astral fly 2",
"astral tiger 3",
];
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["205"]();
riddles["206"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 107;
players[enemy_idx].cultivation = 79;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 107;
players[my_idx].cultivation = 66;
players[my_idx].physique = 85;
players[my_idx].max_physique = 90;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"crane footwork",
"exercise marrow 3",
"exercise soul",
"exercise soul",
"exercise soul",
"realm killing palm",
"exercise soul",
"exercise soul",
"exercise marrow 3",
"crane footwork",
"hexproof formation",
"hexproof formation",
];
players[enemy_idx].cards = [
"unrestrained zero 2",
"anthomania 2",
"echo formation 2",
"unrestrained one 2",
"unrestrained flame dance",
"unrestrained two 3",
"meru formation 2",
"normal attack",
];
players[enemy_idx].hand_count = 4;
players[enemy_idx].pact_of_equilibrium_stacks = 1;
players[my_idx].hand_count = 14;
players[my_idx].pact_of_equilibrium_stacks = 1;
players[my_idx].p4_regenerating_body_stacks = 1;
players[my_idx].stance_of_fierce_attack_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["206"]();
riddles["207"] = async () => {
const players = [{},{}];
const my_idx = 0;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 97;
players[enemy_idx].cultivation = 58;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 97;
players[my_idx].cultivation = 55;
players[my_idx].physique = 0;
players[my_idx].max_physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"spirit gather citta dharma 2",
"centibird spirit sword",
"giant roc spirit sword",
"thousand evil incantation",
"moon water sword",
"spiritage incantation",
"giant kun spirit sword 2",
"mirror flower sword formation",
"raven spirit sword 2",
"raven spirit sword",
"cloud sword dragon roam",
"egret sword",
"cloud sword pierce the star",
];
players[enemy_idx].cards = [
"spiritage formation 2",
"great spirit 2",
"hunter hunting hunter",
"escape plan",
"strike twice",
"imposing 2",
"extremely suspicious 2",
"normal attack",
];
players[enemy_idx].heptastar_soulstat_stacks = 1;
players[my_idx].sword_in_sheathed_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["207"]();
riddles["208"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 111;
players[enemy_idx].cultivation = 99;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 107;
players[my_idx].cultivation = 53;
players[my_idx].physique = 0;
players[my_idx].max_physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"spirit gather citta dharma 3",
"divine walk fulu 2",
"giant kun spirit sword 3",
"raven spirit sword 2",
"egret sword 3",
"thousand evil incantation",
"moon water sword 3",
"rule sky sword 2",
"chain sword",
"chain sword",
"mirror flower sword formation 3",
];
players[enemy_idx].cards = [
"sword slash 3",
"cloud dance rhythm 3",
"contemplate spirits rhythm 3",
"sword intent surge",
"thousand evil 2",
"spirit cat chaos 2",
"cloud sword cat paw",
"cloud sword flash wind 3",
];
players[my_idx].sword_in_sheathed_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["208"]();
riddles["209"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 119;
players[enemy_idx].cultivation = 74;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 107;
players[my_idx].cultivation = 80;
players[my_idx].physique = 0;
players[my_idx].max_physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"rule sky sword 3",
"thousand evil incantation",
"dharma spirit sword",
"spiritage incantation 2",
"spiritage incantation 2",
"qi perfusion 2",
"spirit gather citta dharma 2",
"moon water sword 2",
"divine walk fulu",
"chain sword",
];
players[enemy_idx].cards = [
"chord in tune",
"sky spirit tune 3",
"sky delicate bracelet",
"moon water 2",
"rule sky sword",
"raven spirit sword 2",
"chain sword",
"mirror flower sword",
];
players[enemy_idx].coral_sword_stacks = 1;
players[my_idx].sword_in_sheathed_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["209"]();
riddles["210"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 109;
players[enemy_idx].cultivation = 74;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 109;
players[my_idx].cultivation = 80;
players[my_idx].physique = 0;
players[my_idx].max_physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"rule sky sword 3",
"thousand evil incantation",
"dharma spirit sword",
"spiritage incantation 3",
"spiritage incantation 2",
"qi perfusion 2",
"spirit gather citta dharma 2",
"moon water sword 2",
"divine walk fulu 2",
"chain sword 2",
"chain sword",
"raven spirit sword 2",
];
players[enemy_idx].cards = [
"metal spirit shuttle 2",
"water spirit spring 2",
"wood spirit willow leaf 3",
"world smash 2",
"gourd of leisure",
"fire spirit flash fire 2",
"fire spirit blazing prairie 2",
"earth spirit dust 2",
];
players[enemy_idx].mark_of_five_elements_stacks = 1;
players[my_idx].sword_in_sheathed_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
riddles["211"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 106;
players[enemy_idx].cultivation = 777;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 127;
players[my_idx].cultivation = 80;
players[my_idx].physique = 0;
players[my_idx].max_physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"kun wu metal ring",
"five elements heavenly marrow rhythm 2",
"earth spirit combine world 2",
"flying brush 2",
"earth spirit cliff 3",
"earth spirit landslide",
"earth spirit steep 3",
"flying brush 2",
"earth spirit formation",
"metal spirit shuttle",
"finishing touch",
"earth spirit combine world"
];
players[enemy_idx].cards = [
"ultimate hexagram base",
"heaven hexagram 3",
"astral cide",
"dance dragonfly 3",
"ice spirit guard elixir 3",
"starry moon 3",
"fury thunder",
"five thunders",
];
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["211"]();
riddles["212"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 107;
players[enemy_idx].cultivation = 72;
players[enemy_idx].physique = 59;
players[enemy_idx].max_physique = 81;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 105;
players[my_idx].cultivation = 61;
players[my_idx].physique = 0;
players[my_idx].max_physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"spirit gather citta dharma 2",
"centibird spirit sword 2",
"moon water sword 2",
"moon water sword",
"giant kun spirit sword 2",
"mirror flower sword formation 2",
"mirror flower sword formation",
"chain sword",
"hard bamboo 3",
"dharma spirit sword",
];
players[enemy_idx].cards = [
"styx agility",
"heartbroken tune 2",
"shura roar 2",
"predicament 2",
"ghost howling 3",
"soul cleaving 3",
"soul seizing",
"soul seizing",
];
players[enemy_idx].p3_mark_of_dark_heart_stacks = 1;
players[enemy_idx].unwavering_soul_stacks = 1;
return await do_riddle({players: players, my_idx: my_idx});
};
//await riddles["212"]();
riddles["213"] = async () => {
const players = [{},{}];
const my_idx = 1;
const enemy_idx = 1 - my_idx;
players[enemy_idx].hp = 119;
players[enemy_idx].cultivation = 81;
players[enemy_idx].physique = 0;
players[enemy_idx].max_physique = 0;
players[enemy_idx].max_hp = players[enemy_idx].hp + players[enemy_idx].physique;
players[my_idx].hp = 139;
players[my_idx].cultivation = 74;
players[my_idx].physique = 0;
players[my_idx].max_physique = 0;
players[my_idx].max_hp = players[my_idx].hp + players[my_idx].physique;
players[my_idx].cards = [
"kun wu metal ring",
"flying brush",
"five elements heavenly marrow rhythm 3",
"earth spirit steep",
"earth spirit steep 2",