Merge remote-tracking branch 'origin/dev' into gold-rush
This commit is contained in:
commit
26e9e4c7ce
@ -98,6 +98,7 @@ class Deck:
|
|||||||
if len(self.scrap_pile) > 0:
|
if len(self.scrap_pile) > 0:
|
||||||
card = self.scrap_pile.pop(-1)
|
card = self.scrap_pile.pop(-1)
|
||||||
self.game.notify_scrap_pile()
|
self.game.notify_scrap_pile()
|
||||||
|
card.reset_card()
|
||||||
return card
|
return card
|
||||||
else:
|
else:
|
||||||
return self.draw()
|
return self.draw()
|
||||||
|
@ -578,8 +578,10 @@ class Game:
|
|||||||
else:
|
else:
|
||||||
for i in range(len(player.hand)):
|
for i in range(len(player.hand)):
|
||||||
vulture[0].hand.append(player.hand.pop())
|
vulture[0].hand.append(player.hand.pop())
|
||||||
|
vulture[0].hand[-1].reset_card()
|
||||||
for i in range(len(player.equipment)):
|
for i in range(len(player.equipment)):
|
||||||
vulture[0].hand.append(player.equipment.pop())
|
vulture[0].hand.append(player.equipment.pop())
|
||||||
|
vulture[0].hand[-1].reset_card()
|
||||||
vulture[0].notify_self()
|
vulture[0].notify_self()
|
||||||
|
|
||||||
#se Vulture Sam è uno sceriffo e ha appena ucciso il suo Vice, deve scartare le carte che ha pescato con la sua abilità
|
#se Vulture Sam è uno sceriffo e ha appena ucciso il suo Vice, deve scartare le carte che ha pescato con la sua abilità
|
||||||
@ -589,13 +591,13 @@ class Game:
|
|||||||
player.attacker.notify_self()
|
player.attacker.notify_self()
|
||||||
|
|
||||||
greg = [p for p in self.get_alive_players() if p.character.check(self, chd.GregDigger)]
|
greg = [p for p in self.get_alive_players() if p.character.check(self, chd.GregDigger)]
|
||||||
if len(greg) > 0:
|
for i in range(len(greg)):
|
||||||
greg[0].lives = min(greg[0].lives+2, greg[0].max_lives)
|
greg[i].lives = min(greg[i].lives+2, greg[i].max_lives)
|
||||||
herb = [p for p in self.get_alive_players() if p.character.check(self, chd.HerbHunter)]
|
herb = [p for p in self.get_alive_players() if p.character.check(self, chd.HerbHunter)]
|
||||||
if len(herb) > 0:
|
for i in range(len(herb)):
|
||||||
herb[0].hand.append(self.deck.draw(True))
|
herb[i].hand.append(self.deck.draw(True))
|
||||||
herb[0].hand.append(self.deck.draw(True))
|
herb[i].hand.append(self.deck.draw(True))
|
||||||
herb[0].notify_self()
|
herb[i].notify_self()
|
||||||
self.is_handling_death = False
|
self.is_handling_death = False
|
||||||
if corpse.is_my_turn:
|
if corpse.is_my_turn:
|
||||||
corpse.is_my_turn = False
|
corpse.is_my_turn = False
|
||||||
|
@ -954,8 +954,8 @@ class Player:
|
|||||||
data=f'_special_bart_cassidy|{self.name}')
|
data=f'_special_bart_cassidy|{self.name}')
|
||||||
self.hand.append(self.game.deck.draw(True))
|
self.hand.append(self.game.deck.draw(True))
|
||||||
elif self.character.check(self.game, chars.ElGringo) and self.attacker and self.attacker in self.game.get_alive_players() and len(self.attacker.hand) > 0:
|
elif self.character.check(self.game, chars.ElGringo) and self.attacker and self.attacker in self.game.get_alive_players() and len(self.attacker.hand) > 0:
|
||||||
self.hand.append(self.attacker.hand.pop(
|
self.hand.append(self.attacker.hand.pop(randrange(0, len(self.attacker.hand))))
|
||||||
randrange(0, len(self.attacker.hand))))
|
self.hand[-1].reset_card()
|
||||||
self.sio.emit('chat_message', room=self.game.name,
|
self.sio.emit('chat_message', room=self.game.name,
|
||||||
data=f'_special_el_gringo|{self.name}|{self.attacker.name}')
|
data=f'_special_el_gringo|{self.name}|{self.attacker.name}')
|
||||||
self.attacker.notify_self()
|
self.attacker.notify_self()
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<meta name="google" content="notranslate" />
|
<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, maximum-scale=1.0, user-scalable=0" />
|
||||||
<meta name="keywords" content="bang, bang online, bang game, bang multiplayer, bang card game, bang card game online"/>
|
<meta name="keywords" content="bang, bang online, bang game, bang multiplayer, bang card game, bang card game online"/>
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
@ -253,6 +253,9 @@ html, #app, input, select {
|
|||||||
border-radius: 12pt;
|
border-radius: 12pt;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.13s ease-in-out;
|
transition: all 0.13s ease-in-out;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
-moz-appearance: none;
|
||||||
|
appearance: none;
|
||||||
}
|
}
|
||||||
.btn:hover:not([disabled]) {
|
.btn:hover:not([disabled]) {
|
||||||
background-color: var(--font-color); /* Green */
|
background-color: var(--font-color); /* Green */
|
||||||
|
@ -166,6 +166,7 @@ input {
|
|||||||
@media only screen and (max-width:1000px) {
|
@media only screen and (max-width:1000px) {
|
||||||
#msg-form {
|
#msg-form {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
margin-bottom: 50pt;
|
||||||
}
|
}
|
||||||
#submit-message {
|
#submit-message {
|
||||||
margin-top: 6pt;
|
margin-top: 6pt;
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="!didSetUsername">
|
<div v-if="!didSetUsername">
|
||||||
<p>{{$t("choose_username")}}</p>
|
<p id="choose_username">{{$t("choose_username")}}</p>
|
||||||
<form @submit="setUsername">
|
<form @submit="setUsername" class="form" style="display:flex">
|
||||||
<input id="username" v-model="username" />
|
<input id="username" v-model="username" />
|
||||||
<input type="submit" class="btn" :value="$t('submit')"/>
|
<input type="submit" class="btn" :value="$t('submit')"/>
|
||||||
</form>
|
</form>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<p>{{$t("online_players")}}{{onlinePlayers}}</p>
|
<p>{{$t("online_players")}}{{onlinePlayers}}</p>
|
||||||
<Card :card="getSelfCard" :donotlocalize="true" style="position:absolute; top:10pt; left: 10pt;"/>
|
<Card :card="getSelfCard" :donotlocalize="true" style="position:absolute; top:10pt; left: 10pt;"/>
|
||||||
<h2>{{$t("create_lobby")}}</h2>
|
<h2>{{$t("create_lobby")}}</h2>
|
||||||
<form @submit="createLobby" style="display:flex">
|
<form @submit="createLobby" class="form" style="display:flex">
|
||||||
<p>{{$t("lobby_name")}}</p>
|
<p>{{$t("lobby_name")}}</p>
|
||||||
<input id="lobbyname" v-model="lobbyName"/>
|
<input id="lobbyname" v-model="lobbyName"/>
|
||||||
<input type="submit" class="btn" :value="$t('submit')"/>
|
<input type="submit" class="btn" :value="$t('submit')"/>
|
||||||
@ -147,10 +147,25 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
if (localStorage.getItem('username'))
|
if (localStorage.getItem('username'))
|
||||||
this.username = localStorage.getItem('username')
|
this.username = localStorage.getItem('username')
|
||||||
|
else {
|
||||||
|
let names = ['player', 'cowboy', 'madman', 'horseshoe', 'mustang', '🤠️', 'dog lover', 'random', 'cows', 'seagull', 'pewneer', 'pioneer', 'django', 'tarantined', 'horse', 'cinnamom', 'toast', 'notPewDiePie', 'username', 'caveman', 'cat', 'gold', 'chicken', 'nugget', 'bullet', 'fire', 'scott', 'emiliano', 'apple', 'pear', 'pencil', 'youtuber', 'hi mom', 'discord guy', '🥰️', 'somebody', 'AAAAA', 'BBBB', 'pain', 'help?', 'gg', 'gigi', 'lmao', 'yikes', 'you?', 'kid', 'cowgirl', 'bite', 'hungry', 'joe', 'limbo', 'leeeroy', 'jenkins', 'batman', 'spiderman', 'luke skywalker', 'nemo', 'zemo', 'ironman', 'butterman', 'postman', 'father', 'son', 'sven', 'mike', 'straw', 'saaay', 'whaaaat', 'rick', 'morty', 'wubbalubbadubdub']
|
||||||
|
this.username = names[Math.floor(Math.random() * names.length)]
|
||||||
|
}
|
||||||
this.$socket.emit('get_online_players')
|
this.$socket.emit('get_online_players')
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
@media only screen and (max-width:1000px) {
|
||||||
|
.form {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.form > input, .form>p{
|
||||||
|
font-size: 20pt;
|
||||||
|
}
|
||||||
|
#choose_username{
|
||||||
|
font-size: 20pt;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
<ul style="margin:0">
|
<ul style="margin:0">
|
||||||
<li v-for="p in r.players" :key="p">
|
<li v-for="p in r.players" :key="p">
|
||||||
<p style="margin:0"><b>name:</b> {{p.name}}</p>
|
<p style="margin:0"><b>name:</b> {{p.name}}</p>
|
||||||
<p style="margin:0"><b>is_bot:</b> {{p.is_bot}}</p>
|
<p style="margin:0"><b>is_bot:</b> {{p.bot}}</p>
|
||||||
<p style="margin:0"><b>health:</b> {{p.health}}</p>
|
<p style="margin:0"><b>health:</b> {{p.health}}</p>
|
||||||
<button v-if="!p.is_bot" @click="kick(p.sid)">Kick</button>
|
<button v-if="!p.bot" @click="kick(p.sid)">Kick</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
Loading…
Reference in New Issue
Block a user