fix molly stark with Slab The Killer

This commit is contained in:
Giulio 2021-05-24 00:47:08 +02:00
parent 63db5d6bb9
commit 8119ff2e45
2 changed files with 13 additions and 5 deletions

View File

@ -308,7 +308,7 @@ def chat_message(sid, msg):
ses.character = [c for c in chs if c.name == ' '.join(cmd[1:])][0] ses.character = [c for c in chs if c.name == ' '.join(cmd[1:])][0]
ses.real_character = ses.character ses.real_character = ses.character
ses.notify_self() ses.notify_self()
elif '/setevent' in msg and ses.game and ses.game.deck: # /setevent (position) 0 (name) Peyote elif '/setevent' in msg and ses.game and ses.game.deck: #add event before the position /setevent (position) 0 (name) Peyote
cmd = msg.split() cmd = msg.split()
if len(cmd) >= 3: if len(cmd) >= 3:
sio.emit('chat_message', room=ses.game.name, data={'color': f'red','text':f'🚨 {ses.name} is in debug mode and changed event'}) sio.emit('chat_message', room=ses.game.name, data={'color': f'red','text':f'🚨 {ses.name} is in debug mode and changed event'})

View File

@ -882,8 +882,11 @@ class Player:
((hand_index < len(self.hand) and self.hand[hand_index].name in self.expected_response) or self.character.check(self.game, chd.ElenaFuente)) or ((hand_index < len(self.hand) and self.hand[hand_index].name in self.expected_response) or self.character.check(self.game, chd.ElenaFuente)) or
(hand_index-len(self.hand) < len(self.equipment) and self.equipment[hand_index-len(self.hand)].name in self.expected_response)): (hand_index-len(self.hand) < len(self.equipment) and self.equipment[hand_index-len(self.hand)].name in self.expected_response)):
card = self.hand.pop(hand_index) if hand_index < len(self.hand) else self.equipment.pop(hand_index-len(self.hand)) card = self.hand.pop(hand_index) if hand_index < len(self.hand) else self.equipment.pop(hand_index-len(self.hand))
if self.character.check(self.game, chd.MollyStark) and hand_index < len(self.hand)+1 and not self.is_my_turn and self.event_type != 'duel': if self.character.check(self.game, chd.MollyStark) and hand_index < len(self.hand) and not self.is_my_turn and self.event_type != 'duel':
self.hand.append(self.game.deck.draw(True)) if self.attacker.character.check(self.game, chars.SlabTheKiller) and isinstance(self.hand[hand_index], cs.Mancato):
self.molly_discarded_cards += 1
else:
self.hand.append(self.game.deck.draw(True))
card.use_card(self) card.use_card(self)
self.sio.emit('chat_message', room=self.game.name, data=f'_respond|{self.name}|{card.name}') self.sio.emit('chat_message', room=self.game.name, data=f'_respond|{self.name}|{card.name}')
self.game.deck.scrap(card, True) self.game.deck.scrap(card, True)
@ -892,9 +895,14 @@ class Player:
if self.mancato_needed <= 0: if self.mancato_needed <= 0:
if self.event_type == 'duel': if self.event_type == 'duel':
self.game.duel(self, self.attacker.name) self.game.duel(self, self.attacker.name)
if self.character.check(self.game, chd.MollyStark) and hand_index < len(self.hand)+1 and not self.is_my_turn: if self.character.check(self.game, chd.MollyStark) and hand_index < len(self.hand) and not self.is_my_turn:
self.molly_discarded_cards += 1 self.molly_discarded_cards += 1
else: else:
if self.character.check(self.game, chd.MollyStark) and not self.is_my_turn:
for i in range(self.molly_discarded_cards):
self.hand.append(self.game.deck.draw(True))
self.molly_discarded_cards = 0
self.notify_self()
self.game.responders_did_respond_resume_turn(did_lose=False) self.game.responders_did_respond_resume_turn(did_lose=False)
self.event_type = '' self.event_type = ''
else: else:
@ -906,7 +914,7 @@ class Player:
self.hand.append(self.game.deck.draw(True)) self.hand.append(self.game.deck.draw(True))
self.molly_discarded_cards = 0 self.molly_discarded_cards = 0
self.notify_self() self.notify_self()
elif self.attacker and self.attacker in self.game.get_alive_players() and isinstance(self.attacker.character, chd.MollyStark) and self.is_my_turn: elif self.attacker and self.attacker in self.game.get_alive_players() and self.attacker.character.check(self.game, chd.MollyStark) and self.is_my_turn:
for i in range(self.attacker.molly_discarded_cards): for i in range(self.attacker.molly_discarded_cards):
self.attacker.hand.append(self.attacker.game.deck.draw(True)) self.attacker.hand.append(self.attacker.game.deck.draw(True))
self.attacker.molly_discarded_cards = 0 self.attacker.molly_discarded_cards = 0