mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Add Pokedex Ability and Move
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
const { firstUpperCase } = require('../../util/Util');
|
||||
|
||||
module.exports = class Move {
|
||||
constructor(store, data) {
|
||||
this.store = store;
|
||||
this.id = data.id;
|
||||
const slugName = firstUpperCase(data.name).replaceAll('-', ' ');
|
||||
this.name = data.names.length
|
||||
? data.names.find(entry => entry.language.name === 'en').name
|
||||
: slugName;
|
||||
this.description = data.effect_entries.find(entry => entry.language.name === 'en').effect;
|
||||
this.accuracy = data.accuracy;
|
||||
this.effectChance = data.effect_chance;
|
||||
this.power = data.power;
|
||||
this.pp = data.pp;
|
||||
this.type = firstUpperCase(data.type.name);
|
||||
this.contestType = firstUpperCase(data.contest_type.name);
|
||||
this.class = firstUpperCase(data.damage_class.name);
|
||||
}
|
||||
|
||||
get cleanDescription() {
|
||||
return this.description
|
||||
.replace(/\$effect_chance/gi, this.effectChance);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user