mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-05-14 01:21:49 +00:00
fix: devweb - Correction of comparison between gameCard and playerCard.
This commit is contained in:
@@ -105,7 +105,7 @@ public class GameWS {
|
||||
|
||||
int playerScore = player.getScore();
|
||||
Card gameCard = game.getDeck().getCards().get(game.getCurrentRound());
|
||||
Card playerCard = player.getDeck().getCards().get(game.getCurrentRound());
|
||||
Card playerCard = player.getDeck().getCards().get((player.getPartialRightClickCount()+player.getRightClickCount()) % player.getDeck().getCards().size());
|
||||
|
||||
player.setCurrentClick(choice);
|
||||
|
||||
@@ -136,23 +136,18 @@ public class GameWS {
|
||||
player.incrementRightClickCount();
|
||||
player.setScore(playerScore + 2);
|
||||
} else {
|
||||
if (isRapid) {
|
||||
player.incrementRapidClickCount();
|
||||
playerScore++;
|
||||
}
|
||||
player.setScore(playerScore - 1);
|
||||
}
|
||||
}
|
||||
case COLOR -> {
|
||||
if (gameCard.getColor().equals(playerCard.getColor())) {
|
||||
if (gameCard.getValue() != playerCard.getValue()) {
|
||||
if (!gameCard.equals(playerCard)) {
|
||||
if (isRapid) {
|
||||
player.incrementRapidClickCount();
|
||||
playerScore++;
|
||||
}
|
||||
player.incrementRightClickCount();
|
||||
player.setScore(playerScore + 2);
|
||||
|
||||
} else {
|
||||
player.incrementPartialRightClickCount();
|
||||
player.setScore(playerScore + 1);
|
||||
@@ -163,7 +158,7 @@ public class GameWS {
|
||||
}
|
||||
case VALUE -> {
|
||||
if (gameCard.getValue() == playerCard.getValue()) {
|
||||
if (!gameCard.getColor().equals(playerCard.getColor())) {
|
||||
if (!gameCard.equals(playerCard)) {
|
||||
if (isRapid) {
|
||||
player.incrementRapidClickCount();
|
||||
playerScore++;
|
||||
@@ -207,7 +202,6 @@ public class GameWS {
|
||||
player.incrementRightClickCount();
|
||||
player.setScore(playerScore + 2);
|
||||
} else {
|
||||
|
||||
player.setScore(playerScore - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ export default class PlayerHand {
|
||||
<div class="pb-1 pt-1">
|
||||
<p class="has-text-centered has-text-white title is-4 mb-1">${this.player.user.username}</p>
|
||||
<p class="has-text-centered has-text-white title is-5">${this.player.score}</p>
|
||||
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -29,6 +28,5 @@ export default class PlayerHand {
|
||||
${textPosition === PlayerHand.TextPosition.BOTTOM ? text : ""}
|
||||
</div>
|
||||
`;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user