1 |
if live_call() |
2 |
return global.live_result; |
3 |
if (instance_exists(obj_battle_enemy_attack_ceroba_phase_2_mask) && obj_battle_enemy_attack_ceroba_phase_2_mask.attack_stop == true) |
4 |
scene = 8 |
5 |
var spawn_delay = 0 |
6 |
var start_delay = 0.5 |
7 |
var fire_count = 7 |
8 |
var fire_distance = 60 |
9 |
var moving_time = 1 |
10 |
var pause_time = 0.75 |
11 |
if (global.hotland_flag[2] == 2) |
12 |
{ |
13 |
pause_time = 0.5 |
14 |
fire_distance = 75 |
15 |
} |
16 |
if (global.hotland_flag[2] == 3) |
17 |
{ |
18 |
pause_time = 0.2 |
19 |
fire_count = 9 |
20 |
fire_distance = 75 |
21 |
} |
22 |
scr_enemy_attack_bullet_hitscr_enemy_attack_bullet_hitfunction scr_enemy_attack_bullet_hit() //gml_Script_scr_enemy_attack_bullet_hit
{
if live_call()
return global.live_result;
if variable_instance_exists(id, "bullet_hit_draw_timer")
{
if (bullet_hit_draw_timer > 0)
bullet_hit_draw_timer -= 1
}
var collider_id = instance_place(x, y, obj_heart_yellow_shot)
if (collider_id != noone)
{
var collider_object_index = collider_id.object_index
instance_create_depth(collider_id.x, collider_id.bbox_top, -999, obj_heart_yellow_shot_destroy)
if (collider_object_index == 690)
{
if (object_index == obj_ceroba_phase_2_bell)
instance_destroy(collider_id)
if (variable_instance_exists(id, "collider_id_last") && collider_id_last == collider_id)
return;
if (collider_object_index == 690)
collider_id_last = collider_id
}
else if (collider_object_index == 2561)
{
if (variable_instance_exists(id, "collider_id_last") && collider_id_last == collider_id)
return;
collider_id_last = collider_id
}
else if ((!(variable_instance_exists(id, "collider_id_last"))) || collider_id != collider_id_last)
{
collider_id.alarm[0] = 1
collider_id.image_alpha = 0
collider_id_last = collider_id
}
audio_play_sound(snd_arc_hit, 0.1, 0)
if variable_instance_exists(id, "bullet_hit_points")
{
bullet_hit_draw_timer = 5
if (collider_object_index == 690)
bullet_hit_points -= 3
else
bullet_hit_points -= 1
if (bullet_hit_points <= 0)
bullet_destroy_self = true
}
return true;
}
} () |
23 |
if bullet_destroy_self |
24 |
{ |
25 |
instance_destroy() |
26 |
instance_create_depth(x, y, depth, obj_ceroba_attack_fire_mask_destroy) |
27 |
} |
28 |
switch scene |
29 |
{ |
30 |
case 0: |
31 |
image_alpha += 0.1 |
32 |
if (global.hotland_flag[2] >= 2) |
33 |
image_alpha += 0.15 |
34 |
if (image_alpha >= 1) |
35 |
{ |
36 |
image_alpha = 1 |
37 |
scene++ |
38 |
} |
39 |
break |
40 |
case 1: |
41 |
cutscene_wait(spawn_delay) |
42 |
break |
43 |
case 2: |
44 |
for (var i = 0; i < 360; i += (360 / fire_count)) |
45 |
{ |
46 |
var xx = x + (lengthdir_x(fire_distance, i)) |
47 |
var yy = y + (lengthdir_y(fire_distance, i)) |
48 |
fireball_array[fireball_current] = instance_create_depth(xx, yy, -100, obj_ceroba_attack_fireball) |
49 |
fireball_array[fireball_current].alarm[0] = 1 + fireball_current * 3 |
50 |
if (global.hotland_flag[2] >= 2) |
51 |
fireball_array[fireball_current].alarm[0] = 1 + fireball_current * 1 |
52 |
fireball_dir[fireball_current] = i |
53 |
fireball_current += 1 |
54 |
} |
55 |
scene++ |
56 |
break |
57 |
case 3: |
58 |
for (i = 0; i < array_length(fireball_array); i++) |
59 |
{ |
60 |
if instance_exists(fireball_array[i]) |
61 |
{ |
62 |
if (fireball_array[i].image_alpha < 1) |
63 |
return; |
64 |
} |
65 |
} |
66 |
cutscene_wait(start_delay) |
67 |
break |
68 |
case 4: |
69 |
x_target = obj_heart_battle_fighting_parent.x |
70 |
y_target = obj_heart_battle_fighting_parent.y |
71 |
direction = point_direction(x, y, x_target, y_target) |
72 |
scene++ |
73 |
break |
74 |
case 5: |
75 |
multiplier = lerp(multiplier, 1, 0.15) |
76 |
cutscene_wait(moving_time) |
77 |
break |
78 |
case 6: |
79 |
multiplier = lerp(multiplier, 0, 0.15) |
80 |
cutscene_wait(pause_time) |
81 |
break |
82 |
case 7: |
83 |
if (attack_count > 0) |
84 |
{ |
85 |
scene = 4 |
86 |
attack_count -= 1 |
87 |
} |
88 |
else |
89 |
scene++ |
90 |
break |
91 |
case 8: |
92 |
image_alpha -= 0.2 |
93 |
for (i = 0; i < array_length(fireball_array); i++) |
94 |
{ |
95 |
if instance_exists(fireball_array[i]) |
96 |
fireball_array[i].image_alpha = image_alpha |
97 |
} |
98 |
if (image_alpha < 0.2) |
99 |
{ |
100 |
instance_destroy() |
101 |
return; |
102 |
} |
103 |
break |
104 |
} |
105 |
|
106 |
if (scene >= 4) |
107 |
{ |
108 |
for (i = 0; i < array_length(fireball_array); i++) |
109 |
{ |
110 |
if instance_exists(fireball_array[i]) |
111 |
{ |
112 |
xx = x + (lengthdir_x(fire_distance, (fireball_dir[i] + dir_offset))) |
113 |
yy = y + (lengthdir_y(fire_distance, (fireball_dir[i] + dir_offset))) |
114 |
fireball_array[i].x = xx |
115 |
fireball_array[i].y = yy |
116 |
} |
117 |
} |
118 |
} |
119 |
speed = move_speed_max * multiplier |
120 |
spin_speed = spin_speed_max * multiplier |
121 |
dir_offset -= spin_speed |