Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_homealone_dess_phone_Step_0

(view raw script w/o annotations or w/e)
1
if (start_speech)
2
{
3
    speech_delay_timer--;
4
    if (speech_delay_timer <= 0)
5
    {
6
        start_speech = false;
7
        speech_active = true;
8
        show_text = true;
9
    }
10
}
11
if (speech_active)
12
{
13
    if (i_ex(obj_writer))
14
    {
15
        var text_finished = false;
16
        with (obj_writer)
17
            text_finished = reachedend;
18
        if (text_finished && show_text_timer <= 0)
19
        {
20
            show_text_timer = 65;
21
            fade_bubble = true;
22
        }
23
    }
24
    else
25
    {
26
        if (stop_speech)
27
            exit;
28
        show_text_timer--;
29
        if (show_text_timer <= 0)
30
        {
31
            if (speech_index >= array_length_1d(speech))
32
            {
33
                speech_active = false;
34
                exit;
35
            }
36
            draw_set_font(
scr_84_get_font
scr_84_get_font

function
scr_84_get_font(arg0)
{ if (!variable_global_exists("chemg_last_get_font")) global.chemg_last_get_font = ""; if (arg0 != global.chemg_last_get_font) global.chemg_last_get_font = arg0; return ds_map_find_value(global.font_map, arg0); }
("dotumche"));
37
            snd_play(spr_kris_phone_message);
38
            bg_base_alpha = 0;
39
            current_text = speech[speech_index];
40
            global.msg[0] = current_text;
41
            var text_height = string_height(current_text) * 0.25;
42
            var text_width = ((string_width(current_text) / 2) + 20) * 0.75;
43
            var bubble = instance_create((phone_marker.x - (text_width / 2)) + 20, phone_marker.y, obj_text_spikeballoon);
44
            bubble.y = phone_marker.y + 30;
45
            bubble.tailx = phone_marker.x + 40;
46
            bubble.taily = phone_marker.y + 15;
47
            bubble.w = (string_width(current_text) / 2) + 20;
48
            global.typer = 81;
49
            writer = instance_create((phone_marker.x - (text_width / 2)) + 20, speech_base_ypos - text_height, obj_writer);
50
            writer.shake = 0.75;
51
            writer.rate = 4;
52
            writer.textscale = 0.5;
53
            writer.hspace = 5;
54
            writer.vspace = 9;
55
            writer.fadeonend = 0.02;
56
            with (writer)
57
                skippable = 0;
58
            speech_index++;
59
        }
60
    }
61
}
62
if (stop_speech)
63
{
64
    if (!i_ex(obj_writer))
65
    {
66
        stop_speech = false;
67
        instance_destroy();
68
    }
69
}
70
if (fade_bubble)
71
{
72
    fade_bubble_timer++;
73
    if (fade_bubble_timer == 1)
74
    {
75
        with (obj_text_spikeballoon)
76
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_alpha", 0.7, 0, 60);
77
    }
78
    if (fade_bubble_timer == 60)
79
    {
80
        fade_bubble = false;
81
        fade_bubble_timer = 0;
82
        with (obj_text_spikeballoon)
83
            instance_destroy();
84
    }
85
}