Created
October 26, 2010 00:28
-
-
Save myano/646089 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def leave (self, phenny, input): | |
if not self.game_on or not self.deck: | |
return | |
if input.nick not in self.players: | |
return | |
if len(self.playerOrder) < 3: | |
phenny.reply("You can't leave a 2 player game.") | |
return | |
if input.nick == self.playerOrder[self.currentPlayer]: | |
self.currentPlayer = self.currentPlayer - 1 | |
self.incPlayer() | |
self.showOnTurn (phenny) | |
del self.players[input.nick] | |
k = 0 | |
for position, element in enumerate(self.playerOrder): | |
if element == "input.nick": | |
k = position | |
del self.playerOrder[k] | |
phenny.say(str(self.playerOrder)) | |
#self.currentPlayer - 1 | |
phenny.say(input.nick + " you have been removed from the game.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment