Tarot game: score calculation
- plugin tarot: score validity is now checked (some of attackers and defender must equal 91) - plugin tarot: new signal tarotGameScore to give the scores and winners/loosers - wix: score are now displayed at the end of the game - xml_tools: 'fixed' type is now managed in dataForm2xml
This commit is contained in:
parent
d663da0526
commit
1a9f7e8396
1 changed files with 139 additions and 20 deletions
|
|
@ -53,6 +53,7 @@ class QuickApp():
|
|||
self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat)
|
||||
self.bridge.register("tarotGameShowCards", self.tarotShowCards)
|
||||
self.bridge.register("tarotGameYourTurn", self.tarotMyTurn)
|
||||
self.bridge.register("tarotGameScore", self.tarotScore)
|
||||
self.bridge.register("tarotGameCardsPlayed", self.tarotCardsPlayed)
|
||||
self.bridge.register("subscribe", self.subscribe)
|
||||
self.bridge.register("paramUpdate", self.paramUpdate)
|
||||
|
|
@ -308,6 +309,14 @@ class QuickApp():
|
|||
if self.chat_wins.has_key(room_jid):
|
||||
self.chat_wins[room_jid].getGame("Tarot").MyTurn()
|
||||
|
||||
def tarotScore(self, room_jid, xml_data, winners, loosers, profile):
|
||||
"""Called when the game is finished and the score are updated"""
|
||||
if not self.__check_profile(profile):
|
||||
return
|
||||
debug (_("Tarot: score received"))
|
||||
if self.chat_wins.has_key(room_jid):
|
||||
self.chat_wins[room_jid].getGame("Tarot").showScores(xml_data, winners, loosers)
|
||||
|
||||
def tarotCardsPlayed(self, room_jid, player, cards, profile):
|
||||
if not self.__check_profile(profile):
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue