add liquore forte

This commit is contained in:
Alberto Xamin 2020-12-19 19:59:54 +01:00
parent f29be68425
commit 37f5ddd755
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
4 changed files with 16 additions and 7 deletions

View File

@ -48,10 +48,10 @@ class LeggeDelWest(CardEvent):
self.desc_eng = 'Every player shows the second card that they draw and must use it in that round' self.desc_eng = 'Every player shows the second card that they draw and must use it in that round'
class LiquoreForte(CardEvent): class LiquoreForte(CardEvent):
def __init__(self):#TODO def __init__(self):
super().__init__('Liquore Forte', '🥃') super().__init__('Liquore Forte', '🥃')
self.desc = 'I giocatori possono evitare di pescare per recuperare 1 vita' self.desc = 'I giocatori possono evitare di pescare per recuperare 1 vita (clicca sulla carta evento per farlo)'
self.desc_eng = 'Players can skip drawing to regain 1 HP' self.desc_eng = 'Players can skip drawing to regain 1 HP (click on the event card to use)'
class MinieraAbbandonata(CardEvent): class MinieraAbbandonata(CardEvent):
def __init__(self):#TODO def __init__(self):#TODO
@ -104,7 +104,7 @@ def get_all_events():
IlGiudice(), IlGiudice(),
Lazo(), Lazo(),
LeggeDelWest(), LeggeDelWest(),
# LiquoreForte(), LiquoreForte(),
# MinieraAbbandonata(), # MinieraAbbandonata(),
# PerUnPugnoDiCarte(), # PerUnPugnoDiCarte(),
# Peyote(), # Peyote(),

View File

@ -24,7 +24,7 @@ class Game:
self.initial_players = 0 self.initial_players = 0
self.password = '' self.password = ''
self.expansions = [] self.expansions = []
self.available_expansions = ['dodge_city'] self.available_expansions = ['dodge_city', 'fistful_of_cards']
self.shutting_down = False self.shutting_down = False
self.is_competitive = False self.is_competitive = False
self.disconnect_bot = True self.disconnect_bot = True

View File

@ -308,7 +308,11 @@ class Player:
def draw(self, pile): def draw(self, pile):
if self.pending_action != PendingAction.DRAW: if self.pending_action != PendingAction.DRAW:
return return
if isinstance(self.character, chars.KitCarlson): if pile == 'event' and self.lives < self.max_lives and self.game.check_event(ce.LiquoreForte):
self.lives += 1
self.pending_action = PendingAction.PLAY
self.notify_self()
elif isinstance(self.character, chars.KitCarlson):
self.is_drawing = True self.is_drawing = True
self.available_cards = [self.game.deck.draw() for i in range(3)] self.available_cards = [self.game.deck.draw() for i in range(3)]
self.pending_action = PendingAction.CHOOSE self.pending_action = PendingAction.CHOOSE

View File

@ -5,7 +5,7 @@
<div v-if="eventCard" style="position:relative"> <div v-if="eventCard" style="position:relative">
<div class="card fistful-of-cards" style="position:relative; bottom:-3pt;right:-3pt;"/> <div class="card fistful-of-cards" style="position:relative; bottom:-3pt;right:-3pt;"/>
<div class="card fistful-of-cards" style="position:absolute; bottom:-1.5pt;right:-1.5pt;"/> <div class="card fistful-of-cards" style="position:absolute; bottom:-1.5pt;right:-1.5pt;"/>
<card :card="eventCard" :key="eventCard" :class="{'last-event':true,'fistful-of-cards':true}"/> <card :card="eventCard" :key="eventCard" :class="{'last-event':true,'fistful-of-cards':true}" @click.native="event"/>
</div> </div>
<div style="position:relative"> <div style="position:relative">
<div class="card back" style="position:absolute; bottom:-3pt;right:-3pt;"/> <div class="card back" style="position:absolute; bottom:-3pt;right:-3pt;"/>
@ -79,6 +79,11 @@ export default {
else if (this.pending_action == 1) else if (this.pending_action == 1)
this.$socket.emit('draw', pile) this.$socket.emit('draw', pile)
} }
},
event() {
if (this.pending_action !== false && this.pending_action < 2) {
this.$socket.emit('draw', 'event')
}
} }
}, },
watch: { watch: {