diff --git a/public/game.html b/public/game.html index a2fc966..3515a0f 100644 --- a/public/game.html +++ b/public/game.html @@ -1101,24 +1101,28 @@ const cid = (c.cardId || c.id || '').toString().toLowerCase(); const title = (c.title || '').toString().toLowerCase(); let imgSrc = null; - if(cid === 'adoubement' || title.indexOf('adoub') !== -1) imgSrc = '/assets/img/cards/adoubement.png'; - if(cid === 'folie' || title.indexOf('folie') !== -1 || title.indexOf('fou') !== -1) imgSrc = '/assets/img/cards/folie.png'; - if(cid === 'fortification' || title.indexOf('fortification') !== -1 || title.indexOf('fortif') !== -1) imgSrc = '/assets/img/cards/fortification.png'; - if(cid === 'rebond' || title.indexOf('rebond') !== -1) imgSrc = '/assets/img/cards/rebond.png'; - if(cid === 'anneau' || title.indexOf('anneau') !== -1) imgSrc = '/assets/img/cards/anneau.png'; - if(cid === 'brouillard' || title.indexOf('brouillard') !== -1) imgSrc = '/assets/img/cards/brouillard.png'; - if(cid === 'coin' || title.indexOf('coin') !== -1) imgSrc = '/assets/img/cards/coincoin.png'; - if(cid === 'inversion' || title.indexOf('inversion') !== -1) imgSrc = '/assets/img/cards/inversion.png'; - if(cid === 'invisible' || title.indexOf('invisible') !== -1) imgSrc = '/assets/img/cards/invisible.png'; - if(cid === 'kamikaz' || title.indexOf('kamikaz') !== -1) imgSrc = '/assets/img/cards/kamikaz.png'; - if(cid === 'melange' || title.indexOf('melange') !== -1 || title.indexOf('melange') !== -1) imgSrc = '/assets/img/cards/mélange.png'; - if(cid === 'mine' || title.indexOf('mine') !== -1) imgSrc = '/assets/img/cards/mine.png'; - if(cid === 'promotion' || title.indexOf('promotion') !== -1) imgSrc = '/assets/img/cards/promotion.png'; - if(cid === 'resurection' || title.indexOf('resurection') !== -1 || title.indexOf('résurection') !== -1) imgSrc = '/assets/img/cards/resurection.png'; - if(cid === 'sniper' || title.indexOf('sniper') !== -1) imgSrc = '/assets/img/cards/sniper.png'; - if(cid === 'totem' || title.indexOf('totem') !== -1) imgSrc = '/assets/img/cards/totem.png'; - if(cid === 'toucher' || title.indexOf('toucher') !== -1) imgSrc = '/assets/img/cards/toucher.png'; - if(cid === 'vole_piece' || title.indexOf('vole_piece') !== -1) imgSrc = '/assets/img/cards/vole_piece.png'; + if(cid === 'adoubement') imgSrc = '/assets/img/cards/adoubement.png'; + if(cid === 'folie') imgSrc = '/assets/img/cards/folie.png'; + if(cid === 'fortification') imgSrc = '/assets/img/cards/fortification.png'; + if(cid === 'rebond') imgSrc = '/assets/img/cards/rebond.png'; + if(cid === 'anneau') imgSrc = '/assets/img/cards/anneau.png'; + if(cid === 'brouillard') imgSrc = '/assets/img/cards/brouillard.png'; + if(cid === 'coincoin') imgSrc = '/assets/img/cards/coincoin.png'; + if(cid === 'inversion') imgSrc = '/assets/img/cards/inversion.png'; + if(cid === 'invisible') imgSrc = '/assets/img/cards/invisible.png'; + if(cid === 'kamikaze') imgSrc = '/assets/img/cards/kamikaz.png'; + if(cid === 'melange') imgSrc = '/assets/img/cards/mélange.png'; + if(cid === 'mine') imgSrc = '/assets/img/cards/mine.png'; + if(cid === 'promotion') imgSrc = '/assets/img/cards/promotion.png'; + if(cid === 'resurection') imgSrc = '/assets/img/cards/resurection.png'; + if(cid === 'sniper') imgSrc = '/assets/img/cards/sniper.png'; + if(cid === 'totem') imgSrc = '/assets/img/cards/totem.png'; + if(cid === 'toucher') imgSrc = '/assets/img/cards/toucher.png'; + if(cid === 'vole_piece') imgSrc = '/assets/img/cards/vole_piece.png'; + if(cid === 'double') imgSrc = '/assets/img/cards/double.png'; + if(cid === 'empathie') imgSrc = '/assets/img/cards/empathie.png'; + if(cid === 'parrure') imgSrc = '/assets/img/cards/parrure.png'; + if(cid === 'revolution') imgSrc = '/assets/img/cards/révolution.png'; if(imgSrc){ const img = document.createElement('img'); img.src = imgSrc; diff --git a/public/index.html b/public/index.html index fb9a1f8..b1c5a82 100644 --- a/public/index.html +++ b/public/index.html @@ -9,8 +9,7 @@
-
ChessNut — Salle d'attente
-
Préparez-vous, invitez un ami et lancez la partie quand tout le monde est prêt.
+
ChessNut
Voir sur GitHub
@@ -19,7 +18,7 @@
- +
@@ -117,28 +116,28 @@ const cid = (c.cardId || c.id || '').toString().toLowerCase(); const title = (c.title || '').toString().toLowerCase(); let imgSrc = null; - if(cid === 'adoubement' || title.indexOf('adoub') !== -1) imgSrc = '/assets/img/cards/adoubement.png'; - if(cid === 'folie' || title.indexOf('folie') !== -1 || title.indexOf('fou') !== -1) imgSrc = '/assets/img/cards/folie.png'; - if(cid === 'fortification' || title.indexOf('fortification') !== -1 || title.indexOf('fortif') !== -1) imgSrc = '/assets/img/cards/fortification.png'; - if(cid === 'rebond' || title.indexOf('rebond') !== -1) imgSrc = '/assets/img/cards/rebond.png'; - if(cid === 'anneau' || title.indexOf('anneau') !== -1) imgSrc = '/assets/img/cards/anneau.png'; - if(cid === 'brouillard' || title.indexOf('brouillard') !== -1) imgSrc = '/assets/img/cards/brouillard.png'; - if(cid === 'coin' || title.indexOf('coin') !== -1) imgSrc = '/assets/img/cards/coincoin.png'; - if(cid === 'inversion' || title.indexOf('inversion') !== -1) imgSrc = '/assets/img/cards/inversion.png'; - if(cid === 'invisible' || title.indexOf('invisible') !== -1) imgSrc = '/assets/img/cards/invisible.png'; - if(cid === 'kamikaz' || title.indexOf('kamikaz') !== -1) imgSrc = '/assets/img/cards/kamikaz.png'; - if(cid === 'melange' || title.indexOf('melange') !== -1 || title.indexOf('melange') !== -1) imgSrc = '/assets/img/cards/mélange.png'; - if(cid === 'mine' || title.indexOf('mine') !== -1) imgSrc = '/assets/img/cards/mine.png'; - if(cid === 'promotion' || title.indexOf('promotion') !== -1) imgSrc = '/assets/img/cards/promotion.png'; - if(cid === 'resurection' || title.indexOf('resurection') !== -1 || title.indexOf('résurection') !== -1) imgSrc = '/assets/img/cards/resurection.png'; - if(cid === 'sniper' || title.indexOf('sniper') !== -1) imgSrc = '/assets/img/cards/sniper.png'; - if(cid === 'totem' || title.indexOf('totem') !== -1) imgSrc = '/assets/img/cards/totem.png'; - if(cid === 'toucher' || title.indexOf('toucher') !== -1) imgSrc = '/assets/img/cards/toucher.png'; - if(cid === 'vole' || title.indexOf('vole') !== -1 || title.indexOf('vole') !== -1) imgSrc = '/assets/img/cards/vole_piece.png'; - if(cid === 'jouer_deux_fois' || title.indexOf('jouer deux fois') !== -1) imgSrc = '/assets/img/cards/double.png'; - if(cid === 'empathie' || title.indexOf('empathie') !== -1) imgSrc = '/assets/img/cards/empathie.png'; - if(cid === 'parrure' || title.indexOf('parrure') !== -1) imgSrc = '/assets/img/cards/parrure.png'; - if(cid === 'révolution' || title.indexOf('révolution') !== -1 || title.indexOf('revolution') !== -1) imgSrc = '/assets/img/cards/révolution.png'; + if(cid === 'adoubement') imgSrc = '/assets/img/cards/adoubement.png'; + if(cid === 'folie') imgSrc = '/assets/img/cards/folie.png'; + if(cid === 'fortification') imgSrc = '/assets/img/cards/fortification.png'; + if(cid === 'rebond') imgSrc = '/assets/img/cards/rebond.png'; + if(cid === 'anneau') imgSrc = '/assets/img/cards/anneau.png'; + if(cid === 'brouillard') imgSrc = '/assets/img/cards/brouillard.png'; + if(cid === 'coincoin') imgSrc = '/assets/img/cards/coincoin.png'; + if(cid === 'inversion') imgSrc = '/assets/img/cards/inversion.png'; + if(cid === 'invisible') imgSrc = '/assets/img/cards/invisible.png'; + if(cid === 'kamikaze') imgSrc = '/assets/img/cards/kamikaz.png'; + if(cid === 'melange') imgSrc = '/assets/img/cards/mélange.png'; + if(cid === 'mine') imgSrc = '/assets/img/cards/mine.png'; + if(cid === 'promotion') imgSrc = '/assets/img/cards/promotion.png'; + if(cid === 'resurection') imgSrc = '/assets/img/cards/resurection.png'; + if(cid === 'sniper') imgSrc = '/assets/img/cards/sniper.png'; + if(cid === 'totem') imgSrc = '/assets/img/cards/totem.png'; + if(cid === 'toucher') imgSrc = '/assets/img/cards/toucher.png'; + if(cid === 'vole_piece') imgSrc = '/assets/img/cards/vole_piece.png'; + if(cid === 'double') imgSrc = '/assets/img/cards/double.png'; + if(cid === 'empathie') imgSrc = '/assets/img/cards/empathie.png'; + if(cid === 'parrure') imgSrc = '/assets/img/cards/parrure.png'; + if(cid === 'revolution') imgSrc = '/assets/img/cards/révolution.png'; if(imgSrc){ const img = document.createElement('img'); img.src = imgSrc; img.alt = c.title || cid || 'card'; img.className = 'card-art-img'; img.style.width = '100%'; img.style.height = '100%'; img.style.objectFit = 'cover'; art.appendChild(img); } }catch(_){ } top.appendChild(art); diff --git a/public/waiting.html b/public/waiting.html index 02c37c3..ca63526 100644 --- a/public/waiting.html +++ b/public/waiting.html @@ -16,13 +16,11 @@
ChessNut — Salle d'attente
-
Préparez-vous, invitez un ami et lancez la partie quand tout le monde est prêt.
-
Room: -
-
Status: -
+
Partie: -
Joueurs: 0/2
@@ -375,24 +373,28 @@ const cid = (c.cardId || c.id || '').toString().toLowerCase(); const titleRaw = (c.title || '').toString().toLowerCase(); let imgSrc = null; - if(cid === 'adoubement' || title.indexOf('adoub') !== -1) imgSrc = '/assets/img/cards/adoubement.png'; - if(cid === 'folie' || title.indexOf('folie') !== -1 || title.indexOf('fou') !== -1) imgSrc = '/assets/img/cards/folie.png'; - if(cid === 'fortification' || title.indexOf('fortification') !== -1 || title.indexOf('fortif') !== -1) imgSrc = '/assets/img/cards/fortification.png'; - if(cid === 'rebond' || title.indexOf('rebond') !== -1) imgSrc = '/assets/img/cards/rebond.png'; - if(cid === 'anneau' || title.indexOf('anneau') !== -1) imgSrc = '/assets/img/cards/anneau.png'; - if(cid === 'brouillard' || title.indexOf('brouillard') !== -1) imgSrc = '/assets/img/cards/brouillard.png'; - if(cid === 'coin' || title.indexOf('coin') !== -1) imgSrc = '/assets/img/cards/coincoin.png'; - if(cid === 'inversion' || title.indexOf('inversion') !== -1) imgSrc = '/assets/img/cards/inversion.png'; - if(cid === 'invisible' || title.indexOf('invisible') !== -1) imgSrc = '/assets/img/cards/invisible.png'; - if(cid === 'kamikaz' || title.indexOf('kamikaz') !== -1) imgSrc = '/assets/img/cards/kamikaz.png'; - if(cid === 'melange' || title.indexOf('melange') !== -1 || title.indexOf('melange') !== -1) imgSrc = '/assets/img/cards/mélange.png'; - if(cid === 'mine' || title.indexOf('mine') !== -1) imgSrc = '/assets/img/cards/mine.png'; - if(cid === 'promotion' || title.indexOf('promotion') !== -1) imgSrc = '/assets/img/cards/promotion.png'; - if(cid === 'resurection' || title.indexOf('resurection') !== -1 || title.indexOf('résurection') !== -1) imgSrc = '/assets/img/cards/resurection.png'; - if(cid === 'sniper' || title.indexOf('sniper') !== -1) imgSrc = '/assets/img/cards/sniper.png'; - if(cid === 'totem' || title.indexOf('totem') !== -1) imgSrc = '/assets/img/cards/totem.png'; - if(cid === 'toucher' || title.indexOf('toucher') !== -1) imgSrc = '/assets/img/cards/toucher.png'; - if(cid === 'vole' || title.indexOf('vole') !== -1 || title.indexOf('vole') !== -1) imgSrc = '/assets/img/cards/vole_piece.png'; + if(cid === 'adoubement') imgSrc = '/assets/img/cards/adoubement.png'; + if(cid === 'folie') imgSrc = '/assets/img/cards/folie.png'; + if(cid === 'fortification') imgSrc = '/assets/img/cards/fortification.png'; + if(cid === 'rebond') imgSrc = '/assets/img/cards/rebond.png'; + if(cid === 'anneau') imgSrc = '/assets/img/cards/anneau.png'; + if(cid === 'brouillard') imgSrc = '/assets/img/cards/brouillard.png'; + if(cid === 'coincoin') imgSrc = '/assets/img/cards/coincoin.png'; + if(cid === 'inversion') imgSrc = '/assets/img/cards/inversion.png'; + if(cid === 'invisible') imgSrc = '/assets/img/cards/invisible.png'; + if(cid === 'kamikaze') imgSrc = '/assets/img/cards/kamikaz.png'; + if(cid === 'melange') imgSrc = '/assets/img/cards/mélange.png'; + if(cid === 'mine') imgSrc = '/assets/img/cards/mine.png'; + if(cid === 'promotion') imgSrc = '/assets/img/cards/promotion.png'; + if(cid === 'resurection') imgSrc = '/assets/img/cards/resurection.png'; + if(cid === 'sniper') imgSrc = '/assets/img/cards/sniper.png'; + if(cid === 'totem') imgSrc = '/assets/img/cards/totem.png'; + if(cid === 'toucher') imgSrc = '/assets/img/cards/toucher.png'; + if(cid === 'vole_piece') imgSrc = '/assets/img/cards/vole_piece.png'; + if(cid === 'double') imgSrc = '/assets/img/cards/double.png'; + if(cid === 'empathie') imgSrc = '/assets/img/cards/empathie.png'; + if(cid === 'parrure') imgSrc = '/assets/img/cards/parrure.png'; + if(cid === 'revolution') imgSrc = '/assets/img/cards/révolution.png'; if(imgSrc){ const img = document.createElement('img'); img.src = imgSrc; img.alt = c.title || cid || 'card'; img.className = 'card-art-img'; img.style.width='100%'; img.style.height='100%'; img.style.objectFit='cover'; art.appendChild(img); } }catch(e){} top.appendChild(art); diff --git a/server.js b/server.js index 5d5a36e..a134cf6 100644 --- a/server.js +++ b/server.js @@ -261,137 +261,137 @@ function checkAndHandleVictory(room){ function buildDefaultDeck(){ const cards = [ [ - 'rebondir sur les bords', + 'Rebondir sur les bords', 'Les déplacements en diagonales de la pièce sélectionnée peuvent rebondir une fois sur les bords', 'rebond' ], [ - 'adoubement', + 'Adoubement', 'La pièce sélectionnée peut maintenant faire les déplacements du cavalier en plus', 'adoubement' ], [ - 'folie', + 'Folie', 'La pièce sélectionnée peut maintenant faire les déplacements du fou en plus', 'folie' ], [ - 'fortification', + 'Fortification', 'La pièce sélectionnée peut maintenant faire les déplacements de la tour en plus', 'fortification' ], [ - "l'anneau", + "L'anneau", "Le plateau devient un anneau pendant un tour", "anneau" ], [ - 'brouillard de guerre', + 'Brouillard de guerre', 'Les joueur ne peuvent voir que au alentour de leurs pièces pendant 4 tours', 'brouillard' ], [ - 'jouer deux fois', + 'Jouer deux fois', 'Le joueur peut déplacer deux pièces', 'double' ], [ - "totem d'immunité", + "Totem d'immunité", "Annule l'effet de la prochaine carte jouée par l'adversaire", "totem" ], [ - 'placement de mines', + 'Placement de mines', 'Le joueur place une mine sur une case vide sans la révéler au joueur adverse. Une pièce qui se pose dessus explose et est capturée par le joueur ayant placé la mine', 'mine' ], [ - "vole d'une pièce", + "Vole d'une pièce", 'Désigne une pièce non roi qui change de camp.\n\nCompte comme un mouvement', 'vole_piece' ], [ - 'promotion', + 'Promotion', 'Un pion au choix est promu', 'promotion' ], [ - "vole d'une carte", + "Vole d'une carte", 'Vole une carte aléatoirement au joueur adverse', 'vole_carte' ], [ - 'resurection', + 'Resurection', 'Ressucite la dernière pièce perdue', 'resurection' ], [ - 'carte sans effet', + 'Carte sans effet', "N'a aucun effet", 'sans_effet' ], [ - 'kamikaze', + 'Kamikaze', 'Détruit une de ses pièces, détruisant toutes les pièces adjacentes.\n\nCompte comme un mouvement', 'kamikaze' ], [ - 'invisible', + 'Invisible', "Une des pièces devient invisible pour l'adversaire", 'invisible' ], [ - "coin coin", + "Coin-Coin", "Possibilité de se téléporter depuis un coin vers n'importe quel autre coin", 'coincoin' ], [ - 'téléportation', + 'Téléportation', "Téléporte n'importe quelle pièce de son camp sur une case vide", 'teleportation' ], [ - "toucher c'est jouer", + "Toucher c'est jouer", "Toucher une pièce adverse qu'il sera obligé de jouer", 'toucher' ], [ - 'sniper', + 'Sniper', 'Capturer une pièce sans avoir à bouger la pièce capturante', 'sniper' ], [ - 'inversion', + 'Inversion', "Échange la position d'une pièce avec une pièce adverse.\n\nCompte comme un mouvement", 'inversion' ], [ - 'mélange', + 'Mélange', 'La position de toutes les pièces sont échangées aléatoirement', 'melange' ], [ - 'la parrure', + 'La parrure', 'Une reine est dégradée en pion', 'parrure' ], [ - 'tout ou rien', + 'Tout ou rien', 'Une pièce choisie ne peut maintenant se déplacer que si elle capture.', 'tout' ], [ - 'tous les mêmes', + 'Tous les mêmes', 'Au yeux de l ennemie, toutes les pièces se ressemblent pendant 2 tours.', 'pareil' ], [ - 'révolution', + 'Révolution', 'Tous les pions sont aléatoirement changés en Cavalier, Fou ou Tour et les Cavaliers, Fous et Tours sont changés en pions.', 'revolution' ], [ - "doppelganger", + "Doppelganger", "Choisis une pièce. À partir de maintenant, devient chacune des pièces qu'elle capture.", 'doppelganger' ], @@ -431,7 +431,7 @@ function buildDefaultDeck(){ // a reflechir [ - 'empathie', + 'Empathie', 'On retourne le plateau', 'empathie' ], // pendant X tours ?