Merge branch 'dev' into gold-rush

This commit is contained in:
Alberto 2021-06-16 16:49:35 +02:00
commit 849aaabb79
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
4 changed files with 10 additions and 7 deletions

View File

@ -43,7 +43,7 @@ class Game:
self.someone_won = False self.someone_won = False
self.attack_in_progress = False self.attack_in_progress = False
self.characters_to_distribute = 2 # personaggi da dare a inizio partita self.characters_to_distribute = 2 # personaggi da dare a inizio partita
self.debug = False self.debug = self.name == 'debug'
def reset(self): def reset(self):
print('resetting lobby') print('resetting lobby')
@ -603,6 +603,7 @@ class Game:
'is_ghost': pls[j].is_ghost, 'is_ghost': pls[j].is_ghost,
'is_bot': pls[j].is_bot, 'is_bot': pls[j].is_bot,
'icon': pls[j].role.icon if (pls[j].role is not None) else '🤠', 'icon': pls[j].role.icon if (pls[j].role is not None) else '🤠',
'role': pls[j].role,
} for j in range(len(pls)) if i != j] } for j in range(len(pls)) if i != j]
def get_alive_players(self): def get_alive_players(self):

View File

@ -366,8 +366,9 @@ class Player:
self.is_using_checchino = True self.is_using_checchino = True
self.available_cards = [{ self.available_cards = [{
'name': p['name'], 'name': p['name'],
'icon': p.role.icon if(self.game.initial_players == 3) else '⭐️' if p['is_sheriff'] else '🤠', 'icon': p['role'].icon if(self.game.initial_players == 3) else '⭐️' if p['is_sheriff'] else '🤠',
'alt_text': ''.join(['❤️']*p['lives'])+''.join(['💀']*(p['max_lives']-p['lives'])) 'alt_text': ''.join(['❤️']*p['lives'])+''.join(['💀']*(p['max_lives']-p['lives'])),
'desc': p['name']
} for p in self.game.get_visible_players(self) if p['dist'] <= self.get_sight()] } for p in self.game.get_visible_players(self) if p['dist'] <= self.get_sight()]
self.available_cards.append({'icon': '', 'noDesc': True}) self.available_cards.append({'icon': '', 'noDesc': True})
self.choose_text = 'choose_cecchino' self.choose_text = 'choose_cecchino'
@ -1009,7 +1010,7 @@ class Player:
self.notify_self() self.notify_self()
def holyday_special(self, data): def holyday_special(self, data):
if self.character.check(self.game, chd.DocHolyday) and self.special_use_count < 1: if self.character.check(self.game, chd.DocHolyday) and self.special_use_count < 1 and self.pending_action == PendingAction.PLAY:
self.special_use_count += 1 self.special_use_count += 1
cards = sorted(data['cards'], reverse=True) cards = sorted(data['cards'], reverse=True)
for c in cards: for c in cards:

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" data-build-timestamp-utc="<%= new Date().toISOString() %>"> <html lang="en" translate="no" class="notranslate" data-build-timestamp-utc="<%= new Date().toISOString() %>">
<head> <head>
<meta name="google" content="notranslate" />
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">

View File

@ -24,7 +24,7 @@
<button class="btn" v-if="is_my_turn && character.name === 'Sid Ketchum' && lives < max_lives && hand.length > 1" @click="sidWantsScrapForHealth=true">{{$t('special_ability')}}</button> <button class="btn" v-if="is_my_turn && character.name === 'Sid Ketchum' && lives < max_lives && hand.length > 1" @click="sidWantsScrapForHealth=true">{{$t('special_ability')}}</button>
<button class="btn" v-if="is_my_turn && character.name === 'Chuck Wengam' && lives > 1" @click="chuckSpecial">{{$t('special_ability')}}</button> <button class="btn" v-if="is_my_turn && character.name === 'Chuck Wengam' && lives > 1" @click="chuckSpecial">{{$t('special_ability')}}</button>
<button class="btn" v-if="is_my_turn && character.name === 'José Delgado' && special_use_count < 2 && hand.filter(x => x.is_equipment).length > 0" @click="joseScrap=true">{{$t('special_ability')}}</button> <button class="btn" v-if="is_my_turn && character.name === 'José Delgado' && special_use_count < 2 && hand.filter(x => x.is_equipment).length > 0" @click="joseScrap=true">{{$t('special_ability')}}</button>
<button class="btn" v-if="is_my_turn && character.name === 'Doc Holyday' && special_use_count < 1 && hand.length > 1" @click="holydayScrap=true">{{$t('special_ability')}}</button> <button class="btn" v-if="is_my_turn && character.name === 'Doc Holyday' && special_use_count < 1 && hand.length > 1 && pending_action == 2" @click="holydayScrap=true">{{$t('special_ability')}}</button>
</div> </div>
<div v-if="lives > 0 || is_ghost" style="position:relative"> <div v-if="lives > 0 || is_ghost" style="position:relative">
<span id="hand_text">{{$t('hand')}}</span> <span id="hand_text">{{$t('hand')}}</span>
@ -310,7 +310,7 @@ export default {
}, },
holydayScrapBang(other) { holydayScrapBang(other) {
this.$socket.emit('holyday_special', { this.$socket.emit('holyday_special', {
cards : [this.hand.indexOf(this.scrapHand[0]), this.hand.indexOf(this.scrapHand[1])], cards : [this.scrapHand[0], this.scrapHand[1]],
against: other.name against: other.name
}) })
this.scrapHand = [] this.scrapHand = []