diff --git a/frontend/js/game.js b/frontend/js/game.js index ad59f4e..61613c1 100644 --- a/frontend/js/game.js +++ b/frontend/js/game.js @@ -192,14 +192,19 @@ class Game { const hand = this.hands[player]; dir = (player - this.turn) % 4; console.assert(dir == 1); - this.hands[player].makeGroup(tiles, this.discards[player].beingStollen(), dir); + this.hands[player].makeGroup(tiles, this.discards[this.turn].beeingStollen(), dir); } pon(player, tiles, dir) { const hand = this.hands[player]; dir = (player - this.turn) % 4; console.assert(dir == 1); - this.hands[player].makeGroup(tiles, this.discards[player].beingStollen(), dir); + this.hands[player].makeGroup(tiles, this.discards[this.turn].beeingStollen(), dir); + } + + canPon(player) { + const lastTile = this.discards[this.turn].tiles[this.discards[this.turn].tiles.length - 1]; + return this.hands[player].tiles.filter(t => t.equals(lastTile)).length >= 2; } botPlay() { diff --git a/frontend/pages/riichi/chap5.html b/frontend/pages/riichi/chap5.html index f87b780..23baeea 100644 --- a/frontend/pages/riichi/chap5.html +++ b/frontend/pages/riichi/chap5.html @@ -296,6 +296,63 @@ left: 37%; width: 250px; } + + #call-panel { + position: fixed; + bottom: 20px; + left: 50%; + transform: translateX(-50%); + display: none; + gap: 10px; + z-index: 100; + } + + .call-button { + padding: 16px 32px; + font-size: 1.3em; + font-weight: bold; + border: none; + border-radius: 8px; + cursor: pointer; + color: white; + transition: all 0.3s ease; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + } + + .call-button:hover { + transform: scale(1.05); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); + } + + .call-button:active { + transform: scale(0.95); + } + + /* Code couleur pour les 6 appels */ + #pon-button { + background-color: #FF6B6B; /* Rouge */ + } + + #chii-button { + background-color: #4ECDC4; /* Turquoise */ + } + + #kan-button { + background-color: #95E1D3; /* Menthe */ + } + + #tsumo-button { + background-color: #FFD700; /* Or */ + color: #333; + } + + #ron-button { + background-color: #9B59B6; /* Violet */ + } + + #skip-button { + background-color: #808080; /* Gris */ + } @@ -330,6 +387,15 @@ +
+ + + + + + +
+