Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit e87817a

Browse files
committed
Improve honitsu discard detection
1 parent aec010a commit e87817a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

project/mahjong/ai/defence/enemy_analyzer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ def _is_honitsu_discards(self, discards_34):
110110

111111
less_suit = suits[0]['count']
112112
percentage_of_less_suit = (less_suit / total_discards) * 100
113+
percentage_of_honor_tiles = (honors['count'] / total_discards) * 100
113114

114115
# there is not too much one suit + honor tiles in the discard
115116
# so we can tell that user trying to collect honitsu
116-
if percentage_of_less_suit <= 20 and honors['count'] < 3:
117+
if percentage_of_less_suit <= 20 and percentage_of_honor_tiles <= 30:
117118
return True, suits[0]['function']
118119

119120
return False, None

0 commit comments

Comments
 (0)