diff options
Diffstat (limited to 'src/maps/maps.js')
| -rw-r--r-- | src/maps/maps.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/maps/maps.js b/src/maps/maps.js new file mode 100644 index 0000000..1571806 --- /dev/null +++ b/src/maps/maps.js @@ -0,0 +1,24 @@ +const rarities = require('./rarities.json'); + +function getTalentRarity(talent) { + switch (talent.slice(talent.length - 7 - 1, talent.length - 1)) { + case 'TalentA': return 'Rare'; + case 'TalentB': return 'Epic'; + case 'TalentC': return 'Legendary'; + default: + if (Object.keys(rarities).includes(talent)) { + return rarities[talent]; + } else { + return 'unknown'; + } + } +} + +function getHero(actor) { + return actor.substring(1, actor.length - 1); +} + +module.exports = { + getTalentRarity, + getHero, +}; |
