|
1
|
if (live_call())
|
|
2
|
return global.live_result;
|
|
3
|
if (state == 0)
|
|
4
|
{
|
|
5
|
if (image_alpha < 1 && can_fade_in == true)
|
|
6
|
{
|
|
7
|
image_alpha += 0.15;
|
|
8
|
if (image_alpha > 1)
|
|
9
|
image_alpha = 1;
|
|
10
|
}
|
|
11
|
}
|
|
12
|
if (state == 1)
|
|
13
|
{
|
|
14
|
var can_trail = false;
|
|
15
|
trail_cc_current += 1;
|
|
16
|
if (trail_cc_current >= trail_cc_max)
|
|
17
|
{
|
|
18
|
can_trail = true;
|
|
19
|
trail_cc_current = 0;
|
|
20
|
}
|
|
21
|
if (can_trail == true)
|
|
22
|
{
|
|
23
|
ds_list_add(x_list, x);
|
|
24
|
ds_list_add(y_list, y);
|
|
25
|
ds_list_add(angle_list, image_angle);
|
|
26
|
while (ds_list_size(x_list) > max_points_trail)
|
|
27
|
{
|
|
28
|
ds_list_delete(x_list, 0);
|
|
29
|
ds_list_delete(y_list, 0);
|
|
30
|
ds_list_delete(angle_list, 0);
|
|
31
|
}
|
|
32
|
}
|
|
33
|
var spin_radius_speed_last = spin_radius_speed;
|
|
34
|
game_maker_cannot_do_math = power((time_elapsed_spin / ((time_max_spin / 2) * (1 / sqrt(max_rise_spin)))) - sqrt(max_rise_spin), 2);
|
|
35
|
spin_radius_speed = sign_modifier_spin * (max_rise_spin - round(game_maker_cannot_do_math));
|
|
36
|
time_elapsed_spin += time_increase_spin;
|
|
37
|
if (time_elapsed_spin >= time_max_spin)
|
|
38
|
{
|
|
39
|
time_elapsed_spin = 0;
|
|
40
|
sign_modifier_spin = -sign_modifier_spin;
|
|
41
|
}
|
|
42
|
spin_angle_speed = spin_radius_speed_multiplier * (spin_radius_speed - spin_radius_speed_last);
|
|
43
|
image_angle += spin_angle_speed;
|
|
44
|
x = spin_default_x + lengthdir_x(spin_radius_speed, spin_direction);
|
|
45
|
y = spin_default_y + lengthdir_y(spin_radius_speed, spin_direction);
|
|
46
|
if (time_elapsed_spin >= (time_max_spin / 2))
|
|
47
|
event_user(2);
|
|
48
|
}
|
|
49
|
else if (state == 2)
|
|
50
|
{
|
|
51
|
if (ds_list_size(x_list) > 0)
|
|
52
|
{
|
|
53
|
ds_list_delete(x_list, 0);
|
|
54
|
ds_list_delete(y_list, 0);
|
|
55
|
ds_list_delete(angle_list, 0);
|
|
56
|
}
|
|
57
|
if (image_angle != angle_destination)
|
|
58
|
image_angle += (target_speed * target_direction);
|
|
59
|
var angle_diff = angle_difference(image_angle, angle_destination);
|
|
60
|
if ((angle_diff * target_direction) < 0)
|
|
61
|
image_angle = angle_destination;
|
|
62
|
if (image_angle == angle_destination && no_loop_target == false)
|
|
63
|
{
|
|
64
|
image_speed = 0.5;
|
|
65
|
alarm[1] = 15; gml_Object_obj_battle_enemy_attack_martlet_feather_circle_final_feather_Alarm_1.gml
if (live_call())
return global.live_result;
image_speed = 0;
image_index = 0;
state = 3;
|
|
66
|
no_loop_target = true;
|
|
67
|
}
|
|
68
|
}
|
|
69
|
else if (state == 3)
|
|
70
|
{
|
|
71
|
var can_trail = false;
|
|
72
|
trail_cc_current += 1;
|
|
73
|
if (trail_cc_current >= trail_cc_max)
|
|
74
|
{
|
|
75
|
can_trail = true;
|
|
76
|
trail_cc_current = 0;
|
|
77
|
}
|
|
78
|
if (can_trail == true)
|
|
79
|
{
|
|
80
|
ds_list_add(x_list, x);
|
|
81
|
ds_list_add(y_list, y);
|
|
82
|
ds_list_add(angle_list, image_angle);
|
|
83
|
while (ds_list_size(x_list) > max_points_trail)
|
|
84
|
{
|
|
85
|
ds_list_delete(x_list, 0);
|
|
86
|
ds_list_delete(y_list, 0);
|
|
87
|
ds_list_delete(angle_list, 0);
|
|
88
|
}
|
|
89
|
}
|
|
90
|
x += lengthdir_x(attack_speed, image_angle);
|
|
91
|
y += lengthdir_y(attack_speed, image_angle);
|
|
92
|
if (place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == false)
|
|
93
|
in_box = true;
|
|
94
|
if (!place_meeting(x, y, obj_dialogue_box_battle_transformation_any) && in_box == true)
|
|
95
|
{
|
|
96
|
if (image_alpha > 0)
|
|
97
|
{
|
|
98
|
image_alpha -= 0.1;
|
|
99
|
if (image_alpha < 0)
|
|
100
|
image_alpha = 0;
|
|
101
|
if (image_alpha == 0)
|
|
102
|
instance_destroy();
|
|
103
|
}
|
|
104
|
}
|
|
105
|
if (distance_to_point(id_target.x, id_target.y) <= ((attack_speed / 2) + 1))
|
|
106
|
{
|
|
107
|
var id_feather_explosion = instance_create(id_target.x, id_target.y, obj_martlet_attack_splitting_feather_ext_checker);
|
|
108
|
id_feather_explosion.fcreate_angle_diff = explosion_angle;
|
|
109
|
id_feather_explosion.feather_targetted = feather_targetted;
|
|
110
|
id_feather_explosion.fcreate_count = feather_create_count;
|
|
111
|
instance_destroy();
|
|
112
|
}
|
|
113
|
}
|
|
114
|
scr_enemy_attack_bullet_hitscr_enemy_attack_bullet_hit
function 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 != -4)
{
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)
exit;
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)
exit;
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;
}
} ();
|
|
115
|
if (bullet_destroy_self)
|
|
116
|
{
|
|
117
|
with (instance_create_depth(x, y, depth, obj_battle_enemy_attack_martlet_final_feather_dying))
|
|
118
|
{
|
|
119
|
sprite_index = other.sprite_index;
|
|
120
|
image_angle = other.image_angle;
|
|
121
|
image_xscale = other.image_xscale;
|
|
122
|
}
|
|
123
|
instance_destroy();
|
|
124
|
}
|