From ca6c396c45354f7789f50fad5794396e38789026 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Mar 2022 04:15:11 +0000 Subject: [PATCH 1/5] Bump pytest from 7.1.0 to 7.1.1 in /backend Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.0 to 7.1.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.1.0...7.1.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- backend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index 468a5ad..a2c7e4e 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -5,6 +5,6 @@ greenlet==1.1.2 python-engineio==3.14.2 python-socketio==4.6.1 six==1.16.0 -pytest==7.1.0 +pytest==7.1.1 requests==2.27.1 discord-webhook==0.15.0 \ No newline at end of file From 2181d1355dd0dfcfbf19d5123aeeed4b08fc3593 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 04:14:25 +0000 Subject: [PATCH 2/5] Bump actions/cache from 2 to 3 Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/dev-image.yml | 2 +- .github/workflows/docker-image.yml | 2 +- .github/workflows/tests.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-image.yml b/.github/workflows/dev-image.yml index 03dab56..6e4d839 100644 --- a/.github/workflows/dev-image.yml +++ b/.github/workflows/dev-image.yml @@ -15,7 +15,7 @@ jobs: uses: crazy-max/ghaction-docker-buildx@v3 - name: Cache Docker layers - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache with: path: /tmp/.buildx-cache diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 90e072d..b4417f9 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,7 +15,7 @@ jobs: uses: crazy-max/ghaction-docker-buildx@v3 - name: Cache Docker layers - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache with: path: /tmp/.buildx-cache diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ca2c18b..a1bd5e8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,7 +14,7 @@ jobs: uses: crazy-max/ghaction-docker-buildx@v3 - name: Cache Docker layers - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache with: path: /tmp/.buildx-cache From 2cda50e82529fec9d4a63dae6b08b876aa671044 Mon Sep 17 00:00:00 2001 From: Giulio Date: Tue, 22 Mar 2022 12:42:20 +0100 Subject: [PATCH 3/5] choose a random card when it is face down --- frontend/src/components/Lobby.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Lobby.vue b/frontend/src/components/Lobby.vue index 0f4aa27..0e37daf 100644 --- a/frontend/src/components/Lobby.vue +++ b/frontend/src/components/Lobby.vue @@ -316,9 +316,16 @@ export default { this.hasToChoose = true }, chooseCard(card) { - this.$socket.emit('choose', this.chooseCards.indexOf(card)) + let index = this.chooseCards.indexOf(card) + if (!this.debug_mode) { + let pl = this.players.filter(x=>x.name === this.target_p)[0] + if (index < pl.ncards) { + index = Math.floor(Math.random() * pl.ncards) + } + } + this.$socket.emit('choose', index) if (Vue.config.devtools) - console.log(card + ' ' + this.chooseCards.indexOf(card)) + console.log(card + ' ' + index) this.chooseCards = [] this.hasToChoose = false this.target_p = '' From 2e0bfc240c8ace611e2627e028e4984e0e42f0e6 Mon Sep 17 00:00:00 2001 From: Giulio Date: Tue, 22 Mar 2022 13:09:44 +0100 Subject: [PATCH 4/5] fix gold rush equipment on roulette --- backend/bang/game.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/bang/game.py b/backend/bang/game.py index 80994f5..729ea20 100644 --- a/backend/bang/game.py +++ b/backend/bang/game.py @@ -399,11 +399,11 @@ class Game: target_pl = pls[(pls.index(self.players[self.turn]) + self.player_bangs) % len(pls)] print(f'{self.name}: stop roulette') target_pl.lives -= 1 - if len([c for c in target_pl.equipment if isinstance(c, grc.Talismano)]) > 0: + if len([c for c in target_pl.gold_rush_equipment if isinstance(c, grc.Talismano)]) > 0: target_pl.gold_nuggets += 1 if target_pl.character.check(self, grch.SimeonPicos): target_pl.gold_nuggets += 1 - if len([c for c in target_pl.equipment if isinstance(c, grc.Stivali)]) > 0: + if len([c for c in target_pl.gold_rush_equipment if isinstance(c, grc.Stivali)]) > 0: target_pl.hand.append(self.deck.draw(True)) target_pl.notify_self() self.is_russian_roulette_on = False From 0ed50022f1cb59237892053840d7d05d7cfbd46d Mon Sep 17 00:00:00 2001 From: Giulio Date: Tue, 22 Mar 2022 13:55:55 +0100 Subject: [PATCH 5/5] fix heal in roulette event --- backend/bang/game.py | 4 ++-- backend/bang/players.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/bang/game.py b/backend/bang/game.py index 729ea20..d00dfd1 100644 --- a/backend/bang/game.py +++ b/backend/bang/game.py @@ -398,7 +398,8 @@ class Game: if did_lose: target_pl = pls[(pls.index(self.players[self.turn]) + self.player_bangs) % len(pls)] print(f'{self.name}: stop roulette') - target_pl.lives -= 1 + target_pl.lives -= 2 + target_pl.heal_if_needed() if len([c for c in target_pl.gold_rush_equipment if isinstance(c, grc.Talismano)]) > 0: target_pl.gold_nuggets += 1 if target_pl.character.check(self, grch.SimeonPicos): @@ -409,7 +410,6 @@ class Game: self.is_russian_roulette_on = False self.players[self.turn].play_turn() else: - self.player_bangs += 1 target_pl = pls[(pls.index(self.players[self.turn]) + self.player_bangs) % len(pls)] print(f'{self.name}: next in line {target_pl.name}') if target_pl.get_banged(self.deck.event_cards[0]): diff --git a/backend/bang/players.py b/backend/bang/players.py index 41c77f8..cf819cc 100644 --- a/backend/bang/players.py +++ b/backend/bang/players.py @@ -166,7 +166,6 @@ class Player: },{ 'icon': '⚫', 'noDesc': True - }] self.is_drawing = True self.choose_text = 'choose_guess'