Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_controller_dw_mansion_bridges_funny_Step_0

(view raw script w/o annotations or w/e)
1
if (saved == true)
2
{
3
    with (swatchfriend)
4
    {
5
        scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
6
        if (con == 0)
7
        {
8
            global.interact = 1;
9
            image_speed = 0.25;
10
            if (x > 1376)
11
            {
12
                x -= 8;
13
            }
14
            else
15
            {
16
                x = 1376;
17
                con++;
18
            }
19
        }
20
        if (con == 1)
21
        {
22
            if (y < 140)
23
            {
24
                y += 8;
25
            }
26
            else
27
            {
28
                y = 140;
29
                con++;
30
            }
31
        }
32
        if (con == 2)
33
        {
34
            if (x > 1280)
35
            {
36
                x -= 8;
37
            }
38
            else
39
            {
40
                x = 1280;
41
                global.flag[376 funny_butler_progress] = 1;
42
                con++;
43
            }
44
        }
45
        if (con == 3)
46
        {
47
            friendlySwatch = instance_create(x, y, obj_npc_room);
48
            friendlySwatch.sprite_index = sprite_index;
49
            friendlySwatch.image_index = image_index;
50
            friendlySwatch.image_speed = 0;
51
            friendlySwatch.image_xscale = image_xscale;
52
            friendlySwatch.image_yscale = image_yscale;
53
            global.interact = 0;
54
            instance_destroy();
55
        }
56
    }
57
}
58
if (vaseSpawned == 0 && spawnVaseTrig == 1)
59
{
60
    global.flag[376 funny_butler_progress] = 2;
61
    global.interact = 1;
62
    vaseSpawned = 1;
63
    vase = instance_create(1078, -70, obj_queenvase);
64
    vase.image_index = 0;
65
    vase.image_xscale = 2;
66
    vase.image_yscale = 2;
67
    vase.con = 0;
68
    vase.newspeed = 4;
69
}
70
if (i_ex(vase))
71
{
72
    with (vase)
73
    {
74
        other.swatchLines = 1;
75
        if (con == 0)
76
        {
77
            newspeed *= 1.5;
78
            newspeed = clamp(newspeed, 0, 12);
79
            if (y <= 294)
80
                y += newspeed;
81
            if (y >= 294)
82
            {
83
                y = 294;
84
                con = 1;
85
                global.interact = 0;
86
            }
87
        }
88
    }
89
}
90
if (instance_exists(obj_marker))
91
{
92
    with (obj_marker)
93
    {
94
        if (sprite_index == spr_queenvase)
95
        {
96
            other.vaseCracked = 1;
97
            timer = 0;
98
        }
99
    }
100
}
101
if (vaseCracked == 1 && instance_exists(obj_npc_room))
102
{
103
    if (vaseCrackedCon == -1)
104
    {
105
        enemySwatch = instance_create(obj_npc_room.x, obj_npc_room.y + 18, obj_chaseenemy);
106
        enemySwatch.image_xscale = obj_npc_room.image_xscale;
107
        enemySwatch.image_yscale = obj_npc_room.image_yscale;
108
        enemySwatch.sprite_index = spr_npc_swatchling_sweep_walk;
109
        enemySwatch.image_speed = 0.25;
110
        with (enemySwatch)
111
        {
112
            myencounter = 64;
113
            radius = 100000;
114
            ignoresolid = 1;
115
            alertcon = 0;
116
            chasetype = 4;
117
        }
118
        with (obj_npc_room)
119
            instance_destroy();
120
        vaseCrackedCon++;
121
    }
122
}
123
if (vaseCrackedCon == 0)
124
{
125
    if (enemySwatch.x <= (obj_mainchara.x + obj_mainchara.sprite_width + 8))
126
    {
127
        global.interact = 1;
128
        enemySwatch.x = obj_mainchara.x + obj_mainchara.sprite_width + 8;
129
        image_index = 0;
130
        timer = 0;
131
        vaseCrackedCon++;
132
    }
133
    else if (instance_exists(obj_caterpillarchara) && enemySwatch.x <= (obj_caterpillarchara.x + obj_caterpillarchara.sprite_width + 8))
134
    {
135
        global.interact = 1;
136
        enemySwatch.x = obj_caterpillarchara.x + obj_caterpillarchara.sprite_width + 8;
137
        image_index = 0;
138
        timer = 0;
139
        vaseCrackedCon++;
140
    }
141
}
142
if (vaseCrackedCon == 1)
143
{
144
    enemySwatch.image_speed = 0;
145
    friendlySwatch = instance_create(enemySwatch.x, 208, obj_marker);
146
    friendlySwatch.sprite_index = spr_npc_swatchling_sweep;
147
    friendlySwatch.image_xscale = enemySwatch.image_xscale;
148
    friendlySwatch.image_index = 0;
149
    friendlySwatch.image_yscale = enemySwatch.image_yscale;
150
    friendlySwatch.image_speed = 0;
151
    with (friendlySwatch)
152
        scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
153
    with (enemySwatch)
154
        instance_destroy();
155
    timer = 0;
156
    vaseCrackedCon++;
157
}
158
if (vaseCrackedCon == 2)
159
{
160
    timer++;
161
    if (timer == 15)
162
    {
163
        global.facing = 1;
164
        if (instance_exists(obj_caterpillarchara))
165
        {
166
            with (obj_caterpillarchara)
167
            {
168
                fun = 1;
169
                _remsprite = sprite_index;
170
                sprite_index = rsprite;
171
                image_index = 0;
172
            }
173
        }
174
    }
175
    if (timer == 30)
176
    {
177
        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 == "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; } if (global.fighting == 1) ...
("no_name");
178
        msgsetloc(0, 
* ...Wait for input
"* .../", "obj_controller_dw_mansion_bridges_funny_slash_Step_0_gml_180_0"
);
179
        msgnextloc(
* I suppose we'll just have to let it go this once.Wait for inputClose Message
"* I suppose we'll just have to let it go this once./%", "obj_controller_dw_mansion_bridges_funny_slash_Step_0_gml_181_0"
);
180
        d = d_make();
181
        vaseCrackedCon++;
182
    }
183
}
184
if (vaseCrackedCon == 3)
185
{
186
    if (!i_ex(d))
187
        vaseCrackedCon++;
188
}
189
if (vaseCrackedCon == 4)
190
{
191
    friendlySwatch.sprite_index = spr_npc_butler;
192
    friendlySwatch.y = 188;
193
    friendlySwatch.image_speed = 0.25;
194
    friendlySwatch.x -= 8;
195
    with (friendlySwatch)
196
        scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
197
    if (instance_exists(obj_caterpillarchara))
198
    {
199
        with (obj_caterpillarchara)
200
        {
201
            if ((other.friendlySwatch.x + (other.friendlySwatch.sprite_width / 2)) < x)
202
                fun = 1;
203
            _remsprite = sprite_index;
204
            sprite_index = lsprite;
205
            image_index = 0;
206
        }
207
    }
208
    if (friendlySwatch.x < obj_mainchara.x)
209
        global.facing = 3;
210
    if (friendlySwatch.x < (camerax() - friendlySwatch.sprite_width))
211
    {
212
        with (friendlySwatch)
213
            instance_destroy();
214
        global.interact = 0;
215
        if (instance_exists(obj_caterpillarchara))
216
        {
217
            with (obj_caterpillarchara)
218
            {
219
                fun = 0;
220
                image_index = 0;
221
            }
222
        }
223
        vaseCrackedCon++;
224
    }
225
}