示例#1
0
    def begin_game(self):
        self.t = False
        if self.turbo:
            self.phenny.say(
                "Welcome! This round of turbo blackjack has now begun!")
        else:
            self.phenny.say(
                "Welcome to the Casino! This round of blackjack has now begun!"
            )
        if len(p.in_game) > 1:
            self.phenny.say(
                str("There are %d players this round: %s" %
                    (len(p.in_game), p.list_in_game())))
        else:
            self.phenny.say(
                str("There is %d player this round: %s" %
                    (len(p.in_game), p.list_in_game())))

        # Place bets
        if self.turbo:
            self.phenny.say(
                "Place your bets! You have %d seconds. Use '!bet amount' to bet."
                % self.delay_time)
        else:
            self.phenny.say(
                "Time to place your initial bets! You have %d seconds. Use '!bet amount' to bet. You can place multiple bets."
                % self.delay_time)
        self.accept_bets = True
        self.t = Timer(self.delay_time, self.deal_cards)
        self.t.start()
示例#2
0
def players(phenny, input):
    if len(p.players) > 0:
        if input.group(0) == "all" or not in_play:
            phenny.say(p.list_players())
        elif len(p.in_game) > 0:
            phenny.say(p.list_in_game())
        else:
            phenny.say("An error occurred.")
    else:
        phenny.say("There are currently no players registered.")
示例#3
0
    def begin_game(self):
        self.t = False
        self.can_join = False
        self.phenny.say("Welcome to the Casino! This round of " +
                        str(self.num_cards) + " card poker has now begun!")

        if self.stakes != "free":
            # Remove users that didnt ante in
            for uid in p.in_game:
                if p.players[uid].ante == False:
                    p.remove_from_game(uid)
                    self.phenny.say(
                        "%s did not ante in and was removed from this game." %
                        p.players[uid].name)
            if len(p.in_game) == 0:
                self.phenny.say("No players ante'd in.")
                self.game_over()
                return

        if len(p.in_game) > 1:
            self.phenny.say(
                str("There are %d players this round: %s" %
                    (len(p.in_game), p.list_in_game())))
        # Not enough players
        else:
            self.phenny.say(
                "There are not enough players! For a game of poker there must be 2 players minimum."
            )
            for uid in p.in_game:
                p.players[uid].add_gold(p.players[uid].bet)
                p.players[uid].bet = 0
                p.remove_from_game(uid)
                self.phenny.write(
                    ('NOTICE',
                     p.players[uid].name + " The dealer returned your ante."))
            self.game_over()
            return

        self.deal_cards()