-
Notifications
You must be signed in to change notification settings - Fork 25
/
characters.lua
8367 lines (7734 loc) · 233 KB
/
characters.lua
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
local floor,ceil,min,max = math.floor, math.ceil, math.min, math.max
local abs = math.abs
local random = math.random
local recycle_one = function(player)
if #player.grave > 0 then
player:grave_to_bottom_deck(#player.grave)
end
end
local ex2_recycle = function(player, char)
if #player.grave >= 5 and
#player:hand_idxs_with_preds(pred.neg(pred[char.faction])) == 0 and
#player:field_idxs_with_preds(pred.neg(pred[char.faction])) == 0 then
local target = uniformly(player:grave_idxs_with_preds(pred.follower))
if target then
player:grave_to_bottom_deck(target)
end
end
end
local ep7_recycle = function(player)
if player.game.turn % 2 == 0 then
local target = uniformly(player:grave_idxs_with_preds())
if target then
player:grave_to_exile(target)
end
target = uniformly(player:grave_idxs_with_preds(pred.follower))
if target then
player:grave_to_bottom_deck(target)
end
end
end
local starter_burn = function(player)
if player.opponent:is_npc() then
OneBuff(player.opponent,0,{life={"-",1}}):apply()
end
end
local wedding_shuffles = function(player)
if (not player.opponent:is_npc()) and player.shuffles == 0 then
player.shuffles = 1
end
end
local sita_vilosa = function(player)
local target_idxs = player.opponent:get_follower_idxs()
local buff = OnePlayerBuff(player.opponent)
for _,idx in ipairs(target_idxs) do
if idx < 4 and player.opponent.field[idx] then
buff[idx] = {sta={"-",1}}
end
end
buff:apply()
end
local cinia_pacifica = function(player)
local target_idxs = player.opponent:get_follower_idxs()
if #target_idxs > 0 then
local target_idx = uniformly(target_idxs)
OneBuff(player.opponent,target_idx,{atk={"-",1},sta={"-",1}}):apply()
end
end
local luthica_preventer = function(player)
local target_idxs = player:field_idxs_with_preds(pred[player.character.faction], pred.follower)
if #target_idxs > 0 then
local target_idx = uniformly(target_idxs)
OneBuff(player,target_idx,{atk={"+",1},sta={"+",1}}):apply()
end
end
local iri_flina = function(player)
if player:field_size() > player.opponent:field_size() then
OneBuff(player.opponent,0,{life={"-",1}}):apply()
end
end
local curious_vernika = function(player)
local idx = player.opponent:field_idxs_with_most_and_preds(pred.def, pred.follower)[1]
if idx then
OneBuff(player.opponent,idx,{def={"=",0}}):apply()
end
end
local thorn_witch_rose = function(player)
local nme_followers = player.opponent:get_follower_idxs()
if #nme_followers == 0 then
return
end
local target_idx = uniformly(nme_followers)
local buff_size = ceil(abs(player.opponent.field[target_idx].size - player.opponent.field[target_idx].def)/2)
OneBuff(player.opponent,target_idx,{atk={"-",buff_size},def={"-",1},sta={"-",buff_size}}):apply()
end
local head_knight_jaina = function(player)
local target = uniformly(player:field_idxs_with_preds(pred.follower))
if target then
if player.game.turn % 2 == 0 then
OneBuff(player, target, {atk={"+",2},sta={"+",1}}):apply()
else
OneBuff(player, target, {atk={"+",2}}):apply()
end
end
end
local clarice = function(stats, skill)
return function(player)
local to_kill = player:field_idxs_with_preds(function(card) return card.id == 300201 end)
for _,idx in ipairs(to_kill) do
player:field_to_grave(idx)
end
local slot = player:last_empty_field_slot()
if slot then
if stats == "turn" then
local amt = 10 - (player.game.turn % 10)
if amt ~= 10 then
player.field[slot] = Card(300201)
OneBuff(player, slot, {atk={"=",amt},def={"=",1},sta={"=",amt}}):apply()
end
else
player.field[slot] = Card(300201)
OneBuff(player, slot, {atk={"=",stats[1]},def={"=",stats[2]},sta={"=",stats[3]}}):apply()
if skill then
player.field[slot].skills[1] = 1075
end
end
end
end
end
local council_vp_tieria = function(group_pred, faction_pred)
return function(player)
local target = uniformly(player:field_idxs_with_preds(group_pred, pred.follower))
local faction_count = #player:field_idxs_with_preds(faction_pred, pred.follower)
if target then
if faction_count == 1 then
OneBuff(player, target, {atk={"+",1},sta={"+",2}}):apply()
elseif faction_count >= 2 then
OneBuff(player, target, {size={"-",1},atk={"+",1},sta={"+",2}}):apply()
end
end
end
end
local hanbok_sita = function(player, opponent, my_card)
local target = uniformly(player:field_idxs_with_preds(pred.follower))
local the_buff = {atk={"+",1},sta={"+",2}}
if target then
if #opponent:field_idxs_with_preds() > #player:field_idxs_with_preds() then
the_buff.atk[2] = the_buff.atk[2] + 1
end
if #player.hand >= #opponent.hand then
the_buff.sta[2] = the_buff.sta[2] + 1
end
OneBuff(player, target, the_buff):apply()
end
end
local hanbok_cinia = function(player, opponent, my_card)
local target = uniformly(opponent:field_idxs_with_preds(pred.follower))
local buff = GlobalBuff(player)
if target then
buff.field[opponent][target] = {def={"-",1},sta={"-",2}}
end
target = opponent:hand_idxs_with_preds(pred.follower)[1]
if target then
buff.hand[opponent][target] = {}
if #opponent:field_idxs_with_preds() > #player:field_idxs_with_preds() then
buff.hand[opponent][target].def = {"-",1}
end
if #player.hand >= #opponent.hand then
local amt = min(2,opponent.hand[target].sta-1)
buff.hand[opponent][target].sta={"-",amt}
end
end
buff:apply()
end
local hanbok_luthica = function(player, opponent, my_card)
local n = 1
if #opponent:field_idxs_with_preds() > #player:field_idxs_with_preds() then
n = n + 1
end
if #player.hand >= #opponent.hand then
n = n + 1
end
for i=1,n do
local target = uniformly(opponent:field_idxs_with_preds(pred.follower))
if target then
OneBuff(opponent, target, {sta={"-",2}}):apply()
end
end
end
local hanbok_iri = function(player, opponent, my_card)
local target = uniformly(opponent:field_idxs_with_preds(pred.follower))
local the_buff = {atk={"-",1},sta={"-",2}}
if target then
if #opponent:field_idxs_with_preds() > #player:field_idxs_with_preds() then
the_buff.atk[2] = the_buff.atk[2] + 1
end
if #player.hand >= #opponent.hand then
the_buff.sta[2] = the_buff.sta[2] + 1
end
OneBuff(opponent, target, the_buff):apply()
end
end
local buff_random = function(player, opponent, my_card, my_buff)
local target_idxs = player:field_idxs_with_preds(pred.follower)
if #target_idxs == 0 then
return
end
local target_idx = uniformly(target_idxs)
OneBuff(player,target_idx,my_buff):apply()
end
local buff_all = function(player, opponent, my_card, my_buff)
local buff = OnePlayerBuff(player)
for _,idx in ipairs(player:field_idxs_with_preds(pred.follower)) do
buff[idx] = my_buff
end
buff:apply()
end
local wind_forestier = function(stats)
return function(player)
local target_idxs = player.opponent:field_idxs_with_preds(pred.follower)
if #target_idxs == 0 then
return
end
local buff = {}
for _,stat in ipairs(stats) do
buff[stat] = {"-",floor(player.game.turn/2)}
end
OneBuff(player.opponent, uniformly(target_idxs), buff):apply()
end
end
characters_func = {
--Mysterious Girl Sita Vilosa
[100001] = function(player)
sita_vilosa(player)
starter_burn(player)
end,
--Beautiful and Smart Cinia Pacifica
[100002] = function(player)
cinia_pacifica(player)
starter_burn(player)
end,
--Crux Knight Luthica
[100003] = function(player)
luthica_preventer(player)
starter_burn(player)
end,
--Runaway Iri Flina
[100004] = function(player)
iri_flina(player)
starter_burn(player)
end,
--Nold
[100005] = function(player)
if #player.hand == 0 then
return
end
local hand_idx = random(#player.hand)
local buff = GlobalBuff(player) --stolen from Tower of Books
buff.hand[player][hand_idx] = {size={"+",1}}
buff:apply()
local my_cards = player:field_idxs_with_preds(function(card) return card.size >= 2 end)
if #my_cards == 0 then
return
end
local target_idx = uniformly(my_cards)
OneBuff(player,target_idx,{size={"-",1}}):apply()
end,
--Ginger
[100006] = function(player)
local ncards = #player:field_idxs_with_preds()
local target_idxs = player:field_idxs_with_preds(pred.follower, function(card) return card.size >= ncards end)
local buff = OnePlayerBuff(player)
for _,idx in ipairs(target_idxs) do
buff[idx] = {atk={"+",1}, sta={"+",2}}
end
buff:apply()
end,
--Curious Girl Vernika
[100007] = curious_vernika,
--Cannelle
[100008] = function(player)
if player.opponent:field_size() == 0 or #player:get_follower_idxs() == 0 then
return
end
local max_size = player.opponent.field[player.opponent:field_idxs_with_most_and_preds(pred.size)[1]].size
local min_size = player.field[player:field_idxs_with_least_and_preds(pred.size)[1]].size
local buff_size = abs(max_size - min_size)
local target_idxs = player:field_idxs_with_least_and_preds(pred.size, pred.follower)
local buff = OnePlayerBuff(player)
for _,idx in ipairs(target_idxs) do
buff[idx] = {atk={"+",buff_size}, sta={"+",buff_size}}
end
buff:apply()
end,
--Gart
[100009] = function(player)
local num_follower = #player.opponent:get_follower_idxs()
if num_follower == 0 then
return
end
local num_vita = #player.opponent:field_idxs_with_preds({pred.follower, pred.V})
local buff = OnePlayerBuff(player.opponent)
if num_follower==num_vita then
local target_idxs = shuffle(player.opponent:get_follower_idxs())
for i=1,2 do
if target_idxs[i] then
buff[target_idxs[i]] = {sta={"-",1}}
end
end
else
local target_idx = uniformly(player.opponent:field_idxs_with_preds(pred.follower, pred.neg(pred.faction.V)))
if target_idx then
buff[target_idx] = {atk={"-",2},sta={"-",2}}
end
end
buff:apply()
end,
-- Dress Sita
[100010] = function(player)
local nme_cards = player.opponent:ncards_in_field()
if nme_cards == 0 then
return
end
if nme_cards > 1 then
local nme_followers = player.opponent:get_follower_idxs()
if #nme_followers == 0 then
return
end
local buff = OnePlayerBuff(player.opponent)
local target_idx = player.opponent:field_idxs_with_most_and_preds(pred.size, pred.follower)[1]
buff[target_idx] = {atk={"-",2},def={"-",1},sta={"-",2}}
buff:apply()
elseif nme_cards == 1 then
local target = player:deck_idxs_with_preds(pred.follower)[1]
if target then
local buff = GlobalBuff(player)
buff.deck[player][target] = {atk={"+",1},sta={"+",2}}
buff:apply()
end
end
end,
--Dress Cinia
[100011] = function(player)
local target_idxs = player.opponent:get_follower_idxs()
if #target_idxs == 0 then
return
end
local max_size
if #player.hand == 0 then
max_size = 0
elseif #player.hand == 1 then
max_size = ceil(player.hand[1].size/2)
else
max_size = ceil((player.hand[1].size + player.hand[2].size)/2)
end
local target_idx = player.opponent:field_idxs_with_preds(pred.follower, function(card) return card.size <= max_size end)[1]
if target_idx then
OneBuff(player.opponent,target_idx,{atk={"-",2},def={"-",2},sta={"-",2}}):apply()
end
end,
--Dress Luthica
[100012] = function(player)
local buff = OnePlayerBuff(player)
local size1 = 0
local size2 = 0
if player.hand[1] then
size1 = player.hand[1].size
end
if player.hand[2] then
size2 = player.hand[2].size
end
local target_idxs = player:get_follower_idxs()
if abs(size1 - size2)%2 == 1 then
for _,idx in ipairs(target_idxs) do
buff[idx] = {sta={"+",2}}
end
else
for _,idx in ipairs(target_idxs) do
buff[idx] = {atk={"+",2}}
end
end
buff:apply()
end,
--Dress Iri
[100013] = function(player)
if #player.hand == 0 then
return
end
if (player.character.life + player.hand[1].size)%2 == 0 then
OneBuff(player,0,{life={"+",3}}):apply()
else
local buff = GlobalBuff(player)
buff.hand[player][1] = {size={"-",1}}
buff:apply()
end
end,
--Dress Vernika
[100014] = function(player)
local target_idxs = player:field_idxs_with_preds(pred.follower, function(card) return card.size > 1 end)
if #target_idxs == 0 then
return
end
local size1 = 0
local size2 = 0
if player.hand[1] then
size1 = player.hand[1].size
end
if player.hand[2] then
size2 = player.hand[2].size
end
local size_diff = abs(size1 - size2)
OneBuff(player,uniformly(target_idxs),{size={"-",min(size_diff,3)}}):apply()
end,
--Kendo Sita
[100015] = function(player)
if #player.opponent:get_follower_idxs() == 0 then
return
end
if not player.opponent.field[3] then
local old_card_idx = uniformly(player.opponent:get_follower_idxs())
local card = player.opponent.field[old_card_idx]
player.opponent.field[3] = card
player.opponent.field[old_card_idx] = nil
end
if pred.follower(player.opponent.field[3]) then
OneBuff(player.opponent,3,{sta={"-",3}}):apply()
end
end,
--Chess Cinia
[100016] = function(player)
local target_idx = player.opponent:field_idxs_with_most_and_preds(pred.size, pred.follower)[1]
local followers = player:get_follower_idxs()
if not target_idx or #followers == 0 then
return
end
local buff_size = 0
if player.field[4] and pred.follower(player.field[4]) then
buff_size = ceil((player.field[followers[1]].size + player.field[4].size)/2)
else
buff_size = ceil(player.field[followers[1]].size/2)
end
OneBuff(player.opponent,target_idx,{atk={"-",buff_size},sta={"-",buff_size}}):apply()
end,
--Sports Luthica
[100017] = function(player)
if #player:get_follower_idxs() == 0 then
return
end
if player.field[1] and pred.follower(player.field[1]) and not player.field[5] then
local card = player.field[1]
player.field[5] = card
player.field[1] = nil
end
if player.field[5] and pred.follower(player.field[5]) then
OneBuff(player,5,{sta={"+",5}}):apply()
end
end,
--Cheerleader Iri
[100018] = function(player, opponent, my_card)
local hand_idx = uniformly(player:hand_idxs_with_preds(function(card) return card.size >= 2 end))
if hand_idx then
local buff = GlobalBuff(player) --stolen from Tower of Books
buff.hand[player][hand_idx] = {size={"-",1}}
buff:apply()
if pred.D(player.hand[hand_idx]) then
buff_random(player, opponent, my_card, {atk={"+",1},sta={"+",1}})
end
end
end,
--Team Manager Vernika
[100019] = function(player)
local hand_size = #player.hand
local buff_size = floor(hand_size/2)
if hand_size < 4 then
local buff = GlobalBuff(player)
for i=1,hand_size do
if pred.follower(player.hand[i]) then
buff.hand[player][i] = {atk={"+",buff_size},sta={"+",buff_size}}
end
end
buff:apply()
for i=1,hand_size do
player:hand_to_bottom_deck(1)
end
else
return
end
local targets = player:field_idxs_with_preds(pred.follower, pred.V)
if #targets > 0 then
OneBuff(player,uniformly(targets),{atk={"+",buff_size},sta={"+",buff_size}}):apply()
end
end,
--Swimwear Sita
[100020] = function(player)
local hand_idx = player:hand_idxs_with_least_and_preds(pred.size, pred.follower)[1]
local nme_followers = player.opponent:get_follower_idxs()
if (not hand_idx) or #nme_followers == 0 then
return
end
local def_lose = floor(player.hand[hand_idx].atk/2)
OneBuff(player.opponent,uniformly(nme_followers),{def={"-",def_lose}}):apply()
end,
--Swimwear Cinia
[100021] = function(player)
local my_followers = player:get_follower_idxs()
local nme_followers = player.opponent:get_follower_idxs()
if #my_followers == 0 or #nme_followers == 0 then
return
end
local my_size = player.field[my_followers[1]].size
local target_idxs = player.opponent:field_idxs_with_preds(pred.follower, function(card) return card.size < my_size end)
local buff = OnePlayerBuff(player.opponent)
for _,idx in ipairs(target_idxs) do
buff[idx] = {atk={"-",1},sta={"-",2}}
end
buff:apply()
end,
--Swimwear Luthica
[100022] = function(player)
local my_followers = player:get_follower_idxs()
if #player.hand == 0 or #my_followers == 0 then
return
end
if pred.C(player.hand[1]) and #player:field_idxs_with_preds(pred.neg(pred.C)) == 0 then
OneBuff(player,uniformly(my_followers),{atk={"+",2},sta={"+",2}}):apply()
end
end,
--Swimwear Iri
[100023] = function(player)
local target = player.opponent.field[5]
if target then
if pred.follower(target) then
OneBuff(player.opponent,5,{atk={"-",1}}):apply()
end
player.opponent:field_to_bottom_deck(5)
end
local target_idx = uniformly(player.opponent:field_idxs_with_preds())
if not target_idx then
return
end
local card = player.opponent.field[target_idx]
for i=target_idx,4 do
if not player.opponent.field[i+1] then
player.opponent.field[i+1] = card
player.opponent.field[target_idx] = nil
break
end
end
if player.opponent.field[5] then
player.opponent:destroy(5)
end
end,
--Swimwear Vernika
[100024] = function(player)
if #player.opponent.hand < 2 or #player:get_follower_idxs() == 0 then
return
end
local new_size = abs(player.opponent.hand[1].size - player.opponent.hand[2].size)
local target_idx = player:field_idxs_with_most_and_preds(pred.size, pred.follower)[1]
if target_idx then
OneBuff(player,target_idx,{size={"=",new_size}}):apply()
end
end,
--Lightseeker Sita
[100025] = function(player)
local nme_followers = player.opponent:get_follower_idxs()
local target_idxs = player:field_idxs_with_preds(pred.D, pred.follower, function(card) return card.size < 10 end)
if #target_idxs == 0 then
return
end
local target_idx = uniformly(target_idxs)
local buff_size = floor(1.5*player.field[target_idx].size)
player:field_to_grave(target_idx)
if #nme_followers > 0 then
OneBuff(player.opponent,uniformly(nme_followers),{sta={"-",buff_size}}):apply()
end
end,
--Foreign Student Cinia
[100026] = function(player)
local my_followers = player:get_follower_idxs()
if #my_followers == 0 or #player.hand == 0 then
return
end
local target_idx = uniformly(my_followers)
if pred.V(player.hand[1]) then
OneBuff(player,target_idx,{atk={"+",1},sta={"+",2}}):apply()
elseif pred.A(player.hand[1]) then
OneBuff(player,target_idx,{sta={"+",3}}):apply()
elseif pred.C(player.hand[1]) then
OneBuff(player,target_idx,{def={"+",1}}):apply()
elseif pred.D(player.hand[1]) then
OneBuff(player,target_idx,{size={"-",2}}):apply()
end
end,
--Blue Reaper Luthica
[100027] = function(player)
local target_idxs = player:field_idxs_with_preds(pred.follower, pred.C)
if #target_idxs == 0 then
return
end
local crux_cards = #player.opponent:field_idxs_with_preds(pred.C) + #player.opponent:hand_idxs_with_preds(pred.C)
local non_crux_cards = #player.opponent:field_idxs_with_preds() + #player.opponent.hand - crux_cards
OneBuff(player,uniformly(target_idxs),{sta={"+",max(crux_cards, non_crux_cards)}}):apply()
end,
--Lovestruck Iri
[100028] = function(player)
local factions = {}
for i=1,5 do
if player.opponent.hand[i] and factions[1] ~= player.opponent.hand[i].faction then
factions[#factions+1] = player.opponent.hand[i].faction
end
if player.opponent.field[i] and factions[1] ~= player.opponent.field[i].faction then
factions[#factions+1] = player.opponent.field[i].faction
end
end
if #factions > 1 and #player.hand > 0 then
local hand_idx = random(#player.hand)
local buff = GlobalBuff(player)
buff.hand[player][hand_idx] = {size={"-",2}}
buff:apply()
end
end,
--Night Denizen Vernika
[100029] = function(player)
local nme_followers = player.opponent:get_follower_idxs()
if #nme_followers > 0 then
local target_idx = uniformly(nme_followers)
OneBuff(player.opponent,target_idx,{sta={"-",3}}):apply()
OneBuff(player, 0, {life={"+",1}}):apply()
end
local target = uniformly(player:field_idxs_with_preds(pred.follower, pred.D))
if target then
OneBuff(player, target, {sta={"+",2}}):apply()
end
end,
--Thorn Witch Rose
[100030] = thorn_witch_rose,
-- rose pacifica
[100031] = function(player)
local hand_idx = player:hand_idxs_with_preds(pred.D)[1]
if hand_idx then
local sz = ceil(player.hand[hand_idx].size/2)
player:hand_to_grave(hand_idx)
local target = uniformly(player.opponent:field_idxs_with_preds(pred.follower))
if target then
OneBuff(player.opponent, target, {atk={"-",sz},sta={"-",sz}}):apply()
end
end
end,
-- blood witch rose
[100032] = function(player)
if player.game.turn % 1 == 1 then
local idx = uniformly(player.opponent:hand_idxs_with_preds(pred.spell))
if idx then
player.opponent:hand_to_exile(idx)
end
else
local idx = uniformly(player.opponent:grave_idxs_with_preds(pred.spell))
if idx then
player.opponent:grave_to_exile(idx)
end
end
end,
-- outcast rose
[100033] = function(player)
if #player:field_idxs_with_preds(pred.follower) >= 2 then
local target = uniformly(player:field_idxs_with_preds(pred.follower))
local buff = OnePlayerBuff(player)
buff[0] = {life={"-",1}}
if target then
buff[target] = {atk={"+",2},def={"+",1},sta={"+",2}}
end
buff:apply()
end
end,
-- picnic rose
[100034] = function(player)
local targets = shuffle(player:field_idxs_with_preds(pred.follower))
if #targets >= 2 then
local amt = abs(player.field[targets[1]].size - player.field[targets[2]].size)
local buff = OnePlayerBuff(player)
for i=1,2 do
buff[targets[i]] = {sta={"+",amt}}
end
buff:apply()
end
end,
-- wedding dress rose
[100035] = function(player, opponent)
local idx = uniformly(opponent:field_idxs_with_preds(pred.follower))
if not idx then
return
end
local mag = ceil(abs(opponent.field[idx].size - opponent.field[idx].def) / 2)
OneBuff(opponent, idx, {atk={"-", mag}, sta={"-", mag}}):apply()
end,
-- wedding dress sita
[100036] = function(player)
sita_vilosa(player)
starter_burn(player)
wedding_shuffles(player)
end,
-- wedding dress cinia
[100037] = function(player)
cinia_pacifica(player)
starter_burn(player)
wedding_shuffles(player)
end,
-- wedding dress luthica
[100038] = function(player)
luthica_preventer(player)
starter_burn(player)
wedding_shuffles(player)
end,
-- wedding dress iri
[100039] = function(player)
iri_flina(player)
starter_burn(player)
wedding_shuffles(player)
end,
-- wedding dress vernika
[100040] = curious_vernika,
-- laevateinn
[100041] = function(player)
local size_to_n = {}
for i=1,#player.hand do
local sz = player.hand[i].size
size_to_n[sz] = (size_to_n[sz] or 0) + 1
end
local size = -1
for k,v in pairs(size_to_n) do
if v >= 2 and k > size then
size = k
end
end
if size > 0 then
OneBuff(player, 0, {life={"+",ceil(size/2)}}):apply()
end
end,
-- sisters sion & rion
[100042] = function(player)
local field_idxs = player:field_idxs_with_preds(pred.follower)
local hand_idxs = player:hand_idxs_with_preds(pred.follower)
local target = uniformly(field_idxs)
if target then
OneBuff(player, target, {atk={"+",#hand_idxs},sta={"+",#field_idxs}}):apply()
end
end,
-- head knight jaina
[100043] = head_knight_jaina,
-- resting jaina
[100044] = function(player, opponent, my_card)
if player.game.turn % 3 == 0 then
local targets = shuffle(player:field_idxs_with_preds(pred.follower, pred.C))
local buff = OnePlayerBuff(player)
for i=1,min(2,#targets) do
buff[targets[i]] = {atk={"+",3},sta={"+",3}}
end
buff[0] = {life={"+",2}}
buff:apply()
end
end,
-- adept jaina
[100045] = function(player, opponent, my_card)
local amt = min(4, 6-#player.hand)
local target = uniformly(player:field_idxs_with_preds(pred.follower))
if target then
OneBuff(player, target, {atk={"+",amt}}):apply()
end
end,
-- swimwear jaina
[100046] = function(player, opponent, my_card)
local target = uniformly(player:field_idxs_with_preds(pred.follower))
if target and player:first_empty_field_slot() then
for i=target+1,5 do
if not player.field[i] then
local card = player.field[target]
player.field[target] = nil
player.field[i] = card
OneBuff(player, i, {atk={"+",i},sta={"+",floor(i/2)}}):apply()
return
end
end
local slot = player:first_empty_field_slot()
local card = player.field[target]
player.field[target] = nil
player.field[slot] = card
OneBuff(player, slot, {atk={"+",slot},sta={"+",floor(slot/2)}}):apply()
end
end,
-- sword planter jaina
[100047] = function(player, opponent, my_card)
local amt = 0
local sizes = {}
for i=1,#player.hand do
if not sizes[player.hand[i].size] then
sizes[player.hand[i].size] = true
amt = amt + 1
end
end
local targets = shuffle(player:field_idxs_with_preds(pred.follower))
local buff = OnePlayerBuff(player)
for i=1,min(2,#targets) do
if amt == 1 then
buff[targets[i]] = {atk={"+", 1}, def={"+", 1}, sta={"+", 1}}
else
buff[targets[i]] = {atk={"+", amt}}
end
end
buff:apply()
end,
-- wedding dress jaina
[100048] = head_knight_jaina,
-- sigma
[100049] = function(player, opponent, my_card)
local buff = GlobalBuff(player)
local hand_targets = shuffle(player:hand_idxs_with_preds(pred.follower))
local targets = shuffle(player:field_idxs_with_preds(pred.follower))
for i=1,min(2,#hand_targets) do
buff.hand[player][hand_targets[i]] = {atk={"+",1},sta={"+",1}}
end
for i=1,min(2,#targets) do
buff.field[player][targets[i]] = {sta={"+",1}}
end
buff:apply()
end,
-- child sita
[100050] = function(player, opponent, my_card)
if opponent.field[2] and pred.follower(opponent.field[2]) then
OneBuff(opponent, 2, {sta={"-",2}}):apply()
end
local idx = opponent:field_idxs_with_preds(pred.follower)[1]
if idx then
OneBuff(opponent, idx, {sta={"-",1}}):apply()
end
local idx = uniformly(opponent:field_idxs_with_preds(pred.follower))
if idx then
OneBuff(opponent, idx, {sta={"-",2}}):apply()
end
end,
-- child cinia
[100051] = function(player, opponent, my_card)
local target = uniformly(opponent:field_idxs_with_preds(pred.follower))
if target then
if opponent.field[target].size >= 3 then
OneBuff(opponent, target, {atk={"-",2}}):apply()
else
OneBuff(opponent, target, {sta={"-",3}}):apply()
end
end
end,
-- child luthica
[100052] = function(player, opponent, my_card)
local target = uniformly(player:field_idxs_with_preds(pred.follower, pred.C))
if target then
if player.field[target].size > 3 then
OneBuff(player, target, {atk={"+",2}}):apply()
elseif player.field[target].size < 3 then
OneBuff(player, target, {sta={"+",3}}):apply()
else
OneBuff(player, target, {atk={"+",2}, sta={"+",3}}):apply()
end
end
end,
-- child iri
[100053] = function(player, opponent, my_card)
local target = uniformly(opponent:field_idxs_with_preds(pred.follower))
if target then
if #player.hand % 2 == 0 then
OneBuff(opponent, target, {atk={"-",1},def={"-",1},sta={"-",2}}):apply()
else
OneBuff(opponent, target, {atk={"-",1},sta={"-",2}}):apply()
end
end
end,
-- onsen sita
[100054] = function(player, opponent, my_card)
local buff = OnePlayerBuff(opponent)
for i=2,4 do
if opponent.field[i] and pred.follower(opponent.field[i]) then
buff[i] = {sta={"-",2}}
end
end
buff:apply()
local target = uniformly(opponent:field_idxs_with_preds(pred.follower))
if target then
OneBuff(opponent, target, {sta={"-",1}}):apply()
end
end,
-- onsen cinia
[100055] = function(player, opponent, my_card)
local target = uniformly(opponent:field_idxs_with_preds(pred.follower))
if target then
if opponent.field[target].def >= 1 then
OneBuff(opponent, target, {atk={"-",2},def={"-",1},sta={"-",2}}):apply()
else
OneBuff(opponent, target, {atk={"-",1},sta={"-",1}}):apply()
end
end
end,
-- onsen luthica
[100056] = function(player, opponent, my_card)
local target = uniformly(player:field_idxs_with_preds(pred.follower))
if target then
if player.field[target].def <= 2 then
OneBuff(player, target, {atk={"+",2},def={"+",1},sta={"+",2}}):apply()
else
OneBuff(player, target, {atk={"+",2},sta={"+",2}}):apply()
end
end
end,
-- onsen iri
[100057] = function(player, opponent, my_card)
local target = uniformly(opponent:field_idxs_with_preds(pred.follower))
if target then
if opponent.field[target].sta >= 12 then
OneBuff(opponent, target, {atk={"-",2},def={"-",1},sta={"-",2}}):apply()
else
OneBuff(opponent, target, {atk={"-",1},def={"-",1}}):apply()
end
end
end,
-- miracle panda panica
[100058] = function(player, opponent, my_card)
if player.game.turn % 2 ==1 then
local buff = OnePlayerBuff(player)
local targets = shuffle(player:field_idxs_with_preds(pred.follower))
for i=1,min(2,#targets) do
buff[targets[i]] = {atk={"+",1}}
end
buff:apply()