From 811435ddf4f5ca56b76349a2fda0b04598571618 Mon Sep 17 00:00:00 2001 From: Nicolas Fritz Date: Sun, 29 Jan 2023 18:01:06 +0100 Subject: [PATCH] Fixed Plus 2 Karte Bug --- uno/web/Style.js | 5 +---- uno/web/cards/special/PlusAmount.js | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/uno/web/Style.js b/uno/web/Style.js index 41e8b8a..c01cdaa 100644 --- a/uno/web/Style.js +++ b/uno/web/Style.js @@ -41,12 +41,12 @@ export default class Style { $('.uno').css('filter', 'grayscale(80%)'); $('#sayUno-glow').css('opacity', 1); this.game.currentPlayerInstanz.sayUno(); + this.game.currentPlayerInstanz.mustSayUno = false; }) $('#drawCard').on('click', () => { if(this.game.currentPlayerInstanz.mustSayUno){ this.game.currentPlayerInstanz.mustSayUno = false; - console.log(this.game.currentPlayerInstanz.mustSayUno) } this.game.currentPlayerInstanz.drawCard(1, true, true); this.refreshDebug(); @@ -84,7 +84,6 @@ export default class Style { refreshCardOnDeck() { if (this._cardOnDeck !== this.game.cardOnDeck) { - console.log(" ewfw") this.putCardAnim(); this._cardOnDeck = this.game.cardOnDeck; } else { @@ -211,8 +210,6 @@ export default class Style { currentPlayerHand[i].xPos = (width * (((43 + cardAmount / 2 * 5) - percent)) / 100); currentPlayerHand[i].yPos = top; - console.log(i + ' ' + currentPlayerHand[i].yPos); - let card = $('#card' + i); let put = false; diff --git a/uno/web/cards/special/PlusAmount.js b/uno/web/cards/special/PlusAmount.js index 9c68342..2b81b79 100644 --- a/uno/web/cards/special/PlusAmount.js +++ b/uno/web/cards/special/PlusAmount.js @@ -18,7 +18,7 @@ export default class PlusAmount extends Card { //Führt eigene Logik aus (+Amount Karten für den nächsten Spieler) putSelf() { - if (this.color !== CARD_COLORS[0]){ + if (this.color !== CARD_COLORS[0] && this.plus === 4){ super.putSelf(); return; } @@ -45,6 +45,9 @@ export default class PlusAmount extends Card { this.game.style.showSelectColor(this); } + if(this.plus === 2) + super.putSelf(); + } //Gibt den PlusWert der Karte zurück