mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 14:04:38 +02:00
Don't need to block blue and purple anymore
This commit is contained in:
@@ -66,11 +66,7 @@ module.exports = class ConnectFourCommand extends Command {
|
|||||||
const playerOneEmoji = color;
|
const playerOneEmoji = color;
|
||||||
let playerTwoEmoji = color === colors.yellow ? colors.red : colors.yellow;
|
let playerTwoEmoji = color === colors.yellow ? colors.red : colors.yellow;
|
||||||
try {
|
try {
|
||||||
const available = Object.keys(colors).filter(clr => {
|
const available = Object.keys(colors).filter(clr => color !== clr);
|
||||||
if (color === colors.blue && clr === colors.purple) return false;
|
|
||||||
if (color === colors.purple && clr === colors.blue) return false;
|
|
||||||
return color !== clr;
|
|
||||||
});
|
|
||||||
if (opponent.bot) {
|
if (opponent.bot) {
|
||||||
playerTwoEmoji = colors[available[Math.floor(Math.random() * available.length)]];
|
playerTwoEmoji = colors[available[Math.floor(Math.random() * available.length)]];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user