def com_roster(_self, self, args):
     """Get the current battle roster."""
     self.player.tell(" - The current battle-roster - ", fmt=" ^")
     parts = []
     for nick, player in self.app.game.fighters.iteritems():
         char = player.character.fullname if player.character else "NO CHAR"
         parts.append("%s(%s)" % (nick, char))
         parts.append("  -  %d HP : %d MP : %d SP %s" % (player.health, player.magicpoints, player.superpoints, ": READY" if player.ready else ""))
         lines = word_table(parts, 2, fmt=" <")
     for line in lines:
         self.player.tell(line)
 def close_selection(self):
     if not self.fighters:
         self.app.game = None
         self.app.gsay(" * Character Selection is now CLOSED. * ", fmt="-^")
         return
     if self.state == "selection":
         parts = []
         lines = []
         for nick, player in self.fighters.iteritems():
             char = player.character.fullname if player.character else "NO CHAR"
             parts.append("%s(%s)" % (nick, char))
             parts.append("  -  %d HP : %d MP : %d SP %s" % (player.health, player.magicpoints, player.superpoints, ": READY" if player.ready else ""))
             lines = word_table(parts, 2, fmt=" <")
         for line in lines:
             self.app.gsay(line)
         if len(self.get_ready()) == len(self.fighters):
             self.app.gsay(" * Character Selection is now closed. * ", fmt="-^")
             self.state = "prebattle"
         else:
             self.app.fsay(" * Waiting for all players to READY. * ", fmt="-^")
             unready = self.get_unready()
             print "UNREADY", [(p.nickname, p.ready) for p in unready]
             for theplayer in unready:
                 theplayer.tell("(!) Battle is waiting on you to, 'ready' !!")
 def __get_doc(self):
     header = "THE LOBBY\n\n  The following users are here:\n\n"
     nlist = self.app.players.keys()
     table = '\n'.join(word_table(nlist, 4))
     return header + table