Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_churchb_bookshelf_Step_0

(view raw script w/o annotations or w/e)
1
scr_populatechars
scr_populatechars

function
scr_populatechars()
{ if (!variable_instance_exists(id, "kris")) kris = 0; if (!variable_instance_exists(id, "ralsei")) ralsei = 0; if (!variable_instance_exists(id, "susie")) susie = 0; if (!variable_instance_exists(id, "noelle")) noelle = 0; if (kris == 0) { with (obj_mainchara) other.kris = id; } if (susie == 0) { with (obj_caterpillarchara) { if (name == "susie") other.susie = id; } } if (ralsei == 0) { with (obj_caterpillarchara) { if (name == "ralsei") other.ralsei = id; } } if (noelle == 0) { with (obj_caterpillarchara) { if (name == "noelle") other.noelle = id; } } }
();
2
if (!init)
3
{
4
    var pos = scr_genmarker("prop2");
5
    prop = instance_create(pos.x + 150, pos.y + 90, obj_dw_church_prophecy);
6
    prop.extflag = "roots";
7
    prop.fade_edges = true;
8
    with (roomglow)
9
        create_highlight(other.npc2.marker, true, true, -16);
10
    init = 1;
11
}
12
with (npc)
13
{
14
    if (myinteract == 3)
15
    {
16
        global.interact = 1;
17
        global.msc = -99;
18
        global.choice = -1;
19
        global.choicemsg[0] = stringsetloc(
#Yes
"#Yes", "obj_dw_churchb_bookshelf_slash_Step_0_gml_26_0"
);
20
        global.choicemsg[1] = stringsetloc(
#No
"#No", "obj_dw_churchb_bookshelf_slash_Step_0_gml_27_0"
);
21
        global.choicemsg[2] = stringset("");
22
        global.choicemsg[3] = stringset("");
23
        
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");
24
        msgsetloc(0, 
* (There's a peculiar book here. Read it?)Wait for input
"* (There's a peculiar book here. Read it?)/", "obj_dw_churchb_bookshelf_slash_Step_0_gml_31_0"
);
25
        msgnext("\\C2 ");
26
        d_make();
27
        myinteract = 20;
28
    }
29
    if (myinteract == 20 && global.choice != -1)
30
    {
31
        if (global.choice == 0)
32
        {
33
            k_d(1);
34
            
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");
35
            msgsetloc(0, 
* And so wept the fallen star,Delay 11 making rivers with its tears.Wait for input
"* And so wept the fallen star^1, making rivers with its tears./", "obj_dw_churchb_bookshelf_slash_Step_0_gml_44_0"
);
36
            msgnextloc(
* Then,Delay 11 slowly,Delay 11 from the bitter water,Delay 11 something grew.Wait for input
"* Then^1, slowly^1, from the bitter water^1, something grew./", "obj_dw_churchb_bookshelf_slash_Step_0_gml_45_0"
);
37
            msgnextloc(
* It looked like glass.Wait for inputClose Message
"* It looked like glass./%", "obj_dw_churchb_bookshelf_slash_Step_0_gml_46_0"
);
38
            d_make();
39
            myinteract = 999;
40
        }
41
        if (global.choice == 1)
42
        {
43
            k_d();
44
            myinteract = 999;
45
        }
46
    }
47
    if (myinteract == 999 && !d_ex())
48
    {
49
        myinteract = 0;
50
        marker.image_index = 0;
51
        global.interact = 0;
52
    }
53
}
54
with (npc2)
55
{
56
    if (myinteract == 3)
57
    {
58
        global.interact = 1;
59
        var texts = [];
60
        array_push(texts, "where ");
61
        array_push(texts, "the ");
62
        array_push(texts, "tail. ");
63
        array_push(texts, "pointed ");
64
        array_push(texts, "the ");
65
        array_push(texts, "children ");
66
        array_push(texts, "would ");
67
        array_push(texts, "grow,");
68
        array_push(texts, "the ");
69
        array_push(texts, "Lost ");
70
        array_push(texts, "forest ");
71
        array_push(texts, "followed ");
72
        if (global.lang == "ja")
73
        {
74
            texts = [];
75
            array_push(texts, stringsetloc(
は 
"は ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_90_0"
));
76
            array_push(texts, stringsetloc(
子ども 
"子ども ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_91_0"
));
77
            array_push(texts, stringsetloc(
を 
"を ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_92_0"
));
78
            array_push(texts, stringsetloc(
森林 
"森林 ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_93_0"
));
79
            array_push(texts, stringsetloc(
しっぽ 
"しっぽ ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_94_0"
));
80
            array_push(texts, stringsetloc(
の 
"の ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_95_0"
));
81
            array_push(texts, stringsetloc(
の 
"の ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_96_0"
));
82
            array_push(texts, stringsetloc(
場所 
"場所 ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_97_0"
));
83
            array_push(texts, stringsetloc(
たどった。 
"たどった。 ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_98_0"
));
84
            array_push(texts, stringsetloc(
迷子 
"迷子 ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_99_0"
));
85
            array_push(texts, stringsetloc(
とがった 
"とがった ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_100_0"
));
86
            array_push(texts, stringsetloc(
で 
"で ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_101_0"
));
87
            array_push(texts, stringsetloc(
育つ 
"育つ ", "obj_dw_churchb_bookshelf_slash_Step_0_gml_102_0"
));
88
        }
89
        var textshuffle = 
scr_array_shuffle
scr_array_shuffle

function
scr_array_shuffle(arg0)
{ var _len = array_length(arg0); var _last = 0; var _i = 0; while (_len) { _i = irandom(--_len); _last = arg0[_len]; arg0[_len] = arg0[_i]; arg0[_i] = _last; } return arg0; }
(texts);
90
        var str = "";
91
        var newline = 0;
92
        for (var i = 0; i < array_length(textshuffle); i++)
93
        {
94
            if (global.lang == "ja")
95
            {
96
                if (newline == 0)
97
                {
98
                    if (string_length(str) > 13)
99
                    {
100
                        newline = 1;
101
                        str += "\n  ";
102
                    }
103
                }
104
                if (newline == 1)
105
                {
106
                    if (string_length(str) > 26)
107
                    {
108
                        newline = 2;
109
                        str += "\n  ";
110
                    }
111
                }
112
            }
113
            str += textshuffle[i];
114
        }
115
        
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");
116
        msgsetloc(0, 
* I heard something in between. Something in between.Wait for input
"* I heard something in between. Something in between./", "obj_dw_churchb_bookshelf_slash_Step_0_gml_127_0"
);
117
        msgnextloc(
* It was mixed up.Wait for input
"* It was mixed up./", "obj_dw_churchb_bookshelf_slash_Step_0_gml_128_0"
);
118
        if (global.lang == "ja")
119
            msgnext("* " + str + "/");
120
        else
121
            msgnext("* " + str + "/");
122
        msgnextloc(
* The poor children!Wait for inputClose Message
"* The poor children!/%", "obj_dw_churchb_bookshelf_slash_Step_0_gml_130_0"
);
123
        d_make();
124
        myinteract = 999;
125
        talked++;
126
    }
127
    if (myinteract > 3 && d_ex())
128
    {
129
        var trig = 0;
130
        if (!i_ex(obj_writer))
131
            trig = 1;
132
        with (obj_writer)
133
        {
134
            if (halt)
135
                trig = 1;
136
        }
137
        if (!trig)
138
            marker.image_index += 0.25;
139
    }
140
    if (myinteract == 999 && !d_ex())
141
    {
142
        myinteract = 0;
143
        marker.image_index = 0;
144
        global.interact = 0;
145
    }
146
}
147
var act = 
scr_trigcheck
scr_trigcheck

function
scr_trigcheck(arg0)
{ var ____trig = 0; if (is_string(arg0)) { with (obj_trigger) { if (extflag == arg0) { if (place_meeting(x, y, obj_mainchara)) ____trig++; } } } return ____trig; } function scr_trigcheck_ext(arg0, arg1 = id) { var ____trig = 0; if (is_string(arg0)) { with (obj_trigger) { if (extflag == arg0) { if (place_meeting(x, y, arg1)) ____trig++; } } } return ____trig; }
("propact");
148
roomglow.active = act;
149
prop.active = act;