Start game with !join
This commit is contained in:
parent
f63dc2565b
commit
c3ef05382f
64
gameloop.py
64
gameloop.py
|
@ -360,6 +360,38 @@ def game(send, notice, voice, devoice, get_event):
|
||||||
else:
|
else:
|
||||||
error('Unknown event type: %s' % event)
|
error('Unknown event type: %s' % event)
|
||||||
|
|
||||||
|
def start_game(rest):
|
||||||
|
expert = False
|
||||||
|
if len(rest) == 0 or rest[0] == 'default':
|
||||||
|
send('Adding the default CAH deck (A5DCM)')
|
||||||
|
|
||||||
|
deck_add_handler('A5DCM')
|
||||||
|
|
||||||
|
elif rest[0] == 'offtopia':
|
||||||
|
send('Adding the default CAH deck (A5DCM), offtopia injoke deck (PXWKC), :Deck (colondeck) and three random decks')
|
||||||
|
|
||||||
|
deck_add_handler('A5DCM')
|
||||||
|
deck_add_handler('PXWKC')
|
||||||
|
deck_add_handler('colondeck')
|
||||||
|
|
||||||
|
deck_add_random_handler()
|
||||||
|
deck_add_random_handler()
|
||||||
|
deck_add_random_handler()
|
||||||
|
|
||||||
|
elif rest[0] == 'empty':
|
||||||
|
pass
|
||||||
|
|
||||||
|
elif rest[0] == 'expert':
|
||||||
|
expert = True
|
||||||
|
|
||||||
|
else:
|
||||||
|
send('Unknown preset %s' % rest[0])
|
||||||
|
|
||||||
|
if not expert:
|
||||||
|
limit_type = {limit_types.rounds: 'rounds', limit_types.points: 'points'}[limit.type]
|
||||||
|
send('Limit is %i %s, change with !limit' % (limit.number, limit_type))
|
||||||
|
send('Once you are ready to start the game, everyone send !ready')
|
||||||
|
|
||||||
def no_game():
|
def no_game():
|
||||||
nonlocal players, bots, decks, limit, round_number, round_call_card, czar, card_choices
|
nonlocal players, bots, decks, limit, round_number, round_call_card, czar, card_choices
|
||||||
if players is not None:
|
if players is not None:
|
||||||
|
@ -388,36 +420,18 @@ def game(send, notice, voice, devoice, get_event):
|
||||||
|
|
||||||
send('%s started a game, !join to join!' % nick)
|
send('%s started a game, !join to join!' % nick)
|
||||||
|
|
||||||
expert = False
|
start_game(rest)
|
||||||
if len(rest) == 0 or rest[0] == 'default':
|
|
||||||
send('Adding the default CAH deck (A5DCM)')
|
|
||||||
|
|
||||||
deck_add_handler('A5DCM')
|
return game_setup
|
||||||
|
|
||||||
elif rest[0] == 'offtopia':
|
elif event == events.join:
|
||||||
send('Adding the default CAH deck (A5DCM), offtopia injoke deck (PXWKC), :Deck (colondeck) and three random decks')
|
nick = args[0]
|
||||||
|
|
||||||
deck_add_handler('A5DCM')
|
send('Started game, !join to join!')
|
||||||
deck_add_handler('PXWKC')
|
|
||||||
deck_add_handler('colondeck')
|
|
||||||
|
|
||||||
deck_add_random_handler()
|
common_handler(event, args)
|
||||||
deck_add_random_handler()
|
|
||||||
deck_add_random_handler()
|
|
||||||
|
|
||||||
elif rest[0] == 'empty':
|
start_game([])
|
||||||
pass
|
|
||||||
|
|
||||||
elif rest[0] == 'expert':
|
|
||||||
expert = True
|
|
||||||
|
|
||||||
else:
|
|
||||||
send('Unknown preset %s' % rest[0])
|
|
||||||
|
|
||||||
if not expert:
|
|
||||||
limit_type = {limit_types.rounds: 'rounds', limit_types.points: 'points'}[limit.type]
|
|
||||||
send('Limit is %i %s, change with !limit' % (limit.number, limit_type))
|
|
||||||
send('Once you are ready to start the game, everyone send !ready')
|
|
||||||
|
|
||||||
return game_setup
|
return game_setup
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue