tequila self

This commit is contained in:
Alberto Xamin 2020-11-27 13:50:03 +01:00
parent a4e3825ab1
commit 04715b2332
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
3 changed files with 14 additions and 1 deletions

View File

@ -35,6 +35,7 @@ class Card(ABC):
self.alt_text = f'{self.range} 🔍' self.alt_text = f'{self.range} 🔍'
self.desc = desc self.desc = desc
self.need_target = False self.need_target = False
self.can_target_self = False
self.need_with = False self.need_with = False
def __str__(self): def __str__(self):

View File

@ -98,6 +98,7 @@ class Tequila(Card):
self.icon = '🍹' self.icon = '🍹'
self.desc = "Fai recuperare 1 vita a un giocatore a tua scelta, anche te stesso" self.desc = "Fai recuperare 1 vita a un giocatore a tua scelta, anche te stesso"
self.need_target = True self.need_target = True
self.can_target_self = True
self.need_with = True self.need_with = True
self.alt_text = '2🃏' self.alt_text = '2🃏'

View File

@ -85,6 +85,7 @@ export default {
sidScrapForHealth: [], sidScrapForHealth: [],
sidWantsScrapForHealth: false, sidWantsScrapForHealth: false,
mancato_needed: 0, mancato_needed: 0,
name: '',
}), }),
sockets: { sockets: {
role(role) { role(role) {
@ -94,6 +95,7 @@ export default {
}, },
self(self) { self(self) {
self = JSON.parse(self) self = JSON.parse(self)
this.name = self.name
this.pending_action = self.pending_action this.pending_action = self.pending_action
this.character = self.character this.character = self.character
this.character.is_character = true this.character.is_character = true
@ -141,7 +143,7 @@ export default {
}, },
visiblePlayers() { visiblePlayers() {
this.range; this.range;
return this.playersDistances.filter(x => { let vis = this.playersDistances.filter(x => {
if (!this.can_target_sheriff && x.is_sheriff) if (!this.can_target_sheriff && x.is_sheriff)
return false return false
else else
@ -153,6 +155,15 @@ export default {
icon: player.is_sheriff ? '⭐' : '🤠', icon: player.is_sheriff ? '⭐' : '🤠',
is_character: true, is_character: true,
}}) }})
if (this.card_against && this.card_against.can_target_self) {
vis.push({
name: this.name,
number: 0,
icon: 'TU',
is_character: true,
})
}
return vis
}, },
hasToPickResponse() { hasToPickResponse() {
return !this.is_my_turn && this.pending_action == 0 return !this.is_my_turn && this.pending_action == 0