Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_couchwriter_Step_0

(view raw script w/o annotations or w/e)
1
if (reformat == true)
2
{
3
    init = 0;
4
    reformat = false;
5
}
6
if (init == 0)
7
{
8
    if (i_ex(obj_quizsequence))
9
        quiz = true;
10
    autowrap = true;
11
    for (var i = 0; i < string_width(mystring); i++)
12
    {
13
        if (string_char_at(mystring, i) == "#")
14
            autowrap = false;
15
    }
16
    if (global.lang == "ja")
17
        autowrap = false;
18
    if (autowrap == true)
19
    {
20
        var spacelocation = 0;
21
        var linelength = 0;
22
        var stringlength = string_length(mystring);
23
        var savestring = mystring;
24
        var autowrapchar = 22;
25
        var failsafe = 0;
26
        for (var i = 1; i < stringlength; i++)
27
        {
28
            var thischar = string_char_at(savestring, i);
29
            if (thischar == " ")
30
                spacelocation = i;
31
            linelength++;
32
            if (linelength >= autowrapchar && spacelocation >= 1)
33
            {
34
                mystring = string_insert("#", mystring, spacelocation);
35
                mystring = string_delete(mystring, spacelocation + 1, 1);
36
                linelength = 0;
37
                i = spacelocation;
38
                spacelocation = -1;
39
                failsafe++;
40
                if (failsafe >= 50 && 
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
41
                    break;
42
            }
43
        }
44
        autowrap = false;
45
    }
46
    if (forceAutowrap == true)
47
        autowrap = true;
48
    if (speaker == "none" || speaker == "")
49
    {
50
        mysnd = 0;
51
        mycolor = c_white;
52
    }
53
    if (speaker == "ralsei" || speaker == "Ralsei" || speaker == "ra" || speaker == "r")
54
    {
55
        mycolor = hexcolor(#6FD213);
56
        mysnd = 131;
57
    }
58
    if (speaker == "susie" || speaker == "Susie" || speaker == "su" || speaker == "s")
59
    {
60
        mycolor = hexcolor(#740C83);
61
        mysnd = 128;
62
    }
63
    if (speaker == "tenna" || speaker == "Tenna" || speaker == "te" || speaker == "t")
64
    {
65
        mycolor = c_yellow;
66
        mysnd = 139;
67
        specialtalk = 1;
68
        if (talklength == 6)
69
            talklength = 12;
70
    }
71
    if (speaker == "lancer" || speaker == "Lancer" || speaker == "la" || speaker == "l")
72
    {
73
        mycolor = #5585BD;
74
        mysnd = 134;
75
    }
76
    readstring = string_hash_to_newline_ex(mystring);
77
    if (drawtime == -1)
78
        drawtime = string_length(mystring) * 4;
79
    if (cleartext == 1)
80
    {
81
        with (object_index)
82
        {
83
            if (id != other.id)
84
                instance_destroy();
85
        }
86
    }
87
    if (cleartext == 2)
88
    {
89
        with (object_index)
90
        {
91
            if (id != other.id)
92
            {
93
                if (speaker == other.speaker)
94
                    instance_destroy();
95
            }
96
        }
97
    }
98
    myfnt = 5;
99
    if (global.lang == "ja")
100
        myfnt = 11;
101
    if (customcolor != -1)
102
        mycolor = customcolor;
103
    if (customsnd != -1)
104
        mysnd = customsnd;
105
    if (customfont != -1)
106
        myfnt = customfnt;
107
    init = 1;
108
    if (depth == -1)
109
    {
110
        depth = 5000;
111
        var count = instance_number(object_index);
112
        if (count > 1)
113
        {
114
            depth = 5000 - count;
115
            with (object_index)
116
            {
117
                if (id != other.id)
118
                {
119
                    if (other.depth >= depth)
120
                        other.depth = depth - 2;
121
                }
122
            }
123
        }
124
    }
125
    if (mode == 3)
126
        init = 0;
127
    if (mode == 3 && !d_ex())
128
    {
129
        darktext = "* " + mystring + "/%";
130
        
scr_speaker
scr_speaker

function
scr_speaker(arg0)
{ _speaker = arg0; global.typer = 5; if (global.darkzone == 1) global.typer = 6; if (global.fighting == 1) global.typer = 4; global.fc = 0; global.fe = 0; if (_speaker == "silent" && global.darkzone == 0) global.typer = 2; if (_speaker == "silent" && global.darkzone == 1) global.typer = 36; if (_speaker == "balloon" || _speaker == "enemy") global.typer = 50; if (_speaker == "sans") { global.typer = 14; global.fc = 6; } if (_speaker == "undyne" || _speaker == "und") { global.typer = 17; global.fc = 9; } if (_speaker == "temmie" || _speaker == "tem") global.typer = 21; if (_speaker == "jevil") global.typer = 35; if (_speaker == "catti") global.fc = 13; if (_speaker == "jockington" || _speaker == "joc") global.fc = 14; if (_speaker == "catty" || _speaker == "caddy") global.fc = 16; if (_speaker == "bratty" || _speaker == "bra") global.fc = 17; if (_speaker == "rouxls" || _speaker == "rou") global.fc = 18; if (_speaker == "burgerpants" || _speaker == "bur") global.fc = 19; if (_speaker == "spamton") { if (global.fighting == 0) global.typer = 66; else global.typer = 68; } if (_speaker == "sneo") global.typer = 67; if (_speaker == "tenna") { global.typer = 80; if (global.fighting == 1) global.typer = 81; } if (_speaker == "susie" || _speaker == "sus") { global.fc = 1; global.typer = 10; if (global.darkzone == 1) { global.typer = 30; if (global.fighting == 1) global.typer = 47; } } if (_speaker == "ralsei" || _speaker == "ral") { global.fc = 2; global.typer = 31; if (global.fighting == 1) global.typer = 45; if (global.flag[30 ralsei_hat_state] == 1) global.typer = 6; } if (_speaker == "noelle" || _speaker == "noe") { global.fc = 3; if (global.darkzone == 0) global.typer = 12; else global.typer = 56; if (global.fighting == 1) global.typer = 59; } if (_speaker == "toriel" || _speaker == "tor") { global.fc = 4; global.typer = 7; } if (_speaker == "asgore" || _speaker == "asg") { global.fc = 10; global.typer = 18; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; ...
(speaker);
131
        msgset(0, darktext);
132
        d = d_make();
133
        d.side = 1;
134
        global.interact = 1;
135
        modecon = 1;
136
        init = 1;
137
    }
138
}
139
if (modecon == 1)
140
{
141
    if (!d_ex())
142
    {
143
        global.interact = 0;
144
        instance_destroy();
145
    }
146
}