1 |
if (live_call()) |
2 |
return global.live_result; |
3 |
if (mask_is_vulnerable) |
4 |
{ |
5 |
var x_target = (obj_ceroba_body_pacifist_phase_2.x - sprite_get_xoffset(obj_ceroba_body_pacifist_phase_2.sprite_index)) + 330; |
6 |
var y_target = (obj_ceroba_body_pacifist_phase_2.y - sprite_get_yoffset(obj_ceroba_body_pacifist_phase_2.sprite_index)) + 259; |
7 |
x = x_target; |
8 |
y = y_target; |
9 |
var collider_id = instance_place(x, y, obj_heart_yellow_shot); |
10 |
if (collider_id != -4) |
11 |
{ |
12 |
audio_play_sound(snd_arc_hit, 1, 0); |
13 |
x += random_range(-2, 2); |
14 |
y += random_range(-2, 2); |
15 |
instance_create_depth(collider_id.x, collider_id.y - collider_id.sprite_height, -999, obj_heart_yellow_shot_destroy); |
16 |
bullet_hit_draw_timer = 5; |
17 |
if (collider_id.object_index == obj_heart_yellow_shot_big) |
18 |
mask_hit_points -= 3; |
19 |
else |
20 |
mask_hit_points -= 1; |
21 |
instance_destroy(collider_id); |
22 |
var xp = x; |
23 |
var yp = y; |
24 |
part_emitter_region(mask_ps, mask_pe_effect_1, xp - 1, xp + 1, yp - 1, yp + 1, 0, 0); |
25 |
part_emitter_burst(mask_ps, mask_pe_effect_1, mask_pt_effect_1, 4); |
26 |
if (mask_hit_points <= 0) |
27 |
{ |
28 |
if (global.hotland_flag[2] < 3) |
29 |
{ |
30 |
audio_play_sound(snd_rock_break, 1, 0); |
31 |
scr_screenshake_battlescr_screenshake_battlefunction scr_screenshake_battle()
{
instance_destroy(obj_screenshake_battle);
var screenshake = instance_create(0, 0, obj_screenshake_battle);
battle_screenshake_duration = argument[0];
battle_screenshake_intensity = argument[1];
battle_screenshake_dec = battle_screenshake_intensity / battle_screenshake_duration;
} (6, 2); |
32 |
if (global.hotland_flag[2] == 1) |
33 |
sprite_index = spr_ceroba_mask_2; |
34 |
if (global.hotland_flag[2] == 2) |
35 |
sprite_index = spr_ceroba_mask_3; |
36 |
mask_new = instance_create_depth(x_target, y_target, depth, obj_ceroba_mask_overworld_transition); |
37 |
mask_new.sprite_index = sprite_index; |
38 |
part_emitter_burst(mask_ps, mask_pe_effect_1, mask_pt_effect_1, 6); |
39 |
instance_destroy(); |
40 |
} |
41 |
else |
42 |
{ |
43 |
instance_create_depth(x, y, depth, obj_battle_enemy_ceroba_phase_2_outro); |
44 |
} |
45 |
} |
46 |
} |
47 |
audio_sound_gain(global.battle_music, mask_hit_points / mask_hit_points_max, 500); |
48 |
if (variable_instance_exists(id, "bullet_hit_draw_timer")) |
49 |
{ |
50 |
if (bullet_hit_draw_timer > 0) |
51 |
bullet_hit_draw_timer -= 1; |
52 |
} |
53 |
exit; |
54 |
} |
55 |
if (instance_exists(obj_ceroba_body_pacifist_phase_1)) |
56 |
{ |
57 |
switch (obj_ceroba_body_pacifist_phase_1.sprite_index) |
58 |
{ |
59 |
case spr_ceroba_transformation_p1_7: |
60 |
attach_points = [[-400, -400], [148, 114], [149, 110], [149, 106], [148, 140], [147, 146], [147, 150], [147, 146], [147, 150], [147, 150], [147, 146], [147, 150], [147, 150], [147, 146], [147, 150], [147, 150], [147, 146], [147, 150], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [145, 86], [145, 86], [145, 86], [145, 86], [145, 86], [145, 84], [145, 84], [145, 82]]; |
61 |
scr_point_attachscr_point_attachfunction scr_point_attach()
{
if (live_call())
return global.live_result;
var coords = argument[0];
var target_instance = argument[1];
if (!instance_exists(target_instance))
{
show_debug_message("Target attach point instance does not exist!");
return false;
}
var x_offset = sprite_get_xoffset(target_instance.sprite_index);
var y_offset = sprite_get_yoffset(target_instance.sprite_index);
if (argument_count > 2 && argument[2] == true)
{
x_offset = 0;
y_offset = 0;
}
var array_index = clamp(target_instance.image_index, 0, array_length(coords) - 1);
x = (target_instance.x - x_offset) + coords[array_index][0];
y = (target_instance.y - y_offset) + coords[array_index][1];
} (attach_points, 773); |
62 |
break; |
63 |
default: |
64 |
break; |
65 |
} |
66 |
} |
67 |
if (instance_exists(obj_ceroba_body_pacifist_phase_2)) |
68 |
{ |
69 |
switch (obj_ceroba_body_pacifist_phase_2.sprite_index) |
70 |
{ |
71 |
case spr_ceroba_p2_1: |
72 |
exit; |
73 |
break; |
74 |
case -4: |
75 |
attach_points = [[-1, -174]]; |
76 |
break; |
77 |
case spr_ceroba_p2_sign: |
78 |
attach_points = [[321, 167], [321, 167], [321, 163], [321, 147], [321, 155], [323, 173], [323, 181], [323, 181], [323, 179], [323, 177], [323, 173], [323, 171], [321, 169]]; |
79 |
break; |
80 |
case spr_ceroba_p2_knocked_down: |
81 |
attach_points = [[-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [-400, -400], [330, 265], [330, 271], [330, 264], [330, 261], [330, 259]]; |
82 |
break; |
83 |
case spr_ceroba_p2_knocked_down_loop: |
84 |
attach_points = [[330, 259]]; |
85 |
break; |
86 |
case spr_ceroba_p2_get_up_1: |
87 |
if (obj_ceroba_body_pacifist_phase_2.image_index > 40) |
88 |
sprite_index = spr_ceroba_mask_2; |
89 |
attach_points = [[330, 259], [330, 259], [330, 259], [330, 259], [330, 259], [330, 259], [330, 259], [334, 253], [335, 253], [333, 253], [333, 253], [329, 267], [330, 263], [330, 261], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [330, 257], [329, 271], [329, 283], [-400, -400]]; |
90 |
break; |
91 |
default: |
92 |
attach_points = [[-4000, -4000]]; |
93 |
break; |
94 |
} |
95 |
scr_point_attachscr_point_attachfunction scr_point_attach()
{
if (live_call())
return global.live_result;
var coords = argument[0];
var target_instance = argument[1];
if (!instance_exists(target_instance))
{
show_debug_message("Target attach point instance does not exist!");
return false;
}
var x_offset = sprite_get_xoffset(target_instance.sprite_index);
var y_offset = sprite_get_yoffset(target_instance.sprite_index);
if (argument_count > 2 && argument[2] == true)
{
x_offset = 0;
y_offset = 0;
}
var array_index = clamp(target_instance.image_index, 0, array_length(coords) - 1);
x = (target_instance.x - x_offset) + coords[array_index][0];
y = (target_instance.y - y_offset) + coords[array_index][1];
} (attach_points, 2833); |
96 |
} |