forked from SmallBookworm/gf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fairy.js
166 lines (141 loc) · 6.78 KB
/
fairy.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
function getFairySkillDetail(fairy) {
var detailText = null;
if (fairy.skillLevel in fairy.skill.detailText) {
detailText = fairy.skill.detailText[fairy.skillLevel];
} else if ("val" in fairy.skill.detailText) {
detailText = fairy.skill.detailText["val"];
} else {
detailText = fairy.skill.detailText["0"];
}
var text = [];
if (fairy.id == "1") text.push(getFairySkillDetailId001(fairy, detailText));
if (fairy.id == "2") text.push(getFairySkillDetailId002(fairy, detailText));
if (fairy.id == "3") text.push(getFairySkillDetailId003(fairy, detailText));
if (fairy.id == "4") text.push(getFairySkillDetailId004(fairy, detailText));
if (fairy.id == "5") text.push(getFairySkillDetailId005(fairy, detailText));
if (fairy.id == "6") text.push(getFairySkillDetailId006(fairy, detailText));
if (fairy.id == "7") text.push(getFairySkillDetailId007(fairy, detailText));
if (fairy.id == "8") text.push(getFairySkillDetailId008(fairy, detailText));
if (fairy.id == "9") text.push(getFairySkillDetailId009(fairy, detailText));
if (fairy.id == "10") text.push(getFairySkillDetailId010(fairy, detailText));
if (fairy.id == "11") text.push(getFairySkillDetailId011(fairy, detailText));
if (fairy.id == "12") text.push(getFairySkillDetailId012(fairy, detailText));
if (fairy.id == "13") text.push(getFairySkillDetailId013(fairy, detailText));
if (fairy.id == "14") text.push(getFairySkillDetailId014(fairy, detailText));
if (fairy.id == "15") text.push(getFairySkillDetailId015(fairy, detailText));
if (fairy.id == "16") text.push(getFairySkillDetailId016(fairy, detailText));
if (fairy.id == "17") text.push(getFairySkillDetailId017(fairy, detailText));
if (fairy.id == "18") text.push(getFairySkillDetailId018(fairy, detailText));
if (fairy.id == "1001") text.push(getFairySkillDetailId1001(fairy, detailText));
if (fairy.id == "1002") text.push(getFairySkillDetailId1002(fairy, detailText));
if (fairy.id == "1003") text.push(getFairySkillDetailId1003(fairy, detailText));
if ("format" in fairy.skill.detailText) text.push(getFairySkillDetailFormat(fairy, detailText, 0, fairy.skill.detailText.format));
return text;
}
function getFortressDetail(fortressLevel) {
var fairy = getFairy("14");
fairy.skillLevel = fortressLevel;
return getFairySkillDetail(fairy);
}
function getFairyMasteryDetail(fairy) {
var detailText = fairy.mastery.detailText["val"];
var text = [];
text.push(detailText);
return text;
}
function getFairySkillDetailId001(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.dmg.val, skillEffect.fireOfRate.val);
}
function getFairySkillDetailId002(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.hit.val, skillEffect.criRate.val);
}
function getFairySkillDetailId003(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.armor.val);
}
function getFairySkillDetailId004(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.shield.val);
}
function getFairySkillDetailId005(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.reducedDamage.val);
}
function getFairySkillDetailId006(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.hp.val);
}
function getFairySkillDetailId007(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.fixedDmg.val);
}
function getFairySkillDetailId008(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.fixedDmg.val);
}
function getFairySkillDetailId009(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.fixedDmg.val);
}
function getFairySkillDetailId010(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.dodge.val);
}
function getFairySkillDetailId011(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText;
}
function getFairySkillDetailId012(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.AttackCurrentHp.val);
}
function getFairySkillDetailId013(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.AttackCurrentHp.val);
}
function getFairySkillDetailId014(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.dmg.val);
}
function getFairySkillDetailId015(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.expUp.val);
}
function getFairySkillDetailId016(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText;
}
function getFairySkillDetailId017(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.hit.val);
}
function getFairySkillDetailId018(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText;
}
function getFairySkillDetailId1001(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.fixedDmg.val);
}
function getFairySkillDetailId1002(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.AttackCurrentHp.val);
}
function getFairySkillDetailId1003(fairy, detailText) {
var skillEffect = getSkillByLevel(fairy.skill.effect, fairy.skillLevel);
return detailText.format(skillEffect.hp.val, skillEffect.fixedDmg.val);
}
function getFairySkillDetailFormat(fairy, detailText, skillIndex, format) {
var result = detailText;
var i = 0;
format.forEach(v => {
if ("textIndex" in v) i = v.textIndex;
var value = fairy.skills[skillIndex].effects[v.effectIndex][v.attr];
if (v.percent) value *= 100;
result = result.replace("{" + i + "}", value);
i++;
});
return result;
}