1 |
if (live_call()) |
2 |
return global.live_result; |
3 |
var xx = 0; |
4 |
var yy = 0; |
5 |
var spawn_corner = irandom_range(1, 4); |
6 |
var spawn_direction = 0; |
7 |
var spawn_direction_1, spawn_direction_2; |
8 |
switch (spawn_corner) |
9 |
{ |
10 |
case 1: |
11 |
xx = battle_box.bbox_left - 18; |
12 |
yy = battle_box.bbox_top - 18; |
13 |
spawn_direction_1 = 0; |
14 |
spawn_direction_2 = 270; |
15 |
break; |
16 |
case 2: |
17 |
xx = battle_box.bbox_right + 18; |
18 |
yy = battle_box.bbox_top - 18; |
19 |
spawn_direction_1 = 180; |
20 |
spawn_direction_2 = 270; |
21 |
break; |
22 |
case 3: |
23 |
xx = battle_box.bbox_left - 18; |
24 |
yy = battle_box.bbox_bottom + 18; |
25 |
spawn_direction_1 = 0; |
26 |
spawn_direction_2 = 90; |
27 |
break; |
28 |
case 4: |
29 |
xx = battle_box.bbox_right + 18; |
30 |
yy = battle_box.bbox_bottom + 18; |
31 |
spawn_direction_1 = 180; |
32 |
spawn_direction_2 = 90; |
33 |
break; |
34 |
} |
35 |
do |
36 |
spawn_direction = choose(spawn_direction_1, spawn_direction_2); |
37 |
until (spawn_corner_last != spawn_corner || spawn_direction != spawn_direction_last); |
38 |
if (spawn_corner_last != spawn_corner && ((spawn_corner < 3 && spawn_corner_last < 3) || (spawn_corner > 2 && spawn_corner_last > 2))) |
39 |
{ |
40 |
if (spawn_direction == spawn_direction_1) |
41 |
spawn_direction = spawn_direction_2; |
42 |
else |
43 |
spawn_direction = spawn_direction_1; |
44 |
} |
45 |
spawn_corner_last = spawn_corner; |
46 |
spawn_direction_last = spawn_direction; |
47 |
mask = instance_create_depth(xx, yy, -100, obj_ceroba_attack_bullet_trail_mask); |
48 |
with (mask) |
49 |
direction = spawn_direction; |
50 |
alarm[0] = 45;gml_Object_obj_battle_enemy_attack_ceroba_phase_2_p1_spawner_mask_Alarm_0.gmlif (live_call())
return global.live_result;
var xx = 0;
var yy = 0;
var spawn_corner = irandom_range(1, 4);
var spawn_direction = 0;
var spawn_direction_1, spawn_direction_2;
switch (spawn_corner)
{
case 1:
xx = battle_box.bbox_left - 18;
yy = battle_box.bbox_top - 18;
spawn_direction_1 = 0;
spawn_direction_2 = 270;
break;
case 2:
xx = battle_box.bbox_right + 18;
yy = battle_box.bbox_top - 18;
spawn_direction_1 = 180;
spawn_direction_2 = 270;
break;
case 3:
xx = battle_box.bbox_left - 18;
yy = battle_box.bbox_bottom + 18;
spawn_direction_1 = 0;
spawn_direction_2 = 90;
break;
case 4:
xx = battle_box.bbox_right + 18;
yy = battle_box.bbox_bottom + 18;
spawn_direction_1 = 180;
spawn_direction_2 = 90;
break;
}
do
spawn_direction = choose(spawn_direction_1, spawn_direction_2);
until (spawn_corner_last != spawn_corner || spawn_direction != spawn_direction_last);
if (spawn_corner_last != spawn_corner && ((spawn_corner < 3 && spawn_corner_last < 3) || (spawn_corner > 2 && spawn_corner_last > 2)))
{
if (spawn_direction == spawn_direction_1)
spawn_direction = spawn_direction_2;
else
spawn_direction = spawn_direction_1;
}
spawn_corner_last = spawn_corner;
spawn_direction_last = spawn_direction;
mask = instance_create_depth(xx, yy, -100, obj_ceroba_attack_bullet_trail_mask);
with (mask)
direction = spawn_direction;
alarm[0] = 45; |