-
Notifications
You must be signed in to change notification settings - Fork 11
/
refinecalc.js
66 lines (43 loc) · 1.47 KB
/
refinecalc.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
const prepName = require('./parse.js').prepName;
let refinecalc = {};
// all arrays must be exactly length 2
refinecalc.refinemap = [
// WEAPON
["Cross Bow", "Mystery Bow"],
["Cross Bow", "Bow of the Wind Chaser"],
["Holy Stick", "Nemesis"],
["Holy Stick", "O’Neill’s Staff"],
["Cardo", "Green Steel Pike"],
["Cardo", "Saintly Glaive"],
["Desert Twilight", "Sandstorm"],
["Desert Twilight", "Desert Storm"],
["Orcish Axe", "Vecer Axe"],
["Orcish Axe", "Destroyer’s War Axe"],
// OFFHAND
["Memory Book", "Life Magic Book"],
["Memory Book", "Arcane Codex"],
["Skull Bracer", "Evil Bracer"],
["Skull Bracer", "Skeleton Bracer"],
["Floral Bracelet", "Rosa Bracelet"],
["Floral Bracelet", "Rosa Chain"],
["Fox Wrist Guard", "Noble Bracer"],
["Fox Wrist Guard", "Golden Wrist"],
["Statue Of Guardian Angel", "Statue Of Archangel"]
// ARMOR
// GARMENT
// SHOE
// ACCESSORY
].flat().map(ele => prepName(ele));
/**
* Returns 0 if ("Cross Bow", "Cross Bow")
* Returns -2 if ("Cross Bow", "Mystery Bow")
* Returns 2 if ("Mystery Bow", "Cross Bow")
*/
refinecalc.calc = function(original, aliased) {
let indexOriginal = refinecalc.refinemap.indexOf(prepName(original));
let indexAliased = refinecalc.refinemap.indexOf(prepName(aliased));
if(indexOriginal === -1 || indexAliased === -1) return 0;
// console.log(original + ", "+aliased+" "+(indexOriginal%2 - indexAliased%2)*2)
return (indexOriginal%2 - indexAliased%2)*2;
}
module.exports = refinecalc;