1 |
function scr_enemy_attack_frostermit_ice_cubesscr_enemy_attack_frostermit_ice_cubesfunction scr_enemy_attack_frostermit_ice_cubes()
{
if (instance_number(obj_battle_enemy_attack_frostermit_ice_cube) < 8)
global.attack_counter_max = 15;
else
global.attack_counter_max = 40;
if (global.attack_counter == 0)
{
if (instance_number(obj_battle_enemy_attack_frostermit_ice_cube) >= 9)
{
with (obj_dialogue_box_battle_transformation_any)
event_user(0);
}
else
{
var distance_y = 20;
var max_variations = 4;
var random_result = irandom_range(0, max_variations);
if (instance_exists(obj_battle_enemy_attack_frostermit_ice_cube))
{
if (!instance_exists(obj_battle_enemy_attack_frostermit_ice_cube_check))
instance_create(0, 0, obj_battle_enemy_attack_frostermit_ice_cube_check);
with (obj_battle_enemy_attack_frostermit_ice_cube_check)
{
var place_meetings_max = 3;
var continue_loop = true;
while (continue_loop == true)
{
var place_meetings = 0;
for (i = 0; i <= max_variations; i++)
{
if (place_meeting(obj_dialogue_box_battle_transformation_any.bbox_left + 5 + (17 * random_result), obj_dialogue_box_battle_transformation_any.bbox_top + 5 + (17 * i), obj_battle_enemy_attack_frostermit_ice_cube))
place_meetings += 1;
}
if (place_meetings >= place_meetings_max)
{
random_result += 1;
if (random_result > max_variations)
random_result = 0;
}
else
{
continue_loop = false;
}
}
}
}
instance_create(obj_dialogue_box_battle_transformation_any.bbox_left + 5 + (17 * random_result), obj_dialogue_box_battle_transformation_any.bbox_top - distance_y, obj_battle_enemy_attack_frostermit_ice_cube);
}
}
} () |
2 |
{ |
3 |
if (instance_number(obj_battle_enemy_attack_frostermit_ice_cube) < 8) |
4 |
global.attack_counter_max = 15; |
5 |
else |
6 |
global.attack_counter_max = 40; |
7 |
if (global.attack_counter == 0) |
8 |
{ |
9 |
if (instance_number(obj_battle_enemy_attack_frostermit_ice_cube) >= 9) |
10 |
{ |
11 |
with (obj_dialogue_box_battle_transformation_any) |
12 |
event_user(0); |
13 |
} |
14 |
else |
15 |
{ |
16 |
var distance_y = 20; |
17 |
var max_variations = 4; |
18 |
var random_result = irandom_range(0, max_variations); |
19 |
if (instance_exists(obj_battle_enemy_attack_frostermit_ice_cube)) |
20 |
{ |
21 |
if (!instance_exists(obj_battle_enemy_attack_frostermit_ice_cube_check)) |
22 |
instance_create(0, 0, obj_battle_enemy_attack_frostermit_ice_cube_check); |
23 |
with (obj_battle_enemy_attack_frostermit_ice_cube_check) |
24 |
{ |
25 |
var place_meetings_max = 3; |
26 |
var continue_loop = true; |
27 |
while (continue_loop == true) |
28 |
{ |
29 |
var place_meetings = 0; |
30 |
for (i = 0; i <= max_variations; i++) |
31 |
{ |
32 |
if (place_meeting(obj_dialogue_box_battle_transformation_any.bbox_left + 5 + (17 * random_result), obj_dialogue_box_battle_transformation_any.bbox_top + 5 + (17 * i), obj_battle_enemy_attack_frostermit_ice_cube)) |
33 |
place_meetings += 1; |
34 |
} |
35 |
if (place_meetings >= place_meetings_max) |
36 |
{ |
37 |
random_result += 1; |
38 |
if (random_result > max_variations) |
39 |
random_result = 0; |
40 |
} |
41 |
else |
42 |
{ |
43 |
continue_loop = false; |
44 |
} |
45 |
} |
46 |
} |
47 |
} |
48 |
instance_create(obj_dialogue_box_battle_transformation_any.bbox_left + 5 + (17 * random_result), obj_dialogue_box_battle_transformation_any.bbox_top - distance_y, obj_battle_enemy_attack_frostermit_ice_cube); |
49 |
} |
50 |
} |
51 |
} |