Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_ceroba_phase_2_overworld_cutscene_dialogue_chujin_Draw_64

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
if (message_current > (array_length_1d(prt) - 1) || prt[message_current] == spr_collisionbox)
4
    portrait = false
5
else
6
    portrait = true
7
if (position == 0)
8
    yy = 160
9
else
10
    yy = 5
11
var xx = 30
12
if (portrait == true)
13
    xx = 88
14
var portrait_xx = 52
15
var line_sep = 18
16
draw_set_font(dialogue_font)
17
draw_set_color(c_white)
18
draw_set_halign(fa_left)
19
message_actual = string_copy(message[message_current], 0, cutoff)
20
if (portrait == true)
21
{
22
    if (cutoff < string_length(message[message_current]) && portrait_can_animate == true)
23
        var prt_animate = -1
24
    else
25
        prt_animate = 0
26
    var portrait_y_disjoint = yy + sprite_get_height(prt[message_current]) / 3 + 28
27
    draw_sprite_ext(prt[message_current], prt_animate, portrait_xx, portrait_y_disjoint, 0.5, 0.5, 0, c_white, 1)
28
    if (prt_animate == 0)
29
    {
30
        switch prt[message_current]
31
        {
32
            case 343:
33
                if (portrait_idle_animated == spr_collisionbox && irandom(40) == 1)
34
                {
35
                    portrait_idle_animated = toriel_blink
36
                    portrait_idle_frame = 0
37
                }
38
                if (portrait_idle_animated != spr_collisionbox)
39
                {
40
                    draw_sprite_ext(portrait_idle_animated, portrait_idle_frame, portrait_xx, portrait_y_disjoint, 0.5, 0.5, 0, c_white, 1)
41
                    portrait_idle_frame += 0.2
42
                }
43
                if (portrait_idle_frame >= sprite_get_number(portrait_idle_animated))
44
                {
45
                    portrait_idle_animated = spr_collisionbox
46
                    portrait_idle_frame = 0
47
                }
48
                break
49
            case 3232:
50
                if (portrait_idle_animated == spr_collisionbox && irandom(30) == 1)
51
                {
52
                    portrait_idle_animated = spr_portrait_ceroba_lostit_twitch
53
                    portrait_idle_frame = 0
54
                }
55
                if (portrait_idle_animated != spr_collisionbox)
56
                {
57
                    draw_sprite_ext(portrait_idle_animated, portrait_idle_frame, portrait_xx, portrait_y_disjoint, 0.5, 0.5, 0, c_white, 1)
58
                    portrait_idle_frame += 0.2
59
                }
60
                if (portrait_idle_frame >= sprite_get_number(portrait_idle_animated))
61
                {
62
                    portrait_idle_animated = 0
63
                    portrait_idle_frame = 0
64
                }
65
                break
66
        }
67
68
    }
69
}
70
draw_set_alpha(image_alpha)
71
var text_yy = 90
72
draw_set_color(c_black)
73
draw_text_ext((xx + 1), text_yy, string_hash_to_newline(message_actual), line_sep, -1)
74
draw_text_ext((xx + 1), (text_yy + 1), string_hash_to_newline(message_actual), line_sep, -1)
75
draw_text_ext(xx, (text_yy + 1), string_hash_to_newline(message_actual), line_sep, -1)
76
draw_text_ext((xx - 1), (text_yy + 1), string_hash_to_newline(message_actual), line_sep, -1)
77
draw_text_ext((xx - 1), text_yy, string_hash_to_newline(message_actual), line_sep, -1)
78
draw_text_ext((xx - 1), (text_yy - 1), string_hash_to_newline(message_actual), line_sep, -1)
79
draw_text_ext(xx, (text_yy - 1), string_hash_to_newline(message_actual), line_sep, -1)
80
draw_text_ext((xx + 1), (text_yy - 1), string_hash_to_newline(message_actual), line_sep, -1)
81
draw_set_color(c_white)
82
draw_text_ext(xx, text_yy, string_hash_to_newline(message_actual), line_sep, -1)
83
draw_set_alpha(1)
84
if (color == true)
85
{
86
    if (color_set == false)
87
    {
88
        for (var i = 0; i < (array_length_1d(message) - 1); i++)
89
        {
90
            var len = array_length_2d(message_col, i)
91
            if (len == 0)
92
                message_col[i][0] = ""
93
            else if (len > 0)
94
            {
95
                for (var j = 0; j < (array_length_1d(col_modif) - 1); j++)
96
                {
97
                    if (j < array_length_2d(message_col, i) && message_col[i][j] == 0)
98
                        message_col[i][j] = ""
99
                }
100
            }
101
        }
102
        color_set = true
103
    }
104
    for (j = 0; j < array_length_2d(message_col, message_current); j++)
105
    {
106
        message_actual_col[j] = string_copy(message_col[message_current][j], 0, cutoff)
107
        draw_set_color(col_modif[j])
108
        draw_text_ext(xx, (yy + 10), string_hash_to_newline(message_actual_col[j]), line_sep, -1)
109
    }
110
}
111
draw_set_color(c_white)
112
if (dialogue_is_minishop == true)
113
{
114
    var minishop_box_xx = 204
115
    var minishop_box_yy = 92
116
    draw_set_color(c_white)
117
    draw_rectangle(minishop_box_xx, minishop_box_yy, (minishop_box_xx + 100), (minishop_box_yy + 53), false)
118
    draw_set_color(c_black)
119
    draw_rectangle((minishop_box_xx + 3), (minishop_box_yy + 3), (minishop_box_xx + 100 - 3), (minishop_box_yy + 53 - 3), false)
120
    draw_set_font(fnt_battle)
121
    draw_set_color(c_white)
122
    var item_count = 1
123
    while (item_count <= 8)
124
    {
125
        if (global.item_slot[item_count] == "Nothing")
126
            break
127
        else
128
        {
129
            item_count++
130
            continue
131
        }
132
    }
133
    draw_text(217, 100, string_hash_to_newline("$ - " + string(global.player_gold) + "#SPACE - " + (string(item_count - 1)) + "/8"))
134
}
135
if (choice == false && alpha_fade == false)
136
    return;
137
xx = 100
138
var spacing = 0.25
139
if (ch[4] != "")
140
    spacing = 0.5
141
if portrait
142
    spacing = 0.15
143
if (position == 0)
144
{
145
    var ypos1 = 190
146
    if (ch[3] == "")
147
        ypos1 = 210
148
    var ypos2 = 210
149
}
150
else
151
{
152
    ypos1 = 32
153
    if (ch[3] == "")
154
        ypos1 = 56
155
    ypos2 = 56
156
}
157
if (ch[4] != "")
158
    xx -= 30
159
var xpos1 = xx
160
var xpos2 = xx + 122
161
if (portrait == true)
162
    xpos1 += 20
163
var xpos3 = xpos1
164
var xpos4 = xpos2
165
if (ch[2] == "")
166
    xpos1 = xpos1 + 56
167
if (ch[4] == "")
168
    xpos3 = xpos1 + 56
169
draw_set_alpha(ch_alpha)
170
if (cutoff >= string_length(message[message_current]) && global.dialogue_open == true)
171
{
172
    draw_set_halign(fa_center)
173
    if (ch[4] != "")
174
        draw_set_halign(fa_left)
175
    draw_text(xpos1, ypos1, string_hash_to_newline(ch[1]))
176
    if (ch[2] != "")
177
        draw_text(xpos2, ypos1, string_hash_to_newline(ch[2]))
178
    if (ch[3] != "")
179
        draw_text(xpos3, ypos2, string_hash_to_newline(ch[3]))
180
    if (ch[4] != "")
181
        draw_text(xpos4, ypos2, string_hash_to_newline(ch[4]))
182
    draw_set_halign(fa_center)
183
    var soul_offset = string_width(string_hash_to_newline(ch[p])) * 0.5
184
    if (ch[4] != "")
185
        soul_offset = 0
186
    switch p
187
    {
188
        case 1:
189
            var soul_x = xpos1 - soul_offset - 8
190
            var soul_y = ypos1 + 8
191
            break
192
        case 2:
193
            soul_x = xpos2 - soul_offset - 8
194
            soul_y = ypos1 + 8
195
            break
196
        case 3:
197
            soul_x = xpos3 - soul_offset - 8
198
            soul_y = ypos2 + 8
199
            break
200
        case 4:
201
            soul_x = xpos4 - soul_offset - 8
202
            soul_y = ypos2 + 8
203
            break
204
    }
205
206
    draw_sprite(spr_heart_yellow_overworld, 0, soul_x, soul_y)
207
}
208
draw_set_alpha(1)
209
draw_set_halign(fa_left)