-
Notifications
You must be signed in to change notification settings - Fork 0
/
component.js
75 lines (66 loc) · 2.08 KB
/
component.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
angular.module('pkmn.sm.prng')
.component('pkmParentInput', {
templateUrl: 'pkm-parent-input.html',
controller: function PkmParentInputController() {
this.male = {
Item: 'NONE',
Nature: 'DOCILE',
AbilitySlot: '1',
};
this.male.IV = {
HP: 31,
Att: 31,
Def: 31,
SpAtt: 31,
SpDef: 31,
Spd: 31
};
this.female = {
Item: 'NONE',
Nature: 'DOCILE',
AbilitySlot: '1',
};
this.female.IV = {
HP: 31,
Att: 31,
Def: 31,
SpAtt: 31,
SpDef: 31,
Spd: 31
};
var hPIvMap = [
"Fighting",
"Flying",
"Poison",
"Ground",
"Rock",
"Bug",
"Ghost",
"Steel",
"Fire",
"Water",
"Grass",
"Electric",
"Psychic",
"Ice",
"Dragon",
"Dark",
];
this.natures = ["HARDY", "LONELY", "BRAVE", "ADAMANT", "NAUGHTY", "BOLD", "DOCILE",
"RELAXED", "IMPISH", "LAX", "TIMID", "HASTY", "SERIOUS", "JOLLY",
"NAIVE", "MODEST", "MILD", "QUIET", "BASHFUL", "RASH", "CALM",
"GENTLE", "SASSY", "CAREFUL", "QUIRKY"
];
this.itemSelections = ["NONE", "DESTINYKNOT", "EVERSTONE"];
this.abilitySlots = ["1", "2", "HA"];
function lsb(num) {
return num % 2;
}
this.getHpType = function(iv) {
return hPIvMap[
Math.floor(
(iv.HP % 2 + 2 * lsb(iv.Att) + 4 * lsb(iv.Def) + 8 * lsb(iv.Spd) + 16 * lsb(iv.SpAtt) + 32 * lsb(iv.SpDef)) * 15 / 63)
];
}
}
})