Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_funnytext_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    var playsound = false;
4
    if (settingb == 0)
5
    {
6
        var text_sound = scr_funnytext_get_sound(sprite_index);
7
        if (text_sound != -4)
8
        {
9
            playsound = true;
10
            typingnoise = text_sound;
11
        }
12
    }
13
    else if (settingb == 1)
14
    {
15
        if (sprite_index == 
scr_84_get_sprite
scr_84_get_sprite

function
scr_84_get_sprite(arg0)
{ return ds_map_find_value(global.chemg_sprite_map, arg0); }
("spr_funnytext_fun_o_meter"))
16
        {
17
            if (i_ex(obj_ch3_GSA01G))
18
            {
19
                playsound = true;
20
                typingnoise = 84;
21
            }
22
        }
23
    }
24
    if (settinga == 0)
25
        typingstyle = 0;
26
    if (settinga == 1)
27
        typingstyle = 1;
28
    y += 5;
29
    if (typingstyle == 0)
30
    {
31
        var spritename = sprite_get_name(sprite_index);
32
        loopsprite = asset_get_index(spritename + "_loop");
33
        if (loopsprite > 0)
34
        {
35
            typingstyle = 2;
36
        }
37
        else
38
        {
39
            x += (sprite_width / 2);
40
            y += (sprite_height / 2);
41
            image_xscale = 0;
42
            image_yscale = 0;
43
            lerpa = 
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_xscale", 0, idealxscale, 10, -2, "out");
44
            lerpb = 
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_yscale", 0, idealyscale, 10, -2, "out");
45
        }
46
    }
47
    init = 1;
48
    if (playsound)
49
        snd_play(typingnoise);
50
}
51
if (i_ex(obj_writer))
52
{
53
    if (obj_writer.halt > 0)
54
        writerfinished = 1;
55
}
56
if (typingstyle == 0)
57
{
58
    if (writerfinished)
59
    {
60
        image_xscale = idealxscale;
61
        image_yscale = idealyscale;
62
        with (lerpa)
63
            instance_destroy();
64
        with (lerpb)
65
            instance_destroy();
66
    }
67
    image_index += 1;
68
}
69
if (typingstyle == 1)
70
{
71
    chartimer++;
72
    if (writerfinished)
73
    {
74
        charmax = image_number;
75
        typingfinished = 1;
76
    }
77
    if (!typingfinished)
78
    {
79
        if (chartimer >= typingspeed)
80
        {
81
            chartimer = 0;
82
            charmax++;
83
            if (charmax >= image_number)
84
                typingfinished = 1;
85
            snd_play(typingnoise);
86
        }
87
    }
88
}
89
if (typingstyle == 2)
90
{
91
    if (con == 1)
92
        image_index += 1;
93
    if (con == 0)
94
    {
95
        image_index += 1;
96
        if (image_index >= image_number)
97
        {
98
            sprite_index = loopsprite;
99
            image_index = 0;
100
            con = 1;
101
        }
102
    }
103
}
104
if (!i_ex(obj_writer))
105
    instance_destroy();