1 |
if (live_call()) |
2 |
return global.live_result; |
3 |
var battle_box = 3154; |
4 |
if (image_alpha < 0.99) |
5 |
image_alpha += 0.2; |
6 |
else |
7 |
image_alpha = 1; |
8 |
if (in_bounds == true) |
9 |
{ |
10 |
if ((bbox_left + lengthdir_x(speed, direction)) <= (obj_dialogue_box_battle_transformation_any.bbox_left - 4)) |
11 |
{ |
12 |
if (direction == 180) |
13 |
direction = 0; |
14 |
else if (direction > 180) |
15 |
direction = 325; |
16 |
else |
17 |
direction = 45; |
18 |
bounce_count -= 1; |
19 |
audio_play_sound(snd_decibatbouncewave2, 1, 0); |
20 |
} |
21 |
else if ((bbox_right + lengthdir_x(speed, direction)) >= (obj_dialogue_box_battle_transformation_any.bbox_right + 4)) |
22 |
{ |
23 |
if (direction == 0) |
24 |
direction = 180; |
25 |
else if (direction > 180) |
26 |
direction = 225; |
27 |
else |
28 |
direction = 135; |
29 |
bounce_count -= 1; |
30 |
audio_play_sound(snd_decibatbouncewave2, 1, 0); |
31 |
} |
32 |
if ((bbox_bottom + lengthdir_y(speed, direction)) >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4)) |
33 |
{ |
34 |
if (direction == 270) |
35 |
direction = 90; |
36 |
else if (direction > 270) |
37 |
direction = 45; |
38 |
else |
39 |
direction = 135; |
40 |
bounce_count -= 1; |
41 |
audio_play_sound(snd_decibatbouncewave2, 1, 0); |
42 |
} |
43 |
if ((bbox_top + lengthdir_y(speed, direction)) <= (obj_dialogue_box_battle_transformation_any.bbox_top + 4)) |
44 |
{ |
45 |
if (direction == 90) |
46 |
direction = 270; |
47 |
else if (direction > 90) |
48 |
direction = 225; |
49 |
else |
50 |
direction = 315; |
51 |
bounce_count -= 1; |
52 |
audio_play_sound(snd_decibatbouncewave2, 1, 0); |
53 |
} |
54 |
} |
55 |
else if (rectangle_in_rectangle(bbox_left, bbox_top, bbox_right, bbox_bottom, battle_box.bbox_left + 28, battle_box.bbox_top + 28, battle_box.bbox_right - 28, battle_box.bbox_bottom - 28)) |
56 |
{ |
57 |
in_bounds = true; |
58 |
} |
59 |
if (bounce_count <= 0) |
60 |
{ |
61 |
image_xscale -= 0.25; |
62 |
image_alpha -= 0.25; |
63 |
image_yscale = image_xscale; |
64 |
if (image_xscale <= 0) |
65 |
instance_destroy(); |
66 |
} |