forked from GDColon/GDBrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.js
53 lines (48 loc) · 2.01 KB
/
Player.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
const colors = require('../iconkit/sacredtexts/colors.json');
class Player {
constructor(account) {
this.username = account[1] || "-",
this.playerID = account[2],
this.accountID = account[16],
this.rank = +account[6] || +account[30],
this.stars = +account[3],
this.diamonds = +account[46],
this.coins = +account[13],
this.userCoins = +account[17],
this.demons = +account[4],
this.cp = +account[8],
this.icon = +account[21]
if (!+account[22]) { // partial profile, used for leaderboards and stuff
this.icon = {
form: ['icon', 'ship', 'ball', 'ufo', 'wave', 'robot', 'spider'][+account[14]],
icon: +account[9] || 1,
col1: +account[10],
col2: +account[11],
glow: +account[15] > 1 || account[28] == "1"
}
delete this.col1; delete this.col2; delete this.glow; delete this.col1RGB; delete this.col2RGB
}
else {
this.friendRequests = account[19] == "0",
this.messages = account[18] == "0" ? "all" : account[18] == "1" ? "friends" : "off",
this.commentHistory = account[50] == "0" ? "all" : account[50] == "1" ? "friends" : "off",
this.moderator = +account[49],
this.youtube = account[20] || null,
this.twitter = account[44] || null,
this.twitch = account[45] || null,
this.ship = +account[22],
this.ball = +account[23],
this.ufo = +account[24],
this.wave = +account[25],
this.robot = +account[26],
this.spider = +account[43],
this.col1 = +account[10],
this.col2 = +account[11],
this.deathEffect = +account[48] || 1,
this.glow = account[15] > 1 || account[28] == "1"
}
this.col1RGB = colors[account[10]] || colors["0"],
this.col2RGB = colors[account[11]] || colors["3"]
}
}
module.exports = Player;