-
Notifications
You must be signed in to change notification settings - Fork 25
/
player-common.js
executable file
·171 lines (150 loc) · 11.4 KB
/
player-common.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
Player.prototype.addGenericAnimations = function()
{
var dizzyFrames = 2;
var offsetXPct = 0.4;
var offsetY = 75;
var bfire = this.addBlueFireAnimation(offsetXPct,offsetY);
for(var i = 0; i < 24; ++i)
{
num = (i < 10) ? ("0" + i) : i;
bfire.addFrame(this,0,null,"images/misc/misc/bfire-" + num + ".png",dizzyFrames);
}
var dizzyFrames = 2;
var offsetXPct = 0.4;
var offsetY = 125;
var rfire = this.addRedFireAnimation(offsetXPct,offsetY);
for(var i = 1; i < 44; ++i)
{
num = (i < 10) ? ("0" + i) : i;
rfire.addFrame(this,0,null,"images/misc/misc/rfire-" + num + ".png",dizzyFrames);
}
var dizzyFrames = 2;
var offsetXPct = 0.4;
var offsetY = 10;
for(var i = 0; i < 2; ++i)
{
var dizzyAnim = this.addDizzyAnimation(offsetXPct,offsetY);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-0.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-1.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-2.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-3.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-4.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-5.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-6.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-7.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-8.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-9.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-10.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-11.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-12.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-13.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-14.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-15.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-16.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-17.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-18.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-19.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-20.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-21.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-22.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-23.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-24.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-25.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-26.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-27.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-28.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-29.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-30.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-31.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-32.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-33.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-34.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-35.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-36.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-37.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-38.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-39.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-40.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-41.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-42.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-43.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-44.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-45.png",dizzyFrames);
dizzyAnim.addFrame(this,0,null,"|images/misc/misc/dizzy-" + i + "-46.png",dizzyFrames);
}
var specialAnimFrames = 2;
var animFrames4 = 4;
for(var team = 1; team < 3; ++team)
{
var fhr_light = this.addGenericAnimation(ATTACK_FLAGS.FRONT|ATTACK_FLAGS.LIGHT,team,"front light");
fhr_light.addFrame(this,0,null,"|images/misc/misc/x-hit-p1-" + team + "-0.png", animFrames4);
fhr_light.addFrame(this,0,null,"|images/misc/misc/x-hit-p1-" + team + "-1.png", animFrames4);
fhr_light.addFrame(this,0,null,"|images/misc/misc/x-hit-p1-" + team + "-2.png", animFrames4);
fhr_light.addFrame(this,0,null,"|images/misc/misc/x-hit-p1-" + team + "-3.png", animFrames4);
fhr_light.addFrame(this,0,null,"|images/misc/misc/x-hit-p1-" + team + "-4.png", animFrames4);
var fhr_medium = this.addGenericAnimation(ATTACK_FLAGS.FRONT|ATTACK_FLAGS.MEDIUM,team,"front medium");
fhr_medium.addFrame(this,0,null,"|images/misc/misc/x-hit-p2-" + team + "-0.png", animFrames4);
fhr_medium.addFrame(this,0,null,"|images/misc/misc/x-hit-p2-" + team + "-1.png", animFrames4);
fhr_medium.addFrame(this,0,null,"|images/misc/misc/x-hit-p2-" + team + "-2.png", animFrames4);
fhr_medium.addFrame(this,0,null,"|images/misc/misc/x-hit-p2-" + team + "-3.png", animFrames4);
fhr_medium.addFrame(this,0,null,"|images/misc/misc/x-hit-p2-" + team + "-4.png", animFrames4);
var fhr_hard = this.addGenericAnimation(ATTACK_FLAGS.FRONT|ATTACK_FLAGS.HARD,team,"front hard");
fhr_hard.addFrame(this,0,null,"|images/misc/misc/x-hit-p3-" + team + "-0.png", animFrames4);
fhr_hard.addFrame(this,0,null,"|images/misc/misc/x-hit-p3-" + team + "-1.png", animFrames4);
fhr_hard.addFrame(this,0,null,"|images/misc/misc/x-hit-p3-" + team + "-2.png", animFrames4);
fhr_hard.addFrame(this,0,null,"|images/misc/misc/x-hit-p3-" + team + "-3.png", animFrames4);
fhr_hard.addFrame(this,0,null,"|images/misc/misc/x-hit-p3-" + team + "-4.png", animFrames4);
}
var fhr_block = this.addGenericAnimation(ATTACK_FLAGS.FRONT|ATTACK_FLAGS.BLOCK,0,"block");
fhr_block.addFrame(this,0,null,"|images/misc/misc/x-hit-block-0.png", animFrames4);
fhr_block.addFrame(this,0,null,"|images/misc/misc/x-hit-block-1.png", animFrames4);
fhr_block.addFrame(this,0,null,"|images/misc/misc/x-hit-block-2.png", animFrames4);
fhr_block.addFrame(this,0,null,"|images/misc/misc/x-hit-block-3.png", animFrames4);
fhr_block.addFrame(this,0,null,"|images/misc/misc/x-hit-block-4.png", animFrames4);
var rhr_spit1 = this.addGenericAnimation(ATTACK_FLAGS.REAR|ATTACK_FLAGS.SPIT1,0,"rear spit",MOVE_FLAGS.MOVE_WITH_PLAYER);
rhr_spit1.addFrame(this,0,null,"|images/misc/misc/x-spit-0-0.png", animFrames4);
rhr_spit1.addFrame(this,0,null,"|images/misc/misc/x-spit-0-1.png", animFrames4);
rhr_spit1.addFrame(this,0,null,"|images/misc/misc/x-spit-0-2.png", animFrames4);
var rhr_spit2 = this.addGenericAnimation(ATTACK_FLAGS.REAR|ATTACK_FLAGS.SPIT2,0,"big rear spit",MOVE_FLAGS.MOVE_WITH_PLAYER);
rhr_spit2.addFrame(this,0,null,"|images/misc/misc/x-spit-1-0.png", animFrames4);
rhr_spit2.addFrame(this,0,null,"|images/misc/misc/x-spit-1-1.png", animFrames4);
rhr_spit2.addFrame(this,0,null,"|images/misc/misc/x-spit-1-2.png", animFrames4);
var rhr_special1 = this.addGenericAnimation(ATTACK_FLAGS.REAR|ATTACK_FLAGS.SPECIAL1,0,"rear special 1",MOVE_FLAGS.MOVE_WITH_PLAYER);
rhr_special1.addFrame(this,0,null,"|images/misc/misc/x-hit-s1-0.png", specialAnimFrames);
rhr_special1.addFrame(this,0,null,"|images/misc/misc/x-hit-s1-1.png", specialAnimFrames);
rhr_special1.addFrame(this,0,null,"|images/misc/misc/x-hit-s1-2.png", specialAnimFrames);
rhr_special1.addFrame(this,0,null,"|images/misc/misc/x-hit-s1-3.png", specialAnimFrames);
rhr_special1.addFrame(this,0,null,"|images/misc/misc/x-hit-s1-4.png", specialAnimFrames);
var rhr_special2 = this.addGenericAnimation(ATTACK_FLAGS.REAR|ATTACK_FLAGS.SPECIAL2,0,"rear special 2",MOVE_FLAGS.MOVE_WITH_PLAYER);
rhr_special2.addFrame(this,0,null,"|images/misc/misc/x-hit-s2-0.png", specialAnimFrames);
rhr_special2.addFrame(this,0,null,"|images/misc/misc/x-hit-s2-1.png", specialAnimFrames);
rhr_special2.addFrame(this,0,null,"|images/misc/misc/x-hit-s2-2.png", specialAnimFrames);
rhr_special2.addFrame(this,0,null,"|images/misc/misc/x-hit-s2-3.png", specialAnimFrames);
rhr_special2.addFrame(this,0,null,"|images/misc/misc/x-hit-s2-4.png", specialAnimFrames);
var rhr_special3 = this.addGenericAnimation(ATTACK_FLAGS.REAR|ATTACK_FLAGS.SPECIAL3,0,"rear special 3",MOVE_FLAGS.MOVE_WITH_PLAYER);
rhr_special3.addFrame(this,0,null,"|images/misc/misc/x-hit-s3-0.png", specialAnimFrames);
rhr_special3.addFrame(this,0,null,"|images/misc/misc/x-hit-s3-1.png", specialAnimFrames);
rhr_special3.addFrame(this,0,null,"|images/misc/misc/x-hit-s3-2.png", specialAnimFrames);
rhr_special3.addFrame(this,0,null,"|images/misc/misc/x-hit-s3-3.png", specialAnimFrames);
rhr_special3.addFrame(this,0,null,"|images/misc/misc/x-hit-s3-4.png", specialAnimFrames);
for(var i = 0; i < CONSTANTS.MAX_EXTRA_IMAGES; ++i)
{
var dirt = this.addDirtAnimation();
dirt.addFrame(this,0,null,"|images/misc/misc/x-dirt-0.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-dirt-1.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-dirt-2.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-dirt-3.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-dirt-4.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-dirt-5.png", animFrames4);
}
for(var i = 0; i < CONSTANTS.MAX_EXTRA_IMAGES; ++i)
{
var dirt = this.addBigDirtAnimation();
dirt.addFrame(this,0,null,"|images/misc/misc/x-big-dirt-0.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-big-dirt-1.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-big-dirt-2.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-big-dirt-3.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-big-dirt-4.png", animFrames4);
dirt.addFrame(this,0,null,"|images/misc/misc/x-big-dirt-5.png", animFrames4);
}
}