Commit 2e8e04fb authored by talljosh's avatar talljosh

Individual game modes now set the winner at end of game.

parent 0471d18d92e4
......@@ -88,9 +88,8 @@ class CatPigeonLevel(Level):
p for p, score in list(playerScores.items())
if score == max_score and p.team == self.blue_team]
self.playSound('game-over-whistle.ogg')
self.set_winners(winners)
for winner in winners:
self.notifyAll('{} wins'.format(winner.nick))
self.world.sendServerCommand(
AwardPlayerCoinMsg(winner.id, BONUS_COINS_FOR_WINNER))
......
......@@ -100,7 +100,7 @@ class ElephantKingLevel(Level):
self.world.sendServerCommand(
AwardPlayerCoinMsg(winner.id, BONUS_COINS_FOR_WINNER))
await asyncio.sleep(3)
await self.world.sleep_future(3)
if __name__ == '__main__':
......
......@@ -100,7 +100,7 @@ class FreeForAllLevel(Level):
self.world.sendServerCommand(
AwardPlayerCoinMsg(winner.id, BONUS_COINS_FOR_WINNER))
await asyncio.sleep(3)
await self.world.sleep_future(3)
return any(not p.bot for p in winners), max_score
......
......@@ -94,9 +94,8 @@ class HuntedLevel(Level):
p for p, score in list(playerScores.items())
if score == maxScore and p.team == self.red_team]
self.playSound('game-over-whistle.ogg')
self.set_winners(winners)
for winner in winners:
self.notifyAll('{} wins'.format(winner.nick))
self.world.sendServerCommand(
AwardPlayerCoinMsg(winner.id, BONUS_COINS_FOR_WINNER))
......
......@@ -81,9 +81,8 @@ class OrbChaseLevel(Level):
if score == max_score
]
self.playSound('game-over-whistle.ogg')
self.set_winners(winners)
for winner in winners:
self.notifyAll('{} wins'.format(winner.nick))
self.world.sendServerCommand(
AwardPlayerCoinMsg(winner.id, BONUS_COINS_FOR_WINNER))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment