This repository has been archived by the owner on May 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
resource_list.js
149 lines (128 loc) · 3.05 KB
/
resource_list.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
// the following functions assume the original image is beige
function turnToBlue(svgElem) {
svgElem.innerHTML = svgElem.innerHTML.replace(/#e0d1af/g, '#8db5e7');
return svgElem;
}
function turnToGreen(svgElem) {
svgElem.innerHTML = svgElem.innerHTML.replace(/#e0d1af/g, '#6fc4a9');
return svgElem;
}
function turnToPink(svgElem) {
svgElem.innerHTML = svgElem.innerHTML.replace(/#e0d1af/g, '#f19cb7');
return svgElem;
}
function turnToYellow(svgElem) {
svgElem.innerHTML = svgElem.innerHTML.replace(/#e0d1af/g, '#fc0');
return svgElem;
}
const resList = {
'meteorBig1': {},
'meteorBig2': {},
'meteorBig3': {},
'meteorBig4': {},
'meteorMed1': {},
'meteorMed2': {},
'meteorSmall1': {},
'meteorSmall2': {},
'meteorTiny1': {},
'meteorTiny2': {},
'laserBeam': {},
'laserBeamDead': {},
'jetpack': {},
'jetpackFire': {},
'jetpackParticle': {},
'planet': {},
'heartFilled': {},
'heartHalfFilled': {},
'heartNotFilled': {},
/*'goldCoin': {},
'silverCoin': {},
'bronzeCoin': {},*/
//'alien(Blue)_hurt': {},
'alien(Beige)_duck': {
'Blue': turnToBlue,
'Green': turnToGreen,
'Pink': turnToPink,
'Yellow': turnToYellow
},
'alien(Beige)_jump': {
'Blue': turnToBlue,
'Green': turnToGreen,
'Pink': turnToPink,
'Yellow': turnToYellow
},
'alien(Beige)_stand': {
'Blue': turnToBlue,
'Green': turnToGreen,
'Pink': turnToPink,
'Yellow': turnToYellow
},
'alien(Beige)_walk1': {
'Blue': turnToBlue,
'Green': turnToGreen,
'Pink': turnToPink,
'Yellow': turnToYellow
},
'alien(Beige)_walk2': {
'Blue': turnToBlue,
'Green': turnToGreen,
'Pink': turnToPink,
'Yellow': turnToYellow
},
'alienBeige_mouth_happy': {},
'alienBeige_mouth_unhappy': {},
'alienBeige_mouth_surprise': {},
'alienBlue_mouth_happy': {},
'alienBlue_mouth_unhappy': {},
'alienBlue_mouth_surprise': {},
'alienGreen_mouth_happy': {},
'alienGreen_mouth_unhappy': {},
'alienGreen_mouth_surprise': {},
'alienPink_mouth_happy': {},
'alienPink_mouth_unhappy': {},
'alienPink_mouth_surprise': {},
'alienYellow_mouth_happy': {},
'alienYellow_mouth_unhappy': {},
'alienYellow_mouth_surprise': {},
'astronaut_helmet': {},
'enemyBlack1': {},
'enemyBlack2': {},
'enemyBlack3': {},
'enemyBlack4': {},
'enemyBlack5': {},
'enemyBlue1': {},
'enemyBlue2': {},
'enemyBlue3': {},
'enemyBlue4': {},
'enemyBlue5': {},
'enemyGreen1': {},
'enemyGreen2': {},
'enemyGreen3': {},
'enemyGreen4': {},
'enemyGreen5': {},
'enemyRed1': {},
'enemyRed2': {},
'enemyRed3': {},
'enemyRed4': {},
'enemyRed5': {},
'rifleShot': {},
'lmg': {},
'smg': {},
'shotgun': {},
'knife': {},
'shotgunBall': {},
'muzzle': {},
'muzzle2': {}
};
export function getFinalResNames(cbk) {
for (let resName in resList) {
let baseName = resName.replace(/\((.+)\)/, '$1'); // get rid of the parens
let variants = {};
for (let variant in resList[resName]) {
let variantName = resName.replace(/\((.+)\)/, variant); // get rid of the parens
variants[variantName] = resList[resName][variant];
}
cbk(baseName, variants);
}
}
export let resourceAmount = Object.keys(resList).length;