summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-24 14:10:35 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 06:38:59 (GMT)
commit69942725c061c262c64c6bdc1ead15c07899f89a (patch)
tree09323610298d99920fdd1cd4787d50ae7c074728
parentd1f279fbe2c9295362f4a2c30771763937b74b56 (diff)
rename declaration to announcements
-rw-r--r--src/player.py4
-rw-r--r--src/predefined.py6
-rw-r--r--src/rule.py2
-rw-r--r--src/scoring.py8
4 files changed, 9 insertions, 11 deletions
diff --git a/src/player.py b/src/player.py
index 8742205..07fb85a 100644
--- a/src/player.py
+++ b/src/player.py
@@ -379,8 +379,8 @@ class Player(StrMixin):
def mjString(self):
"""compile hand info into a string as needed by the scoring engine"""
- declaration = 'a' if self.originalCall else ''
- return ''.join(['m', self.lastSource, declaration])
+ announcements = 'a' if self.originalCall else ''
+ return ''.join(['m', self.lastSource, announcements])
def makeTileKnown(self, tileName):
"""used when somebody else discards a tile"""
diff --git a/src/predefined.py b/src/predefined.py
index 1eb191e..1421a4d 100644
--- a/src/predefined.py
+++ b/src/predefined.py
@@ -61,7 +61,7 @@ class ClassicalChinese(PredefinedRuleset):
description=m18n('Winner said Mah Jong by claiming the 4th tile of a kong another player '
'just declared'), debug=True)
self.winnerRules.createRule('Mah Jongg with Original Call',
- 'FMahJonggWithOriginalCall||Odeclaration=a', doubles=1,
+ 'FMahJonggWithOriginalCall||Oannouncements=a', doubles=1,
description=m18n(
'Just before the first discard, a player can declare Original Call meaning she needs only one '
'tile to complete the hand and announces she will not alter the hand in any way (except bonus tiles)'))
@@ -71,7 +71,7 @@ class ClassicalChinese(PredefinedRuleset):
'is declared to be dangerous, and if that tile actually makes somebody win, the discarder '
'pays the winner for all'))
self.winnerRules.createRule(
- 'Twofold Fortune', 'FTwofoldFortune||Odeclaration=t',
+ 'Twofold Fortune', 'FTwofoldFortune||Oannouncements=t',
limits=1, description=m18n('Kong after Kong: Declare Kong and a second Kong with the replacement '
'tile and Mah Jong with the second replacement tile'))
# limit hands:
@@ -376,8 +376,6 @@ class ClassicalChineseBMJA(ClassicalChinese):
self.parameterRules['mustDeclareCallingHand'].parameter = True
def loadRules(self):
-# TODO: we need a separate part for any number of announcements. Both r for robbing kong and a for
-# Original Call can be possible together.
ClassicalChinese.loadRules(self)
del self.winnerRules['ZeroPointHand']
originalCall = self.winnerRules.pop('MahJonggwithOriginalCall')
diff --git a/src/rule.py b/src/rule.py
index 95eee25..34e563b 100644
--- a/src/rule.py
+++ b/src/rule.py
@@ -972,7 +972,7 @@ class Rule(RuleBase):
def hasNonValueAction(self):
"""Rule has a special action not changing the score directly"""
- return bool(any(x not in ['lastsource', 'declaration'] for x in self.options))
+ return bool(any(x not in ['lastsource', 'announcements'] for x in self.options))
class ParameterRule(RuleBase):
diff --git a/src/scoring.py b/src/scoring.py
index 7e147e8..56a1cc6 100644
--- a/src/scoring.py
+++ b/src/scoring.py
@@ -401,7 +401,7 @@ class ScoringPlayer(VisiblePlayer, Player):
lastSource = 'w'
else:
lastSource = 'd'
- declaration = ''
+ announcements = ''
rules = [x.rule for x in self.manualRuleBoxes if x.isChecked()]
for rule in rules:
options = rule.options
@@ -409,9 +409,9 @@ class ScoringPlayer(VisiblePlayer, Player):
if lastSource != '1':
# this defines precedences for source of last tile
lastSource = options['lastsource']
- if 'declaration' in options:
- declaration = options['declaration']
- return ''.join(['m', lastSource, declaration])
+ if 'announcements' in options:
+ announcements += options['announcements']
+ return ''.join(['m', lastSource, announcements])
def __lastString(self):
"""compile hand info into a string as needed by the scoring engine"""