summaryrefslogtreecommitdiff
path: root/src/maps/maps.js
blob: 1571806bc83aca2e0de68bebd3b7bb00c4347e86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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,
};