1 |
if live_call() |
2 |
return global.live_result; |
3 |
image_angle = (sin(current_time / 300)) * 30 |
4 |
if (fade_in > 0 && image_alpha >= 0.5) |
5 |
{ |
6 |
if 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;
}
} () |
7 |
{ |
8 |
image_xscale = 1.2 |
9 |
image_yscale = 1.2 |
10 |
audio_play_sound(snd_ceroba_shield_bell_hit, 1, 0) |
11 |
obj_ceroba_phase_2_shield.hit_show_timer = 30 |
12 |
} |
13 |
} |
14 |
if (bullet_destroy_self == true) |
15 |
{ |
16 |
instance_create_depth(x, y, (depth - 100), obj_attack_ceroba_bell_ring_white) |
17 |
instance_create_depth(x, y, (depth - 101), obj_ceroba_phase_2_bell_destroy) |
18 |
instance_destroy() |
19 |
return; |
20 |
} |
21 |
if (fade_in == 1) |
22 |
{ |
23 |
if (image_alpha < 1) |
24 |
image_alpha += 0.2 |
25 |
else |
26 |
fade_in = 2 |
27 |
} |
28 |
else if (fade_in == 2) |
29 |
{ |
30 |
if (global.enemy_attacking == true) |
31 |
image_alpha = lerp(image_alpha, 1, 0.15) |
32 |
else |
33 |
image_alpha = lerp(image_alpha, 0, 0.15) |
34 |
} |
35 |
image_xscale = lerp(image_xscale, 1, 0.15) |
36 |
image_yscale = image_xscale |
37 |
x_offset_base = obj_ceroba_phase_2_shield.x - obj_ceroba_phase_2_shield.xstart |
38 |
if (can_move == true) |
39 |
{ |
40 |
var dir = point_direction(x_offset, y, target_position[0], target_position[1]) |
41 |
if (point_distance(x_offset, y, target_position[0], target_position[1]) > move_speed) |
42 |
{ |
43 |
x_offset += lengthdir_x(move_speed, dir) |
44 |
y += lengthdir_y(move_speed, dir) |
45 |
} |
46 |
else |
47 |
{ |
48 |
x_offset = target_position[0] |
49 |
y = target_position[1] |
50 |
can_move = false |
51 |
} |
52 |
} |
53 |
x = xstart + x_offset_base + (x_offset - xstart) |