mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 14:18:36 +02:00
Split Single and Multi Player Games
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { randomRange } = require('../../util/Util');
|
||||
const fishes = require('../../assets/json/fishy');
|
||||
|
||||
module.exports = class FishyCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'fishy',
|
||||
aliases: ['fishing'],
|
||||
group: 'sp-games',
|
||||
memberName: 'fishy',
|
||||
description: 'Go fishing.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const fishID = Math.floor(Math.random() * 10) + 1;
|
||||
let rarity;
|
||||
if (fishID < 5) rarity = 'junk';
|
||||
else if (fishID < 8) rarity = 'common';
|
||||
else if (fishID < 10) rarity = 'uncommon';
|
||||
else rarity = 'rare';
|
||||
const fish = fishes[rarity];
|
||||
const worth = randomRange(fish.min, fish.max);
|
||||
return msg.reply(`You caught a ${fish.symbol}. I bet it'd sell for around $${worth}.`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user