1 |
if (type == 5 && sameattacker < 2 && obj_swatchling_battle_controller.red_count > 0) |
2 |
{ |
3 |
var swatch_bc = obj_swatchling_battle_controller; |
4 |
if (init == 1) |
5 |
{ |
6 |
if (sameattacker == 1 && sameattack == scr_monsterpop()) |
7 |
btimer = -20; |
8 |
init = 2; |
9 |
if (scr_monsterpop() != 1 && sameattack != scr_monsterpop()) |
10 |
side = irandom(20); |
11 |
difficulty = (scr_monsterpop() == 1) ? 1.5 : 1; |
12 |
var _platecarry = swatch_bc.yellow_count > swatch_bc.blue_count; |
13 |
if (_platecarry) |
14 |
difficulty = (sameattacker == 1) ? 0.35 : 0.75; |
15 |
if (_platecarry) |
16 |
swatch_bc.shockwave_x_1 = ((maxx + 140) - side) + 98; |
17 |
} |
18 |
if (made >= 10) |
19 |
{ |
20 |
made = 0; |
21 |
if (swatch_bc.yellow_count > swatch_bc.blue_count) |
22 |
{ |
23 |
if ((init % 2) == 0) |
24 |
swatch_bc.shockwave_x_2 = ((maxx + 140) - side) + 98 + 40; |
25 |
else |
26 |
swatch_bc.shockwave_x_1 = ((maxx + 140) - side) + 98 + 40; |
27 |
} |
28 |
else |
29 |
{ |
30 |
side = irandom(20); |
31 |
} |
32 |
init++; |
33 |
} |
34 |
if (btimer > ((scr_monsterpop() == sameattack) ? 4 : 6)) |
35 |
{ |
36 |
flip = sameattacker == 1 || (swatch_bc.blue_count == swatch_bc.yellow_count && swatch_bc.blue_count > 0); |
37 |
reverse = swatch_bc.blue_count == swatch_bc.yellow_count && swatch_bc.blue_count > 0; |
38 |
btimer = 0; |
39 |
xx = (maxx + 140) - (made * 40) - side; |
40 |
yy = maxy - 3; |
41 |
if (flip) |
42 |
yy = miny + 3; |
43 |
if (reverse) |
44 |
xx = (minx - 140) + (made * 40) + side; |
45 |
d = scr_bullet_createscr_bullet_createfunction scr_bullet_create(arg0, arg1, arg2)
{
var __newbullet = instance_create(arg0, arg1, arg2);
__newbullet.damage = damage;
__newbullet.target = target;
if (variable_instance_exists(self, "element"))
__newbullet.element = element;
return __newbullet;
} (xx, yy, obj_swatchling_shockwave); |
46 |
d.damage = damage; |
47 |
d.target = target; |
48 |
d.grazepoints = 4; |
49 |
if (swatch_bc.blue_count > swatch_bc.yellow_count) |
50 |
d.sizemultiplier = 0.5; |
51 |
else |
52 |
d.sizemultiplier = difficulty; |
53 |
d.startColor = special ? c_orange : c_red; |
54 |
if (flip) |
55 |
d.image_angle = 180; |
56 |
made++; |
57 |
} |
58 |
} |
59 |
else if (type == 6 && sameattacker < 2 && obj_swatchling_battle_controller.yellow_count > 0) |
60 |
{ |
61 |
if (init == 1) |
62 |
{ |
63 |
ratio = min(ratio, 1.6); |
64 |
init = 2; |
65 |
side = irandom(6 - (scr_monsterpop() + sameattack)); |
66 |
if (obj_swatchling_battle_controller.red_count > obj_swatchling_battle_controller.blue_count) |
67 |
{ |
68 |
if (sameattack >= 2) |
69 |
ratio = 2.4; |
70 |
if (sameattacker == 1) |
71 |
btimer = 36; |
72 |
} |
73 |
} |
74 |
if (btimer > (30 * ratio)) |
75 |
{ |
76 |
btimer = 0; |
77 |
var _bounce = obj_swatchling_battle_controller.blue_count > 0; |
78 |
var _shockwave = !_bounce && obj_swatchling_battle_controller.red_count > 0; |
79 |
if (sameattack > 1) |
80 |
_bounce = false; |
81 |
var _combo = _shockwave || _bounce; |
82 |
xx = (sameattacker || _shockwave) ? (minx - 120) : (maxx + 120); |
83 |
flip = (sameattack > 1) ? sameattacker : (made % 2); |
84 |
if (_combo) |
85 |
flip = 0; |
86 |
yy = (obj_growtangle.y + 50) - (flip * 60); |
87 |
d = instance_create(xx, yy, obj_swatchling_platter); |
88 |
d.speed = (sameattack || _combo == 3) ? 3 : 4; |
89 |
d.direction = ((sameattacker == 0 || _bounce) && !_shockwave) ? 180 : 0; |
90 |
d.grazepoints = 4; |
91 |
if (special) |
92 |
d.hasCandy = irandom(6) == 6; |
93 |
else if (made == side) |
94 |
d.hasCandy = 1; |
95 |
d.timer = -1 - irandom(19); |
96 |
d.damage = damage; |
97 |
d.target = target; |
98 |
d.startColor = special ? c_green : c_yellow; |
99 |
d.platterPlate.image_blend = image_blend == d.startColor; |
100 |
d.platterLid.image_blend = image_blend == d.startColor; |
101 |
made++; |
102 |
} |
103 |
} |
104 |
else if (type == 7 && obj_swatchling_battle_controller.blue_count > 0) |
105 |
{ |
106 |
if (special == 0) |
107 |
{ |
108 |
special = 1; |
109 |
d = instance_create(x + 82, y + 68, obj_swatchling_cannonball); |
110 |
d.creator = creator; |
111 |
d.damage = damage; |
112 |
d.target = target; |
113 |
d.grazepoints = 4; |
114 |
d.childgraze = 4; |
115 |
global.monsterinstance[creator].visible = 0; |
116 |
if (sameattack > 1) |
117 |
d.trackplayer = -1; |
118 |
if (sameattack > 2) |
119 |
d.spawnbullets = 0; |
120 |
} |
121 |
} |