Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_room_castle_tv_Step_0

(view raw script w/o annotations or w/e)
1
if (con < 0)
2
    exit;
3
if (zapper_talk_active)
4
{
5
    var stop_anim = false;
6
    with (obj_writer)
7
    {
8
        if (halt > 0)
9
            stop_anim = true;
10
    }
11
    zapper_marker.image_speed = stop_anim ? 0 : 0.2;
12
    zapper_marker.image_index = stop_anim ? 0 : zapper_marker.image_index;
13
}
14
if (con == 0 && !d_ex())
15
{
16
    con = 10;
17
    zapper_talk_active = true;
18
    global.interact = 1;
19
    zapper_marker.image_speed = 0.2;
20
    
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 == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; 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; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("no_name");
21
    msgsetloc(0, 
* Hello,Delay 11 boss. Welcome to TV STUDIO.Wait for input
"* Hello^1, boss. Welcome to TV STUDIO./", "obj_room_castle_tv_slash_Step_0_gml_30_0"
);
22
    msgnextloc(
* Here you can play various MiniGames.Wait for input
"* Here you can play various MiniGames./", "obj_room_castle_tv_slash_Step_0_gml_31_0"
);
23
    msgnextloc(
* They have no effect on anything,Delay 11 so just enjoy yourself and relax!Wait for inputClose Message
"* They have no effect on anything^1, so just enjoy yourself and relax!/%", "obj_room_castle_tv_slash_Step_0_gml_32_0"
);
24
    var d = d_make();
25
}
26
if (con == 10 && !d_ex())
27
{
28
    con = -1;
29
    global.interact = 0;
30
    zapper_talk_active = false;
31
    with (zapper_marker)
32
    {
33
        image_speed = 0;
34
        image_index = 0;
35
    }
36
}
37
if (con == 20 && global.interact == 0 && !d_ex())
38
{
39
    con = 21;
40
    global.interact = 1;
41
}
42
if (con == 21)
43
{
44
    con = 22;
45
    code_timer = 0;
46
    code_entry = instance_create(x, y, obj_codeentry);
47
    with (code_entry)
48
    {
49
        side = 0;
50
        correctcode = [6, 4, 5, 3];
51
        numcount = array_length(correctcode);
52
    }
53
}
54
if (con == 22)
55
{
56
    if (code_entry.result != -1)
57
    {
58
        code_timer++;
59
        if (code_timer == 1)
60
        {
61
            if (code_entry.result == -2)
62
            {
63
                with (code_entry)
64
                    instance_destroy();
65
                code_timer = 0;
66
                con = 30;
67
            }
68
        }
69
        if (code_timer == 30)
70
        {
71
            
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 == "gerson" || _speaker == "ger" || _speaker == "gers") global.typer = 85; 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; if (global.chapter == 1) { if (global.plot < 235) global.typer = 36; ...
("no_name");
72
            if (code_entry.result == 0)
73
            {
74
                msgsetloc(0, 
* (...Delay 11 wrong combination!)Wait for inputClose Message
"* (..^1. wrong combination!)/%", "obj_room_castle_tv_slash_Step_0_gml_91_0"
);
75
                con = 30;
76
            }
77
            else
78
            {
79
                msgsetloc(0, 
* (You entered the numbers knowingly.)Wait for inputClose Message
"* (You entered the numbers knowingly.)/%", "obj_room_castle_tv_slash_Step_0_gml_96_0"
);
80
                if (
scr_flag_get
scr_flag_get

function
scr_flag_get(arg0)
{ var flag_value = global.flag[arg0]; return flag_value; } function scr_flag_name_get(arg0) { if (!global.is_console) { var v = global.flagname[arg0]; return is_undefined(v) ? "*unknown flag*" : v; } else { return ""; } } function scr_getflag(arg0) { return
scr_flag_get(arg0);
}
(1645) == 0)
81
                    
scr_flag_set
scr_flag_set

function
scr_flag_set(arg0, arg1)
{ global.flag[arg0] = arg1; if (
scr_debug())
show_debug_message("*** flag [" + string(arg0) + "] updated: " + string(arg1) + " | " + scr_flag_name_get(arg0)); } function scr_setflag(arg0, arg1) {
scr_flag_set(arg0, arg1);
}
(1645, 1);
82
                
scr_tempsave
scr_tempsave

function
scr_tempsave()
{ filechoicebk2 = global.filechoice; global.filechoice = 9;
scr_saveprocess(global.filechoice);
global.filechoice = filechoicebk2; }
();
83
                unlock_mystery_door();
84
                con = 30;
85
            }
86
            var d = d_make();
87
            d.side = 0;
88
            with (code_entry)
89
                instance_destroy();
90
            code_timer = 0;
91
        }
92
    }
93
}
94
if (con == 30 && !d_ex())
95
{
96
    con = -1;
97
    global.interact = 0;
98
}
99
if (con == 50 && !d_ex() && global.interact == 0)
100
{
101
    con = 51;
102
    global.facing = 0;
103
    global.interact = 1;
104
    var margin = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(-10, room_height - 10, spr_pixel_white);
105
    with (margin)
106
    {
107
        image_blend = c_black;
108
        image_xscale = 170;
109
        image_yscale = 40;
110
    }
111
    blackall = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(-10, -10, spr_pixel_white);
112
    blackall.image_xscale = 999;
113
    blackall.image_yscale = 999;
114
    blackall.depth = 100;
115
    blackall.image_blend = c_black;
116
    blackall.visible = 1;
117
    cutscene_master = 
scr_cutscene_make
scr_cutscene_make

function
scr_cutscene_make()
{ _cutscene_master = instance_create(0, 0, obj_cutscene_master); _cutscene_master.master_object = id; return _cutscene_master; }
();
118
    
scr_maincharacters_actors
scr_maincharacters_actors

function
scr_maincharacters_actors()
{ actor_count = 0; kr = 0; kr_actor = instance_create(obj_mainchara.x, obj_mainchara.y, obj_actor);
scr_actor_setup(kr, kr_actor, "kris");
kr_actor.sprite_index = obj_mainchara.sprite_index; kr_actor.depth = obj_mainchara.depth; with (obj_mainchara) visible = 0; for (__jj = 0; __jj < array_length_1d(global.cinstance); __jj++) { if (i_ex(global.cinstance[__jj])) { if (global.cinstance[__jj].name == "susie") { actor_count++; su = __jj + 1; su_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(su, su_actor, "susie");
su_actor.sprite_index = global.cinstance[__jj].sprite_index; su_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } if (global.cinstance[__jj].name == "ralsei") { actor_count++; ra = __jj + 1; ra_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(ra, ra_actor, "ralsei");
ra_actor.sprite_index = global.cinstance[__jj].sprite_index; ra_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } if (global.cinstance[__jj].name == "noelle") { actor_count++; no = __jj + 1; no_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(no, no_actor, "noelle");
no_actor.sprite_index = global.cinstance[__jj].sprite_index; no_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } } } }
();
119
    
c_var_lerp_instance
c_var_lerp_instance

function
c_var_lerp_instance()
{ if (argument_count < 6)
c_cmd_x("var", argument[0], argument[1], argument[2], argument[3], argument[4], 0);
else if (argument_count == 6)
c_cmd_x("var", argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
else if (argument_count == 7)
c_cmd_x("var", argument[0], argument[1], argument[2], argument[3], argument[4], string(argument[5]) + string(argument[6]));
} function c_lerp_var_instance() { if (argument_count >= 6)
c_var_lerp_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
c_var_lerp_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
c_var_lerp_instance(argument0, argument1, argument2, argument3, argument4);
} function c_lerpvar_instance() { if (argument_count >= 6)
c_var_lerp_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7)
c_var_lerp_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else
c_var_lerp_instance(argument0, argument1, argument2, argument3, argument4);
}
(blackall, "image_alpha", 1, 0, 30);
120
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(kr);
121
    
c_walkdirect
c_walkdirect

function
c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
}
(kr_actor.x, 255, 30);
122
    if (
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(2) &&
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(3))
123
    {
124
        
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
125
        
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("u");
126
        
c_setxy
c_setxy

function
c_setxy(arg0, arg1)
{
c_cmd("setxy", arg0, arg1, 0, 0);
}
(240, 265);
127
        
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
128
        
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("u");
129
        
c_setxy
c_setxy

function
c_setxy(arg0, arg1)
{
c_cmd("setxy", arg0, arg1, 0, 0);
}
(160, 265);
130
    }
131
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(60);
132
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(kr);
133
    
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("u");
134
    if (
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(2) &&
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(3))
135
    {
136
        
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
137
        
c_sprite
c_sprite

function
c_sprite(arg0)
{
c_cmd("sprite", arg0, 0, 0, 0);
}
(spr_susie_shocked_behind);
138
        
c_flip
c_flip

function
c_flip(arg0)
{
c_cmd("flip", arg0, 0, 0, 0);
}
("x");
139
        
c_shakeobj
c_shakeobj

function
c_shakeobj()
{
c_cmd("shakeobj", 0, 0, 0, 0);
}
();
140
        
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
141
        
c_sprite
c_sprite

function
c_sprite(arg0)
{
c_cmd("sprite", arg0, 0, 0, 0);
}
(spr_ralsei_shocked_behind);
142
        
c_shakeobj
c_shakeobj

function
c_shakeobj()
{
c_cmd("shakeobj", 0, 0, 0, 0);
}
();
143
    }
144
    
c_customfunc
c_customfunc

function
c_customfunc(arg0, arg1 = -1)
{ if (instance_exists(obj_cutscene_master)) { with (obj_cutscene_master) array_push(customfuncs, arg0);
c_cmd("customfunc", arg1, 0, 0, 0);
} } function c_delay_customfunc(arg0, arg1, arg2 = -1) { if (instance_exists(obj_cutscene_master))
c_cmd_x("delaycmd", arg0, "customfunc", arg2, arg1, 0, 0);
}
(function()
145
    {
146
        var explosion = instance_create(220, 240, obj_animation);
147
        snd_play(snd_badexplosion);
148
        explosion.sprite_index = spr_realisticexplosion;
149
        explosion.depth = kr_actor.depth + 10;
150
        
scr_shakescreen
scr_shakescreen

function
scr_shakescreen(arg0 = 4, arg1 = 4)
{ var shaker = instance_create(x, y, obj_shake); if (i_ex(shaker)) { shaker.shakex = arg0; shaker.shakey = arg1; } }
();
151
    });
152
    
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(mystery_door_marker, "sprite_index", spr_dw_ranking_doors_narrow_mouse);
153
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(30);
154
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(kr);
155
    
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("d");
156
    if (
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(2) &&
scr_havechar
scr_havechar

function
scr_havechar(arg0)
{ var checker = arg0; if (checker == "susie" || checker == "su" || checker == "s") checker = 2; if (checker == "ralsei" || checker == "ra" || checker == "r") checker = 3; if (checker == "noelle" || checker == "no" || checker == "n") checker = 4; _rreturn = 0; if (global.char[0] == checker) _rreturn = 1; if (global.char[1] == checker) _rreturn = 1; if (global.char[2] == checker) _rreturn = 1; return _rreturn; }
(3))
157
    {
158
        
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
159
        
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("u");
160
        
c_flip
c_flip

function
c_flip(arg0)
{
c_cmd("flip", arg0, 0, 0, 0);
}
("x");
161
        
c_setxy
c_setxy

function
c_setxy(arg0, arg1)
{
c_cmd("setxy", arg0, arg1, 0, 0);
}
(240, 265);
162
        
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
163
        
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("u");
164
        
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(30);
165
    }
166
    
c_customfunc
c_customfunc

function
c_customfunc(arg0, arg1 = -1)
{ if (instance_exists(obj_cutscene_master)) { with (obj_cutscene_master) array_push(customfuncs, arg0);
c_cmd("customfunc", arg1, 0, 0, 0);
} } function c_delay_customfunc(arg0, arg1, arg2 = -1) { if (instance_exists(obj_cutscene_master))
c_cmd_x("delaycmd", arg0, "customfunc", arg2, arg1, 0, 0);
}
(function()
167
    {
168
        global.flag[1702] = 1;
169
        with (obj_doorAny)
170
        {
171
            if (doorSpecial == "mike")
172
                init = 0;
173
        }
174
    });
175
    
c_actortokris
c_actortokris

function
c_actortokris()
{
c_cmd("actortokris", 0, 0, 0, 0);
}
();
176
    
c_actortocaterpillar
c_actortocaterpillar

function
c_actortocaterpillar()
{
c_cmd("actortocaterpillar", 0, 0, 0, 0);
}
();
177
    
c_terminatekillactors
c_terminatekillactors

function
c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
}
();
178
}
179
if (con == 51 && !d_ex() && !i_ex(obj_cutscene_master))
180
{
181
    con = -1;
182
    global.interact = 0;
183
}