summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-18 09:04:57 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 06:43:13 (GMT)
commitccd24eb84fd0fbee46427d6caf65d0304d0593aa (patch)
tree67cb57cc95368c03014deeefbb02c04a354fc8b1
parenta51e9c21716144729d9ac2a982706915dd285529 (diff)
GatesOfHeaven: unite options pair28 and lastExtra in one option BMJA
-rw-r--r--src/predefined.py6
-rw-r--r--src/rulecode.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/predefined.py b/src/predefined.py
index 0392db7..b75ff0b 100644
--- a/src/predefined.py
+++ b/src/predefined.py
@@ -233,7 +233,7 @@ class ClassicalChinese(PredefinedRuleset):
points=20)
# option internal makes it not show up in the ruleset editor
self.mjRules.createRule(
- 'Nine Gates', 'FGatesOfHeaven||OlastExtra', limits=1,
+ 'Nine Gates', 'FGatesOfHeaven', limits=1,
description=m18n(
'A concealed hand in one color 1112345678999 plus last tile of this suit (from wall or discarded)'))
self.mjRules.createRule(
@@ -391,7 +391,7 @@ class ClassicalChineseBMJA(ClassicalChinese):
description=originalCall.description)
del self.mjRules['NineGates']
self.mjRules.createRule(
- 'Gates of Heaven', 'FGatesOfHeaven||Opair28', limits=1,
+ 'Gates of Heaven', 'FGatesOfHeaven||OBMJA', limits=1,
description=m18n('All tiles concealed of same color: Values 1112345678999'
' with one pair from 2 to 8 (last tile from wall or discarded)'))
self.mjRules.createRule(
@@ -458,7 +458,7 @@ class ClassicalChineseBMJA(ClassicalChinese):
'FCallingHand||Ohand=TripleKnitting',
limits=0.2)
self.loserRules.createRule(
- 'Calling for Gates of Heaven', 'FCallingHand||Ohand=GatesofHeaven||Opair28',
+ 'Calling for Gates of Heaven', 'FCallingHand||Ohand=GatesofHeaven||OBMJA',
limits=0.4)
self.loserRules.createRule(
'Calling for Knitting',
diff --git a/src/rulecode.py b/src/rulecode.py
index 699ab2c..4d61d73 100644
--- a/src/rulecode.py
+++ b/src/rulecode.py
@@ -1047,9 +1047,9 @@ class GatesOfHeaven(StandardMahJongg):
if len(values) != 1:
return False
surplus = values[0]
- if 'pair28' in cls.options:
+ if 'BMJA' in cls.options:
return 1 < surplus < 9
- if 'lastExtra' in cls.options:
+ else:
return hand.lastTile and surplus == hand.lastTile.value
return True
@@ -1068,7 +1068,7 @@ class GatesOfHeaven(StandardMahJongg):
elif values.count(9) != 3:
result = set([9])
else:
- if 'pair28' in cls.options:
+ if 'BMJA' in cls.options:
result = Tile.minors # pylint: disable=redefined-variable-type
else:
result = Tile.numbers