diff --git a/scripts/game.js b/scripts/game.js index 7e56869..4f1446f 100644 --- a/scripts/game.js +++ b/scripts/game.js @@ -590,11 +590,11 @@ random2 += 1; } } - else if (random1 < 1) { - random1 = 1; + if (random1 < 1) { + random1 = 1 + randomValue(0,2); } - else if (random2 < 1) { - random2 = 1; + if (random2 < 1) { + random2 = 1 + randomValue(0, 2); } if (randomVar === 1) { document.getElementById("answer1").innerHTML = `${answerValue}`; @@ -642,12 +642,12 @@ const clicked = await setupButtons(answerValue); let fight = checkSolution(clicked, answerValue); if(fight) { - msg.push(`${Game.player.name} hit the monster.`); + msg.push(`${Game.player.name} haut ${hitter.name}.`); hitter.stats.hp -= 1; sfx["hit"].play(); } else { sfx["miss"].play(); - msg.push(`The monster hit ${Game.player.name}.`); + msg.push(`${hitter.name} haut ${Game.player.name}.`); Game.player.stats.hp -= 1; } if(msg) { @@ -817,7 +817,7 @@ return msgs .concat( m.split(" ").map(function (p) { - const match = p.match(/hit|miss/); + const match = p.match(/haut|miss/); return el("span", { className: match ? match[0] : "" }, [p, " "]); }) ) diff --git a/styles/game.css b/styles/game.css index 99d51b2..12d4977 100644 --- a/styles/game.css +++ b/styles/game.css @@ -323,7 +323,7 @@ a:hover { flex-direction: column; } -#message .hit { +#message .haut { color: #C01256; } diff --git a/views/profile.view.php b/views/profile.view.php index 0820df8..14f7e25 100644 --- a/views/profile.view.php +++ b/views/profile.view.php @@ -46,4 +46,4 @@ - \ No newline at end of file +