Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_couchwriter_Draw_0

(view raw script w/o annotations or w/e)
1
var _cx = camerax();
2
var _cy = cameray();
3
if (init)
4
{
5
    draw_set_font(fnt_dotumche);
6
    if (x == -1 && y == -1)
7
    {
8
        setxy(_cx + 320, _cy + 430);
9
        if (quiz)
10
            y = _cy + 420;
11
        if (speaker == "ralsei" || speaker == "Ralsei" || speaker == "ra" || speaker == "r" || speaker == 2)
12
        {
13
            if (quiz)
14
            {
15
                x = _cx + 400;
16
            }
17
            else
18
            {
19
                x = _cx + 362;
20
                y = _cy + 350 + 4;
21
            }
22
        }
23
        if (speaker == "susie" || speaker == "Susie" || speaker == "su" || speaker == "s" || speaker == 1)
24
        {
25
            if (quiz)
26
            {
27
                x = _cx + 100;
28
            }
29
            else
30
            {
31
                x = _cx + 164;
32
                y = _cy + 350 + 4;
33
            }
34
        }
35
        if (speaker == "tenna")
36
        {
37
            if (quiz)
38
                x = _cx + 540;
39
            else
40
                x = _cx + 474 + 8;
41
            if (quiz)
42
            {
43
            }
44
            else
45
            {
46
                y = _cy + 310;
47
                var count = instance_number(object_index);
48
                if (count > 1)
49
                {
50
                    var doadjust = false;
51
                    with (object_index)
52
                    {
53
                        if (speaker == "ralsei" || speaker == "Ralsei" || speaker == "ra" || speaker == "r" || speaker == 2)
54
                            doadjust = true;
55
                    }
56
                    if (doadjust)
57
                        y -= 16;
58
                }
59
            }
60
        }
61
    }
62
    timer++;
63
    if (specialtalk == 0)
64
    {
65
        if (timer % talkrate && timer < talklength)
66
        {
67
            if (mysnd != 0)
68
                snd_play(mysnd);
69
        }
70
    }
71
    if (specialtalk == 1)
72
    {
73
        if (timer % talkrate && timer < talklength)
74
        {
75
            var rand = irandom(8) + 1;
76
            var pitchrandom = 0.86 + random(0.35);
77
            var soundindex = "snd_tv_voice_short";
78
            if (rand >= 2)
79
                soundindex += ("_" + string(rand));
80
            soundindex = asset_get_index(soundindex);
81
            audio_stop_sound(snd_tv_voice_short);
82
            audio_stop_sound(snd_tv_voice_short_2);
83
            audio_stop_sound(snd_tv_voice_short_3);
84
            audio_stop_sound(snd_tv_voice_short_4);
85
            audio_stop_sound(snd_tv_voice_short_5);
86
            audio_stop_sound(snd_tv_voice_short_6);
87
            audio_stop_sound(snd_tv_voice_short_7);
88
            audio_stop_sound(snd_tv_voice_short_8);
89
            audio_stop_sound(snd_tv_voice_short_9);
90
            audio_stop_sound(snd_tv_voice_short_10);
91
            snd_play_x(soundindex, 0.7, pitchrandom);
92
        }
93
    }
94
    if (timer >= drawtime)
95
        myalpha = lerp(myalpha, -0.1, 0.2);
96
    if (myalpha <= 0)
97
        instance_destroy();
98
    if (mode == 0)
99
    {
100
    }
101
    if (mode == 1)
102
    {
103
    }
104
    if (mode == 2)
105
    {
106
        if (global.lang == "ja")
107
            draw_set_font(fnt_ja_dotumche);
108
        else
109
            draw_set_font(fnt_dotumche);
110
        truetext = string_hash_to_newline(mystring);
111
        bubblewidth = round(string_width(truetext) / 2) + bubblepadding;
112
        bubbleheight = round(string_height(truetext) / 2) + bubblepadding;
113
        if (autowrap == 1)
114
        {
115
            truetext = mystring;
116
            bubblewidth = min(string_width(truetext) / 2, autowraplength / 2) + bubblepadding;
117
            linecount = round(string_width(mystring) / autowraplength);
118
            bubbleheight = (linecount * (separation / 2)) + bubblepadding + 8;
119
            bubbleheight = max(bubbleheight, 8);
120
        }
121
        draw_set_color(outlineColor);
122
        draw_circle(x - bubblewidth, y - bubbleheight, 8 + outlineThickness, 0);
123
        draw_circle(x + bubblewidth, y - bubbleheight, 8 + outlineThickness, 0);
124
        draw_circle(x - bubblewidth, y + bubbleheight, 8 + outlineThickness, 0);
125
        draw_circle(x + bubblewidth, y + bubbleheight, 8 + outlineThickness, 0);
126
        ossafe_fill_rectangle(x - bubblewidth, y - bubbleheight - 8 - outlineThickness, x + bubblewidth, y + bubbleheight + 8 + outlineThickness);
127
        ossafe_fill_rectangle(x - bubblewidth - 8 - outlineThickness, y - bubbleheight, x + bubblewidth + 8 + outlineThickness, y + bubbleheight);
128
        if (quiz == false)
129
        {
130
            draw_line_width(x + 10 + outlineThickness, y + bubbleheight, x, y + bubbleheight + 20 + outlineThickness, outlineThickness);
131
            draw_line_width(x - 10 - outlineThickness, y + bubbleheight, x, y + bubbleheight + 20 + outlineThickness, outlineThickness);
132
        }
133
        if (quiz == true)
134
        {
135
            draw_line_width(x + 10 + outlineThickness, y - bubbleheight, x, y - bubbleheight - 20 - outlineThickness, outlineThickness);
136
            draw_line_width(x - 10 - outlineThickness, y - bubbleheight, x, y - bubbleheight - 20 - outlineThickness, outlineThickness);
137
        }
138
        draw_set_color(textbubbleColor);
139
        draw_circle(x - bubblewidth, y - bubbleheight, 8, 0);
140
        draw_circle(x + bubblewidth, y - bubbleheight, 8, 0);
141
        draw_circle(x - bubblewidth, y + bubbleheight, 8, 0);
142
        draw_circle(x + bubblewidth, y + bubbleheight, 8, 0);
143
        ossafe_fill_rectangle(x - bubblewidth, y - bubbleheight - 8, x + bubblewidth, y + bubbleheight + 8);
144
        ossafe_fill_rectangle(x - bubblewidth - 8, y - bubbleheight, x + bubblewidth + 8, y + bubbleheight);
145
        if (quiz == false)
146
            draw_triangle(x + 10, y + bubbleheight, x - 10, y + bubbleheight, x, y + bubbleheight + 20, 0);
147
        if (quiz == true)
148
            draw_triangle(x + 10, y - bubbleheight, x - 10, y - bubbleheight, x, y - bubbleheight - 20, 0);
149
        draw_set_color(c_white);
150
        if (forceTraditionalWriter)
151
        {
152
            if (tradwriter == 0)
153
            {
154
                tradwriter = instance_create((x - bubblewidth) + 2, y - bubbleheight - 2, obj_writer);
155
                with (tradwriter)
156
                {
157
                    
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; ...
("silent");
158
                    myfont = 
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");
159
                    skippable = 0;
160
                    rate = 1;
161
                    mycolor = c_black;
162
                    mystring = other.mystring;
163
                    hspace = 9;
164
                    vspace = 16;
165
                    special = 5;
166
                    formattext = false;
167
                    charline = 22;
168
                    skipme = 1;
169
                    shadcolor = #13D26F;
170
                }
171
            }
172
        }
173
        if (!forceTraditionalWriter)
174
        {
175
            if (dropshadow == false)
176
            {
177
                draw_set_color(mycolor);
178
                if (textColor == textbubbleColor)
179
                    textColor = 0;
180
                draw_set_halign(fa_center);
181
                draw_set_valign(fa_middle);
182
                if (autowrap == 1)
183
                    draw_text_ext(x, y, truetext, separation, autowraplength);
184
                else
185
                    draw_text(x, y, truetext);
186
                draw_set_halign(fa_left);
187
                draw_set_valign(fa_top);
188
            }
189
            else
190
            {
191
                draw_set_halign(fa_center);
192
                draw_set_valign(fa_middle);
193
                draw_set_color(mycolor);
194
                draw_set_alpha(0.25);
195
                if (autowrap == 1)
196
                {
197
                    draw_text_ext(x, y + 1, truetext, separation, autowraplength);
198
                    draw_text_ext(x + 1, y, truetext, separation, autowraplength);
199
                    draw_text_ext(x + 1, y + 1, truetext, separation, autowraplength);
200
                    draw_set_alpha(1);
201
                    draw_set_color(c_black);
202
                    draw_text_ext(x, y, truetext, separation, autowraplength);
203
                }
204
                else
205
                {
206
                    draw_text(x, y + 1, truetext);
207
                    draw_text(x + 1, y, truetext);
208
                    draw_text(x + 1, y + 1, truetext);
209
                    draw_set_alpha(1);
210
                    draw_set_color(c_black);
211
                    draw_text(x, y, truetext);
212
                }
213
                draw_set_halign(fa_left);
214
                draw_set_valign(fa_top);
215
            }
216
        }
217
    }
218
    draw_set_alpha(1);
219
}
220
draw_set_color(c_white);