-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6475c61
commit b8d40ca
Showing
14 changed files
with
462 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"xyz": ["druid", "drood", "dru"], | ||
"500": ["superstorm", "sstorm"], | ||
"030": ["jungle"], | ||
"040": ["bounty"], | ||
"050": ["spirit_of_the_forest", "spirit", "sotf"], | ||
"003": ["druid_of_wrath", "dow"], | ||
"004": ["poplust", "lust"], | ||
"005": ["avatar_of_wrath", "aow"] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const r = require('../jsons/round2.json'); | ||
const { red, magenta } = require('../jsons/colours.json'); | ||
const OrParser = require('../parser/or-parser'); | ||
const RoundParser = require('../parser/round-parser'); | ||
const EmptyParser = require('../parser/empty-parser'); | ||
module.exports = { | ||
name: 'pop', | ||
aliases: ['rbe', 'popcount', 'pops'], | ||
execute(message, args) { | ||
let parsed = CommandParser.parse( | ||
args, | ||
new RoundParser('ALL'), | ||
new OrParser(new RoundParser('ALL'), new EmptyParser()) | ||
); | ||
console.log(JSON.stringify(parsed)); | ||
if (parsed.hasErrors()) { | ||
return module.exports.errorMessage(message, parsed.parsingErrors); | ||
} | ||
let rounds = parsed.rounds.sort(); | ||
const startround = rounds[0]; | ||
if (rounds.length == 1) { | ||
return module.exports.oneRound(startround, message.channel); | ||
} | ||
let endround = rounds[1]; | ||
return module.exports.showData(startround, endround, message.channel); | ||
}, | ||
errorMessage(message, errors) { | ||
let errorEmbed = new Discord.MessageEmbed() | ||
.setTitle(`${errors.join('\n')}`) | ||
.addField( | ||
'find the cash from round X to round Y', | ||
'**q!income <startround> <endround>**' | ||
) | ||
.addField( | ||
'other difficulties', | ||
'**q!income <startround> <endround> <difficulty>**\n(<difficulty> includes deflation, half cash, abr, apop is random)' | ||
) | ||
.setColor(red); | ||
return message.channel.send(errorEmbed); | ||
}, | ||
oneRound(startround, channel) { | ||
return channel.send( | ||
`Round ${startround} has a rbe(pop count) of ${r[startround].rbe}` | ||
); | ||
}, | ||
showData(startround, endround, channel) { | ||
let totalpopcount = | ||
r[endround].cumulativeRBE - r[startround - 1].cumulativeRBE; | ||
const dataEmbed = new Discord.MessageEmbed() | ||
.setTitle(`<:PopIcon:755016023333404743>${totalpopcount}`) | ||
.setDescription(`from round ${startround} to ${endround}`) | ||
.setFooter('note: towers may count pops differently due to bugs') | ||
.setColor(magenta); | ||
channel.send(dataEmbed); | ||
}, | ||
}; |
Oops, something went wrong.