plugin tarot: fixed bad score calculation
This commit is contained in:
parent
209a82e076
commit
4d4c768fd5
1 changed files with 5 additions and 4 deletions
|
|
@ -272,7 +272,7 @@ class Tarot():
|
||||||
bouts.append(card.value)
|
bouts.append(card.value)
|
||||||
score += card.points
|
score += card.points
|
||||||
|
|
||||||
#We now check if there is no bug in score calculation
|
#We we do a basic check on score calculation
|
||||||
check_score = 0
|
check_score = 0
|
||||||
defenseurs = game_data['players'][:]
|
defenseurs = game_data['players'][:]
|
||||||
defenseurs.remove(game_data['attaquant'])
|
defenseurs.remove(game_data['attaquant'])
|
||||||
|
|
@ -302,11 +302,12 @@ class Tarot():
|
||||||
elif game_data['contrat'] == 'Garde Contre':
|
elif game_data['contrat'] == 'Garde Contre':
|
||||||
contrat_mult = 6
|
contrat_mult = 6
|
||||||
else:
|
else:
|
||||||
error(_('Internal error: contrat not managed (mispelled ?)'))
|
error(_('INTERNAL ERROR: contrat not managed (mispelled ?)'))
|
||||||
|
assert(False)
|
||||||
|
|
||||||
victory = (score >= point_limit)
|
victory = (score >= point_limit)
|
||||||
margin = score - point_limit
|
margin = abs(score - point_limit)
|
||||||
points_defenseur = (-margin + 25) * contrat_mult
|
points_defenseur = (margin + 25) * contrat_mult * (-1 if victory else 1)
|
||||||
winners = []
|
winners = []
|
||||||
loosers = []
|
loosers = []
|
||||||
player_score = {}
|
player_score = {}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue