Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b2d_icedoor_Step_0

(view raw script w/o annotations or w/e)
1
if (active)
2
{
3
    if (actinit == 0)
4
    {
5
        snd_pause(global.currentsong[1]);
6
        actinit = 1;
7
        kris.cantleave = true;
8
    }
9
}
10
if (kris == 0)
11
{
12
    with (obj_mainchara_board)
13
        other.kris = id;
14
}
15
if (deer == 0)
16
{
17
    with (obj_board_enemy_deer)
18
        other.deer = id;
19
}
20
buffer--;
21
if (myinteract == 3)
22
{
23
    if (con == 0)
24
    {
25
        con = 1;
26
        kris.controlled = false;
27
        snd_free_all();
28
        
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, 3, 2);
29
        deer.follow = 0;
30
        with (deer)
31
        {
32
            sprite_index = spr_board_deer_upsprite;
33
            var deerx = board_tilex(5.5);
34
            var deery = board_tiley(4);
35
            var movetime = max(1, round(point_distance(x, y, deerx, deery) / 4));
36
            
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, deerx, movetime);
37
            
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, deery, movetime);
38
        }
39
    }
40
}
41
if (con == 1 && 
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, 3, 1))
42
{
43
    timer++;
44
    if (timer == 15)
45
    {
46
        
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");
47
        msgsetloc(0, 
THE DOOR IS LOCKED
"THE DOOR IS LOCKED", "obj_b2d_icedoor_slash_Step_0_gml_46_0"
);
48
        d = bw_make();
49
        d.skippable = false;
50
        d.reachedend_draw_triangle = false;
51
        d.rate = 3;
52
        d.reachedend_sound_play = false;
53
        d.boardopensound = false;
54
        d.side = 1;
55
        global.interact = 1;
56
        con = 2;
57
        timer = 0;
58
    }
59
}
60
if (con == 2)
61
{
62
    if (i_ex(obj_writer))
63
    {
64
        if (obj_writer.reachedend)
65
            timer++;
66
    }
67
    if (timer >= 60)
68
    {
69
        safe_delete(obj_writer);
70
        
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");
71
        msgsetloc(0, 
THE ICE KEY WAS USED UP
"THE \\cIICE KEY\\cW WAS USED UP", "obj_b2d_icedoor_slash_Step_0_gml_71_0"
);
72
        d = bw_make();
73
        d.skip = true;
74
        d.skippable = false;
75
        d.reachedend_draw_triangle = false;
76
        d.rate = 3;
77
        d.reachedend_sound_play = false;
78
        d.boardopensound = false;
79
        d.side = 1;
80
        global.interact = 1;
81
        con = 3;
82
        timer = 0;
83
    }
84
}
85
if (con == 3)
86
{
87
    if (i_ex(obj_writer))
88
    {
89
        if (obj_writer.reachedend)
90
            timer++;
91
    }
92
    if (timer == 15)
93
    {
94
        global.flag[1055 sword_route_progress] = 2;
95
        snd_play_x(snd_board_kill_ominous, 0.5, 0.5);
96
        snd_play_x(snd_board_torch, 0.8, 1.2);
97
    }
98
    if (timer >= 60)
99
    {
100
        safe_delete(obj_writer);
101
        
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");
102
        msgsetloc(0, 
SHE WAS USED UP
"SHE WAS USED UP", "obj_b2d_icedoor_slash_Step_0_gml_105_0"
);
103
        d = bw_make();
104
        d.skip = true;
105
        d.skippable = false;
106
        d.reachedend_draw_triangle = false;
107
        d.rate = 3;
108
        d.reachedend_sound_play = false;
109
        d.boardopensound = false;
110
        d.side = 1;
111
        global.interact = 1;
112
        con = 4;
113
        timer = 0;
114
    }
115
}
116
if (con == 4)
117
{
118
    if (i_ex(obj_writer))
119
    {
120
        if (obj_writer.reachedend)
121
            timer++;
122
    }
123
    if (timer == 15)
124
    {
125
        snd_play_x(snd_board_kill_ominous, 0.5, 0.5);
126
        snd_play_x(snd_board_torch, 0.8, 1.2);
127
        with (obj_board_enemy_deer)
128
            instance_destroy();
129
    }
130
    if (timer >= 60)
131
    {
132
        safe_delete(obj_board_writer);
133
        safe_delete(obj_writer);
134
        image_index = 1;
135
        snd_play_x(snd_board_torch_low, 1, 0.7);
136
        snd_play_x(snd_board_door_close, 0.8, 0.7);
137
        snd_play_x(snd_board_door_close, 0.5, 0.4);
138
        timer = 0;
139
        con = 5;
140
        kris.controlled = true;
141
        global.interact = 0;
142
        safe_delete(mysolid);
143
    }
144
}