1 |
if (state == 0) |
2 |
{ |
3 |
if (image_alpha < 1) |
4 |
{ |
5 |
image_alpha += 0.1 |
6 |
if (image_alpha >= 1) |
7 |
{ |
8 |
image_alpha = 1 |
9 |
alarm[0] = appear_alarmalarm[0]state += 1
no_loop_alarm = false |
10 |
} |
11 |
} |
12 |
} |
13 |
else if (state == 1) |
14 |
{ |
15 |
if (bbox_bottom < (obj_dialogue_box_battle_transformation_any.bbox_bottom - 5)) |
16 |
{ |
17 |
var vsp = fall_speed |
18 |
if ((bbox_bottom + vsp) >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4)) |
19 |
{ |
20 |
while ((bbox_bottom + sign(vsp)) < (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4)) |
21 |
y += sign(vsp) |
22 |
vsp = 0 |
23 |
} |
24 |
y += vsp |
25 |
if (bbox_bottom == (obj_dialogue_box_battle_transformation_any.bbox_bottom - 5)) |
26 |
{ |
27 |
default_y = y |
28 |
instance_create(x, y, obj_battle_enemy_attack_dunebud_sandcastle_sandcastle) |
29 |
alarm[0] = fall_alarmalarm[0]state += 1
no_loop_alarm = false |
30 |
} |
31 |
} |
32 |
} |
33 |
else if (state == 2) |
34 |
{ |
35 |
if (no_loop_alarm == false) |
36 |
{ |
37 |
shake_x_current += (shake_increase * shake_direction) |
38 |
if (abs(shake_x_current) >= shake_width_max) |
39 |
{ |
40 |
shake_x_current = shake_width_max * shake_direction |
41 |
shake_direction = (-shake_direction) |
42 |
} |
43 |
x = default_x + shake_x_current |
44 |
lift_y_current += lift_speed |
45 |
y = default_y - lift_y_current |
46 |
if (lift_y_current >= lift_height_max && abs(x - default_x) < shake_increase) |
47 |
{ |
48 |
shake_x_current = 0 |
49 |
x = default_x + shake_x_current |
50 |
} |
51 |
if (lift_y_current >= lift_height_max && x == default_x) |
52 |
{ |
53 |
alarm[0] = shake_alarmalarm[0]state += 1
no_loop_alarm = false |
54 |
no_loop_alarm = true |
55 |
} |
56 |
} |
57 |
} |
58 |
else if (state == 3) |
59 |
{ |
60 |
y -= rise_speed |
61 |
if (bbox_bottom < obj_dialogue_box_battle_transformation_any.bbox_top) |
62 |
{ |
63 |
if (image_alpha > 0) |
64 |
{ |
65 |
image_alpha -= 0.1 |
66 |
if (image_alpha <= 0) |
67 |
instance_destroy() |
68 |
} |
69 |
} |
70 |
} |