Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_ch4_LWF04A_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 = 75;
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(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
            start_pos_x = 14;
42
            start_pos_y = cameray() + 162;
43
            var text_height = string_height(current_text) * 0.25;
44
            var text_width = ((string_width(current_text) / 2) + 20) * 0.75;
45
            var bubble = instance_create((start_pos_x - (text_width / 2)) + 20, start_pos_y, obj_text_spikeballoon);
46
            bubble.y = start_pos_y;
47
            bubble.tailx = start_pos_x + 35;
48
            bubble.taily = start_pos_y - 30;
49
            bubble.w = (string_width(current_text) / 2) + 20;
50
            bubble.depth = 90;
51
            global.typer = 81;
52
            writer = instance_create((start_pos_x - (text_width / 2)) + 20, (start_pos_y - text_height) + 4, obj_writer);
53
            writer.shake = 0.75;
54
            writer.rate = 4;
55
            writer.textscale = 0.5;
56
            writer.hspace = 5;
57
            writer.vspace = 9;
58
            writer.fadeonend = 0.02;
59
            writer.depth = bubble.depth - 10;
60
            with (writer)
61
                skippable = 0;
62
            speech_index++;
63
        }
64
    }
65
}
66
if (stop_speech)
67
{
68
    if (!i_ex(obj_writer))
69
    {
70
        stop_speech = false;
71
        instance_destroy();
72
    }
73
}
74
if (fade_bubble)
75
{
76
    fade_bubble_timer++;
77
    if (fade_bubble_timer == 10)
78
    {
79
        with (obj_text_spikeballoon)
80
            
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);
81
    }
82
    if (fade_bubble_timer == 70)
83
    {
84
        fade_bubble = false;
85
        fade_bubble_timer = 0;
86
        with (obj_text_spikeballoon)
87
            instance_destroy();
88
    }
89
}