1 |
if (state == 0) |
2 |
{ |
3 |
if (timer >= (animConst * 2.5)) |
4 |
timer += 0.25; |
5 |
else |
6 |
timer += (1.5 * animSpeed); |
7 |
if (timer >= (animConst * 3)) |
8 |
timer = animConst * 3; |
9 |
} |
10 |
else if (state == 1) |
11 |
{ |
12 |
timer += (8 * animSpeed); |
13 |
if (timer >= (animConst * 5)) |
14 |
timer = animConst * 5; |
15 |
} |
16 |
else if (state == 2) |
17 |
{ |
18 |
if (timer >= (animConst * 5) && zapping) |
19 |
timer -= 1.5; |
20 |
else |
21 |
timer = animConst * 5; |
22 |
} |
23 |
else if (state == 4) |
24 |
{ |
25 |
if (timer >= (animConst * 2.5)) |
26 |
timer += (0.25 * animSpeed); |
27 |
else |
28 |
timer += (1.5 * animSpeed); |
29 |
if (timer >= (animConst * 3)) |
30 |
timer = animConst * 3; |
31 |
} |
32 |
var otherHandSprite = sprite[4]; |
33 |
draw_sprite_ext(otherHandSprite, 0, x + xOffset[4] + (sin(timer / 6) * 2), y + yOffset[4] + (sin(timer / 6) * 2), 2, 2, 0, c_white, 1); |
34 |
var tailsprite = sprite[2]; |
35 |
draw_sprite_ext(tailsprite, 0, x + xOffset[2], y + yOffset[2], 2, 2, -sin(timer / 6) * 10, c_white, 1); |
36 |
var handSprite = (attacktimer < 20) ? spr_tm_hand_l : sprite[3]; |
37 |
var handdir = point_direction(xOffset[1], yOffset[1], xOffset[3], yOffset[3]); |
38 |
var handlength = point_distance(xOffset[1], yOffset[1], xOffset[3], yOffset[3]); |
39 |
var handx = xOffset[1] + lengthdir_x(handlength, (handdir - 45) + (sin(timer / 6) * 50)); |
40 |
var handy = yOffset[1] + lengthdir_y(handlength, (handdir - 45) + (sin(timer / 6) * 30)); |
41 |
var rot1 = (state == 0) ? -45 : 0; |
42 |
var rot2 = (state == 0) ? 45 : 90; |
43 |
var whipimage = 0; |
44 |
if (state == 0) |
45 |
{ |
46 |
handSprite = spr_tm_whip_ready; |
47 |
if (timer >= (animConst * 2.5)) |
48 |
whipimage = 4; |
49 |
else if (timer >= (animConst * 2)) |
50 |
whipimage = 2; |
51 |
} |
52 |
if (state == 1) |
53 |
{ |
54 |
if (timer < (animConst * 5)) |
55 |
{ |
56 |
handx = xOffset[1] + lengthdir_x(handlength, (handdir - 45) + (sin((animConst * 5) / 6) * 50)); |
57 |
handy = yOffset[1] + lengthdir_y(handlength, (handdir - 45) + (sin((animConst * 5) / 6) * 30)); |
58 |
} |
59 |
if (timer < (animConst * 4)) |
60 |
handSprite = spr_tm_whip_smear; |
61 |
draw_sprite_ext(handSprite, 0, x + handx + (cos((animConst * 5) / 6) * 2), y + handy + (sin((animConst * 5) / 6) * 2), 2, 2, point_direction(x + handx + (cos((animConst * 5) / 6) * 2), y + handy + (sin((animConst * 5) / 6) * 2), targetx, targety) - 90, c_white, 1); |
62 |
} |
63 |
else if (state != 2 && !(state == 3 && attacktimer > 55)) |
64 |
{ |
65 |
draw_sprite_ext(handSprite, whipimage, x + handx + (cos(timer / 6) * 2), y + handy + (sin(timer / 6) * 2), 2, 2, rot1 + (sin((timer - 2) / 6) * rot2), c_white, 1); |
66 |
} |
67 |
var legSprite = sprite[5]; |
68 |
draw_sprite_ext(legSprite, 0, x + xOffset[5] + (sin(timer / 6) * 0), y + yOffset[5], 2, 2, 0, c_white, 1); |
69 |
var bodySprite = sprite[1]; |
70 |
draw_sprite_ext(bodySprite, 0, x + xOffset[1], y + yOffset[1] + (sin(timer / 6) * 2), 2, 2, 0, c_white, 1); |
71 |
var headSprite = sprite[0]; |
72 |
draw_sprite_ext(headSprite, 0, x + xOffset[0], y + yOffset[0] + (sin(timer / 6) * 3), 2, 2, sin(timer / 6) * 10, c_white, 1); |
73 |
if (!quizmode && attacktimer >= 5 && attacktimer <= 20 && global.turntimer > 30) |
74 |
{ |
75 |
if (difficulty == 1) |
76 |
whipball.warnoffset = 6; |
77 |
else |
78 |
whipball.warnoffset = ((attackoffset % 90) == 0) ? 0 : 3; |
79 |
whipball.warning = attacktimer - 4; |
80 |
} |
81 |
if (attacktimer > 20) |
82 |
{ |
83 |
whipball.warning = 0; |
84 |
handx = x + handx + (cos(timer / 6) * 2); |
85 |
handy = y + handy + (sin(timer / 6) * 2); |
86 |
} |
87 |
if (attacktimer > 20 && attacktimer < 30) |
88 |
{ |
89 |
whipball.dodraw = 1; |
90 |
var invlerp = scr_inverselerp(15, 30, attacktimer); |
91 |
var xlerp = lerp(handx, targetx, invlerp); |
92 |
var ylerp = lerp(handy, targety, invlerp); |
93 |
var linkdir = point_direction(handx, handy, targetx, targety); |
94 |
whipball.origx = handx; |
95 |
whipball.origy = handy; |
96 |
for (i = 1; i < 6; i++) |
97 |
draw_sprite_ext(spr_whitepixel, 0, lerp(handx, xlerp, i / 12), lerp(handy, ylerp, i / 12), 12, 2, linkdir, c_white, 1); |
98 |
whipball.x = xlerp; |
99 |
whipball.y = ylerp; |
100 |
whipball.image_angle = attackoffset + (invlerp * 720); |
101 |
} |
102 |
if (attacktimer >= 30 && attacktimer <= 55) |
103 |
{ |
104 |
whipball.dodraw = 1; |
105 |
var linkdir = point_direction(handx, handy, targetx, targety); |
106 |
whipball.origx = handx; |
107 |
whipball.origy = handy; |
108 |
for (i = 1; i < 6; i++) |
109 |
draw_sprite_ext(spr_whitepixel, 0, lerp(handx, targetx, i / 12), lerp(handy, targety, i / 12), 12, 2, linkdir, c_white, 1); |
110 |
if (state == 2) |
111 |
draw_sprite_ext(handSprite, 0, handx, handy, 2, 2, point_direction(handx, handy, targetx, targety) - 90, c_white, 1); |
112 |
whipball.x = targetx; |
113 |
whipball.y = targety; |
114 |
whipball.image_angle = attackoffset - 45; |
115 |
} |
116 |
if (attacktimer > 55) |
117 |
{ |
118 |
var invlerp = scr_inverselerp(65, 55, attacktimer); |
119 |
var xlerp = lerp(handx, targetx, invlerp); |
120 |
var ylerp = lerp(handy, targety, invlerp); |
121 |
whipball.origx = handx; |
122 |
whipball.origy = handy; |
123 |
var linkdir = point_direction(handx, handy, targetx, targety); |
124 |
for (i = 1; i < 6; i++) |
125 |
draw_sprite_ext(spr_whitepixel, 0, lerp(handx, xlerp, i / 12), lerp(handy, ylerp, i / 12), 12, 2, linkdir, c_white, 1); |
126 |
if (state == 2 || state == 3) |
127 |
draw_sprite_ext(handSprite, 0, handx, handy, 2, 2, point_direction(handx, handy, targetx, targety) - 90, c_white, 1); |
128 |
whipball.x = xlerp; |
129 |
whipball.y = ylerp; |
130 |
whipball.image_angle = attackoffset + (invlerp * 720); |
131 |
} |