Last active
January 28, 2018 02:42
-
-
Save chernjie/03ee3dfde06d173543d8bd08a8e6cbcd to your computer and use it in GitHub Desktop.
everwing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EditorConfig is awesome: http://EditorConfig.org | |
# top-most EditorConfig file | |
root = true | |
# Unix-style newlines with a newline ending every file | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
# Set default charset | |
[*.{js,json}] | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var e = String.fromCharCode, | |
t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", | |
i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", | |
n = {}; | |
function getBaseValue(e, t) { | |
if (!n[e]) { | |
n[e] = {}; | |
for (var i = 0; i < e.length; i++) n[e][e.charAt(i)] = i | |
} | |
return n[e][t] | |
} | |
function _decompress (t, i, n) { | |
var r, o, a, s, f, h, c, l, u = [], | |
d = 4, | |
p = 4, | |
g = 3, | |
y = "", | |
x = [], | |
m = { | |
val: n(0), | |
position: i, | |
index: 1 | |
}; | |
for (o = 0; o < 3; o += 1) u[o] = o; | |
for (s = 0, h = Math.pow(2, 2), c = 1; c != h;) f = m.val & m.position, m.position >>= 1, 0 == m.position && (m.position = i, m.val = n(m.index++)), s |= (f > 0 ? 1 : 0) * c, c <<= 1; | |
switch (r = s) { | |
case 0: | |
for (s = 0, h = Math.pow(2, 8), c = 1; c != h;) f = m.val & m.position, m.position >>= 1, 0 == m.position && (m.position = i, m.val = n(m.index++)), s |= (f > 0 ? 1 : 0) * c, c <<= 1; | |
l = e(s); | |
break; | |
case 1: | |
for (s = 0, h = Math.pow(2, 16), c = 1; c != h;) f = m.val & m.position, m.position >>= 1, 0 == m.position && (m.position = i, m.val = n(m.index++)), s |= (f > 0 ? 1 : 0) * c, c <<= 1; | |
l = e(s); | |
break; | |
case 2: | |
return "" | |
} | |
for (u[3] = l, a = l, x.push(l);;) { | |
if (m.index > t) return ""; | |
for (s = 0, h = Math.pow(2, g), c = 1; c != h;) f = m.val & m.position, m.position >>= 1, 0 == m.position && (m.position = i, m.val = n(m.index++)), s |= (f > 0 ? 1 : 0) * c, c <<= 1; | |
switch (l = s) { | |
case 0: | |
for (s = 0, h = Math.pow(2, 8), c = 1; c != h;) f = m.val & m.position, m.position >>= 1, 0 == m.position && (m.position = i, m.val = n(m.index++)), s |= (f > 0 ? 1 : 0) * c, c <<= 1; | |
u[p++] = e(s), l = p - 1, d--; | |
break; | |
case 1: | |
for (s = 0, h = Math.pow(2, 16), c = 1; c != h;) f = m.val & m.position, m.position >>= 1, 0 == m.position && (m.position = i, m.val = n(m.index++)), s |= (f > 0 ? 1 : 0) * c, c <<= 1; | |
u[p++] = e(s), l = p - 1, d--; | |
break; | |
case 2: | |
return x.join("") | |
} | |
if (0 == d && (d = Math.pow(2, g), g++), u[l]) y = u[l]; | |
else { | |
if (l !== p) return null; | |
y = a + a.charAt(0) | |
} | |
x.push(y), u[p++] = a + y.charAt(0), d--, a = y, 0 == d && (d = Math.pow(2, g), g++) | |
} | |
} | |
module.exports = function decompress(string) { | |
var encoded = string.substring(11); | |
var decoded = _decompress(encoded.length, 32, function(i) { | |
return getBaseValue(t, encoded.charAt(i)) | |
}); | |
return JSON.parse(JSON.parse(decoded)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lodash = require('lodash'); | |
var everwing = require('./everwing.json'); | |
var state = require('./decompress')(everwing.state); | |
module.exports = lodash(state.instances) | |
.filter((el, i) => { | |
return el.schemaPrimativeType === "Item"; | |
}).filter((el, i) => { | |
return el.schemaPrimativeID.match(/sidekick/); | |
}).map((el, i) => { | |
el.model = el.schemaPrimativeID; | |
return el; | |
}).map((el, i) => { | |
if (! el.stats) { | |
return el; | |
} | |
el.stats.forEach(function (uuid) { | |
var ell = state.instances[uuid]; | |
var name = ell.schemaPrimativeID.split('_').splice(1).join('_'); | |
el[name] = { | |
value: ell.value, | |
maximum: ell.maximum, | |
}; | |
}) | |
delete el.stats; | |
return el; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lodash = require('lodash'); | |
var skutil = require('./sidekick-util.js'); | |
var sidekicks = require('./everwing-state.js'); | |
var backlog = lodash(sidekicks.value()) | |
.groupBy(function (sidekick) { | |
return skutil.getName(sidekick) +":"+ skutil.getZodiac(sidekick); | |
}, {}).map(function (sidekicks, type) { | |
var total = lodash(sidekicks).reduce(function (total, sidekick) { | |
return total + sidekick.maturity.value % sidekick.maturity.maximum; | |
}, 0); | |
return { | |
type: type, | |
sidekicks: sidekicks, | |
total: total, | |
} | |
}).map(function (types) { | |
types.analysed = lodash(types.sidekicks).reduce(function (last, sidekick) { | |
var tier = 'tier' + ( sidekick.maturity.value - 1 ); | |
last[tier] = last[tier] || []; | |
last[tier].push(skutil.getState(sidekick)); | |
return last; | |
}, {}); | |
return types; | |
}).map(function (el, i) { | |
['tier0', 'tier1', 'tier2'].forEach(function (tier) { | |
el.analysed[tier] = el.analysed[tier] ? el.analysed[tier].join('') : '.'; | |
}) | |
return el; | |
}).sortBy(function (el, i) { | |
return el.type; | |
}).filter(function (el, i) { | |
var combined = el.sidekicks.filter(function (sidekick) { | |
return sidekick.maturity.value % sidekick.maturity.maximum; | |
}).reduce(function (total, sidekick) { | |
total.value += sidekick.xp.value; | |
total.maximum += sidekick.xp.maximum; | |
return total; | |
}, { value: 0, maximum: 0 }); | |
var evolvable = el.sidekicks.filter(function (sidekick) { | |
return sidekick.maturity.value % sidekick.maturity.maximum; | |
}).filter(function (sidekick) { | |
return sidekick.xp.value === sidekick.xp.maximum; | |
}).reduce(function (total, sidekick) { | |
var tier = 'tier' + ( sidekick.maturity.value - 1 ); | |
total[tier] += 1; | |
return total; | |
}, { tier0: 0, tier1: 0 }); | |
return combined.value !== combined.maximum | |
|| evolvable.tier0 > 1 | |
|| evolvable.tier1 > 1; | |
}).filter(function (el, i) { | |
return el.total >= 2 | |
|| skutil.getRarity(el.sidekicks[0]) === "legendary"; | |
}); | |
backlog.map(function (el, i) { | |
var args = [ | |
skutil.getName(el.sidekicks[0]), | |
skutil.getZodiac(el.sidekicks[0]), | |
el.total, | |
el.analysed.tier0, | |
el.analysed.tier1, | |
el.analysed.tier2, | |
]; | |
console.log.apply(console, args); | |
return args.join(' '); | |
}).value(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"stats": "node statistics", | |
"unpack": "node unpack", | |
"postunpack": "find resources spritesheets -type f -iname '*.json' -exec json -If {} \\;", | |
"prestart": "git add everwing-backlog.json", | |
"poststart": "git diff --ignore-all-space everwing-backlog.json && git reset everwing-backlog.json", | |
"start": "node everwing.js | column -t | tee everwing-backlog.json" | |
}, | |
"dependencies": { | |
"json": "^9.0.4", | |
"lodash": "^4.17.4" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
offsetX: 110, | |
offsetY: 80, | |
width: 62, | |
height: 107, | |
shootTimeout: 100, | |
unlocks: { | |
message: "", | |
itemIcon: "", | |
special: { | |
2: { | |
message: "dialogs.levelUpDialogViewController.unlocks.sidekicks.level2", | |
itemIcon: "resources/images/dialogs/sidekicks/chibi_icon.png" | |
}, | |
10: { | |
message: "dialogs.levelUpDialogViewController.unlocks.sidekicks.level10", | |
itemIcon: "resources/images/dialogs/sidekicks/chibi_icon.png" | |
}, | |
16: { | |
message: "dialogs.levelUpDialogViewController.unlocks.sidekicks.level6", | |
itemIcon: "resources/images/dialogs/sidekicks/chibi_icon.png" | |
} | |
} | |
}, | |
types: { | |
FC00: { | |
elementType: "fire", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.12, 1.12, 1.12] | |
}, | |
FC01: { | |
elementType: "fire", | |
rarity: "legendary", | |
powers: [ | |
["homing"], | |
["homing"], | |
["homing"] | |
], | |
powersDescriptionKeys: ["homing", "homing", "homing"], | |
damageMultipliers: [1.11, 1.22, 1.44] | |
}, | |
FC02: { | |
elementType: "fire", | |
rarity: "rare", | |
powers: [ | |
["bombs"], | |
["bombs"], | |
["bombs"] | |
], | |
powersDescriptionKeys: ["bombs", "bombs", "bombs"] | |
}, | |
FC04: { | |
elementType: "fire", | |
rarity: "legendary", | |
powers: [ | |
["bombs", "dualShot"], | |
["bombs", "dualShot"], | |
["bombs", "dualShot"] | |
], | |
powersDescriptionKeys: ["bombs:dualShot", "bombs:dualShot", "bombs:dualShot"], | |
damageMultipliers: [.66, .77, .88] | |
}, | |
FC05: { | |
elementType: "fire", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.07, 1.07, 1.07] | |
}, | |
FC10: { | |
elementType: "fire", | |
rarity: "rare", | |
powers: [ | |
["poison"], | |
["poison"], | |
["poison"] | |
], | |
powersDescriptionKeys: ["poison", "poison", "poison"], | |
damageMultipliers: [1.05, 1.1, 1.2] | |
}, | |
FC11: { | |
elementType: "fire", | |
rarity: "legendary", | |
powers: [ | |
["gems"], | |
["gems"], | |
["gems"] | |
], | |
powersDescriptionKeys: ["gems", "gems", "gems"], | |
damageMultipliers: [1.06, 1.12, 1.18] | |
}, | |
FC12: { | |
elementType: "fire", | |
rarity: "legendary", | |
powers: [ | |
["itemSpawn"], | |
["itemSpawn"], | |
["itemSpawn"] | |
], | |
powersDescriptionKeys: ["itemSpawn", "itemSpawn", "itemSpawn"], | |
damageMultipliers: [1.12, 1.18, 1.24] | |
}, | |
LC00: { | |
elementType: "light", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.08, 1.08, 1.08] | |
}, | |
LC01: { | |
elementType: "light", | |
rarity: "rare", | |
powers: [ | |
["treasure"], | |
["treasure"], | |
["treasure"] | |
], | |
powersDescriptionKeys: ["treasure", "treasure", "treasure"] | |
}, | |
LC03: { | |
elementType: "light", | |
rarity: "legendary", | |
powers: [ | |
["homing", "slowing"], | |
["homing", "slowing"], | |
["homing", "slowing"] | |
], | |
powersDescriptionKeys: ["homing:slowing", "homing:slowing", "homing:slowing"], | |
damageMultipliers: [1.04, 1.08, 1.16] | |
}, | |
LC09: { | |
elementType: "light", | |
rarity: "rare", | |
powers: [ | |
["questing"], | |
["questing"], | |
["questing"] | |
], | |
powersDescriptionKeys: ["questing", "questing", "questing"] | |
}, | |
NC00: { | |
elementType: "nature", | |
rarity: "rare", | |
powers: [ | |
["treasure"], | |
["treasure"], | |
["treasure"] | |
], | |
powersDescriptionKeys: ["treasure", "treasure", "treasure"] | |
}, | |
NC01: { | |
elementType: "nature", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.09, 1.09, 1.09] | |
}, | |
NC02: { | |
elementType: "nature", | |
rarity: "legendary", | |
powers: [ | |
["itemBoost"], | |
["itemBoost"], | |
["itemBoost"] | |
], | |
powersDescriptionKeys: ["itemBoost", "itemBoost", "itemBoost"], | |
damageMultipliers: [1.1, 1.25, 1.5] | |
}, | |
NC03: { | |
elementType: "nature", | |
rarity: "legendary", | |
powers: [ | |
["charm", "treasure"], | |
["charm", "treasure"], | |
["charm", "treasure"] | |
], | |
powersDescriptionKeys: ["charm:treasure", "charm:treasure", "charm:treasure"], | |
damageMultipliers: [1.05, 1.1, 1.2] | |
}, | |
NC04: { | |
elementType: "nature", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.07, 1.07, 1.07] | |
}, | |
NC07: { | |
elementType: "nature", | |
rarity: "rare", | |
powers: [ | |
["dualShot"], | |
["dualShot"], | |
["dualShot", "hasTwin"] | |
], | |
powersDescriptionKeys: ["dualShot", "dualShot", "dualShot"], | |
damageMultipliers: [.56, .67, .78] | |
}, | |
NC09: { | |
elementType: "nature", | |
rarity: "legendary", | |
powers: [ | |
["bombs", "treasure"], | |
["bombs", "treasure"], | |
["bombs", "treasure"] | |
], | |
powersDescriptionKeys: ["bombs:treasure", "bombs:treasure", "bombs:treasure"], | |
damageMultipliers: [1.1, 1.2, 1.3] | |
}, | |
SC00: { | |
elementType: "shadow", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.1, 1.1, 1.1] | |
}, | |
SC01: { | |
elementType: "shadow", | |
rarity: "rare", | |
powers: [ | |
["homing"], | |
["homing"], | |
["homing"] | |
], | |
powersDescriptionKeys: ["homing", "homing", "homing"] | |
}, | |
SC02: { | |
elementType: "shadow", | |
rarity: "legendary", | |
powers: [ | |
["gems"], | |
["gems"], | |
["gems"] | |
], | |
powersDescriptionKeys: ["gems", "gems", "gems"], | |
damageMultipliers: [1.06, 1.12, 1.18] | |
}, | |
SC03: { | |
elementType: "shadow", | |
rarity: "legendary", | |
powers: [ | |
["homing", "ice"], | |
["homing", "ice"], | |
["homing", "ice"] | |
], | |
powersDescriptionKeys: ["homing:ice", "homing:ice", "homing:ice"], | |
damageMultipliers: [1.22, 1.22, 1.22] | |
}, | |
SC04: { | |
elementType: "shadow", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.12, 1.12, 1.12] | |
}, | |
SC06: { | |
elementType: "shadow", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.07, 1.07, 1.07] | |
}, | |
SC09: { | |
elementType: "shadow", | |
rarity: "rare", | |
powers: [ | |
["bossKiller"], | |
["bossKiller"], | |
["bossKiller"] | |
], | |
powersDescriptionKeys: ["bossKiller", "bossKiller", "bossKiller"], | |
damageMultipliers: [1.04, 1.08, 1.12] | |
}, | |
SC10: { | |
elementType: "shadow", | |
rarity: "legendary", | |
powers: [ | |
["spreadShot"], | |
["spreadShot"], | |
["spreadShot"] | |
], | |
powersDescriptionKeys: ["spreadShot", "spreadShot", "spreadShot"], | |
damageMultipliers: [.45, .56, .67] | |
}, | |
SC11: { | |
elementType: "shadow", | |
rarity: "rare", | |
powers: [ | |
["charm"], | |
["charm"], | |
["charm"] | |
], | |
powersDescriptionKeys: ["charm", "charm", "charm"] | |
}, | |
WC00: { | |
elementType: "water", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.14, 1.14, 1.14] | |
}, | |
WC01: { | |
elementType: "water", | |
rarity: "rare", | |
powers: [ | |
["itemBoost"], | |
["itemBoost"], | |
["itemBoost"] | |
], | |
powersDescriptionKeys: ["itemBoost", "itemBoost", "itemBoost"] | |
}, | |
WC02: { | |
elementType: "water", | |
rarity: "legendary", | |
powers: [ | |
["ice", "slowing"], | |
["ice", "slowing"], | |
["ice", "slowing"] | |
], | |
powersDescriptionKeys: ["ice:slowing", "ice:slowing", "ice:slowing"], | |
damageMultipliers: [1.06, 1.12, 1.18] | |
}, | |
WC05: { | |
elementType: "water", | |
rarity: "common", | |
powers: [ | |
[], | |
[], | |
[] | |
], | |
powersDescriptionKeys: ["damage", "damage", "damage"], | |
damageMultipliers: [1.07, 1.07, 1.07] | |
}, | |
WC06: { | |
elementType: "water", | |
rarity: "rare", | |
powers: [ | |
["ice"], | |
["ice"], | |
["ice"] | |
], | |
powersDescriptionKeys: ["ice", "ice", "ice"] | |
}, | |
WC13: { | |
elementType: "water", | |
rarity: "rare", | |
powers: [ | |
["slowing"], | |
["slowing"], | |
["slowing"] | |
], | |
powersDescriptionKeys: ["slowing", "slowing", "slowing"] | |
} | |
}, | |
zodiacs: ["aquarius", "pisces", "aries", "taurus", "gemini", "cancer", "leo", "virgo", "libra", "scorpio", "sagittarius", "capricorn"], | |
levelsPerTier: 10, | |
zodiacBonusMultipliers: [1, 1.25, 1.3], | |
damagePerTier: [{ | |
base: 5, | |
levelMultiplier: 4, | |
levelOffset: -1 | |
}, { | |
base: 50, | |
levelMultiplier: 2, | |
levelOffset: -10 | |
}, { | |
base: 80, | |
levelMultiplier: 1, | |
levelOffset: -20 | |
}], | |
tutorialEgg: { | |
type: "tutorialEgg", | |
elementType: "fire", | |
level: 0, | |
damage: 0, | |
powers: ["none"], | |
wingUrl: "resources/images/game/sidekicks/parts/FC01_T1_wing.png", | |
bodyUrl: "resources/images/game/sidekicks/parts/tut_egg_fire_body.png" | |
}, | |
maxLevel: 30, | |
fusionLevel: 10, | |
fusionEnabled: !0, | |
xpPerLevel: [200, 500, 900, 1400, 2e3, 2700, 3500, 4600, 5600, 2e3, 2200, 2500, 2900, 3400, 4e3, 4700, 5500, 6600, 7600, 4e3, 4200, 4500, 4900, 5400, 6e3, 7e3, 8e3, 9e3, 1e4], | |
sellTables: { | |
common: [{ | |
coins: 0, | |
trophies: 0 | |
}, { | |
coins: 300, | |
trophies: 0 | |
}, { | |
coins: 310, | |
trophies: 0 | |
}, { | |
coins: 340, | |
trophies: 0 | |
}, { | |
coins: 400, | |
trophies: 0 | |
}, { | |
coins: 480, | |
trophies: 0 | |
}, { | |
coins: 600, | |
trophies: 0 | |
}, { | |
coins: 760, | |
trophies: 0 | |
}, { | |
coins: 970, | |
trophies: 0 | |
}, { | |
coins: 1240, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 7 | |
}, { | |
coins: 3100, | |
trophies: 0 | |
}, { | |
coins: 3300, | |
trophies: 0 | |
}, { | |
coins: 3700, | |
trophies: 0 | |
}, { | |
coins: 3900, | |
trophies: 0 | |
}, { | |
coins: 4300, | |
trophies: 0 | |
}, { | |
coins: 4900, | |
trophies: 0 | |
}, { | |
coins: 5500, | |
trophies: 0 | |
}, { | |
coins: 6100, | |
trophies: 0 | |
}, { | |
coins: 6900, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 60 | |
}, { | |
coins: 16300, | |
trophies: 0 | |
}, { | |
coins: 17100, | |
trophies: 0 | |
}, { | |
coins: 18300, | |
trophies: 0 | |
}, { | |
coins: 19500, | |
trophies: 0 | |
}, { | |
coins: 20700, | |
trophies: 0 | |
}, { | |
coins: 22300, | |
trophies: 0 | |
}, { | |
coins: 23900, | |
trophies: 0 | |
}, { | |
coins: 25900, | |
trophies: 0 | |
}, { | |
coins: 27900, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 355 | |
}], | |
rare: [{ | |
coins: 0, | |
trophies: 0 | |
}, { | |
coins: 1700, | |
trophies: 0 | |
}, { | |
coins: 1750, | |
trophies: 0 | |
}, { | |
coins: 1900, | |
trophies: 0 | |
}, { | |
coins: 2100, | |
trophies: 0 | |
}, { | |
coins: 2500, | |
trophies: 0 | |
}, { | |
coins: 3e3, | |
trophies: 0 | |
}, { | |
coins: 3800, | |
trophies: 0 | |
}, { | |
coins: 4700, | |
trophies: 0 | |
}, { | |
coins: 5900, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 35 | |
}, { | |
coins: 14300, | |
trophies: 0 | |
}, { | |
coins: 15500, | |
trophies: 0 | |
}, { | |
coins: 16700, | |
trophies: 0 | |
}, { | |
coins: 18300, | |
trophies: 0 | |
}, { | |
coins: 20100, | |
trophies: 0 | |
}, { | |
coins: 22300, | |
trophies: 0 | |
}, { | |
coins: 24700, | |
trophies: 0 | |
}, { | |
coins: 27700, | |
trophies: 0 | |
}, { | |
coins: 31300, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 276 | |
}, { | |
coins: 73300, | |
trophies: 0 | |
}, { | |
coins: 77700, | |
trophies: 0 | |
}, { | |
coins: 82500, | |
trophies: 0 | |
}, { | |
coins: 87700, | |
trophies: 0 | |
}, { | |
coins: 93700, | |
trophies: 0 | |
}, { | |
coins: 100100, | |
trophies: 0 | |
}, { | |
coins: 107700, | |
trophies: 0 | |
}, { | |
coins: 116100, | |
trophies: 0 | |
}, { | |
coins: 125700, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 1600 | |
}], | |
legendary: [{ | |
coins: 0, | |
trophies: 0 | |
}, { | |
coins: 5e3, | |
trophies: 0 | |
}, { | |
coins: 5100, | |
trophies: 0 | |
}, { | |
coins: 5400, | |
trophies: 0 | |
}, { | |
coins: 6e3, | |
trophies: 0 | |
}, { | |
coins: 6800, | |
trophies: 0 | |
}, { | |
coins: 8e3, | |
trophies: 0 | |
}, { | |
coins: 9600, | |
trophies: 0 | |
}, { | |
coins: 11700, | |
trophies: 0 | |
}, { | |
coins: 14400, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 83 | |
}, { | |
coins: 32800, | |
trophies: 0 | |
}, { | |
coins: 35400, | |
trophies: 0 | |
}, { | |
coins: 38400, | |
trophies: 0 | |
}, { | |
coins: 42e3, | |
trophies: 0 | |
}, { | |
coins: 46e3, | |
trophies: 0 | |
}, { | |
coins: 50800, | |
trophies: 0 | |
}, { | |
coins: 56400, | |
trophies: 0 | |
}, { | |
coins: 62800, | |
trophies: 0 | |
}, { | |
coins: 70800, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 623 | |
}, { | |
coins: 164200, | |
trophies: 0 | |
}, { | |
coins: 174200, | |
trophies: 0 | |
}, { | |
coins: 185e3, | |
trophies: 0 | |
}, { | |
coins: 196600, | |
trophies: 0 | |
}, { | |
coins: 209400, | |
trophies: 0 | |
}, { | |
coins: 223800, | |
trophies: 0 | |
}, { | |
coins: 240200, | |
trophies: 0 | |
}, { | |
coins: 259400, | |
trophies: 0 | |
}, { | |
coins: 281e3, | |
trophies: 0 | |
}, { | |
coins: 0, | |
trophies: 3570 | |
}] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zodiac = require('./zodiac.json'); | |
var locale = require('./resources/strings/en.json'); | |
var metadata = require('./sidekick-metadata'); | |
function sidekickName(sidekick) { | |
return getNameByModel(sidekick.model.split(':')[1]); | |
} | |
function sidekickZodiac(sidekick) { | |
return zodiac[(sidekick.zodiac.value+10)%12].symbol; | |
} | |
function sidekickState(sidekick) { | |
var state = sidekick.xp.value/sidekick.xp.maximum*10; | |
if (sidekick.state !== "idle") { | |
return sidekick.state | |
.match(/((^|:)[\w]|[A-Z])/g) | |
.join('') | |
.replace('q:', '') | |
.toUpperCase(); | |
} | |
return (state < 1 ? Math.ceil : Math.floor)(state, 4).toString(16).toUpperCase(); | |
} | |
function sidekickRarity(sidekick) { | |
var type = sidekick.model.split(':')[1]; | |
return metadata.types[type] && metadata.types[type].rarity; | |
} | |
function getNameByModel(model) { | |
return locale.sidekicks[model] | |
? locale.sidekicks[model].names.tier0 | |
: model; | |
} | |
module.exports = { | |
getName: sidekickName, | |
getZodiac: sidekickZodiac, | |
getState: sidekickState, | |
getRarity: sidekickRarity, | |
getNameByModel: getNameByModel, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lodash = require('lodash'); | |
var skutil = require('./sidekick-util.js'); | |
var sidekicks = require('./everwing-state.js'); | |
// print(sidekicks.value()); | |
printCounter(sidekicks.value()); | |
function print(sidekicks) { | |
sidekicks.forEach(function (sidekick) { | |
console.log( | |
skutil.getName(sidekick), | |
skutil.getZodiac(sidekick), | |
sidekick.state, | |
sidekick.xp.value, | |
sidekick.xp.maximum, | |
sidekick.maturity.value, | |
sidekick.zodiac_bonus.value | |
); | |
}) | |
} | |
function printCounter(sidekicks) { | |
var groupByName = lodash(sidekicks).countBy(function (el, i) { | |
return skutil.getName(el); | |
}).value(); | |
var groupByLevel = lodash(sidekicks).countBy('maturity.value').value(); | |
var groupByZodiac = lodash(sidekicks).countBy('zodiac.value').value(); | |
var totalRawCount = lodash(sidekicks).reduce(function (sum, el, i) { | |
switch (el.maturity.value) { | |
case 3: return sum + 4; | |
case 2: return sum + 2; | |
case 1: return sum + 1; | |
} | |
}, 0); | |
console.log(JSON.stringify({ | |
groupByName: groupByName, | |
groupByLevel: groupByLevel, | |
groupByZodiac: groupByZodiac, | |
totalRawCount: totalRawCount, | |
}, null, 2)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var json = require('./browser-mobile-CACHE.json'); | |
var fs = require('fs'); | |
for (var i in json) { | |
fs.writeFile(i, json[i], function (err) { | |
err && console.error(err); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"unicode": "2648", | |
"symbol": "♈", | |
"zodiac": "Aries" | |
}, | |
{ | |
"unicode": "2649", | |
"symbol": "♉", | |
"zodiac": "Taurus" | |
}, | |
{ | |
"unicode": "264A", | |
"symbol": "♊", | |
"zodiac": "Gemini" | |
}, | |
{ | |
"unicode": "264B", | |
"symbol": "♋", | |
"zodiac": "Cancer" | |
}, | |
{ | |
"unicode": "264C", | |
"symbol": "♌", | |
"zodiac": "Leo" | |
}, | |
{ | |
"unicode": "264D", | |
"symbol": "♍", | |
"zodiac": "Virgo" | |
}, | |
{ | |
"unicode": "264E", | |
"symbol": "♎", | |
"zodiac": "Libra" | |
}, | |
{ | |
"unicode": "264F", | |
"symbol": "♏", | |
"zodiac": "Scorpio" | |
}, | |
{ | |
"unicode": "2650", | |
"symbol": "♐", | |
"zodiac": "Sagittarius" | |
}, | |
{ | |
"unicode": "2651", | |
"symbol": "♑", | |
"zodiac": "Capricorn" | |
}, | |
{ | |
"unicode": "2652", | |
"symbol": "♒", | |
"zodiac": "Aquarius" | |
}, | |
{ | |
"unicode": "2653", | |
"symbol": "♓", | |
"zodiac": "Pisces" | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{
elementType: "fire",
rarity: "common",
powers: [
[],
[],
[]
],
powersDescriptionKeys: ["damage", "damage", "damage"],
damageMultipliers: [500, 500, 500]
},