add train robbery cards to help
This commit is contained in:
parent
b72319f335
commit
beff8151c2
@ -104,7 +104,7 @@ class CrownsHole(StationCard):
|
|||||||
"""Discard a beer to rob the train"""
|
"""Discard a beer to rob the train"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Crown's Hole")
|
super().__init__("Crowns Hole")
|
||||||
self.price = [cs.Birra(0, 0).__dict__]
|
self.price = [cs.Birra(0, 0).__dict__]
|
||||||
|
|
||||||
def check_price(self, player: "Player"):
|
def check_price(self, player: "Player"):
|
||||||
@ -204,7 +204,7 @@ class MinersOath(StationCard):
|
|||||||
"""Discard a card of diamonds to rob the train"""
|
"""Discard a card of diamonds to rob the train"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Miner's Oath")
|
super().__init__("Miners Oath")
|
||||||
self.price = [{"icon": "♦️"}]
|
self.price = [{"icon": "♦️"}]
|
||||||
|
|
||||||
def check_price(self, player: "Player"):
|
def check_price(self, player: "Player"):
|
||||||
|
@ -231,9 +231,11 @@ class ObservationCar(TrainCard):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Observation Car")
|
super().__init__("Observation Car")
|
||||||
self.icon = "🚋👀"
|
self.icon = "🚋👀"
|
||||||
|
self.sight_mod = 1
|
||||||
|
self.vis_mod = 1
|
||||||
|
|
||||||
def play_card(self, player, against=None, _with=None) -> bool:
|
def play_card(self, player, against=None, _with=None) -> bool:
|
||||||
return True
|
return False
|
||||||
|
|
||||||
|
|
||||||
class PassengerCar(TrainCard):
|
class PassengerCar(TrainCard):
|
||||||
|
@ -1306,6 +1306,24 @@ def get_wildwestshowcards(sid):
|
|||||||
"wwscards_info", room=sid, data=json.dumps(chs, default=lambda o: o.__dict__)
|
"wwscards_info", room=sid, data=json.dumps(chs, default=lambda o: o.__dict__)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@sio.event
|
||||||
|
@bang_handler
|
||||||
|
def get_trainrobberycards(sid):
|
||||||
|
print("get_trainrobberycards")
|
||||||
|
import bang.expansions.train_robbery.cards as trc
|
||||||
|
import bang.expansions.train_robbery.stations as trs
|
||||||
|
import bang.expansions.train_robbery.trains as trt
|
||||||
|
|
||||||
|
chs = []
|
||||||
|
chs.extend(trs.get_all_stations())
|
||||||
|
chs.extend(trt.get_locomotives())
|
||||||
|
chs.extend(trt.get_all_cards())
|
||||||
|
sio.emit(
|
||||||
|
"trainrobberycards_info", room=sid, data=json.dumps({
|
||||||
|
"cards": chs,
|
||||||
|
"stations": trs.get_all_stations()
|
||||||
|
}, default=lambda o: o.__dict__)
|
||||||
|
)
|
||||||
|
|
||||||
@sio.event
|
@sio.event
|
||||||
@bang_handler
|
@bang_handler
|
||||||
|
@ -127,15 +127,32 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<h2 id="trainrobberycards">{{$t('help.trainrobberycards')}}</h2>
|
||||||
|
<div class="flexy-cards-wrapper">
|
||||||
|
<div v-for="(c, i) in trainrobberycards" v-bind:key="c.name ? (c.name+c.number) : i" class="flexy-cards">
|
||||||
|
<Card :card="c" class="train-robbery" @pointerenter.native="''" @pointerleave.native="''"/>
|
||||||
|
<div style="margin-left:6pt;">
|
||||||
|
<p>{{$t(`cards.${c.name}.desc`)}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-for="(c, i) in trainrobberystations" v-bind:key="c.name ? (c.name+c.number) : i" class="flexy-cards">
|
||||||
|
<StationCard :card="c" class="train-robbery" @pointerenter.native="''" @pointerleave.native="''" :price="c.price"/>
|
||||||
|
<div style="margin-left:6pt;">
|
||||||
|
<p>{{$t(`cards.${c.name}.desc`)}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Card from '@/components/Card.vue'
|
import Card from '@/components/Card.vue'
|
||||||
|
import StationCard from './StationCard.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Help',
|
name: 'Help',
|
||||||
components: {
|
components: {
|
||||||
Card,
|
Card,
|
||||||
|
StationCard,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
inGame: Boolean
|
inGame: Boolean
|
||||||
@ -152,6 +169,8 @@ export default {
|
|||||||
goldrushcards: [],
|
goldrushcards: [],
|
||||||
valleyofshadowscards: [],
|
valleyofshadowscards: [],
|
||||||
wildwestshowcards: [],
|
wildwestshowcards: [],
|
||||||
|
trainrobberycards: [],
|
||||||
|
trainrobberystations: [],
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
endTurnCard() {
|
endTurnCard() {
|
||||||
@ -196,6 +215,14 @@ export default {
|
|||||||
...x,
|
...x,
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
trainrobberycards_info(cardsJson) {
|
||||||
|
this.trainrobberycards = JSON.parse(cardsJson).cards.map(x=>({
|
||||||
|
...x,
|
||||||
|
}))
|
||||||
|
this.trainrobberystations = JSON.parse(cardsJson).stations.map(x=>({
|
||||||
|
...x,
|
||||||
|
}))
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$socket.emit('get_cards')
|
this.$socket.emit('get_cards')
|
||||||
@ -205,6 +232,7 @@ export default {
|
|||||||
this.$socket.emit('get_goldrushcards')
|
this.$socket.emit('get_goldrushcards')
|
||||||
this.$socket.emit('get_valleyofshadowscards')
|
this.$socket.emit('get_valleyofshadowscards')
|
||||||
this.$socket.emit('get_wildwestshowcards')
|
this.$socket.emit('get_wildwestshowcards')
|
||||||
|
this.$socket.emit('get_trainrobberycards')
|
||||||
document.getElementById('help').scrollIntoView();
|
document.getElementById('help').scrollIntoView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user