chuck wengam
This commit is contained in:
parent
de303b7eb5
commit
950d588b66
@ -262,5 +262,10 @@ def scrap(sid, card_index):
|
|||||||
ses: Player = sio.get_session(sid)
|
ses: Player = sio.get_session(sid)
|
||||||
ses.scrap(card_index)
|
ses.scrap(card_index)
|
||||||
|
|
||||||
|
@sio.event
|
||||||
|
def chuck_lose_hp_draw(sid):
|
||||||
|
ses: Player = sio.get_session(sid)
|
||||||
|
ses.chuck_lose_hp_draw()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
eventlet.wsgi.server(eventlet.listen(('', 5001)), app)
|
eventlet.wsgi.server(eventlet.listen(('', 5001)), app)
|
||||||
|
@ -78,6 +78,12 @@ class VeraCuster(Character):
|
|||||||
self.desc_eng = "Before drawing, she may choose the special ability on another alive player. This ability is used until next turn."
|
self.desc_eng = "Before drawing, she may choose the special ability on another alive player. This ability is used until next turn."
|
||||||
self.icon = '🎭'
|
self.icon = '🎭'
|
||||||
|
|
||||||
|
class ChuckWengam(Character):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__("Chuck Wengam", max_lives=4)
|
||||||
|
self.desc = "Durante il suo turno può perdere una vita per pescare 2 carte dal mazzo."
|
||||||
|
self.desc_eng = "On his turn he may decide to lose 1 HP to draw 2 cards from the deck."
|
||||||
|
self.icon = '💰'
|
||||||
|
|
||||||
def all_characters() -> List[Character]:
|
def all_characters() -> List[Character]:
|
||||||
return [
|
return [
|
||||||
@ -92,6 +98,7 @@ def all_characters() -> List[Character]:
|
|||||||
SeanMallory(),
|
SeanMallory(),
|
||||||
BelleStar(),
|
BelleStar(),
|
||||||
VeraCuster(),
|
VeraCuster(),
|
||||||
|
ChuckWengam(),
|
||||||
]
|
]
|
||||||
|
|
||||||
#Apache Kid: il suo effetto non conta nei duelli
|
#Apache Kid: il suo effetto non conta nei duelli
|
||||||
|
@ -660,6 +660,13 @@ class Player:
|
|||||||
self.game.deck.scrap(self.hand.pop(card_index))
|
self.game.deck.scrap(self.hand.pop(card_index))
|
||||||
self.notify_self()
|
self.notify_self()
|
||||||
|
|
||||||
|
def chuck_lose_hp_draw(self):
|
||||||
|
if isinstance(self.character, chd.ChuckWengam) and self.lives > 1 and self.is_my_turn:
|
||||||
|
self.lives -= 1
|
||||||
|
self.hand.append(self.game.deck.draw())
|
||||||
|
self.hand.append(self.game.deck.draw())
|
||||||
|
self.notify_self()
|
||||||
|
|
||||||
def end_turn(self, forced=False):
|
def end_turn(self, forced=False):
|
||||||
if not self.is_my_turn:
|
if not self.is_my_turn:
|
||||||
return
|
return
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
<transition name="list">
|
<transition name="list">
|
||||||
<p v-if="desc"><i>{{desc}}</i></p>
|
<p v-if="desc"><i>{{desc}}</i></p>
|
||||||
</transition>
|
</transition>
|
||||||
|
<button v-if="is_my_turn && character.name === 'Sid Ketchum'" @click="sidWantsScrapForHealth=true">{{$t('special_ability')}}</button>
|
||||||
|
<button v-if="is_my_turn && character.name === 'Chuck Wengam' && lives > 1" @click="chuckSpecial">{{$t('special_ability')}}</button>
|
||||||
<div v-if="lives > 0" style="position:relative">
|
<div v-if="lives > 0" style="position:relative">
|
||||||
<span id="hand_text">{{$t('hand')}}</span>
|
<span id="hand_text">{{$t('hand')}}</span>
|
||||||
<transition-group name="list" tag="div" class="hand">
|
<transition-group name="list" tag="div" class="hand">
|
||||||
@ -46,7 +48,6 @@
|
|||||||
<Chooser v-if="showScrapScreen" :text="`${$t('discard')} ${hand.length}/${lives}`" :cards="hand" :select="scrap" :cancel="cancelEndingTurn"/>
|
<Chooser v-if="showScrapScreen" :text="`${$t('discard')} ${hand.length}/${lives}`" :cards="hand" :select="scrap" :cancel="cancelEndingTurn"/>
|
||||||
<Chooser v-if="sidWantsScrapForHealth && sidScrapForHealth.length < 2" :text="`${$t('discard')} ${2 - sidScrapForHealth.length} ${$t('to_regain_1_hp')}`"
|
<Chooser v-if="sidWantsScrapForHealth && sidScrapForHealth.length < 2" :text="`${$t('discard')} ${2 - sidScrapForHealth.length} ${$t('to_regain_1_hp')}`"
|
||||||
:cards="sidScrapHand" :select="sidScrap" :cancel="() => {sidWantsScrapForHealth = false;sidScrapForHealth=[]}"/>
|
:cards="sidScrapHand" :select="sidScrap" :cancel="() => {sidWantsScrapForHealth = false;sidScrapForHealth=[]}"/>
|
||||||
<button v-if="is_my_turn && character.name === 'Sid Ketchum'" @click="sidWantsScrapForHealth=true">{{$t('special_ability')}}</button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -220,6 +221,9 @@ export default {
|
|||||||
this.sidWantsScrapForHealth = false
|
this.sidWantsScrapForHealth = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
chuckSpecial(){
|
||||||
|
this.$socket.emit('chuck_lose_hp_draw')
|
||||||
|
},
|
||||||
end_turn(){
|
end_turn(){
|
||||||
console.log('ending turn')
|
console.log('ending turn')
|
||||||
this.cancelEndingTurn()
|
this.cancelEndingTurn()
|
||||||
|
Loading…
Reference in New Issue
Block a user