should fix death disconnect and also bots not playing some cards
This commit is contained in:
parent
c126006198
commit
beeabac342
@ -291,7 +291,7 @@ def chat_message(sid, msg):
|
|||||||
elif '/arcadekick' in msg and ses.game.started:
|
elif '/arcadekick' in msg and ses.game.started:
|
||||||
if len([p for p in ses.game.players if p.pending_action != PendingAction.WAIT]) == 0:
|
if len([p for p in ses.game.players if p.pending_action != PendingAction.WAIT]) == 0:
|
||||||
sio.emit('chat_message', room=ses.game.name, data={'color': f'','text':f'KICKING THE ARCADE CABINET'})
|
sio.emit('chat_message', room=ses.game.name, data={'color': f'','text':f'KICKING THE ARCADE CABINET'})
|
||||||
ses.game.play_turn()
|
ses.game.next_turn()
|
||||||
else:
|
else:
|
||||||
sio.emit('chat_message', room=sid, data={'color': f'','text':f'{msg} COMMAND NOT FOUND'})
|
sio.emit('chat_message', room=sid, data={'color': f'','text':f'{msg} COMMAND NOT FOUND'})
|
||||||
else:
|
else:
|
||||||
|
@ -425,6 +425,7 @@ class Game:
|
|||||||
print(f'player {player.name} died')
|
print(f'player {player.name} died')
|
||||||
if self.waiting_for > 0 and player.pending_action == pl.PendingAction.RESPOND:
|
if self.waiting_for > 0 and player.pending_action == pl.PendingAction.RESPOND:
|
||||||
self.responders_did_respond_resume_turn()
|
self.responders_did_respond_resume_turn()
|
||||||
|
player.pending_action = pl.PendingAction.WAIT
|
||||||
|
|
||||||
if player.is_dead: return
|
if player.is_dead: return
|
||||||
if not self.started:
|
if not self.started:
|
||||||
|
@ -237,7 +237,8 @@ class Player:
|
|||||||
self.draw('')
|
self.draw('')
|
||||||
elif self.pending_action == PendingAction.PLAY:
|
elif self.pending_action == PendingAction.PLAY:
|
||||||
equippables = [c for c in self.hand if (c.is_equipment or c.usable_next_turn) and not isinstance(c, cs.Prigione) and not any([type(c) == type(x) for x in self.equipment])]
|
equippables = [c for c in self.hand if (c.is_equipment or c.usable_next_turn) and not isinstance(c, cs.Prigione) and not any([type(c) == type(x) for x in self.equipment])]
|
||||||
misc = [c for c in self.hand if (isinstance(c, cs.WellsFargo) and not c.usable_next_turn) or isinstance(c, cs.Diligenza) or isinstance(c, cs.Emporio) or (isinstance(c, cs.Birra) and self.lives < self.max_lives and not self.game.check_event(ceh.IlReverendo))]
|
misc = [c for c in self.hand if (isinstance(c, cs.WellsFargo) or isinstance(c, cs.Indiani) or isinstance(c, cs.Gatling) or isinstance(c, cs.Diligenza) or isinstance(c, cs.Emporio) or (isinstance(c, cs.Birra) and self.lives < self.max_lives and not self.game.check_event(ceh.IlReverendo)))
|
||||||
|
and not (not c.can_be_used_now and self.game.check_event(ce.IlGiudice))]
|
||||||
need_target = [c for c in self.hand if c.need_target and c.can_be_used_now and not (c.need_with and len(self.hand) < 2) and not (
|
need_target = [c for c in self.hand if c.need_target and c.can_be_used_now and not (c.need_with and len(self.hand) < 2) and not (
|
||||||
(self.game.check_event(ceh.Sermone) or self.has_played_bang and not (any([isinstance(c, cs.Volcanic) for c in self.equipment]) and type(c) == type(cs.Bang)
|
(self.game.check_event(ceh.Sermone) or self.has_played_bang and not (any([isinstance(c, cs.Volcanic) for c in self.equipment]) and type(c) == type(cs.Bang)
|
||||||
) and not self.game.check_event(ce.Lazo))) and not ( isinstance(c, cs.Prigione) and self.game.check_event(ce.IlGiudice))]
|
) and not self.game.check_event(ce.Lazo))) and not ( isinstance(c, cs.Prigione) and self.game.check_event(ce.IlGiudice))]
|
||||||
|
Loading…
Reference in New Issue
Block a user