Add optional asso pigliatutto rule with a lobby toggle
CI / Build and push docker image (push) Successful in 3m16s
CI / Build and push docker image (push) Successful in 3m16s
An ace played when no equal rank is on the table sweeps the whole table; the sweep never scores a scopa, and an ace already on the table still forces the mandatory equal-rank capture. The rule is off by default, selectable per match via the schema-driven creation form, and announced in the game view.
This commit is contained in:
@@ -63,6 +63,9 @@ fn move_banner(mv: MoveView) -> View {
|
||||
.map(|c| card_img(c.clone(), "move-card"))
|
||||
.collect::<Vec<_>>();
|
||||
let scopa = mv.scopa.then(|| view! { span(class="scopa-badge") { "Scopa!" } });
|
||||
let pigliatutto = mv
|
||||
.pigliatutto
|
||||
.then(|| view! { span(class="pigliatutto-badge") { "Asso pigliatutto!" } });
|
||||
view! {
|
||||
div(class="move-banner") {
|
||||
strong { (name) }
|
||||
@@ -70,6 +73,7 @@ fn move_banner(mv: MoveView) -> View {
|
||||
(played)
|
||||
(captured)
|
||||
(scopa)
|
||||
(pigliatutto)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -565,6 +569,9 @@ fn table_view(
|
||||
let banner = game.last_move.clone().map(move_banner);
|
||||
let hand_number = game.hand_number;
|
||||
let target_score = game.target_score;
|
||||
let rule_badge = game.asso_pigliatutto.then(|| view! {
|
||||
span(class="pigliatutto-badge") { "Asso pigliatutto" }
|
||||
});
|
||||
|
||||
let viewer = player_for_seat(&game, viewer_seat);
|
||||
let my_captured = viewer.as_ref().map(|p| p.captured_count).unwrap_or(0);
|
||||
@@ -602,6 +609,7 @@ fn table_view(
|
||||
div(class="hud") {
|
||||
a(href="/") { "← Lobby" }
|
||||
span { "Hand " (hand_number) }
|
||||
(rule_badge)
|
||||
span(class="hud-scores") {
|
||||
"Team A " (scores.a) " — " (scores.b) " Team B (target "
|
||||
(target_score) ")"
|
||||
|
||||
Reference in New Issue
Block a user