1 |
script_execute(gml_Script_scr_controls_text) |
2 |
if key_revert_pressed |
3 |
{ |
4 |
characters = message_length |
5 |
message_draw = string_copy(message[message_current], 0, characters) |
6 |
} |
7 |
if (characters < message_length) |
8 |
{ |
9 |
if (counter == 0) |
10 |
{ |
11 |
script_execute(gml_Script_scr_text_increase) |
12 |
script_execute(gml_Script_scr_talking_axis) |
13 |
} |
14 |
else |
15 |
can_talk = false |
16 |
} |
17 |
else |
18 |
{ |
19 |
can_talk = false |
20 |
if (key_select_pressed && skippable == true) |
21 |
{ |
22 |
if (message_current < message_end) |
23 |
message_adv = true |
24 |
else |
25 |
{ |
26 |
with (obj_dialogue_box_battle_transformation_any) |
27 |
event_user(0) |
28 |
with (obj_quote_bubble_battle) |
29 |
instance_destroy() |
30 |
instance_destroy() |
31 |
} |
32 |
} |
33 |
if (skippable == false) |
34 |
{ |
35 |
if (current_turn == 3 && message_current == 0) |
36 |
{ |
37 |
if (scene == 0) |
38 |
scene = 1 |
39 |
} |
40 |
} |
41 |
} |
42 |
switch scene |
43 |
{ |
44 |
case 1: |
45 |
if scr_battle_box_resize_midfightscr_battle_box_resize_midfightfunction scr_battle_box_resize_midfight() //gml_Script_scr_battle_box_resize_midfight
{
if instance_exists(obj_dialogue_box_battle_transformation_any)
{
with (obj_dialogue_box_battle_transformation_any)
{
battle_box_resize_midfight = true
battle_box_target_xscale = argument[0] / sprite_get_width(sprite_index)
battle_box_target_yscale = argument[1] / sprite_get_height(sprite_index)
if (argument_count > 2)
{
battle_box_target_x = argument[2]
battle_box_target_y = argument[3]
}
if (abs(image_xscale - battle_box_target_xscale) < 0.01 && abs(image_yscale - battle_box_target_yscale) < 0.01 && abs(x - battle_box_target_x) < 0.1 && abs(y - battle_box_target_y) < 0.1)
{
var box = obj_dialogue_box_battle_transformation_any
global.attack_surface_width = box.sprite_width - 8
global.attack_surface_height = box.sprite_height - 8
global.attack_surface_x = box.x - global.attack_surface_width * 0.5
global.attack_surface_y = box.y - global.attack_surface_height * 0.5
if surface_exists(global.attack_surface)
global.attack_surface = surface_create(global.attack_surface_width, global.attack_surface_height)
return true;
}
}
}
else
return false;
} (575, 140) |
46 |
{ |
47 |
scr_text_battlescr_text_battlefunction scr_text_battle() //gml_Script_scr_text_battle
{
if (!instance_exists(obj_dialogue_battle))
msg = instance_create(x, y, obj_dialogue_battle)
} () |
48 |
with (msg) |
49 |
{ |
50 |
sndfnt = 391 |
51 |
message[0] = "* (You do.)" |
52 |
} |
53 |
if (!global.dialogue_open) |
54 |
cutscene_advance() |
55 |
} |
56 |
break |
57 |
case 2: |
58 |
message_adv = true |
59 |
cutscene_advance() |
60 |
break |
61 |
case 3: |
62 |
if cutscene_wait(0.5) |
63 |
audio_play_sound(snd_generator_start, 1, 0, 1, 0, 0.7) |
64 |
break |
65 |
case 4: |
66 |
obj_axis_body.x = obj_axis_body.xstart |
67 |
obj_axis_body.y = obj_axis_body.ystart |
68 |
obj_axis_body.x += random_range(-1, 1) |
69 |
obj_axis_body.y += random_range(-1, 1) |
70 |
white_fade_alpha += 0.05 |
71 |
if (white_fade_alpha >= 1) |
72 |
cutscene_advance() |
73 |
break |
74 |
case 5: |
75 |
cutscene_wait(1) |
76 |
break |
77 |
case 6: |
78 |
message_adv = true |
79 |
cutscene_advance() |
80 |
obj_axis_heart.image_index = 3 |
81 |
obj_axis_heart.image_speed = 0 |
82 |
obj_axis_body.sprite_index = spr_axis_body |
83 |
audio_play_sound(snd_undertale_flash, 1, 0, 0.75, 0, 1.2) |
84 |
audio_play_sound(snd_love_increased, 1, 0, 1, 0, 1.2) |
85 |
break |
86 |
case 7: |
87 |
white_fade_alpha -= 0.1 |
88 |
if (white_fade_alpha <= 0) |
89 |
cutscene_advance() |
90 |
break |
91 |
case 8: |
92 |
skippable = true |
93 |
scene = 0 |
94 |
global.enemy_sparing = true |
95 |
break |
96 |
} |
97 |
|
98 |
if (message_adv == true) |
99 |
{ |
100 |
message_current += 1 |
101 |
message_length = string_length(message[message_current]) |
102 |
characters = 0 |
103 |
message_draw = "" |
104 |
draw_enabled = true |
105 |
message_adv = false |
106 |
} |
107 |
script_execute(gml_Script_scr_text_counter) |
108 |
if (scene > 0) |
109 |
{ |
110 |
with (obj_heart_battle_fighting_axis) |
111 |
{ |
112 |
if (image_alpha > 0) |
113 |
image_alpha -= 0.1 |
114 |
} |
115 |
with (obj_battle_enemy_attack_axis_shield) |
116 |
{ |
117 |
if (image_alpha > 0) |
118 |
image_alpha -= 0.1 |
119 |
} |
120 |
} |