Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_event_bigdoor_Step_0

(view raw script w/o annotations or w/e)
1
if (myinteract == 3)
2
{
3
    keystouse = obj_board_inventory.keycount;
4
    if (keystouse > 4)
5
        keystouse = 4;
6
    holecount = array_length(key);
7
    debug_message("holecount=" + string(holecount));
8
    if (nokeyholes == false)
9
    {
10
        if (keystouse > 0)
11
            con = 10;
12
        else
13
            con = 2;
14
    }
15
    else
16
    {
17
        con = 90;
18
    }
19
    if (nokeyholes && !obj_board_inventory.sunmoonstone)
20
    {
21
        con = 90;
22
        keytimer = 14;
23
    }
24
    myinteract = 4;
25
}
26
if (con == 2)
27
{
28
    if (read == 0)
29
    {
30
        
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; ...
("no_name");
31
        msgsetloc(0, 
IT'S LOCKED.Wait for inputClose Message
"IT'S LOCKED./%", "obj_board_event_bigdoor_slash_Step_0_gml_34_0"
);
32
        read++;
33
    }
34
    else
35
    {
36
        
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; ...
("no_name");
37
        msgsetloc(0, 
IT'S STILL LOCKED.Wait for inputClose Message
"IT'S STILL LOCKED./%", "obj_board_event_bigdoor_slash_Step_0_gml_40_0"
);
38
    }
39
    bw_make();
40
    con++;
41
}
42
if (con == 3 && !bw_ex())
43
{
44
    con = 0;
45
    myinteract = 0;
46
    global.interact = 0;
47
}
48
if (con == 10)
49
{
50
    var whichkey = 0;
51
    for (var i = 0; i < array_length(key); i++)
52
    {
53
        if (key[whichkey].x > key[i].x)
54
            whichkey = i;
55
    }
56
    instance_create(key[whichkey].x, key[whichkey].y, obj_board_smokepuff);
57
    with (key[whichkey])
58
        instance_destroy();
59
    array_delete(key, whichkey, 1);
60
    snd_play(snd_impact);
61
    keystouse--;
62
    holecount--;
63
    with (obj_board_inventory)
64
        keycount--;
65
    con++;
66
}
67
if (con == 11)
68
{
69
    if (keystouse <= 0)
70
    {
71
        con = 3;
72
    }
73
    else
74
    {
75
        keytimer = 0;
76
        con = 12;
77
    }
78
    if (holecount == 0)
79
    {
80
        keytimer = 0;
81
        nokeyholes = true;
82
        con = 90;
83
    }
84
}
85
if (con == 12)
86
{
87
    keytimer++;
88
    if (keytimer == 15)
89
        con = 10;
90
}
91
if (con == 90)
92
{
93
    if (obj_board_inventory.sunmoonstone == 0)
94
    {
95
        keytimer++;
96
        if (keytimer == 15)
97
        {
98
            
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; ...
("no_name");
99
            msgsetloc(0, 
ONLY THE MOONCLOUD STONE REMAINS.Wait for inputClose Message
"ONLY THE \\cYMOONCLOUD STONE\\cW REMAINS./%", "obj_board_event_bigdoor_slash_Step_0_gml_94_0"
);
100
            bw_make();
101
            con = 3;
102
        }
103
    }
104
    else
105
    {
106
        con = 90.5;
107
    }
108
}
109
if (con == 90.5)
110
{
111
    global.interact = 0;
112
    with (obj_mainchara_board)
113
    {
114
        controlled = false;
115
        follow = false;
116
        sleepy = false;
117
    }
118
    
scr_pathfind_end
scr_pathfind_end

function
scr_pathfind_end(arg0)
{ with (obj_mainchara_board) { if (name == arg0) { path_end(); path_target_x = -1; path_target_y = -1; is_moving_timer = 0; is_moving = false; } } }
("ralsei");
119
    
scr_pathfind_end
scr_pathfind_end

function
scr_pathfind_end(arg0)
{ with (obj_mainchara_board) { if (name == arg0) { path_end(); path_target_x = -1; path_target_y = -1; is_moving_timer = 0; is_moving = false; } } }
("susie");
120
    
scr_play_recording
scr_play_recording

function
scr_play_recording(arg0, arg1)
{ with (obj_mainchara_board) { if (name == arg0) { susierecordcon = 2; susierecordcount = 0; susierecordstring = arg1; susierecordsave = false; } } }
("ralsei", "0W0W");
121
    
scr_play_recording
scr_play_recording

function
scr_play_recording(arg0, arg1)
{ with (obj_mainchara_board) { if (name == arg0) { susierecordcon = 2; susierecordcount = 0; susierecordstring = arg1; susierecordsave = false; } } }
("susie", "0W0W");
122
    
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("kris", 5.5, 4, 2);
123
    
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("ralsei", 5, 5, 2);
124
    
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie", 6, 5, 2);
125
    con = 90.6;
126
    timer = 0;
127
    failsafe = 0;
128
}
129
if (con == 90.6)
130
{
131
    var trig = 0;
132
    var krtrig = 0;
133
    if (
scr_board_checklocation
scr_board_checklocation

function
scr_board_checklocation()
{ var _name = argument0; var _xloc = argument1; var _yloc = argument2; if (_xloc < 12) _xloc = board_tilex(_xloc); if (_yloc < 12) _yloc = board_tiley(_yloc); var _tol = 4; if (argument_count == 4) _tol = argument3; var targ = 0; with (obj_mainchara_board) { if (name == _name) targ = id; } if (!i_ex(targ)) { debug_message("target does not exist"); return false; } if (abs(targ.x - _xloc) < _tol && abs(targ.y - _yloc) < _tol) return true; }
("kris", 5.5, 4, 2))
134
        krtrig = 1;
135
    if (
scr_board_checklocation
scr_board_checklocation

function
scr_board_checklocation()
{ var _name = argument0; var _xloc = argument1; var _yloc = argument2; if (_xloc < 12) _xloc = board_tilex(_xloc); if (_yloc < 12) _yloc = board_tiley(_yloc); var _tol = 4; if (argument_count == 4) _tol = argument3; var targ = 0; with (obj_mainchara_board) { if (name == _name) targ = id; } if (!i_ex(targ)) { debug_message("target does not exist"); return false; } if (abs(targ.x - _xloc) < _tol && abs(targ.y - _yloc) < _tol) return true; }
("ralsei", 5, 5, 2))
136
        trig++;
137
    if (
scr_board_checklocation
scr_board_checklocation

function
scr_board_checklocation()
{ var _name = argument0; var _xloc = argument1; var _yloc = argument2; if (_xloc < 12) _xloc = board_tilex(_xloc); if (_yloc < 12) _yloc = board_tiley(_yloc); var _tol = 4; if (argument_count == 4) _tol = argument3; var targ = 0; with (obj_mainchara_board) { if (name == _name) targ = id; } if (!i_ex(targ)) { debug_message("target does not exist"); return false; } if (abs(targ.x - _xloc) < _tol && abs(targ.y - _yloc) < _tol) return true; }
("susie", 6, 5, 2))
138
        trig++;
139
    if (krtrig)
140
    {
141
        var movecheck = 0;
142
        with (obj_mainchara_board)
143
        {
144
            if (!is_moving)
145
                movecheck++;
146
        }
147
        if (movecheck == 3)
148
            failsafe++;
149
        if (failsafe > 5 && trig < 2)
150
            trig = 2;
151
    }
152
    if (krtrig && trig == 2)
153
    {
154
        timer = 0;
155
        con = 90.7;
156
    }
157
}
158
if (con == 90.7)
159
{
160
    timer++;
161
    if (timer == 5)
162
    {
163
        with (obj_mainchara_board)
164
        {
165
            if (name == "kris")
166
                setxy(304, 192);
167
        }
168
        con = 91;
169
        timer = 0;
170
    }
171
}
172
if (con == 91)
173
{
174
    snd_play(snd_item);
175
    obj_board_inventory.sunmoonstone = 0;
176
    var kris = 0;
177
    with (obj_mainchara_board)
178
    {
179
        if (name == "kris")
180
            kris = id;
181
    }
182
    kris.fun = 1;
183
    kris.sprite_index = kris.usprite_carry;
184
    sunmoonstone = instance_create(kris.x, kris.y, obj_board_marker);
185
    sunmoonstone.sprite_index = spr_board_sunmoonstone;
186
    sunmoonstone.depth = kris.depth;
187
    
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(sunmoonstone);
188
    with (sunmoonstone)
189
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("y", y, 120, 30, 1, "out");
190
    with (sunmoonstone)
191
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("x", x, 304, 30, 1, "out");
192
    snd_play_delay(snd_link_secret, 30);
193
    keytimer = 0;
194
    con++;
195
}
196
if (con == 92)
197
{
198
    keytimer++;
199
    if (keytimer == 70)
200
    {
201
        instance_create(sunmoonstone.x, sunmoonstone.y, obj_board_smokepuff);
202
        safe_delete(sunmoonstone);
203
        keytimer = 0;
204
        snd_play(snd_impact);
205
        dooropened = true;
206
        con++;
207
        with (obj_mainchara_board)
208
        {
209
            if (name == "kris")
210
            {
211
                controlled = true;
212
                fun = 0;
213
            }
214
            if (name == "ralsei")
215
            {
216
            }
217
        }
218
    }
219
}
220
if (dooropened == true)
221
{
222
    image_index = 1;
223
    mysolid.image_yscale = 0.1;
224
}