Skip to content

Instantly share code, notes, and snippets.

@myano
Created October 26, 2010 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myano/646117 to your computer and use it in GitHub Desktop.
Save myano/646117 to your computer and use it in GitHub Desktop.
def leave (self, phenny, input):
phenny.say("list before: " + str(self.playerOrder))
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]:
phenny.say("before changing, self.currentPlayer: " + str(self.currentPlayer))
if input.nick != self.playerOrder[self.currentPlayer]:
self.currentPlayer = self.currentPlayer + self.way
if self.currentPlayer == len (self.players):
self.currentPlayer = 0
if self.currentPlayer < 0:
self.currentPlayer = len (self.players) - 1
phenny.say("after changing, self.currentPlayer: " + str(self.currentPlayer))
self.showOnTurn (phenny)
del self.players[input.nick]
a = self.playerOrder
a.remove(input.nick)
self.playerorder = a
phenny.say(input.nick + " you have been removed from the game.")
phenny.say("list after: " + str(self.playerOrder))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment