From b984c55f40784215bb4a3d386c01d8b7f60fb368 Mon Sep 17 00:00:00 2001 From: Alberto Xamin Date: Sat, 19 Jun 2021 19:25:43 +0200 Subject: [PATCH 1/5] fix for mobile safari --- frontend/public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/index.html b/frontend/public/index.html index 61a29af..d935a74 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -4,7 +4,7 @@ - + From 5948a7ad7445294f4b12e88cc7bb220b6d507622 Mon Sep 17 00:00:00 2001 From: Alberto Xamin Date: Sat, 19 Jun 2021 19:56:10 +0200 Subject: [PATCH 2/5] more mobile safari fixes + username suggestions --- frontend/src/App.vue | 3 +++ frontend/src/components/Chat.vue | 1 + frontend/src/components/Menu.vue | 21 ++++++++++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d556899..86a09e3 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -253,6 +253,9 @@ html, #app, input, select { border-radius: 12pt; cursor: pointer; transition: all 0.13s ease-in-out; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } .btn:hover:not([disabled]) { background-color: var(--font-color); /* Green */ diff --git a/frontend/src/components/Chat.vue b/frontend/src/components/Chat.vue index 5f9372e..2d1e63e 100644 --- a/frontend/src/components/Chat.vue +++ b/frontend/src/components/Chat.vue @@ -166,6 +166,7 @@ input { @media only screen and (max-width:1000px) { #msg-form { flex-direction: column; + margin-bottom: 50pt; } #submit-message { margin-top: 6pt; diff --git a/frontend/src/components/Menu.vue b/frontend/src/components/Menu.vue index 03e970a..29982e3 100644 --- a/frontend/src/components/Menu.vue +++ b/frontend/src/components/Menu.vue @@ -12,8 +12,8 @@
-

{{$t("choose_username")}}

-
+

{{$t("choose_username")}}

+
@@ -24,7 +24,7 @@

{{$t("online_players")}}{{onlinePlayers}}

{{$t("create_lobby")}}

-
+

{{$t("lobby_name")}}

@@ -147,10 +147,25 @@ export default { mounted() { if (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') }, } From 7c4eb60808ab297076b947a108cffd5a7c4d8760 Mon Sep 17 00:00:00 2001 From: Giulio Date: Sun, 20 Jun 2021 00:02:00 +0200 Subject: [PATCH 3/5] fix bot in status page --- frontend/src/components/Status.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Status.vue b/frontend/src/components/Status.vue index eb0d3d8..58fc9c5 100644 --- a/frontend/src/components/Status.vue +++ b/frontend/src/components/Status.vue @@ -19,9 +19,9 @@
  • name: {{p.name}}

    -

    is_bot: {{p.is_bot}}

    +

    is_bot: {{p.bot}}

    health: {{p.health}}

    - +

From 1149aa9dc7aa1fffbc8be2d91270af3f47a03246 Mon Sep 17 00:00:00 2001 From: Giulio Date: Sun, 20 Jun 2021 02:42:06 +0200 Subject: [PATCH 4/5] fix multiple gregs and herbs --- backend/bang/game.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/bang/game.py b/backend/bang/game.py index d0138b0..e0845cd 100644 --- a/backend/bang/game.py +++ b/backend/bang/game.py @@ -569,13 +569,13 @@ class Game: player.attacker.notify_self() greg = [p for p in self.get_alive_players() if p.character.check(self, chd.GregDigger)] - if len(greg) > 0: - greg[0].lives = min(greg[0].lives+2, greg[0].max_lives) + for i in range(len(greg)): + 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)] - if len(herb) > 0: - herb[0].hand.append(self.deck.draw(True)) - herb[0].hand.append(self.deck.draw(True)) - herb[0].notify_self() + for i in range(len(herb)): + herb[i].hand.append(self.deck.draw(True)) + herb[i].hand.append(self.deck.draw(True)) + herb[i].notify_self() self.is_handling_death = False if corpse.is_my_turn: corpse.is_my_turn = False From 467162eb6e030501073fd0b851746dc2a0251421 Mon Sep 17 00:00:00 2001 From: Giulio Date: Sun, 20 Jun 2021 03:22:12 +0200 Subject: [PATCH 5/5] reset more card --- backend/bang/deck.py | 1 + backend/bang/game.py | 2 ++ backend/bang/players.py | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/bang/deck.py b/backend/bang/deck.py index 57aa884..3f21054 100644 --- a/backend/bang/deck.py +++ b/backend/bang/deck.py @@ -80,6 +80,7 @@ class Deck: if len(self.scrap_pile) > 0: card = self.scrap_pile.pop(-1) self.game.notify_scrap_pile() + card.reset_card() return card else: return self.draw() diff --git a/backend/bang/game.py b/backend/bang/game.py index e0845cd..af15d1c 100644 --- a/backend/bang/game.py +++ b/backend/bang/game.py @@ -558,8 +558,10 @@ class Game: else: for i in range(len(player.hand)): vulture[0].hand.append(player.hand.pop()) + vulture[0].hand[-1].reset_card() for i in range(len(player.equipment)): vulture[0].hand.append(player.equipment.pop()) + vulture[0].hand[-1].reset_card() 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à diff --git a/backend/bang/players.py b/backend/bang/players.py index 7e947dc..eadf24e 100644 --- a/backend/bang/players.py +++ b/backend/bang/players.py @@ -862,8 +862,8 @@ class Player: data=f'_special_bart_cassidy|{self.name}') 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: - self.hand.append(self.attacker.hand.pop( - randrange(0, len(self.attacker.hand)))) + self.hand.append(self.attacker.hand.pop(randrange(0, len(self.attacker.hand)))) + self.hand[-1].reset_card() self.sio.emit('chat_message', room=self.game.name, data=f'_special_el_gringo|{self.name}|{self.attacker.name}') self.attacker.notify_self()