Created
August 17, 2018 15:07
-
-
Save KagamiChan/f31ce3a8ec8fa655d611eb379dddfa1e to your computer and use it in GitHub Desktop.
ship full image
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
const secrets = { | |
resource: [6657, 5699, 3371, 8909, 7719, 6229, 5449, 8561, 2987, 5501, 3127, 9319, 4365, 9811, 9927, 2423, 3439, 1865, 5925, 4409, 5509, 1517, 9695, 9255, 5325, 3691, 5519, 6949, 5607, 9539, 4133, 7795, 5465, 2659, 6381, 6875, 4019, 9195, 5645, 2887, 1213, 1815, 8671, 3015, 3147, 2991, 7977, 7045, 1619, 7909, 4451, 6573, 4545, 8251, 5983, 2849, 7249, 7449, 9477, 5963, 2711, 9019, 7375, 2201, 5631, 4893, 7653, 3719, 8819, 5839, 1853, 9843, 9119, 7023, 5681, 2345, 9873, 6349, 9315, 3795, 9737, 4633, 4173, 7549, 7171, 6147, 4723, 5039, 2723, 7815, 6201, 5999, 5339, 4431, 2911, 4435, 3611, 4423, 9517, 3243], | |
voice: [2475, 6547, 1471, 8691, 7847, 3595, 1767, 3311, 2507, 9651, 5321, 4473, 7117, 5947, 9489, 2669, 8741, 6149, 1301, 7297, 2975, 6413, 8391, 9705, 2243, 2091, 4231, 3107, 9499, 4205, 6013, 3393, 6401, 6985, 3683, 9447, 3287, 5181, 7587, 9353, 2135, 4947, 5405, 5223, 9457, 5767, 9265, 8191, 3927, 3061, 2805, 3273, 7331], | |
} | |
const createKey = function (t) { | |
let e = 0 | |
if (null != t && "" != t) | |
for (let i = 0; i < t.length; i++) | |
e += t.charCodeAt(i) | |
return e | |
} | |
const createSuffix = function (e, i) { | |
const o = e.toString().match(/\d+/) | |
if (null == o || 0 == o.length) | |
return "" | |
let r = parseInt(o[0]) | |
, s = createKey(i) | |
, a = null == i || 0 == i.length ? 1 : i.length | |
return (17 * (r + 7) * secrets.resource[(s + r * a) % 100] % 8973 + 1e3).toString() | |
} | |
const zeroPadding = function (t, e) { | |
const i = t >= 0 ? "" : "-" | |
t = Math.abs(t) | |
for (var n = t > 0 ? Math.floor(Math.log(t) * Math.LOG10E + 1) : 1, o = "", r = 0, s = e - n; r < s; r++) | |
o += "0" | |
return i + o + t | |
} | |
const getPath = function(t, e, i) { | |
"album_status" == i ? e = !1 : 1 == false && (e = !1) | |
let _ = i + (e ? "_dmg" : "") | |
, u = "ship_" + _ | |
, l = createSuffix(t, u) | |
, c = zeroPadding(t, 4) | |
return "/kcs2/" + "resources/ship/" + _ + "/" + c + "_" + l + ".png" + '?version=16' | |
} | |
console.log(getPath(547, false, 'full')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment