1 |
if (init == 0) |
2 |
{ |
3 |
whipball.quizmode = quizmode; |
4 |
init = 1; |
5 |
} |
6 |
truetimer++; |
7 |
attacktimer++; |
8 |
if (state == 0 && attacktimer >= 20) |
9 |
{ |
10 |
if (global.turntimer > 30) |
11 |
state = 1; |
12 |
else |
13 |
attacktimer = 19; |
14 |
} |
15 |
if (attacktimer == 5) |
16 |
{ |
17 |
if (!quizmode) |
18 |
{ |
19 |
targetx = obj_heart.x + 8; |
20 |
targety = obj_heart.y + 8; |
21 |
} |
22 |
whipball.origx = targetx; |
23 |
whipball.origy = targety; |
24 |
attackoffset += 45; |
25 |
} |
26 |
if (state == 1 && attacktimer >= 35) |
27 |
state = 2; |
28 |
if (attacktimer >= 35 && (attacktimer % 5) == 0 && attacktimer <= 45) |
29 |
{ |
30 |
var rotation = attackoffset; |
31 |
var balldirection = 0; |
32 |
if (rotateCracker) |
33 |
{ |
34 |
var handx = x + xOffset[1]; |
35 |
var handy = y + yOffset[1]; |
36 |
balldirection = point_direction(targetx, targety, handx, handy); |
37 |
} |
38 |
if (!quizmode) |
39 |
{ |
40 |
for (i = 0; i < 4; i++) |
41 |
{ |
42 |
var d = instance_create(targetx, targety, obj_regularbullet); |
43 |
d.speed = 0.1; |
44 |
d.friction = -0.5; |
45 |
d.sprite_index = spr_virovirokun_invaderbullet; |
46 |
d.timepoints = 0; |
47 |
d.direction = rotation + (90 * i) + balldirection; |
48 |
d.image_angle = d.direction + 90; |
49 |
} |
50 |
} |
51 |
} |
52 |
if (state == 2 && attacktimer > 55) |
53 |
state = 3; |
54 |
if (state == 3 && attacktimer >= 59) |
55 |
{ |
56 |
timer = animConst; |
57 |
state = 4; |
58 |
} |
59 |
if (state == 4 && attacktimer >= 65) |
60 |
{ |
61 |
whipball.dodraw = 0; |
62 |
if (!quizmode) |
63 |
{ |
64 |
targetx = obj_heart.x + 8; |
65 |
targety = obj_heart.y + 8; |
66 |
} |
67 |
whipball.origx = targetx; |
68 |
whipball.origy = targety; |
69 |
attacktimer = 5; |
70 |
state = 0; |
71 |
attackoffset += 45; |
72 |
} |