Cinturone

This commit is contained in:
Alberto Xamin 2021-06-15 23:01:39 +02:00
parent f030808343
commit 8c57e87532
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
3 changed files with 15 additions and 8 deletions

View File

@ -61,7 +61,7 @@ class CorsaAllOro(ShopCard):
super().__init__("Corsa All'Oro", 5, ShopCardKind.BROWN)
self.icon = '🤑️'
def play_card(self, player, against, _with=None):
def play_card(self, player, against=None, _with=None):
player.lives = player.max_lives
return True
@ -170,9 +170,9 @@ class Zaino(ShopCard):
def get_cards() -> List[Card]:
cards = [
Bicchierino(),
Bottiglia(),
Complice(),
# Bicchierino(),
# Bottiglia(),
# Complice(),
CorsaAllOro(),
Rum(),
UnionPacific(),

View File

@ -272,6 +272,8 @@ class Player:
return
break
maxcards = self.lives if not self.character.check(self.game, chd.SeanMallory) else 10
if maxcards == self.lives and len([c for c in self.equipment if isinstance(c, grc.Cinturone)]) > 0:
maxcards = 8
if len(self.hand) > maxcards:
self.scrap(0)
else:
@ -536,7 +538,7 @@ class Player:
print(self.name, 'is playing ', card, ' against:', against, ' with:', _with)
did_play_card = False
event_blocks_card = (self.game.check_event(ce.IlGiudice) and (card.is_equipment or (card.usable_next_turn and not card.can_be_used_now))) or (self.game.check_event(ce.Lazo) and card.usable_next_turn and card.can_be_used_now) or (self.game.check_event(ceh.Manette) and card.suit != self.committed_suit_manette and not (card.usable_next_turn and card.can_be_used_now))
if not(against != None and (isinstance(self.game.get_player_named(against).character, chd.ApacheKid) or len([c for c in self.player.equipment if isinstance(c, grc.Calumet)]) > 0) and card.check_suit(self.game, [cs.Suit.DIAMONDS])) and not event_blocks_card:
if not(against != None and (isinstance(self.game.get_player_named(against).character, chd.ApacheKid) or len([c for c in self.game.get_player_named(against).equipment if isinstance(c, grc.Calumet)]) > 0) and card.check_suit(self.game, [cs.Suit.DIAMONDS])) and not event_blocks_card:
if against == self.name and not isinstance(card, csd.Tequila):
did_play_card = False
else:
@ -812,7 +814,7 @@ class Player:
def get_indians(self, attacker):
self.attacker = attacker
if self.character.check(self.game, chd.ApacheKid) or len([c for c in self.player.equipment if isinstance(c, grc.Calumet)]) > 0: return False
if self.character.check(self.game, chd.ApacheKid) or len([c for c in self.equipment if isinstance(c, grc.Calumet)]) > 0: return False
if not self.game.is_competitive and len([c for c in self.hand if isinstance(c, cs.Bang) or (self.character.check(self.game, chars.CalamityJanet) and isinstance(c, cs.Mancato))]) == 0:
print('Cant defend')
self.take_damage_response()
@ -1008,6 +1010,8 @@ class Player:
if not self.is_my_turn and not forced:
return
maxcards = self.lives if not self.character.check(self.game, chd.SeanMallory) else 10
if maxcards == self.lives and len([c for c in self.equipment if isinstance(c, grc.Cinturone)]) > 0:
maxcards = 8
if len(self.hand) > maxcards and not forced:
print(
f"{self.name}: I have to many cards in my hand and I can't end the turn")

View File

@ -50,7 +50,7 @@
<Chooser v-if="!show_role && availableCharacters.length > 0" :text="$t('choose_character')" :cards="availableCharacters" :select="setCharacter"/>
<Chooser v-if="hasToPickResponse" :playAudio="true" :text="`${$t('pick_a_card')} ${attacker?($t('to_defend_from')+' '+attacker):''}`" :key="hasToPickResponse" class="turn-notify" />
<Chooser v-if="!card_against && card_with" :text="`${$t('choose_scarp_card_to')} ${card_with.name.toUpperCase()}`" :cards="handComputed.filter(x => x !== card_with)" :select="selectWith" :cancel="()=>{card_with = null}"/>
<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}/${maxHandLength()}`" :cards="hand" :select="scrap" :cancel="cancelEndingTurn"/>
<Chooser v-if="sidWantsScrapForHealth && scrapHand.length < 2" :text="`${$t('discard')} ${2 - scrapHand.length} ${$t('to_regain_1_hp')}`"
:cards="notScrappedHand" :select="sidScrap" :cancel="() => {sidWantsScrapForHealth = false;scrapHand=[]}"/>
<Chooser v-if="joseScrap" :text="`${$t('discard')}`"
@ -241,7 +241,7 @@ export default {
return x[this.pending_action]
},
canEndTurn() {
return (this.pending_action == 2 && this.hand.length <= (this.character.name === "Sean Mallory" && !(this.eventCard && this.eventCard.name == "Sbornia")?10:this.lives))
return (this.pending_action == 2 && this.hand.length <= this.maxHandLength())
},
respondCards() {
let cc = [{
@ -276,6 +276,9 @@ export default {
}
},
methods: {
maxHandLength() {
return (this.character.name === "Sean Mallory" && !(this.eventCard && this.eventCard.name == "Sbornia")?10:(this.equipment.filter(x => x.name == 'Cinturone').length>0?8:this.lives))
},
setCharacter(char) {
this.availableCharacters = []
this.$socket.emit('set_character', char.name)