Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_tallbookcases_Step_0

(view raw script w/o annotations or w/e)
1
if (doorinit == 0)
2
{
3
    with (obj_doorAny)
4
    {
5
        if (doorRoom == room_dw_church_pianopiece_left)
6
        {
7
            doorRoom = room_dw_church_pianopiece_left_b;
8
            other.doorinit = 1;
9
        }
10
    }
11
}
12
if (global.plot >= 242)
13
{
14
    with (cup)
15
    {
16
        if (global.fighting)
17
            myinteract = 0;
18
        marker.image_index += 0.25;
19
        if (myinteract == 3)
20
        {
21
            global.interact = 1;
22
            var gerstate = 0;
23
            if (global.flag[851] > 0)
24
                gerstate = 1;
25
            
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");
26
            msgsetloc(0, 
* O,Delay 11 there once was a great fortepiano up above!Delay 11 How it sang in gold...Wait for input
"* O^1, there once was a great fortepiano up above^1! How it sang in gold.../", "obj_dw_church_tallbookcases_slash_Step_0_gml_39_0"
);
27
            msgnextloc(
* Until the Grand Door opened,Delay 11 releasing a cacophony of ancient witches.Wait for input
"* Until the Grand Door opened^1, releasing a cacophony of ancient witches./", "obj_dw_church_tallbookcases_slash_Step_0_gml_40_0"
);
28
            var nextline = stringsetloc(
* They did away with its fine timbres...Delay 11 leaving naught but dissonance.Wait for input
"* They did away with its fine timbres..^1. leaving naught but dissonance./", "obj_dw_church_tallbookcases_slash_Step_0_gml_41_0"
);
29
            if (gerstate == 0)
30
                msgnext(nextline + "%");
31
            if (gerstate == 1)
32
            {
33
                msgnext(nextline);
34
                msgnextloc(
* But,Delay 11 Warriors!Delay 11 I heard rumor you did solve the piano's mystery.Wait for input
"* But^1, Warriors^1! I heard rumor you did solve \\cYthe piano's mystery\\cW./", "obj_dw_church_tallbookcases_slash_Step_0_gml_50_0"
);
35
                msgnextloc(
* Though the piano be gone,Delay 11 its song may play on in our hearts...Wait for inputClose Message
"* Though the piano be gone^1, its song may play on in our hearts.../%", "obj_dw_church_tallbookcases_slash_Step_0_gml_51_0"
);
36
            }
37
            if (talked)
38
            {
39
                if (gerstate == 0)
40
                {
41
                    
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");
42
                    msgsetloc(0, 
* O,Delay 11 that the mystery of the piano was not solved!Wait for input
"* O^1, that \\cYthe mystery of the piano\\cW was not solved!/", "obj_dw_church_tallbookcases_slash_Step_0_gml_59_0"
);
43
                    msgnextloc(
* And now...Delay 11 it shall never be.Wait for inputClose Message
"* And now..^1. \\cRit shall never be\\cW./%", "obj_dw_church_tallbookcases_slash_Step_0_gml_60_0"
);
44
                }
45
                if (gerstate == 1)
46
                {
47
                    
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");
48
                    msgsetloc(0, 
* O,Delay 11 the Pianosong,Delay 11 it plays on in my heart.Wait for input
"* O^1, the Pianosong^1, it plays on in my heart./", "obj_dw_church_tallbookcases_slash_Step_0_gml_65_0"
);
49
                    msgnextloc(
* Duh duh duh,Delay 11 doo doo doo,Delay 11 dee dee dah...Delay 11 and stuffs.Wait for inputClose Message
"* Duh duh duh^1, doo doo doo^1, dee dee dah..^1. and stuffs./%", "obj_dw_church_tallbookcases_slash_Step_0_gml_66_0"
);
50
                }
51
            }
52
            d_make();
53
            myinteract = 999;
54
            talked++;
55
        }
56
        if (myinteract == 999 && !d_ex())
57
        {
58
            myinteract = 0;
59
            global.interact = 0;
60
        }
61
    }
62
}
63
if (gueicheck == true)
64
{
65
    if (gueitoskip == -1)
66
    {
67
        var ent1 = -4;
68
        var ent3 = -4;
69
        var ent4 = -4;
70
        var ent14 = -4;
71
        with (obj_markerAny)
72
        {
73
            if (image_index == 1)
74
                ent1 = id;
75
            if (image_index == 3)
76
                ent3 = id;
77
            if (image_index == 4)
78
                ent4 = id;
79
            if (image_index == 14)
80
                ent14 = id;
81
        }
82
        if (i_ex(obj_climb_kris))
83
        {
84
            gueitoskip = 4;
85
        }
86
        else
87
        {
88
            if (
scr_checklocation
scr_checklocation

function
scr_checklocation(arg0 = id, arg1, arg2, arg3 = 0)
{ if (!i_ex(arg0)) { debug_message("target instance does not exist"); return false; } if (abs(arg0.x - arg1) <= arg3 && abs(arg0.y - arg2) <= arg3) return true; else return false; }
(1049, ent1.x, ent1.y, 40))
89
                gueitoskip = 2;
90
            if (
scr_checklocation
scr_checklocation

function
scr_checklocation(arg0 = id, arg1, arg2, arg3 = 0)
{ if (!i_ex(arg0)) { debug_message("target instance does not exist"); return false; } if (abs(arg0.x - arg1) <= arg3 && abs(arg0.y - arg2) <= arg3) return true; else return false; }
(1049, ent3.x, ent3.y, 40))
91
                gueitoskip = 2;
92
            if (
scr_checklocation
scr_checklocation

function
scr_checklocation(arg0 = id, arg1, arg2, arg3 = 0)
{ if (!i_ex(arg0)) { debug_message("target instance does not exist"); return false; } if (abs(arg0.x - arg1) <= arg3 && abs(arg0.y - arg2) <= arg3) return true; else return false; }
(1049, ent4.x, ent4.y, 40))
93
                gueitoskip = 0;
94
            if (
scr_checklocation
scr_checklocation

function
scr_checklocation(arg0 = id, arg1, arg2, arg3 = 0)
{ if (!i_ex(arg0)) { debug_message("target instance does not exist"); return false; } if (abs(arg0.x - arg1) <= arg3 && abs(arg0.y - arg2) <= arg3) return true; else return false; }
(1049, ent14.x, ent14.y, 40))
95
                gueitoskip = 4;
96
        }
97
        if (gueitoskip == -1)
98
            gueitoskip = -2;
99
        printval("gueitoskip");
100
    }
101
    var version = 0;
102
    if (global.flag[encounterflag] != 0)
103
        version = 1;
104
    var gueicount = 5;
105
    if (version == 1)
106
    {
107
        depth = 96340;
108
        gueicount = 3;
109
        gueitoskip = 99;
110
    }
111
    var xspace = 320;
112
    if (con == 0)
113
    {
114
        if (global.interact == 0)
115
        {
116
            for (var i = 0; i < gueicount; i++)
117
            {
118
                var side = 1;
119
                if ((i % 2) == 0)
120
                    side = -1;
121
                var yloc = 382;
122
                var range = 140;
123
                var bonusspace = 0;
124
                if (version == 1)
125
                {
126
                    yloc -= 48;
127
                    range = 60;
128
                    if (i == 2)
129
                        bonusspace = 320;
130
                    movespeed = 15;
131
                }
132
                var xloc = 320 + (sin(siner / movespeed) * range * side) + (xspace * i) + bonusspace;
133
                if (i != gueitoskip)
134
                {
135
                    var docats = false;
136
                    var gotem = false;
137
                    if (i_ex(collision_rectangle(xloc - 10, yloc - 8, xloc + 10, yloc + 20, obj_mainchara, 0, true)))
138
                        gotem = true;
139
                    if (docats)
140
                    {
141
                        if (i_ex(collision_rectangle(xloc - 10, yloc - 8, xloc + 10, yloc + 20, obj_caterpillarchara, 0, true)))
142
                            gotem = true;
143
                    }
144
                    if (gotem)
145
                    {
146
                        dontdraw = i;
147
                        chaser = 
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{ var thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth_alt();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; } function scr_marker_fromasset(arg0, arg1 = depth, arg2 = false) { if (is_undefined(arg0)) { debug_message("Warning: scr_marker_fromasset() sprite_instance didn't exist"); return -4; } var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var imagespeed = layer_sprite_get_speed(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var thismarker = instance_create_depth(xloc, yloc, arg1, obj_marker); with (thismarker) { sprite_index = sprite; image_index = index; image_speed = imagespeed; image_xscale = xscale; image_yscale = yscale; image_angle = angle; image_blend = blend; image_alpha = alpha; if (arg2)
scr_depth_alt(id, arg2);
} return thismarker; } function scr_assetgetinfo(arg0) { var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var imagespeed = layer_sprite_get_speed(arg0); return [sprite, index, xloc, yloc, xscale, yscale, angle, blend, alpha, imagespeed]; }
(xloc, yloc, spr_guei_chase, 2, 2, 0);
148
                        chaser.alpha = 1;
149
                        chaser.image_alpha = 0;
150
                        snd_play(snd_cough, 1, 1.4);
151
                        snd_play(snd_paper_rise, 0.7, 1.2);
152
                        snd_play(snd_paper_rise, 0.4, 1.8);
153
                        snd_play(snd_ghostappear, undefined, 1.6);
154
                        global.interact = 1;
155
                        speed = 0;
156
                        other.con = 2;
157
                        with (chaser)
158
                            
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, obj_mainchara.x + 80, 20, 4, "out");
159
                        with (chaser)
160
                            
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, obj_mainchara.y - 40 - 12, 20, 2, "out");
161
                    }
162
                }
163
            }
164
        }
165
    }
166
    if (con == 2)
167
    {
168
        timer++;
169
        if (timer == 1)
170
            
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; }
("image_alpha", image_alpha, -1.35, 20, 2, "in");
171
        if (timer > 1 && chaser.x > obj_mainchara.x)
172
            global.facing = 1;
173
        if (timer == 35)
174
        {
175
            snd_play(snd_tensionhorn);
176
            snd_play_delay(snd_tensionhorn, 10, undefined, 1.1);
177
        }
178
        if (timer == 59)
179
        {
180
            chaser.image_alpha = 1;
181
            chaser.depth = 500;
182
            global.flag[54 encounter_pointer] = encounterflag;
183
            
scr_battle
scr_battle

function
scr_battle(arg0, arg1, arg2, arg3, arg4)
{ global.specialbattle = arg1; global.encounterno = arg0; if (global.flag[9 battle_music] != 2) { global.flag[9 battle_music] = 1; if (global.chapter == 4 && room != room_dw_castle_dojo) global.batmusic[0] = snd_init("ch4_battle.ogg"); else global.batmusic[0] = snd_init("battle.ogg"); } instance_create(0, 0, obj_battleback); instance_create(0, 0, obj_encounterbasic); __enemymarker[0] = arg2; __enemymarker[1] = arg3; __enemymarker[2] = arg4; for (__ien = 0; __ien < 3; __ien++) { if (global.monstertype[__ien] != 0(None)) { if (!i_ex(__enemymarker[__ien])) { __enemymarker[__ien] =
scr_dark_marker(global.monstermakex[__ien] + 300, global.monstermakey[__ien], object_get_sprite(global.monsterinstancetype[__ien]));
__enemymarker[__ien].depth = -__ien; } __enemymarker[__ien].__ien = __ien; with (__enemymarker[__ien]) {
scr_move_to_point_over_time(global.monstermakex[__ien], global.monstermakey[__ien], 20);
__doom = instance_create(x, y, obj_doom); __doom.target = id; __doom.alarm[0] = 25; } } } }
(encounterno, 0, chaser);
184
            con = 3;
185
            
scr_var_delay
scr_var_delay

function
scr_var_delay(arg0, arg1, arg2)
{
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_var_delayed(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_delay_var(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
}
("guiecheck", false, 120);
186
        }
187
    }
188
}