feat(ui): implement tie & trump menu, fixed some critical bugs (#52)
Co-authored-by: LQ63 <lkhermann@web.de> Reviewed-on: #52 Co-authored-by: Janis <janis.e.20@gmx.de> Co-committed-by: Janis <janis.e.20@gmx.de>
This commit is contained in:
Submodule knockoutwhist updated: b9a7b0a2af...5aa1cef356
@@ -33,6 +33,10 @@
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
}
|
||||
.lobby-background {
|
||||
background-color: @background-color;
|
||||
|
||||
}
|
||||
|
||||
.navbar-header{
|
||||
text-align:center;
|
||||
@@ -78,6 +82,10 @@ body {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.navbar-drop-shadow {
|
||||
box-shadow: 0 1px 15px 0 #000000
|
||||
}
|
||||
|
||||
#sessions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -228,4 +236,36 @@ body {
|
||||
}
|
||||
.score-row {
|
||||
color: #000000;
|
||||
}
|
||||
}
|
||||
|
||||
/* In-game centered stage and blurred sides overlay */
|
||||
.ingame-stage {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
|
||||
/* Wrapper that adds a backdrop blur to the background outside the centered card */
|
||||
.blur-sides {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Create an overlay that blurs everything behind it, except the central content area */
|
||||
.blur-sides::before {
|
||||
content: "";
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
/* fallback: subtle vignette if backdrop-filter unsupported */
|
||||
background: radial-gradient(ellipse at center, rgba(0,0,0,0) 30%, rgba(0,0,0,0.35) 100%);
|
||||
}
|
||||
|
||||
@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
|
||||
.blur-sides::before {
|
||||
background: rgba(0,0,0,0.08);
|
||||
-webkit-backdrop-filter: blur(10px) saturate(110%);
|
||||
backdrop-filter: blur(10px) saturate(110%);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,12 +39,14 @@ class IngameController @Inject()(
|
||||
case SelectTrump =>
|
||||
Ok(views.html.ingame.selecttrump(
|
||||
g.getPlayerByUser(request.user),
|
||||
g.logic
|
||||
g.logic,
|
||||
gameId
|
||||
))
|
||||
case TieBreak =>
|
||||
Ok(views.html.ingame.tie(
|
||||
g.getPlayerByUser(request.user),
|
||||
g.logic
|
||||
g.logic,
|
||||
gameId
|
||||
))
|
||||
case _ =>
|
||||
InternalServerError(s"Invalid game state for in-game view. GameId: $gameId" + s" State: ${g.logic.getCurrentState}")
|
||||
@@ -318,7 +320,7 @@ class IngameController @Inject()(
|
||||
val session = g.getUserSession(request.user.id)
|
||||
optSession = Some(session)
|
||||
session.lock.lock()
|
||||
g.selectTie(g.getUserSession(request.user.id), tie.toInt)
|
||||
g.selectTie(g.getUserSession(request.user.id), tie.toInt - 1)
|
||||
}
|
||||
optSession.foreach(_.lock.unlock())
|
||||
if (result.isSuccess) {
|
||||
|
||||
@@ -157,6 +157,9 @@ class GameLobby private(
|
||||
*/
|
||||
def selectTie(userSession: UserSession, tieNumber: Int): Unit = {
|
||||
val player = getPlayerInteractable(userSession, InteractionType.TieChoice)
|
||||
val highestNumber = logic.playerTieLogic.highestAllowedNumber()
|
||||
if (tieNumber < 0 || tieNumber > highestNumber)
|
||||
throw new IllegalArgumentException(s"Selected number $tieNumber is out of allowed range (0 to $highestNumber)")
|
||||
userSession.resetCanInteract()
|
||||
logic.playerTieLogic.receivedTieBreakerCard(tieNumber)
|
||||
}
|
||||
|
||||
@@ -1,27 +1,72 @@
|
||||
@(player: de.knockoutwhist.player.AbstractPlayer, logic: de.knockoutwhist.control.GameLogic)
|
||||
@(player: de.knockoutwhist.player.AbstractPlayer, logic: de.knockoutwhist.control.GameLogic, gameId: String)
|
||||
|
||||
@main("Selecting Trumpsuit...") {
|
||||
<div id="selecttrumpsuit" class="game-field game-field-background">
|
||||
@if(player.equals(logic.getCurrentMatch.get.roundlist.last.winner.get)) {
|
||||
<h1>Knockout Whist</h1>
|
||||
<p>You (@player.toString) have won the last round! Select a trumpsuit for the next round!</p>
|
||||
<p>Available trumpsuits are displayed below:</p>
|
||||
<div id="playercards">
|
||||
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Spades))
|
||||
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Clubs))
|
||||
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Hearts))
|
||||
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Diamonds))
|
||||
</div>
|
||||
<p>Your cards</p>
|
||||
<div class="ingame-stage blur-sides">
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header text-center">
|
||||
<h3 class="mb-0">Select Trump Suit</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(player.equals(logic.getCurrentMatch.get.roundlist.last.winner.get)) {
|
||||
<div class="alert alert-info" role="alert" aria-live="polite">
|
||||
You (@player.toString) won the last round. Choose the trump suit for the next round.
|
||||
</div>
|
||||
|
||||
<div id="playercards">
|
||||
@for(card <- player.currentHand().get.cards) {
|
||||
@util.WebUIUtils.cardtoImage(card)
|
||||
}
|
||||
<div class="row justify-content-center col-auto mb-5">
|
||||
<div class="col-auto handcard">
|
||||
<form action="@routes.IngameController.playTrump(gameId)" method="post">
|
||||
<input type="hidden" name="cardId" value="0" />
|
||||
<button type="submit" class="btn btn-outline-light p-0 border-0 shadow-none" name="trump" value="0" style="border-radius: 6px">
|
||||
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Spades)) width="120px" style="border-radius: 6px"/>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-auto handcard">
|
||||
<form action="@routes.IngameController.playTrump(gameId)" method="post">
|
||||
<input type="hidden" name="cardId" value="1" />
|
||||
<button type="submit" class="btn btn-outline-light p-0 border-0 shadow-none" name="trump" value="1" style="border-radius: 6px">
|
||||
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Hearts)) width="120px" style="border-radius: 6px"/>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-auto handcard">
|
||||
<form action="@routes.IngameController.playTrump(gameId)" method="post">
|
||||
<input type="hidden" name="cardId" value="2" />
|
||||
<button type="submit" class="btn btn-outline-light p-0 border-0 shadow-none" name="trump" value="2" style="border-radius: 6px">
|
||||
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Diamonds)) width="120px" style="border-radius: 6px"/>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-auto handcard">
|
||||
<form action="@routes.IngameController.playTrump(gameId)" method="post">
|
||||
<input type="hidden" name="cardId" value="3" />
|
||||
<button type="submit" class="btn btn-outline-light p-0 border-0 shadow-none" name="trump" value="3" style="border-radius: 6px">
|
||||
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Clubs)) width="120px" style="border-radius: 6px"/>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row justify-content-center" id="card-slide">
|
||||
@for(i <- player.currentHand().get.cards.indices) {
|
||||
<div class="col-auto" style="border-radius: 6px">
|
||||
@util.WebUIUtils.cardtoImage(player.currentHand().get.cards(i)) width="120px" style="border-radius: 6px"/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
} else {
|
||||
<div class="alert alert-warning" role="alert" aria-live="polite">
|
||||
@logic.getCurrentMatch.get.roundlist.last.winner.get.name is choosing a trumpsuit. The new round will start once a suit is picked.
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
} else {
|
||||
<h1>Knockout Whist</h1>
|
||||
<p>@player.toString is choosing a trumpsuit. Starting new round when @player.toString picked a trumpsuit...</p>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -1,27 +1,107 @@
|
||||
@(player: de.knockoutwhist.player.AbstractPlayer, logic: de.knockoutwhist.control.GameLogic)
|
||||
@(player: de.knockoutwhist.player.AbstractPlayer, logic: de.knockoutwhist.control.GameLogic, gameId: String)
|
||||
|
||||
@main("Tie") {
|
||||
<div id="tie" class="game-field game-field-background">
|
||||
<h1>Knockout Whist</h1>
|
||||
<p>The last Round was tied between
|
||||
@for(players <- logic.playerTieLogic.getTiedPlayers) {
|
||||
@players
|
||||
}
|
||||
</p>
|
||||
@if(player.equals(logic.playerTieLogic.currentTiePlayer())) {
|
||||
<p>Pick a card between 1 and @logic.playerTieLogic.highestAllowedNumber()! The resulting card will be your card for the cut.</p>
|
||||
} else {
|
||||
<p>@logic.playerTieLogic.currentTiePlayer() is currently picking his number for the cut.</p>
|
||||
<p>Currently picked Cards:</p>
|
||||
<div id="cardsplayed">
|
||||
@for((player, card) <- logic.playerTieLogic.getSelectedCard) {
|
||||
<div id="playedcardplayer">
|
||||
<p>@player</p>
|
||||
@util.WebUIUtils.cardtoImage(card)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="ingame-stage blur-sides">
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 col-md-10 col-lg-8">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header text-center">
|
||||
<h3 class="mb-0">Tie Break</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<p class="card-text">
|
||||
The last round was tied between:
|
||||
<span class="ms-1">
|
||||
@for(players <- logic.playerTieLogic.getTiedPlayers) {
|
||||
<span class="badge text-bg-secondary me-1">@players</span>
|
||||
}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@if(player.equals(logic.playerTieLogic.currentTiePlayer())) {
|
||||
@defining(logic.playerTieLogic.highestAllowedNumber()) { maxNum =>
|
||||
<div class="alert alert-info" role="alert" aria-live="polite">
|
||||
Pick a number between 1 and @{maxNum + 1}. The resulting card will be your card for the cut.
|
||||
</div>
|
||||
|
||||
<form class="row g-2 align-items-center" method="post" action="@routes.IngameController.playTie(gameId)">
|
||||
<div class="col-auto">
|
||||
<label for="tieNumber" class="col-form-label">Your number</label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="number" id="tieNumber" class="form-control" name="tie" min="1" max="@{maxNum + 1}" placeholder="1" required>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary">Confirm</button>
|
||||
</div>
|
||||
</form>
|
||||
<h6 class="mt-4 mb-3">Currently Picked Cards</h6>
|
||||
|
||||
<div id="cardsplayed" class="row g-3 justify-content-center">
|
||||
@if(logic.playerTieLogic.getSelectedCard.nonEmpty) {
|
||||
@for((player, card) <- logic.playerTieLogic.getSelectedCard) {
|
||||
<div class="col-6">
|
||||
<div class="card shadow-sm border-0 h-100 text-center">
|
||||
<div class="card-body d-flex flex-column justify-content-between">
|
||||
<p class="card-text fw-semibold mb-2 text-primary">@player</p>
|
||||
<div class="card-img-top">
|
||||
@util.WebUIUtils.cardtoImage(card)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
} else {
|
||||
<div class="col-12">
|
||||
<div class="alert alert-info text-center" role="alert">
|
||||
<i class="bi bi-info-circle me-2"></i>
|
||||
No cards have been selected yet.
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
} else {
|
||||
<div class="alert alert-warning" role="alert" aria-live="polite">
|
||||
<strong>@logic.playerTieLogic.currentTiePlayer()</strong> is currently picking a number for the cut.
|
||||
</div>
|
||||
|
||||
<h6 class="mt-4 mb-3">Currently Picked Cards</h6>
|
||||
|
||||
<div id="cardsplayed" class="row g-3 justify-content-center">
|
||||
@if(logic.playerTieLogic.getSelectedCard.nonEmpty) {
|
||||
@for((player, card) <- logic.playerTieLogic.getSelectedCard) {
|
||||
<div class="col-6 col-sm-4 col-md-3 col-lg-2">
|
||||
<div class="card shadow-sm border-0 h-100 text-center">
|
||||
<div class="card-body d-flex flex-column justify-content-between">
|
||||
<p class="card-text fw-semibold mb-2 text-primary">@player</p>
|
||||
<div class="card-img-top">
|
||||
@util.WebUIUtils.cardtoImage(card)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
} else {
|
||||
<div class="col-12">
|
||||
<div class="alert alert-info text-center" role="alert">
|
||||
<i class="bi bi-info-circle me-2"></i>
|
||||
No cards have been selected yet.
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
@* And here's where we render the `Html` object containing
|
||||
* the page content. *@
|
||||
@content
|
||||
|
||||
<script src="@routes.JavaScriptRoutingController.javascriptRoutes()" type="text/javascript"></script>
|
||||
<script src="@routes.Assets.versioned("javascripts/main.js")" type="text/javascript"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@main("Create Game") {
|
||||
@navbar(user)
|
||||
<main class="lobby-background flex-grow-1">
|
||||
<div class="w-50 mx-auto">
|
||||
<div class="25 mx-auto">
|
||||
<div class="mt-3">
|
||||
<label for="lobbyname" class="form-label">Lobby-Name</label>
|
||||
<input type="text" class="form-control" id="lobbyname" name="lobbyname" placeholder="Lobby 1" required>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@(user: Option[model.users.User])
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<div class="container d-flex justify-content-left">
|
||||
<div class="container d-flex justify-content-start">
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navBar" aria-controls="navBar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
@@ -2,75 +2,179 @@
|
||||
|
||||
@main("Rules") {
|
||||
@navbar(user)
|
||||
<div id="rules">
|
||||
<div class="container my-4">
|
||||
<div class="card shadow-sm rounded-3">
|
||||
<div class="card-header text-white text-center">
|
||||
<h4 class="mb-0 text-body">Game Rules Overview</h4>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover mb-0 align-middle">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th scope="col">Section</th>
|
||||
<th scope="col">Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Players</td>
|
||||
<td>Two to seven players. The aim is to be the last player left in the game.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aim</td>
|
||||
<td>To be the last player left at the end of the game, with the object in each hand being to win a majority of tricks.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Equipment</td>
|
||||
<td>A standard 52-card pack is used.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Card Ranks</td>
|
||||
<td>In each suit, cards rank from highest to lowest: A K Q J 10 9 8 7 6 5 4 3 2.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Deal (First Hand)</td>
|
||||
<td>The dealer deals seven cards to each player. One card is turned up to determine the trump suit for the round.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Deal (Subsequent Hands)</td>
|
||||
<td>The deal rotates clockwise. The player who took the most tricks in the previous hand selects the trump suit. If there's a tie, players cut cards to decide who calls trumps. One fewer card is dealt in each successive hand until the final hand consists of one card each.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Play</td>
|
||||
<td>The player to the dealer's left (eldest hand) leads the first trick. Any card can be led. Other players must follow suit if possible. A player with no cards of the suit led may play any card.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Winning a Trick</td>
|
||||
<td>The highest card of the suit led wins, unless a trump is played, in which case the highest trump wins. The winner of the trick leads the next.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Leading Trumps</td>
|
||||
<td>Some rules disallow leading trumps before the suit has been 'broken' (a trump has been played to the lead of another suit). Leading trumps is always permissible if a player holds only trumps.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Knockout</td>
|
||||
<td>At the end of each hand, any player who took no tricks is knocked out and takes no further part in the game.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Winning the Game</td>
|
||||
<td>The game is won when a player takes all the tricks in a round, as all other players are knocked out, leaving only one player remaining.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dog Life</td>
|
||||
<td>The first player who takes no tricks is awarded a "dog's life". In the next hand, that player is dealt one card and can decide which trick to play it to. Each time a trick is played the "dog" may either play the card or knock on the table and wait to play it later. If the dog wins a trick, the player to the left leads the next and the dog re-enters the game properly in the next hand. If the dog fails, they are knocked out.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<main class="lobby-background flex-grow-1">
|
||||
<div class="container my-4" style="max-width:980px;">
|
||||
<div class="card rules-card shadow-sm rounded-3 overflow-hidden">
|
||||
<div class="card-header text-center py-3 border-0">
|
||||
<h3 class="mb-0 rules-title">Game Rules Overview</h3>
|
||||
</div>
|
||||
|
||||
<div class="card-body p-0">
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div class="accordion rules-accordion" id="rulesAccordion">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingPlayers">
|
||||
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapsePlayers" aria-expanded="true" aria-controls="collapsePlayers">
|
||||
Players
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapsePlayers" class="accordion-collapse collapse show" aria-labelledby="headingPlayers" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
Two to seven players. The aim is to be the last player left in the game.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingAim">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseAim" aria-expanded="false" aria-controls="collapseAim">
|
||||
Aim
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseAim" class="accordion-collapse collapse" aria-labelledby="headingAim" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
To be the last player left at the end of the game, with the object in each hand being to win a majority of tricks.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingEquipment">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseEquipment" aria-expanded="false" aria-controls="collapseEquipment">
|
||||
Equipment
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseEquipment" class="accordion-collapse collapse" aria-labelledby="headingEquipment" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
A standard 52-card pack is used.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingRanks">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseRanks" aria-expanded="false" aria-controls="collapseRanks">
|
||||
Card Ranks
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseRanks" class="accordion-collapse collapse" aria-labelledby="headingRanks" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
In each suit, cards rank from highest to lowest: A K Q J 10 9 8 7 6 5 4 3 2.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingDealFirst">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseDealFirst" aria-expanded="false" aria-controls="collapseDealFirst">
|
||||
Deal (First Hand)
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseDealFirst" class="accordion-collapse collapse" aria-labelledby="headingDealFirst" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
The dealer deals seven cards to each player. One card is turned up to determine the trump suit for the round.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingDealSubsequent">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseDealSubsequent" aria-expanded="false" aria-controls="collapseDealSubsequent">
|
||||
Deal (Subsequent Hands)
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseDealSubsequent" class="accordion-collapse collapse" aria-labelledby="headingDealSubsequent" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
The deal rotates clockwise. The player who took the most tricks in the previous hand selects the trump suit. If there's a tie, players cut cards to decide who calls trumps. One fewer card is dealt in each successive hand until the final hand consists of one card each.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingPlay">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapsePlay" aria-expanded="false" aria-controls="collapsePlay">
|
||||
Play
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapsePlay" class="accordion-collapse collapse" aria-labelledby="headingPlay" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
The player to the dealer's left (eldest hand) leads the first trick. Any card can be led. Other players must follow suit if possible. A player with no cards of the suit led may play any card.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingWinningTrick">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseWinningTrick" aria-expanded="false" aria-controls="collapseWinningTrick">
|
||||
Winning a Trick
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseWinningTrick" class="accordion-collapse collapse" aria-labelledby="headingWinningTrick" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
The highest card of the suit led wins, unless a trump is played, in which case the highest trump wins. The winner of the trick leads the next.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingLeadingTrumps">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseLeadingTrumps" aria-expanded="false" aria-controls="collapseLeadingTrumps">
|
||||
Leading Trumps
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseLeadingTrumps" class="accordion-collapse collapse" aria-labelledby="headingLeadingTrumps" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
Some rules disallow leading trumps before the suit has been 'broken' (a trump has been played to the lead of another suit). Leading trumps is always permissible if a player holds only trumps.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingKnockout">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseKnockout" aria-expanded="false" aria-controls="collapseKnockout">
|
||||
Knockout
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseKnockout" class="accordion-collapse collapse" aria-labelledby="headingKnockout" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
At the end of each hand, any player who took no tricks is knocked out and takes no further part in the game.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingWinningGame">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseWinningGame" aria-expanded="false" aria-controls="collapseWinningGame">
|
||||
Winning the Game
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseWinningGame" class="accordion-collapse collapse" aria-labelledby="headingWinningGame" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
The game is won when a player takes all the tricks in a round, as all other players are knocked out, leaving only one player remaining.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="headingDogLife">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseDogLife" aria-expanded="false" aria-controls="collapseDogLife">
|
||||
Dog Life
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapseDogLife" class="accordion-collapse collapse" aria-labelledby="headingDogLife" data-bs-parent="#rulesAccordion">
|
||||
<div class="accordion-body">
|
||||
The first player who takes no tricks is awarded a \"dog's life\". In the next hand, that player is dealt one card and can decide which trick to play it to. Each time a trick is played the dog may either play the card or knock on the table and wait to play it later. If the dog wins a trick, the player to the left leads the next and the dog re-enters the game properly in the next hand. If the dog fails, they are knocked out.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</main>
|
||||
}
|
||||
|
||||
@@ -27,5 +27,10 @@ GET /game/:id controllers.IngameController.game(id: String
|
||||
GET /game/:id/join controllers.IngameController.joinGame(id: String)
|
||||
GET /game/:id/start controllers.IngameController.startGame(id: String)
|
||||
POST /game/:id/kickPlayer controllers.IngameController.kickPlayer(id: String, playerId: String)
|
||||
|
||||
POST /game/:id/trump controllers.IngameController.playTrump(id: String)
|
||||
POST /game/:id/tie controllers.IngameController.playTie(id: String)
|
||||
|
||||
POST /game/:id/kickPlayer controllers.IngameController.kickPlayer(id: String, playerId: java.util.UUID)
|
||||
GET /game/:id/leaveGame controllers.IngameController.leaveGame(id: String)
|
||||
POST /game/:id/playCard controllers.IngameController.playCard(id: String)
|
||||
Reference in New Issue
Block a user