Undertale script viewer

← back to main script listing

gml_Object_obj_undyneencounter4_Step_0

(view raw script w/o annotations or w/e)
1
if (instance_exists(obj_mainchara))
2
{
3
    if (obj_mainchara.x > x && con == 0)
4
    {
5
        con = 2;
6
        musfade = instance_create(0, 0, obj_musfadeout);
7
        musfade.fadespeed = 0.01;
8
        if (instance_exists(obj_speartilegen))
9
        {
10
            with (obj_speartilegen)
11
                instance_destroy();
12
        }
13
        undyne = instance_create(view_xview[0] - 420, 100, obj_undynea_actor);
14
        undyne.rsprite = spr_undynea_starkr;
15
        undyne.direction = 0;
16
        undyne.sprite_index = undyne.rsprite;
17
    }
18
}
19
if (instance_exists(obj_mainchara))
20
{
21
    if (con == 2 && obj_mainchara.x < (x - 320) && global.interact == 0)
22
    {
23
        con = 1.5;
24
        alarm[4] = 30;
25
        global.interact = 1;
26
        curview = view_xview[0];
27
        obj_mainchara.cutscene = 1;
28
    }
29
}
30
if (con == 2.5)
31
    con = 3;
32
if (con == 3)
33
{
34
    view_xview[0] -= 1;
35
    if (view_xview[0] < (curview - 50))
36
    {
37
        con = 3.1;
38
        alarm[4] = 140;
39
    }
40
}
41
if (con == 3.1)
42
{
43
    undyne.fun = 3;
44
    undyne.hspeed = 1;
45
    undyne.image_speed = 0.1;
46
}
47
if (con == 4.1)
48
{
49
    undyne.hspeed = 0;
50
    undyne.image_speed = 0;
51
    undyne.image_index = 0;
52
    con = 5;
53
    alarm[4] = 60;
54
}
55
if (con == 6)
56
{
57
    con = 7;
58
    snd_play(snd_spearappear);
59
    alarm[4] = 30;
60
}
61
if (con == 8)
62
{
63
    snd_play(snd_arrow);
64
    rr = 1;
65
    repeat (3)
66
    {
67
        ar = instance_create(170 + (rr * 6) + random(3), -223 + (rr * 3) + random(6), obj_npc_marker);
68
        ar.visible = true;
69
        ar.sprite_index = spr_undynespear;
70
        ar.image_angle = -90;
71
        ar.vspeed = 24;
72
        ar.friction = -0.3;
73
        rr += 1;
74
    }
75
    con = 9;
76
}
77
if (con == 9)
78
{
79
    if (ar.y > obj_mainchara.y)
80
    {
81
        snd_play(snd_spearrise);
82
        instance_create(0, 0, obj_flasher);
83
        scr_shake
scr_shake

instance_create(0, 0, obj_shaker); obj_shaker.hshake = argument0; obj_shaker.vshake = argument1; obj_shaker.shakespeed = argument2;
(2, 2, 2);
84
        con = 10;
85
        alarm[4] = 30;
86
    }
87
}
88
if (con == 11)
89
{
90
    global.phasing = 1;
91
    con = 12;
92
    alarm[4] = 70;
93
    dir = 0;
94
    int = 1;
95
    tspeed = 1;
96
    tgrav = 0.2;
97
}
98
if (con == 12)
99
{
100
    if (dir == 0)
101
    {
102
        memx = random(int) - (int / 2);
103
        memy = random(int) - (int / 2);
104
        int += 0.08;
105
        dir = 1;
106
    }
107
    else
108
    {
109
        memx = -memx;
110
        memy = -memy;
111
        dir = 0;
112
    }
113
    obj_mainchara.x += memx;
114
    obj_mainchara.y += memy;
115
    tile_layer_shift(1000010, memx, memy);
116
}
117
if (con == 13)
118
{
119
    con = 14;
120
    alarm[4] = 110;
121
}
122
if (con == 14 || con == 15)
123
{
124
    tspeed += tgrav;
125
    global.border = 0;
126
    global.flag[15 in_battle] = 0;
127
    global.flag[16 type_heart_transition] = 0;
128
    SCR_BORDERSETUP
SCR_BORDERSETUP

if (global.border == 0) { global.idealborder[0] = 32; global.idealborder[1] = 602; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 1) { global.idealborder[0] = 217; global.idealborder[1] = 417; global.idealborder[2] = 180; global.idealborder[3] = 385; } if (global.border == 2) { global.idealborder[0] = 217; global.idealborder[1] = 417; global.idealborder[2] = 125; global.idealborder[3] = 385; } if (global.border == 3) { global.idealborder[0] = 237; global.idealborder[1] = 397; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 4) { global.idealborder[0] = 267; global.idealborder[1] = 367; global.idealborder[2] = 295; global.idealborder[3] = 385; } if (global.border == 5) { global.idealborder[0] = 192; global.idealborder[1] = 442; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 6) { global.idealborder[0] = 227; global.idealborder[1] = 407; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 7) { global.idealborder[0] = 227; global.idealborder[1] = 407; global.idealborder[2] = 200; global.idealborder[3] = 385; } if (global.border == 8) { global.idealborder[0] = 202; global.idealborder[1] = 432; global.idealborder[2] = 290; global.idealborder[3] = 385; } if (global.border == 9) { global.idealborder[0] = 132; global.idealborder[1] = 492; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 10) { global.idealborder[0] = 147; global.idealborder[1] = 487; global.idealborder[2] = 200; global.idealborder[3] = 385; } if (global.border == 11) { global.idealborder[0] = 32; global.idealborder[1] = 602; global.idealborder[2] = 330; global.idealborder[3] = 465; } if (global.border == 12) { global.idealborder[0] = (room_width / 2) - 40; global.idealborder[1] = (room_width / 2) + 40; global.idealborder[2] = (room_height / 2) - 40; global.idealborder[3] = (room_height / 2) + 40; } if (global.border == 13) { global.idealborder[0] = (room_width / 2) - 40; global.idealborder[1] = (room_width / 2) + 40; global.idealborder[2] = 250; global.idealborder[3] = 385; } if (global.border == 14) { global.idealborder[0] = (room_width / 2) - 35; ...
();
129
    tile_layer_shift(1000010, 1, tspeed);
130
    obj_mainchara.x += 1;
131
    obj_mainchara.y += (tspeed - 0.8);
132
    obj_mainchara.image_angle -= 0.5;
133
    view_yview[0] += 2;
134
    f = instance_create(0, 0, obj_whitefader);
135
    f.tspeed = 0.001;
136
}
137
if (con == 15)
138
{
139
    snd_play(snd_splash);
140
    with (obj_whitefader)
141
        instance_destroy();
142
    alarm[4] = 3;
143
    con = 16;
144
}
145
if (con == 17)
146
{
147
    g = instance_create(0, 0, obj_npc_marker);
148
    g.visible = true;
149
    obj_mainchara.x = 20;
150
    obj_mainchara.y = 20;
151
    obj_mainchara.cutscene = 0;
152
    g.depth = 10;
153
    g.sprite_index = spr_pixblk;
154
    g.image_xscale = 100;
155
    g.image_yscale = 100;
156
    tempmusic = caster_load("music/musicbox.ogg");
157
    con = 18;
158
    tempvol = 0;
159
    temppitch = 0.7;
160
    alarm[4] = 120;
161
}
162
if (con == 19)
163
{
164
    caster_loop(tempmusic, tempvol, 0.7);
165
    global.typer = 35;
166
    global.msc = 0;
167
    global.facechoice = 0;
168
    global.msg[0] = 
It sounds like it
came from over
here...Wait for input
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_undyneencounter4_255")
;
169
    global.msg[1] = 
Oh!Delay 11 You've fallen
down,Delay 11 haven't you...Wait for input
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_undyneencounter4_256")
;
170
    global.msg[2] = 
Are you okay?Wait for input
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_undyneencounter4_257")
;
171
    global.msg[3] = 
Here,Delay 11 get up...Wait for input
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_undyneencounter4_258")
;
172
    global.msg[4] = 
...Wait for input
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_undyneencounter4_259")
;
173
    global.msg[5] = 
\[C],Delay 11 huh?Wait for input
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_undyneencounter4_260")
;
174
    global.msg[6] = 
That's a nice name.Wait for inputClose MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_undyneencounter4_261")
;
175
    instance_create(50, 80, OBJ_WRITER);
176
    con = 20;
177
}
178
if (con == 19 || con == 20)
179
{
180
    if (tempvol < 1)
181
        tempvol += 0.02;
182
    caster_set_volume(tempmusic, tempvol);
183
}
184
if (con == 20 && instance_exists(OBJ_WRITER) == 0)
185
{
186
    global.typer = 36;
187
    global.msg[0] = 
My name is Close MessageClose Message
scr_gettext
scr_gettext

var text_id = argument[0]; var text = ds_map_find_value(global.text_data_en, text_id); if (is_undefined(text)) text = ""; if (global.language == "ja") { var loc_text = ds_map_find_value(global.text_data_ja, text_id); if (!is_undefined(loc_text)) text = loc_text; } for (var i = 1; i <= (string_length(text) - 3); i++) { if (string_copy(text, i, 2) == "\[" && string_char_at(text, i + 3) == "]") { var sel = string_char_at(text, i + 2); var replace; if (sel == "C") replace = global.charname; else if (sel == "G") replace = string(global.gold); else if (sel == "I") replace = global.itemname[global.menucoord[1]]; else if (sel == "1" && argument_count > 1) replace = argument[1]; else if (sel == "2" && argument_count > 2) replace = argument[2]; else if (sel == "3" && argument_count > 3) replace = argument[3]; else if (sel == "4" && argument_count > 4) replace = argument[4]; else if (sel == "5" && argument_count > 5) replace = argument[5]; else if (sel == "6" && argument_count > 6) replace = argument[6]; else if (sel == "7" && argument_count > 7) replace = argument[7]; else if (sel == "8" && argument_count > 8) replace = argument[8]; else if (sel == "9" && argument_count > 9) replace = argument[9]; else replace = ""; var before = string_copy(text, 1, i - 1); var after = string_copy(text, i + 4, string_length(text)); text = before + replace + after; i += (string_length(replace) - 1); } } return text;
("obj_undyneencounter4_275")
;
188
    instance_create(50, 80, OBJ_WRITER);
189
    q = instance_create(0, 0, obj_whitefader);
190
    q.tspeed = 0.01;
191
    con = 21;
192
}
193
if (con == 21)
194
{
195
    if (tempvol > 0)
196
        tempvol -= 0.008;
197
    temppitch += 0.004;
198
    caster_set_volume(tempmusic, tempvol);
199
    caster_set_pitch(tempmusic, temppitch);
200
    if (tempvol <= 0.009)
201
    {
202
        caster_free(tempmusic);
203
        con = 22;
204
    }
205
}
206
if (con == 22)
207
    room_goto_next();