You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_rule("Rules", "Rinshan", "If you kan and then tsumo on the replacement tile, you are awarded rinshan (1 han).")
3
+
add_rule("Rules", "Chankan", "If someone calls kan to upgrade a triplet (added kan), you may call ron on the added tile. Doing so awards chankan (1 han).)")
4
+
end
5
+
6
+
define_yaku yaku, "Chankan", 1, won_by_call
7
+
define_yaku yaku, "Rinshan", 1, status("kan")
8
+
define_yaku yaku, "Sankantsu", 2, match(["calls"], ~m"(daiminkan ankan kakan):3")
9
+
define_yaku yakuman, "Suukantsu", 1, match(["calls"], ~m"(daiminkan ankan kakan):4")
10
+
11
+
def do_kan_draw do
12
+
set_status("$status")
13
+
shift_tile_to_dead_wall(1)
14
+
draw(1, "opposite_end")
15
+
end
16
+
17
+
apply prepend, "functions.discard_passed" do
18
+
as others do
19
+
unset_status("kan")
20
+
end
21
+
end
22
+
23
+
# additional furiten check
24
+
apply append, "functions.discard_passed" do
25
+
as everyone do
26
+
if (last_call_is("kakan") and match(["hand", "calls", "last_called_tile"], ["win"]))
27
+
or (last_call_is("ankan") and match(["hand", "calls"], ["kokushi_tenpai"]) and match(["hand", "calls", "last_called_tile"], ["win"])) do
add(2, won_by_draw and (minipoints_at_most(999) or not_has_no_call_named("chii", "pon", "daiminkan", "kakan")))
349
+
add(2, won_by_draw and (minipoints_at_most(999) or not @closed_hand))
350
350
351
351
# closed ron +10 and open pinfu ron +10
352
-
add(10, not_won_by_draw and has_no_call_named("chii", "pon", "daiminkan", "kakan"))
353
-
add(10, not_won_by_draw and not_has_no_call_named("chii", "pon", "daiminkan", "kakan") and minipoints_at_least(1000))
352
+
add(10, not_won_by_draw and @closed_hand)
353
+
add(10, not_won_by_draw and not @closed_hand and minipoints_at_least(1000))
354
354
355
355
# take max, then subtract 1000 from pinfu hands
356
356
take_maximum
@@ -366,7 +366,7 @@ def calculate_fu do
366
366
add(25, minipoints_equals(0) and match(["hand", "calls", "winning_tile"], [[ [["pair"], 7] ]]))
367
367
368
368
# kokushi
369
-
add(40, not_won_by_draw and has_no_call_named("chii", "pon", "daiminkan", "kakan") and minipoints_equals(0) and match(["hand", "calls", "winning_tile"], ["kokushi"]))
369
+
add(40, not_won_by_draw and @closed_hand and minipoints_equals(0) and match(["hand", "calls", "winning_tile"], ["kokushi"]))
370
370
add(30, minipoints_equals(0) and match(["hand", "calls", "winning_tile"], ["kokushi"]))
0 commit comments