forked from EpicOrange/riichi_advanced
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathriichi.majs
More file actions
1074 lines (1027 loc) · 64.5 KB
/
riichi.majs
File metadata and controls
1074 lines (1027 loc) · 64.5 KB
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
define_set pair, ~s"0 0"
define_set shuntsu, ~s"0 1 2"
define_set koutsu, ~s"0 0 0"
define_set mentsu, ~s"0 0 0 | 0 1 2"
define_set quad, ~s"0 0 0 0"
define_set taatsu, ~s"0 0 | 0 1 | 0 2"
define_set iipeikou, ~s"0 1 2, 0 1 2"
define_set ittsu, ~s"0 1 2, 3 4 5, 6 7 8"
define_set sanshoku_doujun, ~s"0 1 2, 10 11 12, 20 21 22"
define_set sanshoku_doukou, ~s"0 0 0, 10 10 10, 20 20 20"
define_set ton, ~s"1z 1z 1z"
define_set nan, ~s"2z 2z 2z"
define_set shaa, ~s"3z 3z 3z"
define_set pei, ~s"4z 4z 4z"
define_set haku, ~s"5z 5z 5z"
define_set hatsu, ~s"6z 6z 6z"
define_set chun, ~s"7z 7z 7z"
define_set ton_pair, ~s"1z 1z"
define_set nan_pair, ~s"2z 2z"
define_set shaa_pair, ~s"3z 3z"
define_set pei_pair, ~s"4z 4z"
define_set haku_pair, ~s"5z 5z"
define_set hatsu_pair, ~s"6z 6z"
define_set chun_pair, ~s"7z 7z"
define_set orphans_all, ~s"1m 9m 1p 9p 1s 9s 1z 2z 3z 4z 5z 6z 7z"
define_set orphans_any, ~s"1m|9m|1p|9p|1s|9s|1z|2z|3z|4z|5z|6z|7z"
define_set chuurenpoutou, ~s"0 0 0 1 2 3 4 5 6 7 8 8 8"
# the instances of any:1 are for minefield,
# which assumes that tenpai specifies exactly 13 tiles
define_match standard_tenpai, ~m"exhaustive, mentsu:3, taatsu:1, pair:1 | exhaustive, mentsu:4, any:1"
define_match chiitoitsu_tenpai, ~m"(nojoker koutsu):-1, pair:6, any:1"
define_match kokushi_tenpai, ~m"unique, dismantle_calls, orphans_any:12, orphans_any:1"
define_match tenpai, "standard_tenpai", "chiitoitsu_tenpai", "kokushi_tenpai"
define_match standard_win, ~m"exhaustive, mentsu:4, pair:1"
define_match chiitoitsu_win, ~m"(nojoker quad):-1, pair:7"
define_match kokushi_win, ~m"unique, dismantle_calls, orphans_any:13, orphans_any:1"
define_match win, "standard_win", "chiitoitsu_win", "kokushi_win"
define_match shousuushii,
~m"""
ton:1, nan:1, shaa:1, pei_pair:1
| ton:1, nan:1, shaa_pair:1, pei:1
| ton:1, nan_pair:1, shaa:1, pei:1
| ton_pair:1, nan:1, shaa:1, pei:1
"""
define_match daisuushii, ~m"ton:1, nan:1, shaa:1, pei:1"
define_match sanankou_tsumo,
~m"""
(pon daiminkan kakan):-1, koutsu:3, mentsu:1, pair:1
| (pon daiminkan kakan):-2, koutsu:4, pair:1
"""
define_match sanankou_ron,
~m"""
exhaustive, (pon daiminkan kakan):-1, koutsu:3, (any@winning_tile):0, mentsu:1, pair:1
| exhaustive, (pon daiminkan kakan):-2, koutsu:4, (any@winning_tile):0, pair:1
"""
define_const closed_hand, has_no_call_named("chii", "pon", "daiminkan", "kakan")
define_yaku yaku, "Tsumo", 1, won_by_draw and @closed_hand
define_yaku yaku, "Haitei", 1, no_tiles_remaining and won_by_draw
define_yaku yaku, "Houtei", 1, no_tiles_remaining and not_won_by_draw
define_yaku yaku, "Pinfu", 1, @closed_hand
and match(["hand", "calls", "winning_tile"], ["standard_win"])
and ((won_by_draw and minipoints_equals(20)) or (not_won_by_draw and minipoints_equals(30)))
define_yaku yaku, "Tanyao", 1, winning_hand_consists_of("2m","3m","4m","5m","6m","7m","8m","2p","3p","4p","5p","6p","7p","8p","2s","3s","4s","5s","6s","7s","8s")
define_yaku yaku, "Iipeikou", 1, @closed_hand and match(["hand", "calls", "winning_tile"], ~m"exhaustive, iipeikou:1, mentsu:2, pair:1")
define_yaku yaku, "Haku", 1, match(["hand", "calls", "winning_tile"], ~m"exhaustive, haku:1, mentsu:3, pair:1")
define_yaku yaku, "Hatsu", 1, match(["hand", "calls", "winning_tile"], ~m"exhaustive, hatsu:1, mentsu:3, pair:1")
define_yaku yaku, "Chun", 1, match(["hand", "calls", "winning_tile"], ~m"exhaustive, chun:1, mentsu:3, pair:1")
# round and seat winds
def add_scoring_attrs do
if round_wind_is("east") do add_attr(["hand", "calls", "winning_tile"], ["_prevalent"], ["1z"]) end
if round_wind_is("south") do add_attr(["hand", "calls", "winning_tile"], ["_prevalent"], ["2z"]) end
if round_wind_is("west") do add_attr(["hand", "calls", "winning_tile"], ["_prevalent"], ["3z"]) end
if round_wind_is("north") do add_attr(["hand", "calls", "winning_tile"], ["_prevalent"], ["4z"]) end
if seat_is("east") do add_attr(["hand", "calls", "winning_tile"], ["_seat"], ["1z"]) end
if seat_is("south") do add_attr(["hand", "calls", "winning_tile"], ["_seat"], ["2z"]) end
if seat_is("west") do add_attr(["hand", "calls", "winning_tile"], ["_seat"], ["3z"]) end
if seat_is("north") do add_attr(["hand", "calls", "winning_tile"], ["_seat"], ["4z"]) end
end
define_set prevalent_wind, ~s"0@prevalent 0@prevalent 0@prevalent"
define_set seat_wind, ~s"0@seat 0@seat 0@seat"
define_yaku yaku, "Round Wind", 1, match(["hand", "calls", "winning_tile"], ~m"exhaustive, prevalent_wind:1, mentsu:3, pair:1")
define_yaku yaku, "Seat Wind", 1, match(["hand", "calls", "winning_tile"], ~m"exhaustive, seat_wind:1, mentsu:3, pair:1")
# welcome to the chanta zone
apply append, "functions.add_scoring_attrs" do
add_attr(["hand", "calls", "winning_tile"], ["_terminal"], ["terminal"])
add_attr(["hand", "calls", "winning_tile"], ["_tanyao"], ["tanyaohai"])
add_attr(["hand", "calls", "winning_tile"], ["_yaochuu"], ["yaochuuhai"])
end
define_set terminal_l, ~s"0@terminal 1 2"
define_set terminal_r, ~s"0 1 2@terminal"
define_set terminal_t, ~s"0@terminal 0@terminal 0@terminal"
define_set terminal_pair, ~s"0@terminal 0@terminal"
define_set yaochuu_l, ~s"0@yaochuu 1 2"
define_set yaochuu_r, ~s"0 1 2@yaochuu"
define_set yaochuu_t, ~s"0@yaochuu 0@yaochuu 0@yaochuu"
define_set yaochuu_pair, ~s"0@yaochuu 0@yaochuu"
define_match chanta, ~m"exhaustive, (yaochuu_l yaochuu_r yaochuu_t):4, yaochuu_pair:1"
define_match junchan, ~m"exhaustive, (terminal_l terminal_r terminal_t):4, terminal_pair:1"
define_yaku yaku, "Chanta", 1, match(["hand", "calls", "winning_tile"], ["chanta"])
define_yaku yaku, "Junchan", 2, match(["hand", "calls", "winning_tile"], ["junchan"])
# now leaving the chanta zone
define_yaku yaku, "Ittsu", 1, match(["hand", "calls", "winning_tile"], ~m"exhaustive, ittsu:1, mentsu:1, pair:1")
define_yaku yaku, "Sanshoku", 1, match(["hand", "calls", "winning_tile"], ~m"exhaustive, sanshoku_doujun:1, mentsu:1, pair:1")
define_yaku yaku, "Sanshoku Doukou", 2, match(["hand", "calls", "winning_tile"], ~m"exhaustive, sanshoku_doukou:1, mentsu:1, pair:1")
define_yaku yaku, "Toitoi", 2, match(["hand", "calls", "winning_tile"], ~m"koutsu:4, pair:1")
define_yaku yaku, "Chiitoitsu", 2, match(["hand", "calls", "winning_tile"], ~m"(nojoker quad):-1, pair:7")
define_yaku yaku, "Sanankou", 2,
(won_by_draw and match(["hand", "calls", "winning_tile"], ["sanankou_tsumo"]))
or (not_won_by_draw and match(["hand", "calls", "winning_tile"], ["sanankou_ron"]))
define_yaku yaku, "Shousangen", 2, match(["hand", "calls", "winning_tile"], ~m"(haku hatsu chun):2, (haku_pair hatsu_pair chun_pair):1")
define_yaku yaku, "Honroutou", 2, winning_hand_consists_of("1m","9m","1p","9p","1s","9s","1z","2z","3z","4z","5z","6z","7z")
define_yaku yaku, "Ryanpeikou", 3, @closed_hand and match(["hand", "calls", "winning_tile"], ~m"exhaustive, iipeikou:2, pair:1")
define_yaku yaku, "Honitsu", 2,
winning_hand_consists_of("1m","2m","3m","4m","5m","6m","7m","8m","9m","1z","2z","3z","4z","5z","6z","7z")
or winning_hand_consists_of("1p","2p","3p","4p","5p","6p","7p","8p","9p","1z","2z","3z","4z","5z","6z","7z")
or winning_hand_consists_of("1s","2s","3s","4s","5s","6s","7s","8s","9s","1z","2z","3z","4z","5z","6z","7z")
define_yaku yaku, "Chinitsu", 5,
winning_hand_consists_of("1m","2m","3m","4m","5m","6m","7m","8m","9m")
or winning_hand_consists_of("1p","2p","3p","4p","5p","6p","7p","8p","9p")
or winning_hand_consists_of("1s","2s","3s","4s","5s","6s","7s","8s","9s")
define_yaku meta_yaku, "Chanta", 1, @closed_hand and has_existing_yaku("Chanta")
define_yaku meta_yaku, "Ittsu", 1, @closed_hand and has_existing_yaku("Ittsu")
define_yaku meta_yaku, "Sanshoku", 1, @closed_hand and has_existing_yaku("Sanshoku")
define_yaku meta_yaku, "Junchan", 1, @closed_hand and has_existing_yaku("Junchan")
define_yaku meta_yaku, "Honitsu", 1, @closed_hand and has_existing_yaku("Honitsu")
define_yaku meta_yaku, "Chinitsu", 1, @closed_hand and has_existing_yaku("Chinitsu")
define_yaku yakuman, "Tenhou", 1, status("discards_empty") and won_by_draw and seat_is("east")
define_yaku yakuman, "Chiihou", 1, status("discards_empty") and won_by_draw and not_seat_is("east")
define_yaku yakuman, "Daisangen", 1, match(["hand", "calls", "winning_tile"], ~m"haku:1, hatsu:1, chun:1")
define_yaku yakuman, "Suuankou", 1, won_by_draw and @closed_hand and match(["hand", "calls"], ~m"koutsu:3, pair:2")
define_yaku yakuman, "Suuankou Tanki", 2, @closed_hand and match(["hand", "calls"], ~m"koutsu:4") and match(["hand", "calls", "winning_tile"], ~m"koutsu:4, pair:1")
define_yaku yakuman, "Tsuuiisou", 1, winning_hand_consists_of("1z","2z","3z","4z","5z","6z","7z")
define_yaku yakuman, "Ryuuiisou", 1, winning_hand_consists_of("2s","3s","4s","6s","8s","6z")
define_yaku yakuman, "Chinroutou", 1, winning_hand_consists_of("1m","9m","1p","9p","1s","9s")
define_yaku yakuman, "Chuurenpoutou", 1, match(["hand", "winning_tile"], ~m"chuurenpoutou:1")
define_yaku yakuman, "Junsei Chuurenpoutou", 2, match(["hand"], ~m"chuurenpoutou:1")
define_yaku yakuman, "Kokushi Musou", 1, match(["hand", "winning_tile"], ~m"orphans_all:1")
define_yaku yakuman, "Kokushi Musou Juusan Menmachi", 2, match(["hand"], ~m"orphans_all:1")
define_yaku yakuman, "Daisuushii", 2, match(["hand", "calls", "winning_tile"], ["daisuushii"])
define_yaku yakuman, "Shousuushii", 1, match(["hand", "calls", "winning_tile"], ["shousuushii"])
# tenhou upgrades certain yakuman to double yakuman
define_yaku meta_yakuman, "Suuankou Tanki", 2, not_has_existing_yaku("Suuankou Tanki") and has_existing_yaku("Tenhou", "Suuankou")
define_yaku meta_yakuman, "Junsei Chuurenpoutou", 2, not_has_existing_yaku("Junsei Chuurenpoutou") and has_existing_yaku("Tenhou", "Chuurenpoutou")
define_yaku meta_yakuman, "Kokushi Musou Juusan Menmachi", 2, not_has_existing_yaku("Kokushi Musou Juusan Menmachi") and has_existing_yaku("Tenhou", "Kokushi Musou")
define_yaku_precedence "Chinitsu", ["Honitsu"]
define_yaku_precedence "Chiitoitsu", ["Iipeikou"]
define_yaku_precedence "Toitoi", ["Iipeikou"]
define_yaku_precedence "Sanankou", ["Iipeikou"]
define_yaku_precedence "Ryanpeikou", ["Iipeikou", "Chiitoitsu"]
define_yaku_precedence "Junchan", ["Chanta"]
define_yaku_precedence "Honroutou", ["Chanta", "Junchan"]
define_yaku_precedence "Suuankou", ["Toitoi", "Sanankou"]
define_yaku_precedence "Suuankou Tanki", ["Suuankou"]
define_yaku_precedence "Chuurenpoutou", ["Chinitsu"]
define_yaku_precedence "Junsei Chuurenpoutou", ["Chuurenpoutou"]
define_yaku_precedence "Kokushi Musou Juusan Menmachi", ["Kokushi Musou"]
define_yaku_precedence "Daisuushii", ["Shousuushii"]
set score_calculation, %{
scoring_method: ["han_fu_formula", "multiplier"],
score_multiplier: 32000, # this is for yakuman
dealer_multiplier: 1.5,
score_name: "Yakuman",
limit_thresholds: [
[3, 70], [4, 40], [5, 0],
[6, 0],
[8, 0],
[11, 0],
[13, 0]
],
limit_scores: [
8000, 8000, 8000,
12000,
16000,
24000,
32000
],
limit_names: [
"Mangan", "Mangan", "Mangan",
"Haneman",
"Baiman",
"Sanbaiman",
"Kazoe Yakuman"
],
yaku_lists: ["yaku", "meta_yaku", "extra_yaku"],
yaku2_lists: ["yakuman", "meta_yakuman"],
extra_yaku_lists: ["extra_yaku"],
yaku2_overrides_yaku1: true,
split_oya_ko_payment: true,
right_display: "minipoints",
point_name: "Han",
point2_name: "★",
minipoint_name: "Fu",
win_by_discard_label: "Ron",
win_by_draw_label: "Tsumo",
win_by_discard_name: "Ron",
win_by_discard_name_2: "Double Ron",
win_by_discard_name_3: "Triple Ron",
win_by_draw_name: "Tsumo",
triple_win_draw_name: "Sanchahou",
exhaustive_draw_name: "Ryuukyoku"
}
def turn_cleanup do
# unset furiten
unset_status("furiten")
check_tenpai
end
def discard_passed do
# furiten check
as everyone do
if match(["hand", "calls", "last_discard"], ["win"]) do
set_status("furiten")
end
end
end
# tenpai check
# this is used to determine furiten and noten payments
def check_tenpai do
if match(["hand", "calls", "draw"], ["tenpai"]) do
set_status("tenpai")
else
unset_status("tenpai")
end
end
# noten payments
# TODO note for future sakicards implementation:
# - if kanbara satomi is in play, the player whose wall the last dora indicator is on loses double points
# + special logic for doubled 1500 payments is: if shimocha is tenpai, double payment to shimocha, otherwise double payment to kamicha
# - ikeda kana triples noten payments
def noten_payments do
# first check tenpai, and reveal tenpai hands
as everyone do
check_tenpai
if status("tenpai") do reveal_hand end
end
# determine how much each player pays
tenpai_count = 0
if status("tenpai") do tenpai_count += 1 end
if shimocha_exists and status("tenpai", as: "shimocha") do tenpai_count += 1 end
if toimen_exists and status("tenpai", as: "toimen") do tenpai_count += 1 end
if kamicha_exists and status("tenpai", as: "kamicha") do tenpai_count += 1 end
n = num_players
if n == 4 and tenpai_count == 1 do tenpai_points = 3000; noten_points = -1000 end
if n == 4 and tenpai_count == 2 do tenpai_points = 1500; noten_points = -1500 end
if n == 4 and tenpai_count == 3 do tenpai_points = 1000; noten_points = -3000 end
if n == 3 and tenpai_count == 1 do tenpai_points = 1000; noten_points = -2000 end
if n == 3 and tenpai_count == 2 do tenpai_points = 2000; noten_points = -1000 end
if n == 2 and tenpai_count == 1 do tenpai_points = 1000; noten_points = -1000 end
set_counter_all("tenpai_points", "tenpai_points")
set_counter_all("noten_points", "noten_points")
as everyone do
if status("tenpai") do
modify_payout("self", "tenpai_points")
else
modify_payout("self", "noten_points")
end
end
end
on after_scoring do
if ended_by_exhaustive_draw do
noten_payments
end
end
define_const calls_fu, %{pon: 2}
define_const winning_groups_fu, [
# kanchan
%{groups: ~s"-1 0@winning_tile 1", value: 2},
# penchan
%{groups: ~s"0@winning_tile -1@tanyao -2@terminal", value: 2},
%{groups: ~s"0@winning_tile 1@tanyao 2@terminal", value: 2},
# ryanmen
%{groups: ~s"0@winning_tile -1@tanyao -2@tanyao"},
%{groups: ~s"0@winning_tile 1@tanyao 2@tanyao"},
# shanpon
%{groups: ~s"0@tanyao 0@tanyao 0@winning_tile&ron", value: 2},
%{groups: ~s"0@yaochuu 0@yaochuu 0@winning_tile&ron", value: 4},
%{groups: ~s"0@tanyao 0@tanyao 0@winning_tile&tsumo", value: 4},
%{groups: ~s"0@yaochuu 0@yaochuu 0@winning_tile&tsumo", value: 8},
# tanki
%{groups: ~s"0@not_yakuhai 0@winning_tile", value: 2},
%{groups: ~s"0@prevalent 0@winning_tile | 0@seat 0@winning_tile | 5z 5z@winning_tile | 6z 6z@winning_tile | 7z 7z@winning_tile", value: 4}
]
define_const groups_fu, [
%{groups: ~s"0 1 2"},
%{groups: ~s"0@tanyao 0@tanyao 0@tanyao", value: 4},
%{groups: ~s"0@yaochuu 0@yaochuu 0@yaochuu", value: 8},
# pair
# for pinfu reasons, only non-yakuhai can be removed for 0 value
%{groups: ~s"0@not_yakuhai 0@not_yakuhai"},
%{groups: ~s"0@prevalent 0@prevalent | 0@seat 0@seat | 5z 5z | 6z 6z | 7z 7z", value: 2}
]
define_const always_yakuhai, ["5z", "6z", "7z"]
apply append, "functions.add_scoring_attrs" do
tag_tiles("not_yakuhai", "all")
untag_tiles("not_yakuhai", @always_yakuhai)
if round_wind_is("east") or seat_is("east") do untag_tiles("not_yakuhai", "1z") end
if round_wind_is("south") or seat_is("south") do untag_tiles("not_yakuhai", "2z") end
if round_wind_is("west") or seat_is("west") do untag_tiles("not_yakuhai", "3z") end
if round_wind_is("north") or seat_is("north") do untag_tiles("not_yakuhai", "4z") end
add_attr_tagged("not_yakuhai", "_not_yakuhai")
# tag winning tile with some attributes
add_attr(["winning_tile"], ["_winning_tile"])
if won_by_draw do
add_attr(["winning_tile"], ["_tsumo"])
else
add_attr(["winning_tile"], ["_ron"])
end
end
def calculate_fu do
if fu == 0 do
set_counter("fu", "minipoints") do
# score calls
convert_calls(@calls_fu)
remove_calls(["tanyaohai"])
convert_calls(@calls_fu)
remove_calls
# now remove all closed groups
remove_groups(@winning_groups_fu)
remove_groups(@groups_fu)
prune(method: "tile_count", num_tiles: [1,4,7,10])
remove_groups(@groups_fu)
prune(method: "tile_count", num_tiles: [1,4,7,10])
remove_groups(@groups_fu)
prune(method: "tile_count", num_tiles: [1,4,7,10])
remove_groups(@groups_fu)
prune(method: "tile_count", num_tiles: [1,4,7,10])
# only retain configurations with 0 tiles remaining
retain_empty_hands
# add 1000 to pinfu hands so we prioritize pinfu later
add(1000, minipoints_equals(0))
# base 20
add(20)
# tsumo +2 (except closed pinfu tsumo)
add(2, won_by_draw and (minipoints_at_most(999) or not @closed_hand))
# closed ron +10 and open pinfu ron +10
add(10, not_won_by_draw and @closed_hand)
add(10, not_won_by_draw and not @closed_hand and minipoints_at_least(1000))
# take max, then subtract 1000 from pinfu hands
take_maximum
add(-1000, minipoints_at_least(1000))
# round up to nearest 10
round_up(10)
# add original hand (for special hands like chiitoitsu and kokushi)
add_original_hand
# chiitoitsu
add(25, minipoints_equals(0) and match(["hand", "calls", "winning_tile"], [[ [["pair"], 7] ]]))
# kokushi
add(40, not_won_by_draw and @closed_hand and minipoints_equals(0) and match(["hand", "calls", "winning_tile"], ["kokushi_win"]))
add(30, minipoints_equals(0) and match(["hand", "calls", "winning_tile"], ["kokushi_win"]))
take_maximum
end
end
end
on after_initialization do
add_rule_tab("Rules")
add_rule_tab("0.5 Han")
add_rule_tab("1 Han")
add_rule_tab("2 Han")
add_rule_tab("3 Han")
add_rule_tab("4 Han")
add_rule_tab("5 Han")
add_rule_tab("Mangan")
add_rule_tab("Yakuman")
add_rule("Rules", "Tenpai Payments", "In event of an exhaustive draw, players not in tenpai pay players in tenpai. 3000 points total are paid, with the payment split among the non-tenpai players. If all or no players are tenpai, no payment occurs.")
add_rule("Rules", "Win Condition", "You may win with one of the following:", -100)
add_rule("Rules", "Win Condition", "- Four sets (sequences or triplets) and a pair.", -100)
add_rule("Rules", "Win Condition", "- (Chiitoitsu) Seven distinct pairs.", -100)
add_rule("Rules", "Win Condition", "- (Kokushi Musou) All thirteen terminal/honor tiles plus one forming a pair.", -100)
add_rule("1 Han", "Tsumo", "Win by self-draw with a closed hand.")
add_rule("1 Han", "Haitei", "Win by drawing the last tile in the wall.")
add_rule("1 Han", "Houtei", "Win off a discard after the last tile in the wall is drawn.")
add_rule("1 Han", "Pinfu", "You won off a double-sided sequence wait, with an all-sequence hand whose pair is not yakuhai.")
update_rule("1 Han", "Pinfu", "%{example_hand}", %{example_hand: ~t"345789m45p23499s 6p"})
add_rule("1 Han", "Tanyao", "Your hand contains only tiles numbered 2-8.")
update_rule("1 Han", "Tanyao", "%{example_hand}", %{example_hand: ~t"234m33777p 45678s 6s"})
add_rule("1 Han", "Iipeikou", "Your closed hand has a double sequence: two copies of the exact same sequence in one suit, like 123 123.")
update_rule("1 Han", "Iipeikou", "%{example_hand}", %{example_hand: ~t"33445m33777p 678s 5m"})
add_rule("1 Han", "Yakuhai", """
1 %{han} for each of the following triplets in your hand:
- A triplet of dragon tiles %{dragons}
- A triplet of winds matching the round marker %{round_wind_triplet}
- A triplet of winds matching your seat %{seat_wind_triplet}
""", %{han: "Han", dragons: ~t"777z"})
add_rule("2 Han", "Chiitoitsu", "Your hand consists of seven non-repeating pairs.")
update_rule("2 Han", "Chiitoitsu", "%{example_hand}", %{example_hand: ~t"2266m99p24477s33z 2s"})
add_rule("1 Han", "Chanta", "1 han if each of the 5 blocks in your hand contains a terminal or honor. 2 han if closed.")
update_rule("1 Han", "Chanta", "%{example_hand}", %{example_hand: ~t"123m79p789s77z 11p1P 8p"})
add_rule("2 Han", "Junchan", "2 han if each of the 5 blocks in your hand contains a terminal. 3 han if closed.")
update_rule("2 Han", "Junchan", "%{example_hand}", %{example_hand: ~t"123m79p78999s 1P11p 8p"})
add_rule("1 Han", "Ittsu", "1 han if your hand contains the sequences 123 456 789 in one suit. 2 han if closed.")
update_rule("1 Han", "Ittsu", "%{example_hand}", %{example_hand: ~t"234p4567779s 12s3S 8s"})
add_rule("1 Han", "Sanshoku", "1 han if your hand contains the same number sequence in all three suits. 2 han if closed.")
update_rule("1 Han", "Sanshoku", "%{example_hand}", %{example_hand: ~t"24p23334678s 2M34m 3p"})
add_rule("2 Han", "Sanshoku Doukou", "2 han if your hand contains the same number triplet in all three suits.")
update_rule("1 Han", "Sanshoku", "%{example_hand}", %{example_hand: ~t"2244p222456s 2M22m 2p"})
add_rule("2 Han", "Toitoi", "2 han if your hand is all triplets.")
update_rule("2 Han", "Toitoi", "%{example_hand}", %{example_hand: ~t"888m222p33s22z 1z1Z1z 3s"})
add_rule("2 Han", "Sanankou", "2 han if your hand has three closed triplets. A triplet formed by a self-draw win counts as closed.")
update_rule("2 Han", "Sanankou", "%{example_hand}", %{example_hand: ~t"222888m444p123s1z 1z"})
add_rule("2 Han", "Shousangen", "2 han on top of yakuhai if you have two dragon triplets/kans and a dragon pair.")
update_rule("2 Han", "Shousangen", "%{example_hand}", %{example_hand: ~t"123m23s66777z 55z5Z 4s"})
add_rule("2 Han", "Honroutou", "2 han if your hand contains only terminal and honor tiles.")
update_rule("2 Han", "Honroutou", "%{example_hand}", %{example_hand: ~t"111m2223344z 9p9P9p 4z"})
add_rule("2 Han", "Honitsu", "2 han if your hand is comprised of one suit plus honor tiles. 3 han if closed.")
update_rule("2 Han", "Honitsu", "%{example_hand}", %{example_hand: ~t"123345888p11z22z 2z"})
add_rule("3 Han", "Ryanpeikou", "3 han if you have two double sequences, each being two copies of the exact same sequence in one suit, like 123 123. Does not count as chiitoitsu (7 pairs).")
update_rule("3 Han", "Ryanpeikou", "%{example_hand}", %{example_hand: ~t"3344566m112233s 5m"})
add_rule("5 Han", "Chinitsu", "5 han if your hand is comprised of one suit only (no honor tiles). 6 han if closed.")
update_rule("5 Han", "Chinitsu", "%{example_hand}", %{example_hand: ~t"1233445568889s 7s"})
add_rule("Yakuman", "Tenhou", "Win with your initial hand as dealer.")
add_rule("Yakuman", "Chiihou", "Win with your first draw as non-dealer.")
add_rule("Yakuman", "Daisangen", "Your hand contains triplets or kans of all three dragons.")
update_rule("Yakuman", "Daisangen", "%{example_hand}", %{example_hand: ~t"123m22s66777z 55z5Z 6z"})
add_rule("Yakuman", "Suuankou", "Your hand has three closed triplets in hand, and you won by self-drawing the fourth.")
update_rule("Yakuman", "Suuankou", "%{example_hand}", %{example_hand: ~t"222888m444p33s11z 1z"})
add_rule("Yakuman", "Suuankou Tanki", "Double yakuman if your hand has four closed triplets in hand, and you won by completing your pair.", 2)
update_rule("Yakuman", "Suuankou Tanki", "%{example_hand}", %{example_hand: ~t"222888m444p333s1z 1z"})
add_rule("Yakuman", "Tsuuiisou", "Your hand consists of only honor tiles.")
update_rule("Yakuman", "Tsuuiisou", "%{example_hand}", %{example_hand: ~t"1112224477z 66z6Z 4z"})
add_rule("Yakuman", "Ryuuiisou", "Your hand consists of only all-green tiles (23468 bamboo and green dragon).")
update_rule("Yakuman", "Ryuuiisou", "%{example_hand}", %{example_hand: ~t"2234466888s 6Z66z 3s"})
add_rule("Yakuman", "Chinroutou", "Your hand consists of only terminals.")
update_rule("Yakuman", "Chinroutou", "%{example_hand}", %{example_hand: ~t"111m999p1199s 9M99m 9s"})
add_rule("Yakuman", "Chuurenpoutou", "You have no calls and your winning hand is the pattern 1112345678999 in one suit, plus one additional tile.")
update_rule("Yakuman", "Chuurenpoutou", "%{example_hand}", %{example_hand: ~t"1112345568999s 7s"})
add_rule("Yakuman", "Junsei Chuurenpoutou", "Double yakuman if your hand was 1112345678999 in one suit, and you won via its nine-sided wait.", 2)
update_rule("Yakuman", "Junsei Chuurenpoutou", "%{example_hand}", %{example_hand: ~t"1112345678999s 7s"})
add_rule("Yakuman", "Kokushi Musou", "Your winning hand consists of one of each terminal/honor tile plus one forming a pair.")
update_rule("Yakuman", "Kokushi Musou", "%{example_hand}", %{example_hand: ~t"19m99p19s1234567z 1p"})
add_rule("Yakuman", "Kokushi Musou Juusan Menmachi", "Double yakuman if your winning hand consists of one of each terminal/honor tile and you won with a thirteen-sided wait for the pair.", 2)
update_rule("Yakuman", "Kokushi Musou Juusan Menmachi", "%{example_hand}", %{example_hand: ~t"19m19p19s1234567z 1p"})
add_rule("Yakuman", "Shousuushii", "Your hand contains triplets or kans of three winds, plus a pair of the fourth wind.")
update_rule("Yakuman", "Shousuushii", "%{example_hand}", %{example_hand: ~t"23s22233444z 1z1Z1z 4s"})
add_rule("Yakuman", "Daisuushii", "Double yakuman if your hand contains triplets or kans of all four winds.", 2)
update_rule("Yakuman", "Daisuushii", "%{example_hand}", %{example_hand: ~t"22s22233444z 1z1Z1z 3z"})
end
on before_turn_change do
turn_cleanup
# add furiten due to discards
if status("tenpai") and match(["hand", "calls", "any_discard"], ["win"]) do
set_status("furiten")
end
end
on after_turn_change do
if not_game_start do
discard_passed
end
end
on before_call do
turn_cleanup
unset_status_all("discards_empty")
end
on before_win do
add_scoring_attrs
calculate_fu
end
on after_start do
set_status_all("discards_empty")
end
apply set_append, "play_effects", [
["any", [["unset_status", "discards_empty"]]]
]
define_button chii,
display_name: "Chii",
show_when: not_our_turn and not_no_tiles_remaining and kamicha_discarded and call_available,
precedence_over: ["chii"],
call: [[-2, -1], [-1, 1], [1, 2]],
call_style: %{
kamicha: ["call_sideways", 0, 1],
toimen: [0, "call_sideways", 1],
shimocha: [0, 1, "call_sideways"]
}
do
big_text("Chii")
call
change_turn("self")
end
define_button pon,
display_name: "Pon",
show_when: not_our_turn
and not_no_tiles_remaining
and someone_else_just_discarded
and call_available,
precedence_over: ["chii"],
call: [[0, 0]],
call_style: %{
kamicha: ["call_sideways", 0, 1],
toimen: [0, "call_sideways", 1],
shimocha: [0, 1, "call_sideways"]
}
do
big_text("Pon")
call
change_turn("self")
end
define_button ron,
display_name: "Ron",
show_when: not_our_turn
and someone_else_just_discarded
and match(["hand", "calls"], ["tenpai"])
and status_missing("furiten")
and match(["hand", "calls", "last_discard"], ["win"]),
precedence_over: ["chii", "pon"]
do
big_text("Ron")
pause(1000)
reveal_hand
win_by_discard
end
define_button tsumo,
display_name: "Tsumo",
show_when: our_turn
and has_draw
and match(["hand", "calls"], ["tenpai"])
and match(["hand", "calls", "draw"], ["win"])
do
big_text("Tsumo")
pause(1000)
reveal_hand
win_by_draw
end
set interruptible_actions, ["play_tile", "draw", "advance_turn", "self_call", "upgrade_call", "recalculate_buttons"]
set shown_statuses, ["furiten"]
set display_wall, true
set initial_score, 25000
set initial_dead_wall_length, 14
set max_rounds, 8
set four_rows_discards, false
# mods
define_mod_category "Rules"
define_mod honba, name: "Honba", order: -1, desc: "Enables honba."
config_mod honba, name: "value", values: [100, 500, 1000]
define_mod nagashi, name: "Nagashi", order: -1, desc: "Enable nagashi mangan. When you discards are all terminals and honors at exhaustive draw, and none of your discards have been called, then you are paid mangan tsumo at draw."
config_mod nagashi, name: "is", values: ["Mangan", "Yakuman"]
define_mod tobi, name: "Tobi", order: -1, desc: "Enable busting. Once anyone's points is reduced below zero, the game ends."
config_mod tobi, name: "below", values: [0, 1, 1000, 1001]
define_mod uma, name: "Uma", desc: "Enable uma. At the end of the game, points are awarded or deducted based on placement."
config_mod uma, name: "_1st", values: [-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30], default: 10
config_mod uma, name: "_2nd", values: [-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30], default: 5
config_mod uma, name: "_3rd", values: [-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30], default: -5
config_mod uma, name: "_4th", values: [-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30], default: -10
define_mod oka, name: "Oka", desc: "Enable oka. Everyone antes the given amount, and the total is awarded to first place at the end of the game."
config_mod oka, name: "ante", values: [5,10,15,20,25,30], default: 5
define_mod agarirenchan, name: "Agarirenchan", desc: "A round repeats if the dealer wins."
define_mod tenpairenchan, name: "Tenpairenchan", desc: "A round repeats if the dealer is tenpai at draw."
define_mod agariyame, deps: ["agarirenchan"], name: "Agariyame", desc: "All Last doesn't repeat if the dealer is first place and wins."
define_mod tenpaiyame, deps: ["tenpairenchan"], name: "Tenpaiyame", desc: "All Last doesn't repeat if the dealer is in first place and is tenpai at draw."
define_mod sudden_death, name: "Sudden Death", desc: "Sets the goal points before the game can end. If the game reaches South 4 (or East 4, in the case of tonpuu) and every player is below [goal] points, play continues to the West (South) round until someone surpasses [goal] points, or at the end of West 4 (South 4)."
config_mod sudden_death, name: "goal", values: [10000,15000,20000,25000,30000,35000,40000,45000,50000], default: 30000
define_mod tonpuu, name: "Tonpuu", desc: "Limit the game to the East round only."
define_mod kuitan_nashi, name: "Kuitan Nashi", desc: "Disallow open tanyao."
define_mod kuikae_nashi, name: "Kuikae Nashi", desc: "Disallow swap-calling."
define_mod kiriage_mangan, name: "Kiriage Mangan", desc: "3 han 60 fu and 4 han 30 fu are worth mangan."
define_mod head_bump, conflicts: ["sanchahou"], name: "Head Bump", desc: "Enable head bump. In case of multiple ron, only the person closest in turn order gets the win."
define_mod double_wind_4_fu, name: "Double Wind 4 Fu", desc: "A pair of round+seat winds is worth 4 fu instead of 2 fu."
define_mod double_round_wind, name: "Double Round Wind", desc: "Both East and West are round winds during East Round, and North and South during South Round. Similarly for West and North Rounds."
define_mod pao, name: "Sekinin Barai", desc: "If you deal the last dragon called for a daisangen hand, or the last wind called for a daisuushii hand, you are responsible for the yakuman payment if they tsumo, or half of the payment if they ron off someone else."
define_mod pao_suukantsu, name: "Suukantsu Pao", desc: "If you deal the last kan tile called for a suukantsu hand, you are responsible for the yakuman payment if they tsumo, or half the payment if they ron off someone else."
define_mod pao_rinshan, name: "Rinshan Pao", desc: "If someone calls kan on your discard and wins off the kan draw, you are responsible for the full payment."
define_mod no_kazoe_yakuman, name: "No Kazoe Yakuman", desc: "Disable kazoe yakuman. 13+ han is worth sanbaiman."
define_mod no_double_yakuman, name: "No Double Yakuman", desc: "Disable double yakuman. Yakuman still stacks, but each yaku that typically awards double yakuman only awards one stack of yakuman."
define_mod wareme, order: 1, name: "Wareme", desc: "In each round, the player whose wall is broken is given the wareme marker. If the wareme player wins, they are paid double the amount of points. If the wareme player has to pay points, they pay double the amount of points. Riichi sticks and honba payments are not affected."
define_mod aotenjou, order: 2, name: "Aotenjou", desc: "Removes limit hands. Score grows exponentially with han according to the formula 4 * fu * 2^(2+han). Not recommended with tobi enabled."
define_mod yakitori, name: "Yakitori", desc: "If you do not win any hands by the end of the game, you pay each player a penalty."
config_mod yakitori, name: "penalty", values: [1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,15000,20000,25000,30000], default: 4000
define_mod shuugi, order: 1, name: "Shuugi", desc: "Play with shuugi (poker chips). Players start with zero shuugi, each is worth some number of points each at the end. Win payments include shuugi along with points. On ron you get shuugi from the discarder; on tsumo you get shuugi from everyone. Each aka, ura, and ippatsu is worth one shuugi. Yakuman is worth 5 shuugi."
config_mod shuugi, name: "worth", values: [200,500,1000,2000,4000,8000], default: 2000
define_mod toriuchi, deps: ["shuugi"], name: "Toriuchi", desc: "On ron, each 1s (bird) tile is worth 1 shuugi, unless the discarder's hand contains 7p (pistol) which would shoot the birds dead. That is, unless the winner's hand contains 8s (birdcage) which would protect the birds from gunfire."
define_mod kansai_chiitoitsu, name: "Kansai Chiitoitsu", desc: "Chiitoitsu now allows repeated pairs."
define_mod min_han, order: 1, name: "Minimum Han", desc: "Minimum han required to win."
config_mod min_han, name: "min", values: [1, 2, 3, 4, "Mangan", "Yakuman"], default: 1
define_mod no_riichi_ankan, deps: ["yaku/riichi"], name: "No Riichi Ankan", desc: "Disallow any concealed kan while in riichi, not just ones that change your waits."
define_mod no_fifth_tile_tenpai, deps: ["yaku/riichi"], name: "No Fifth Tile Tenpai", desc: "At exhaustive draw, you are not considered tenpai if all four tiles of each wait is in hand: for example, 123456789m1111p. You may still declare riichi with such a hand, however."
define_mod kokushi_ankan_chankan, name: "Kokushi Chankan", desc: "Allow robbing ankans if in tenpai for kokushi musou."
define_mod first_gets_riichi_sticks, deps: ["yaku/riichi"], name: "First Gets Riichi Sticks", desc: "At the end of the game, all leftover riichi sticks on the table are given to first place. (Otherwise they are lost.)"
define_mod starting_score, order: -2, name: "Starting Points", desc: "Number of points each player starts with. You can also set this by writing the following in the Config tab: \"initial_score\": 100000"
config_mod starting_score, name: "points", values: [0,5000,10000,15000,20000,25000,30000,35000,40000,45000,50000,100000], default: 25000
define_mod_category "Abortive Draws"
define_mod suufon_renda, name: "Suufon Renda", desc: "Enable 4 wind abortive draw."
define_mod suucha_riichi, name: "Suucha Riichi", deps: ["yaku/riichi"], desc: "Enable 4 riichi abortive draw."
define_mod suukaikan, name: "Suukaikan", desc: "Enable 4 kan abortive draw."
define_mod sanchahou, conflicts: ["head_bump"], name: "Sanchahou", desc: "Enable triple ron abortive draw."
define_mod kyuushu_kyuuhai, name: "Kyuushu Kyuuhai", desc: "Enable 9 distinct terminal/honor abortive draw."
define_mod_category "Dora"
define_mod dora, name: "Dora", desc: "Enables dora."
config_mod dora, name: "start_indicators", values: [1,2,3,4,5]
define_mod ura, deps: ["dora"], name: "Ura", desc: "Enables ura dora."
define_mod aka, order: 3, conflicts: ["chinitsu"], name: "Aka", desc: "Enables aka dora (red fives), worth 1 han each."
config_mod aka, name: "man", values: [0,1,2,3,4], default: 1
config_mod aka, name: "pin", values: [0,1,2,3,4], default: 1
config_mod aka, name: "sou", values: [0,1,2,3,4], default: 1
define_mod kandora, deps: ["dora"], name: "Kandora", desc: "Enables dora flip on kan."
define_mod immediate_kan_dora, order: 1, deps: ["kandora", "dora"], name: "Immediate Kan Dora", desc: "Flip kan dora immediately after daiminkan and kakan."
define_mod ao, order: 3, deps: ["aka"], conflicts: ["its_all_aka"], name: "Ao", desc: "Enables ao dora (blue fives), worth 2 han each."
config_mod ao, name: "man", values: [0,1,2,3,4], default: 1
config_mod ao, name: "pin", values: [0,1,2,3,4], default: 1
config_mod ao, name: "sou", values: [0,1,2,3,4], default: 1
define_mod kin, order: 3, deps: ["aka"], conflicts: ["its_all_aka"], name: "Kin", desc: "Enables kin dora (gold fives), worth 3 han each."
config_mod kin, name: "man", values: [0,1,2,3,4], default: 1
config_mod kin, name: "pin", values: [0,1,2,3,4], default: 1
config_mod kin, name: "sou", values: [0,1,2,3,4], default: 1
define_mod aka1, order: 3, conflicts: ["chinitsu"], name: "Aka 1", desc: "Adds aka ones, worth 1 han each."
config_mod aka1, name: "man", values: [0,1,2,3,4], default: 1
config_mod aka1, name: "pin", values: [0,1,2,3,4], default: 1
config_mod aka1, name: "sou", values: [0,1,2,3,4], default: 1
define_mod aka3, order: 3, conflicts: ["chinitsu"], name: "Aka 3", desc: "Adds aka threes, worth 1 han each."
config_mod aka3, name: "man", values: [0,1,2,3,4], default: 1
config_mod aka3, name: "pin", values: [0,1,2,3,4], default: 1
config_mod aka3, name: "sou", values: [0,1,2,3,4], default: 1
define_mod aka7, order: 3, conflicts: ["chinitsu"], name: "Aka 7", desc: "Adds aka sevens, worth 1 han each."
config_mod aka7, name: "man", values: [0,1,2,3,4], default: 1
config_mod aka7, name: "pin", values: [0,1,2,3,4], default: 1
config_mod aka7, name: "sou", values: [0,1,2,3,4], default: 1
define_mod aka9, order: 3, conflicts: ["chinitsu"], name: "Aka 9", desc: "Adds aka nines, worth 1 han each."
config_mod aka9, name: "man", values: [0,1,2,3,4], default: 1
config_mod aka9, name: "pin", values: [0,1,2,3,4], default: 1
config_mod aka9, name: "sou", values: [0,1,2,3,4], default: 1
define_mod its_all_aka, order: 3, deps: ["aka"], conflicts: ["chinitsu", "ao", "kin"], order: 3, name: "It's All Aka?", desc: "Changes all standard tiles to aka."
define_mod shiny_dora, order: 4, deps: ["dora"], name: "Shiny Dora", desc: "Make dora display shiny."
define_mod_category "Jokers"
define_mod "jokers/manzu", conflicts: ["jokers/vietnamese"], name: "Manzu", desc: "Adds a single manzu joker to the game. The manzu joker looks like 萬 and can represent any character tile."
define_mod "jokers/pinzu", conflicts: ["jokers/vietnamese"], name: "Pinzu", desc: "Adds a single pinzu joker to the game. The pinzu joker looks like 筒 and can represent any character tile."
define_mod "jokers/souzu", conflicts: ["jokers/vietnamese"], name: "Souzu", desc: "Adds a single souzu joker to the game. The souzu joker looks like 索 and can represent any character tile."
define_mod "jokers/vietnamese", conflicts: ["jokers/manzu", "jokers/pinzu", "jokers/souzu"], name: "Vietnamese Jokers", desc: "Adds eight jokers to the game. See the Vietnamese ruleset to learn how they work. Note that this mod adds a honors joker instead of a flower joker."
define_mod "jokers/19", name: "19", desc: "Adds a copy of the 19 joker, which can be used as any 1 or 9."
define_mod "jokers/37", name: "37", desc: "Adds a copy of the 37 joker, which can be used as any 3 or 7."
define_mod "jokers/46", name: "46", desc: "Adds a copy of the 46 joker, which can be used as any 4 or 6."
define_mod "jokers/147", name: "147", desc: "Adds a copy of the 147 joker, which can be used as any 1, 4, or 7."
define_mod "jokers/258", name: "258", desc: "Adds a copy of the 258 joker, which can be used as any 2, 5, or 8."
define_mod "jokers/369", name: "369", desc: "Adds a copy of the 369 joker, which can be used as any 3, 6, or 9."
define_mod "jokers/123", name: "123", desc: "Adds a copy of the 123 joker, which looks like 小 and can be used as any 1, 2, or 3."
define_mod "jokers/456", name: "456", desc: "Adds a copy of the 456 joker, which looks like 中 and can be used as any 4, 5, or 6. Don't confuse it with the red dragon!"
define_mod "jokers/789", name: "789", desc: "Adds a copy of the 789 joker, which looks like 大 and can be used as any 7, 8, or 9."
define_mod "jokers/odd", name: "Odd", desc: "Adds a copy of the odd joker, which looks like 單 and can be used as any odd number tile."
define_mod "jokers/even", name: "Even", desc: "Adds a copy of the even joker, which looks like 雙 and can be used as any even number tile."
define_mod_category "Yaku"
# 1 han
define_mod "yaku/riichi", order: -1, name: "Riichi", desc: "Enable riichi declarations. When you are tenpai with at least 1000 points (and it is not your last discard), you may declare riichi before discarding. If the discard passes, you automatically bet 1000 and can no longer change your hand. If you win under this condition, you get the riichi yaku (1 han). If you riichi on your first discard (calls invalidate), this is called Double Riichi and worth 2 han."
config_mod "yaku/riichi", name: "bet", values: [1000,2000,3000,4000,5000]
config_mod "yaku/riichi", name: "drawless", values: [false, true]
define_mod "yaku/ippatsu", order: 2, name: "Ippatsu", deps: ["yaku/riichi"], desc: "Enables ippatsu. \"One-shot\". 1 han if you win before or during your next draw after riichi. Calls invalidate."
define_mod "yaku/tsubame_gaeshi", name: "Tsubame Gaeshi", deps: ["yaku/riichi"], desc: "Local yaku. \"Swallow Reversal\". 1 han if you win off a riichi declaration discard."
define_mod "yaku/shiiaru_raotai", name: "Shiiaru Raotai", desc: "Local yaku. \"Twelve Tiles Down\". 1 han if you win with four calls (and therefore on a single tile wait). Closed kans are permitted."
define_mod "yaku/kanburi", name: "Kanburi", desc: "Local yaku. \"Shoot After Kan\". 1 han if you win off the tile discarded by a player who just called kan."
define_mod "yaku/honors_chiitoitsu", name: "Honors Chiitoitsu", desc: "Local yaku. 1 han on top of chiitoitsu if three of your pairs are dragons, or if four of your pairs are winds. If you have all seven honor pairs? Double yakuman."
define_mod "yaku/uushin_tsuukan", name: "Uushin Tsuukan", desc: "Local yaku. \"Five-Heart Straight\". 1 han on top of ittsu if the winning tile is the five needed for ittsu."
define_mod "yaku/ketsupaihou", name: "Ketsupaihou", desc: "Local yaku. \"Missing Tile\". 1 han if you have an edge (12, 89) or middle (24, 57) wait on a tile for which three are already publicly visible (so 12333 winning on 3 doesn't count)."
# 2 han
define_mod "yaku/open_riichi", name: "Open Riichi", deps: ["yaku/riichi"], desc: "You have the option to declare open riichi, which is worth 2 han but reveals your hand to the table. Open double riichi is 3 han."
define_mod "yaku/sanrenkou", name: "Sanrenkou", desc: "Local yaku. \"Three Consecutive Triplets\". 2 han for having three triplets of the same suit in sequence, like 222 333 444."
define_mod "yaku/sanshoku_ittsu", name: "Sanshoku Ittsu", desc: "Local yaku. 1 han for having a three-color straight, like 123m 456p 789s. 2 han if closed."
define_mod "yaku/kyandonhou", name: "Kyandonhou", desc: "Local yaku. \"Twice Mixed Double Sequence\". A mixed double sequence is when you have two sequences of the same number in different suits, like 345m 345p. 2 han for having two mixed double sequences."
define_mod "yaku/ryandoukou", name: "Ryandoukou", desc: "Local yaku. \"Twice Double Triplets\". A double triplet is when you have two triplets of the same number in different suits, like 333m 333p. 2 han for having two sets of double triplets."
define_mod "yaku/shoutate", name: "Shoutate", desc: "Local yaku. \"Little Mixed Triplets\". 2 han for having sanshoku doukou, except one of the triplets is a pair."
define_mod "yaku/choupaikou", name: "Choupaikou etc.", desc: "Local yaku. 2 han for having the pattern 111333555 (choupaikou), 111444777 (sujipaikou), or 111555999 (chousankou) in one suit. The pattern does not have to start with 1, but cannot wrap. 1 han if instead, all three triplets are in different suits."
define_mod "yaku/suuzuukou", name: "Suuzuukou", desc: "Local yaku. \"Four Honor Triplets\". 2 han for having four honor tile triplets."
define_mod "yaku/uumensai", name: "Uumensai", desc: "Local yaku. \"Five Suits Collected\". 2 han if your hand includes all five suits (character, circle, bamboo, wind, dragon)."
define_mod "yaku/sanpuukou", name: "Sanpuukou", desc: "Local yaku. \"Three Wind Triplets\". 2 han if you have three wind triplets."
define_mod "yaku/renkaihou", name: "Renkaihou", desc: "Local yaku. \"Consecutive Blossom\". 2 han if you kan off the rinshan tile and win off of _that_ rinshan tile. Does not stack with rinshan."
define_mod "yaku/mondeikou", deps: ["aka"], name: "Mondeikou", desc: "Local yaku. If you have 4 aka, 2 han on top of aka. This counts as a yaku."
# 3 han
define_mod "yaku/isshoku_sanjun", name: "Isshoku Sanjun", desc: "Local yaku. \"Pure Triple Sequences\". 2 han if you have three of the exact same sequence in one suit, like 123 123 123. Like iipeikou but three. +1 han if closed. Does not stack with iipeikou (123 123) or sanrenkou (111 222 333)."
define_mod "yaku/ittsu_chanta", name: "Ittsu Chanta", desc: "Local yaku. 2 han if you have ittsu, and (except the 456) the rest of your hand is chanta (or junchan, in which case it's 3 han). +1 han if closed. Does not stack with ittsu."
define_mod "yaku/tanfonhou", name: "Tanfonhou", desc: "Local yaku. \"Win Without Red\". 2 han if your hand contains no red. This means you can have only 248p (2,4,8 circles), 23468s (2,3,4,6,8 bamboo), and any honors except red dragon. 5 han instead if no honor tiles (chintanfon). +1 han if closed."
define_mod "yaku/chinpeikou", name: "Chinpeikou", desc: "Local yaku. 3 han on top of ryanpeikou if your ryanpeikou sequences are all the same numbers (may be different suits), like 112233 112233. No restriction on the pair, so you can have an honor pair (despite 'chin' being in the name)."
# 4 han
define_mod "yaku/chinchii_toushii", deps: ["yaku/ketsupaihou"], name: "Chinchii Toushii", desc: "Local yaku. \"Golden Rooster Steals Food\". 4 han instead of the usual 2 han if you win ketsupaihou by chankan."
define_mod_category "Mangan"
define_mod "yaku/riichi_renhou", name: "Renhou", desc: "Local yaku. Instant mangan/yakuman if you win off the first tile someone dropped before your first draw. Calls invalidate."
config_mod "yaku/riichi_renhou", name: "is", values: ["Mangan", "Yakuman"], default: "Yakuman"
define_mod "yaku/kinkei_dokuritsu", name: "Kinkei Dokuritsu", desc: "Local yaku. \"Golden Rooster Standing Alone\". Mangan if you are waiting on 1s (1 bamboo, the bird tile) with four calls. Can be open or closed."
define_mod "yaku/touchao_hanchanshue", name: "Touchao Hanchanshue", desc: "Local yaku. \"Fishing Alone in the Cold River Snow\". Mangan if you are waiting on 5z (white dragon) with four calls (open or closed)."
define_mod "yaku/uupin_kaihou", name: "Uupin Kaihou", desc: "Local yaku. \"Gathering a Plum Blossom from the Roof\". Mangan if you win with rinshan on the 5p (5 circles)."
define_mod "yaku/ryanzou_chankan", name: "Ryanzou Chankan", desc: "Local yaku. \"Scratching a Carrying Pole\". Mangan if you win with chankan on the 2s (2 bamboo)."
define_mod "yaku/iipin_mouyue", name: "Iipin Mouyue", desc: "Local yaku. \"Plucking the Moon from the Bottom of the Sea\". Mangan if you win with haitei (not houtei) on the 1p (1 circles)."
define_mod "yaku/chuupin_raoyui", name: "Chuupin Raoyui", desc: "Local yaku. \"Catching Fish from the Bottom of the River\". Mangan if you win with houtei (not haitei) on the 9p (9 circles)."
define_mod "yaku/shanron_chonchu", name: "Shanron Chonchu", desc: "Local yaku. \"Two Dragons Fighting Over Pearls\". Mangan if you have kyandonhou (two mixed double sequences) in manzu and souzu, plus a pinzu pair. For the manzu and souzu suits, your two sequences in that suit should not overlap."
define_mod "yaku/chiishin_uushii", name: "Chiishin Uushii", desc: "Local yaku. \"Seven Stars Disconnected\". Mangan if you have one of every honor tile, plus 7 of 9 tiles in different suji (e.g. 14m25p369s)."
define_mod "yaku/maneman", name: "Maneshi Mangan", desc: "Local yaku. \"Imitation Mangan\". If you copy any opponent's first five discards exactly, they will pay mangan if you win, but only if you win less than mangan. Calls invalidate."
define_mod "yaku/rentsuu_honitsu", name: "Rentsuu Honitsu", desc: "Local yaku. Mangan if you have honitsu with dragon yakuhai matching the suit: manzu with chun, pinzu with hatsu (not a typo), or souzu with haku (also not a typo)."
define_mod "yaku/dorahairi_chinroutou_chiitoitsu", deps: ["dora"], name: "Dorahairi Chinroutou Chiitoitsu", desc: "Local yaku. Mangan if you have chiitoitsu composed of each terminal tile with the seventh pair being dora."
define_mod_category "Yakuman"
define_mod "yaku/paarenchan", name: "Paarenchan", desc: "Local yakuman. The eighth consecutive dealer win is worth yakuman. Exhaustive and abortive draws break the streak. After 5 wins, the minimum han required for the dealer becomes 2 han."
define_mod "yaku/ishino_uenimo_sannen", name: "Ishino Uenimo Sannen", deps: ["yaku/riichi"], desc: "Local yakuman. \"Three Years on a Rock\". If you win with double riichi and haitei/houtei, it's yakuman."
define_mod "yaku/toukanhou", name: "Toukanhou", desc: "Local yakuman. \"First Kan Win\". If you kan (concealed or from a player) before discarding any tile, and win with rinshan, it's yakuman. Any call from an opponent invalidates this."
define_mod "yaku/shiisanpuutaa", name: "Shiisanpuutaa", desc: "Local yakuman. \"Thirteen Unconnected\". If you start with 13 disconnected tiles (with one forming a pair), it's yakuman. Calls invalidate."
define_mod "yaku/shiisanuushi", name: "Shiisanuushi", desc: "Local yakuman. \"Thirteen Independent\". If you start with 14 disconnected tiles, it's yakuman. Calls invalidate."
define_mod "yaku/suurenkou", name: "Suurenkou", desc: "Local yakuman. \"Four Consecutive Triplets\". If you have four triplets of the same suit of increasing number, like 111 222 333 444, it's yakuman. Pao is applied if the fourth triplet is called."
define_mod "yaku/suuchoupaikou", name: "Suuchoupaikou", desc: "Local yakuman. \"Four Skipped Tile Triplets\". If you have four triplets of the same suit whose numbers step by 2, like 111 333 555 777, it's yakuman. Pao is applied if the fourth triplet is called."
define_mod "yaku/daisharin", name: "Daisharin etc.", desc: "Local yakuman. If your hand is closed and your winning hand is 22334455667788 in one suit, it's yakuman."
define_mod "yaku/shousharin", name: "Shousharin etc.", desc: "Local yakuman. If your hand is closed and your winning hand is 11223344556677 or 33445566778899 in one suit, it's yakuman."
define_mod "yaku/isshoku_yonjun", name: "Isshoku Yonjun", desc: "Local yakuman. \"Pure Quadruple Sequences\". If you have four of the exact same sequence in one suit, like 123m 123m 123m 123m, it's yakuman. Like iipeikou but four. Pao is applied if the fourth sequence is called."
define_mod "yaku/hyakuman_goku", name: "Hyakuman Goku", desc: "Local yakuman. \"One Million Stones\". If your hand is purely character tiles whose numbers sum up to at least 100, it's yakuman."
define_mod "yaku/kachoufuugetsu", name: "Kachoufuugetsu", desc: "Local yakuman. \"Flower, Bird, Wind, Moon\". If your hand is 555p (5 circles) + 111s (birds) + triplet of round or seat wind + 111p (1 circles), it's yakuman."
define_mod "yaku/fuukasetsugetsu", name: "Fuukasetsugetsu", desc: "Local yakuman. \"Flower, Bird, Snow, Moon\". If your hand is 555p (5 circles) + 555z (white dragon) + triplet of round or seat wind + 111p (1 circles), it's yakuman."
define_mod "yaku/kouitten", name: "Kouitten", desc: "Local yakuman. \"A Little Red\". Like ryuuiisou, except instead of green dragon, it's red dragon (you must include red dragons)."
define_mod "yaku/benikujaku", name: "Benikujaku", desc: "Local yakuman. \"Red Peacock\". Like ryuuiisou but red bamboo only: you can only have 1579s and red dragon."
define_mod "yaku/kokuiisou", name: "Kokuiisou", desc: "Local yakuman. \"All Black\". Like ryuuiisou but black: you can only have 248p and winds."
define_mod "yaku/ryuuiisourin", name: "Ryuuiisourin", desc: "Local yakuman. Like ryuuiisou, except you have a pair of 5s (5 bamboo)."
define_mod "yaku/kouittenrin", name: "Kouittenrin", desc: "Local yakuman. Like kouitten, except you have a pair of 5s (5 bamboo)."
define_mod "yaku/golden_gate_bridge", name: "Golden Gate Bridge", desc: "Local yakuman. If your hand contains 123 345 567 789 all in one suit, it's yakuman. No restrictions on your pair."
define_mod "yaku/american_civil_war", name: "American Civil War", desc: "Local yakuman. If you have no calls (not even ankan) and your hand consists of the tiles 1861 in one suit, 1865 in another suit, and you have triplets of north and south winds, it's yakuman."
define_mod "yaku/tohoku_expressway", name: "Tohoku Expressway", desc: "Local yakuman. If your hand consists of only 246p (2,4,6 circles) and east/north winds, it's yakuman."
define_mod "yaku/tohoku_shinkansen", name: "Tohoku Shinkansen", desc: "Local yakuman. If your closed hand consists of an ittsu and east/north winds, it's yakuman."
define_mod "yaku/blue_tunnel", name: "Blue Tunnel", desc: "Local yakuman. If your hand consists of only 248p (2,4,8 circles), green dragon, and one type of wind, it's yakuman."
define_mod "yaku/junsei_ryuuiisou", name: "Junsei Ryuuiisou", desc: "Local yakuman. If you have ryuuiisou without green dragon, it's double yakuman. Doesn't stack with ryuuiisou."
define_mod "yaku/chousangen", name: "Chousangen", desc: "Local yakuman. If you have kans of all three dragons, it's double yakuman. Doesn't stack with daisangen."
define_mod "yaku/chousuushii", name: "Chousuushii", desc: "Local yakuman. If you have kans of all four winds, it's quadruple yakuman. Doesn't stack with daisuushi and suukantsu."
define_mod_category "Other"
define_mod cancellable_riichi, order: 1, deps: ["yaku/riichi"], name: "Cancellable Riichi", desc: "Riichi declarations happen only after you confirm by discarding a tile."
define_mod ten, order: 3, name: "Ten", desc: "Adds 10m, 10p, and 10s. Changes dora accordingly (if dora is enabled). Tanyao now allows nines, and chanta/junchan/honroutou require tens instead. 13 Orphans now requires the ten instead of the nine of each suit. Ittsu allows 23456789T."
define_mod star_suit, order: 2, name: "Star Suit (beta)", desc: "Adds a fourth suit (stars). This suit does not form yaku. This mod is in beta because we should probably write some yaku for it."
define_mod space, order: 2, name: "Space Mahjong", desc: "Sequences can wrap (891, 912). Winds and dragons can make sequences. You can chii from any direction. Chiitoitsu is disabled. Open kokushi is allowed and worth 3 han."
define_mod galaxy, order: 2, conflicts: ["chinitsu"], name: "Galaxy Mahjong", desc: "Replaces one of each tile with a blue 'galaxy' tile that acts as a wildcard of its number. For example, galaxy 3s can be used as 3m, 3p, or 3s. Galaxy winds are wind wildcards, and galaxy dragons are dragon wildcards."
define_mod fifth_tile, order: -1, conflicts: ["chinitsu"], name: "Fifth Tile", desc: "Adds a fifth copy of every standard tile."
define_mod no_honors, order: -1, conflicts: ["shiro_pocchi", "golden_chun", "blue_dragon"], name: "No Honors", desc: "Removes the honor tiles (winds and dragons) from the game."
define_mod shiro_pocchi, order: 2, deps: ["yaku/riichi"], conflicts: ["no_honors", "chinitsu"], name: "Shiro Pocchi", desc: "One of the white dragons is shiro pocchi. Shiro pocchi acts a joker tile when drawn while in riichi."
define_mod golden_chun, deps: ["aka", "yaku/riichi", "shiro_pocchi"], conflicts: ["no_honors", "chinitsu"], name: "Golden Chun", desc: "One of each dragon tile is a special tile. The special white dragon is shiro pocchi, which acts a joker tile when drawn while in riichi. The special green dragon is an aka dora. The special red dragon is the golden chun, which can be used as a five of any suit, and grants 1 han when used as a five. Completing a hand via shiro pocchi while using the golden chun as a five and having the aka green dragon scores yakuman. If playing with shuugi, a golden chun used as a five scores 1 shuugi."
define_mod blue_dragon, conflicts: ["no_honors", "chinitsu"], name: "Blue Dragon (beta)", desc: "Adds the Chinese blue-framed white dragon as a fourth dragon tile (hakuban). Yaku treats it as an honor tile. Shousangen is reduced to 1 han (+2 from dragons) and Daisangen is reduced to 2 han (+3 from dragons). Adds Shousuugen (3 dragons + dragon pair) as yakuman and Daisuugen (4 dragons) as double yakuman. This mod is in beta because pao is not yet implemented for blue dragon."
define_mod shouhai, order: 3, name: "Shouhai", desc: "Reduces tiles in hand from 13 to 12. The goal is to achieve a tenpai hand rather than a winning hand. The idea is that your 13th tile is replaced with an invisible 'joker' tile that can be used to complete any hand."
define_mod chinitsu, conflicts: ["aka", "aka1", "aka3", "aka7", "aka9", "yaku/mondeikou", "galaxy", "fifth_tile", "shiro_pocchi", "golden_chun", "blue_dragon"], name: "Chinitsu", desc: "Replace the wall with 16 copies of each bamboo tile. Includes 10s if Ten is enabled."
define_mod washizu, order: -1, name: "Washizu", desc: "Each tile in the wall is transparent and visible to all, except for one copy. Unflipped dora indicators are not visible."
define_mod calls_are_forced, conflicts: ["chombo"], name: "Calls Are Forced", desc: "Forces you to make all available calls, including riichi (if enabled). You still get to choose if multiple calls are available."
define_mod chombo, conflicts: ["calls_are_forced"], name: "Chombo", desc: "The tsumo and ron buttons are enabled on every draw and discard. If you make an incorrect win call, your hand is dead and you cannot make a win call for the remainder of the round."
set default_mods, [
"honba", "yaku/riichi", "dora", "ura", "kandora", "aka",
"yaku/ippatsu",
"nagashi",
"tobi",
"uma",
"kuikae_nashi",
"min_han",
"suufon_renda",
"suucha_riichi",
"suukaikan",
"agarirenchan", "tenpairenchan",
"kyuushu_kyuuhai",
"double_wind_4_fu",
"yaku/riichi_renhou", "pao", "kokushi_ankan_chankan",
"cancellable_riichi"
]
define_preset "Mahjong Soul", [
%{name: "honba", config: %{value: 100}},
%{name: "yaku/riichi", config: %{bet: 1000, drawless: false}},
%{name: "nagashi", config: %{is: "Mangan"}},
%{name: "tobi", config: %{below: 0}},
%{name: "uma", config: %{_1st: 10, _2nd: 5, _3rd: -5, _4th: -10}},
"agarirenchan",
"tenpairenchan",
"agariyame",
"tenpaiyame",
%{name: "sudden_death", config: %{goal: 30000}},
"kuikae_nashi",
"double_wind_4_fu",
"pao",
"kokushi_ankan_chankan",
"suufon_renda",
"suucha_riichi",
"suukaikan",
"kyuushu_kyuuhai",
%{name: "dora", config: %{start_indicators: 1}},
"ura",
"kandora",
"yaku/ippatsu",
"show_waits",
%{name: "min_han", config: %{min: 1}},
"cancellable_riichi",
%{name: "aka", config: %{man: 1, pin: 1, sou: 1}},
"shiny_dora",
"first_gets_riichi_sticks"
]
define_preset "tenhou.net", [
%{name: "honba", config: %{value: 100}},
%{name: "yaku/riichi", config: %{bet: 1000, drawless: false}},
%{name: "nagashi", config: %{is: "Mangan"}},
%{name: "tobi", config: %{below: 0}},
%{name: "uma", config: %{_1st: 20, _2nd: 10, _3rd: -10, _4th: -20}},
"agarirenchan",
"tenpairenchan",
"agariyame",
"tenpaiyame",
%{name: "sudden_death", config: %{goal: 30000}},
"kuikae_nashi",
"double_wind_4_fu",
"pao",
"no_fifth_tile_tenpai",
"kokushi_ankan_chankan",
"suufon_renda",
"suucha_riichi",
"suukaikan",
"sanchahou",
"kyuushu_kyuuhai",
%{name: "dora", config: %{start_indicators: 1}},
"ura",
"kandora",
"yaku/ippatsu",
"show_waits",
%{name: "min_han", config: %{min: 1}},
%{name: "aka", config: %{man: 1, pin: 1, sou: 1}},
"shiny_dora",
"first_gets_riichi_sticks"
]
define_preset "Riichi City", [
%{name: "honba", config: %{value: 100}},
%{name: "yaku/riichi", config: %{bet: 1000, drawless: false}},
%{name: "nagashi", config: %{is: "Mangan"}},
%{name: "tobi", config: %{below: 0}},
%{name: "uma", config: %{_1st: 30, _2nd: 10, _3rd: -10, _4th: -30}},
"agarirenchan",
"tenpairenchan",
"agariyame",
"tenpaiyame",
%{name: "sudden_death", config: %{goal: 30000}},
"kuikae_nashi",
"double_wind_4_fu",
"pao",
"pao_rinshan",
"kokushi_ankan_chankan",
"suufon_renda",
"suucha_riichi",
"suukaikan",
"sanchahou",
"kyuushu_kyuuhai",
%{name: "dora", config: %{start_indicators: 1}},
"ura",
"kandora",
"yaku/ippatsu",
"show_waits",
%{name: "min_han", config: %{min: 1}},
"cancellable_riichi",
%{name: "aka", config: %{man: 1, pin: 1, sou: 1}},
"shiny_dora",
"first_gets_riichi_sticks"
]
# amatsuki rules seem to be a clone of mahjong soul rules
define_preset "Amatsuki Mahjong", [
%{name: "honba", config: %{value: 100}},
%{name: "yaku/riichi", config: %{bet: 1000, drawless: false}},
%{name: "nagashi", config: %{is: "Mangan"}},
%{name: "tobi", config: %{below: 0}},
%{name: "uma", config: %{_1st: 10, _2nd: 5, _3rd: -5, _4th: -10}},
"agarirenchan",
"tenpairenchan",
"agariyame",
"tenpaiyame",
%{name: "sudden_death", config: %{goal: 30000}},
"kuikae_nashi",
"double_wind_4_fu",
"pao",
"kokushi_ankan_chankan",
"suufon_renda",
"suucha_riichi",
"suukaikan",
"kyuushu_kyuuhai",
%{name: "dora", config: %{start_indicators: 1}},
"ura",
"kandora",
"yaku/ippatsu",
"show_waits",
%{name: "min_han", config: %{min: 1}},
"cancellable_riichi",
%{name: "aka", config: %{man: 1, pin: 1, sou: 1}},
"shiny_dora",
"first_gets_riichi_sticks"
]
define_preset "WRC 2022", [
%{name: "honba", config: %{value: 100}},
%{name: "yaku/riichi", config: %{bet: 1000, drawless: false}},
%{name: "uma", config: %{_1st: 15, _2nd: 5, _3rd: -5, _4th: -15}},
"agarirenchan",
"tenpairenchan",
"tenpaiyame",
"kuikae_nashi",
"kiriage_mangan",
"head_bump",
"pao",
"pao_suukantsu",
"no_kazoe_yakuman",
"no_double_yakuman",
%{name: "dora", config: %{start_indicators: 1}},
"ura",
"kandora",
"yaku/ippatsu",
%{name: "yaku/riichi_renhou", config: %{is: "Mangan"}},
"show_waits",
%{name: "min_han", config: %{min: 1}},
"cancellable_riichi",
%{name: "starting_score", config: %{points: 30000}}
]
define_preset "M.League", [
%{name: "honba", config: %{value: 100}},
%{name: "yaku/riichi", config: %{bet: 1000, drawless: false}},
%{name: "nagashi", config: %{is: "Mangan"}},
%{name: "uma", config: %{_1st: 30, _2nd: 10, _3rd: -10, _4th: -30}},
%{name: "oka", config: %{ante: 5}},
"agarirenchan",
"tenpairenchan",
"agariyame",
"tenpaiyame",
"kuikae_nashi",
"head_bump",
"pao",
"pao_suukantsu",
"no_kazoe_yakuman",
"no_double_yakuman",
"kokushi_ankan_chankan",
%{name: "dora", config: %{start_indicators: 1}},
"ura",
"kandora",
"immediate_kan_dora",
"yaku/ippatsu",
"show_waits",
%{name: "min_han", config: %{min: 1}},
"cancellable_riichi",
%{name: "aka", config: %{man: 1, pin: 1, sou: 1}}
]
define_preset "Just Like Modded Minecraft", [
%{name: "starting_score", config: %{points: 25000}},
%{name: "honba", config: %{value: 500}},
%{name: "tobi", config: %{below: 0}},
%{name: "yaku/riichi", config: %{bet: 1000, drawless: true}},
"fifth_tile",
"washizu",
%{name: "nagashi", config: %{is: "Yakuman"}},
%{name: "uma", config: %{_1st: 10, _2nd: 5, _3rd: -5, _4th: -10}},
%{name: "oka", config: %{ante: 5}},
"agarirenchan",
"tenpairenchan",
"agariyame",
"tenpaiyame",
%{name: "sudden_death", config: %{goal: 30000}},
"tonpuu",
"kuitan_nashi",
"kuikae_nashi",
"kiriage_mangan",
"double_wind_4_fu",
"double_round_wind",
"pao",
"pao_suukantsu",
"pao_rinshan",
"kansai_chiitoitsu",
"kokushi_ankan_chankan",
"first_gets_riichi_sticks",
"suufon_renda",
"suukaikan",
"sanchahou",
"kyuushu_kyuuhai",
%{name: "dora", config: %{start_indicators: 3}},
"ura",
"kandora",
"yaku/tsubame_gaeshi",
"yaku/shiiaru_raotai",
"yaku/kanburi",
"yaku/honors_chiitoitsu",