fixed rangeless card
This commit is contained in:
parent
91a1d2122d
commit
90b138d70a
@ -111,6 +111,7 @@ export default {
|
|||||||
range: 1,
|
range: 1,
|
||||||
sight: 1,
|
sight: 1,
|
||||||
sight_extra: 1,
|
sight_extra: 1,
|
||||||
|
norangecard: false,
|
||||||
can_target_sheriff: true,
|
can_target_sheriff: true,
|
||||||
show_role: false,
|
show_role: false,
|
||||||
attacker: undefined,
|
attacker: undefined,
|
||||||
@ -240,7 +241,10 @@ export default {
|
|||||||
if (!this.can_target_sheriff && x.is_sheriff)
|
if (!this.can_target_sheriff && x.is_sheriff)
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
//console.log("aa" +(this.sight-1))
|
//console.log(x.name +" dist:" +x.dist +" range:" +this.range +" sight:" +this.sight +" sight_extra:" +this.sight_extra)
|
||||||
|
if (this.norangecard)
|
||||||
|
return x.dist <= this.range
|
||||||
|
else
|
||||||
return x.dist <= this.range + this.sight_extra
|
return x.dist <= this.range + this.sight_extra
|
||||||
}).map(player => {
|
}).map(player => {
|
||||||
return {
|
return {
|
||||||
@ -372,10 +376,13 @@ export default {
|
|||||||
if (card.need_with && !this.card_with) {
|
if (card.need_with && !this.card_with) {
|
||||||
this.card_with = card
|
this.card_with = card
|
||||||
} else if ((card.need_target || calamity_special) && !((card.name == 'Bang!' || (calamity_special && card.name=='Mancato!')) && cant_play_bang)) {
|
} else if ((card.need_target || calamity_special) && !((card.name == 'Bang!' || (calamity_special && card.name=='Mancato!')) && cant_play_bang)) {
|
||||||
if (card.name == 'Bang!' || card.name == "Pepperbox" || calamity_special)
|
if (card.name == 'Bang!' || card.name == "Pepperbox" || calamity_special) {
|
||||||
this.range = this.sight
|
this.range = this.sight
|
||||||
else
|
this.norangecard = true
|
||||||
|
} else {
|
||||||
this.range = card.range
|
this.range = card.range
|
||||||
|
this.norangecard = false
|
||||||
|
}
|
||||||
if (this.visiblePlayers.length == 0 && this.hand.length > this.lives) {
|
if (this.visiblePlayers.length == 0 && this.hand.length > this.lives) {
|
||||||
this.really_play_card(card, null)
|
this.really_play_card(card, null)
|
||||||
}
|
}
|
||||||
@ -401,6 +408,7 @@ export default {
|
|||||||
if (this.card_with.need_target) {
|
if (this.card_with.need_target) {
|
||||||
this.card_against = this.card_with
|
this.card_against = this.card_with
|
||||||
this.range = this.card_against.range
|
this.range = this.card_against.range
|
||||||
|
this.norangecard = false
|
||||||
this.card_with = card
|
this.card_with = card
|
||||||
} else {
|
} else {
|
||||||
let card_data = {
|
let card_data = {
|
||||||
|
Loading…
Reference in New Issue
Block a user