Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_npc_room_Create_0

(view raw script w/o annotations or w/e)
1
init = 0;
2
myinteract = 0;
3
talked = 0;
4
tempvar = 0;
5
image_speed = 0;
6
depthcancel = 0;
7
normalanim = 1;
8
remanimspeed = 0;
9
flag = 0;
10
alwaysanimate = false;
11
jpspecial = 0;
12
skip = 0;
13
if (global.darkzone == 0)
14
{
15
    if (room == room_krisroom)
16
        sprite_index = spr_redwagon;
17
    if (room == room_torhouse)
18
    {
19
        sprite_index = spr_chairiel_empty;
20
        if (global.plot >= 250)
21
        {
22
            if (global.chapter == 1)
23
                sprite_index = spr_chairiel;
24
        }
25
    }
26
    if (room == room_graveyard)
27
    {
28
        fence = 
scr_marker
scr_marker

function
scr_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; } return thismarker; }
(81, 122, spr_npc_graveyardfence);
29
        with (fence)
30
            
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
31
        if (x < 30)
32
            sprite_index = spr_npc_bench;
33
    }
34
    if (room == room_hospital_lobby)
35
        sprite_index = spr_npc_nurse;
36
    if (room == room_hospital_rudy)
37
    {
38
        if (global.chapter == 1)
39
            sprite_index = spr_rudy_d;
40
        if (global.chapter >= 2)
41
            sprite_index = spr_rudy_l;
42
    }
43
    if (room == room_library)
44
        sprite_index = spr_normalnpc;
45
    if (room == room_townhall)
46
    {
47
        sprite_index = spr_npc_businessguy;
48
        if (x > 100)
49
            sprite_index = spr_npc_receptionist;
50
        if (x > 200)
51
            sprite_index = spr_npc_politicsbear;
52
    }
53
    if (room == room_diner)
54
    {
55
        if (global.chapter == 1)
56
        {
57
            if (x < 120)
58
                sprite_index = spr_npc_cattiwaitress;
59
            if (x < 60)
60
                sprite_index = spr_npc_dragonfamily;
61
            if (x >= 120 && x <= 140)
62
                sprite_index = spr_npc_qc;
63
            if (y > 130)
64
            {
65
                if (x > 180)
66
                    sprite_index = spr_npc_dresslion;
67
                if (x > 240)
68
                {
69
                    sprite_index = spr_npc_greenfire;
70
                    depth = 4000;
71
                    depthcancel = 1;
72
                }
73
                if (x > 260)
74
                {
75
                    sprite_index = spr_npc_flanneldemon;
76
                    depth = 4000;
77
                    depthcancel = 1;
78
                }
79
            }
80
            if (y < 120)
81
            {
82
                if (x > 160)
83
                    sprite_index = spr_npc_most_improved_1997;
84
                if (x > 200)
85
                    sprite_index = spr_npc_icewolf;
86
            }
87
        }
88
        if (global.chapter >= 2)
89
        {
90
            if (y < 85)
91
                sprite_index = spr_npc_qc;
92
            if (x > 150 && x < 180 && y < 115)
93
                sprite_index = spr_jockington_lt;
94
            if (x > 80 && x < 120)
95
                sprite_index = spr_npc_cattiwaitress;
96
        }
97
    }
98
    if (room == room_town_south)
99
    {
100
        if (global.chapter == 1)
101
        {
102
            if (x > 560)
103
                sprite_index = spr_npc_donutcar;
104
            if (x > 720)
105
                sprite_index = spr_npc_snailcar;
106
        }
107
    }
108
    if (room == room_town_church)
109
    {
110
        if (global.chapter == 1)
111
            sprite_index = spr_npc_alvin;
112
        if (global.chapter >= 2)
113
        {
114
            if (x > 270 && y < 320)
115
                sprite_index = spr_npc_terry;
116
            if (x > 220 && x < 260 && y > 310)
117
                sprite_index = spr_npc_icecap_r;
118
            if (x > 230 && x < 245 && y > 300)
119
                sprite_index = spr_npc_icecap_g;
120
            if (x > 250 && x < 260 && y > 300)
121
                sprite_index = spr_npc_icecap_b;
122
            if (x > 380)
123
                sprite_index = spr_npc_rgbun;
124
            if (x > 400)
125
                sprite_index = spr_npc_rgdragon;
126
            if (x > 590)
127
                sprite_index = spr_npc_rabbitkid;
128
        }
129
    }
130
    if (room == room_town_mid)
131
    {
132
        if (x >= 1800 && x < 1840)
133
        {
134
            if (global.chapter == 1)
135
                sprite_index = spr_mkid_dt;
136
            else
137
                instance_destroy();
138
        }
139
        if (x >= 1900 && x < 1920)
140
        {
141
            if (global.chapter == 1)
142
                sprite_index = spr_snowy_dt;
143
            else
144
                instance_destroy();
145
        }
146
    }
147
    if (room == room_town_north)
148
    {
149
        if (global.chapter == 1)
150
        {
151
            if (x >= 480)
152
                sprite_index = spr_npc_catty;
153
            if (x >= 640)
154
                sprite_index = spr_npc_cattydad;
155
            if (x >= 880)
156
                sprite_index = spr_npc_bratty;
157
        }
158
        if (global.chapter >= 2)
159
        {
160
            if (x < 1000)
161
                instance_destroy();
162
        }
163
    }
164
    if (room == room_beach)
165
    {
166
        if (global.chapter == 1)
167
        {
168
            if (x >= 60)
169
                sprite_index = spr_npc_rgbun;
170
            if (x >= 100)
171
                sprite_index = spr_npc_rgdragon;
172
        }
173
        if (global.chapter >= 2)
174
            instance_destroy();
175
    }
176
}
177
if (room == room_flowershop_1f)
178
{
179
    if (global.chapter >= 2)
180
        sprite_index = spr_asgored;
181
    else
182
        instance_destroy();
183
}
184
if (room == room_lw_police)
185
{
186
    if (x > 80)
187
        sprite_index = spr_npc_napstablook_police_down;
188
    if (x > 140)
189
        sprite_index = spr_undyne_dt;
190
    if (x > 170)
191
    {
192
        sprite_index = spr_npc_prisoner_dog_m;
193
        depthcancel = 1;
194
    }
195
    if (x > 190)
196
    {
197
        sprite_index = spr_npc_prisoner_dog_f;
198
        depthcancel = 1;
199
    }
200
}
201
if (room == room_alphysalley)
202
    sprite_index = spr_npc_bratty;
203
if (room == room_lw_conbini)
204
{
205
    if (x > 280)
206
        sprite_index = spr_npc_diamond_tallboy;
207
    else
208
        sprite_index = spr_npc_milklooker;
209
}
210
if (global.darkzone == 1)
211
{
212
    image_xscale = 2;
213
    image_yscale = 2;
214
    if (room == room_castle_tutorial)
215
    {
216
        if (global.chapter == 1)
217
            sprite_index = spr_dummynpc;
218
        if (global.chapter >= 2)
219
        {
220
            if (x > 760 && x < 780)
221
            {
222
                if (global.chapter == 2 && (global.plot < 200 || global.plot < 9))
223
                    sprite_index = spr_dummynpc;
224
                else
225
                    sprite_index = spr_mannequin_ralsei_nugu;
226
            }
227
        }
228
    }
229
    if (room == room_dw_ralsei_castle_front)
230
    {
231
        if (x >= 250 && y >= 430)
232
        {
233
            if (scr_get_total_recruits(2) >= 9)
234
                sprite_index = spr_npc_ballperson_wig;
235
            else
236
                sprite_index = spr_ballperson;
237
        }
238
        if (x >= 650)
239
        {
240
            sprite_index = spr_npc_jackperson_hat;
241
            x = 740;
242
            y = 225;
243
        }
244
        if (x >= 350 && y >= 430)
245
        {
246
            if (scr_get_total_recruits(2) >= 9)
247
            {
248
                sprite_index = spr_npc_nubert;
249
                image_xscale = -2;
250
                x = 410;
251
            }
252
            else
253
            {
254
                instance_destroy();
255
            }
256
        }
257
    }
258
    if (room == room_dw_castle_town)
259
    {
260
        if (x > 600 && x < 640 && y > 750 && y < 780)
261
        {
262
            sprite_index = spr_diamond_overworld;
263
            image_xscale = -2;
264
        }
265
        if (x > 1100 && x < 1300 && y > 870 && y < 890)
266
            sprite_index = spr_heartenemy_overworld;
267
        if (x > 1150 && x < 1170 && y > 590 && y < 610)
268
        {
269
            if (global.flag[636 recruit_butler] != 1)
270
            {
271
                sprite_index = spr_npc_rabbick_clean;
272
            }
273
            else
274
            {
275
                rabbicksweep = instance_create(1222, 562, obj_npc_room_animated);
276
                rabbicksweep.sprite_index = spr_npc_rabbick_sweep;
277
                rabbicksweep.image_speed = 0.1;
278
                with (rabbicksweep)
279
                    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
280
                instance_destroy();
281
            }
282
        }
283
        if (global.flag[636 recruit_butler] == 1)
284
        {
285
            var swatchling_sweep = false;
286
            if (i_ex(obj_npc_room_animated))
287
            {
288
                with (obj_npc_room_animated)
289
                {
290
                    if (sprite_index == spr_npc_swatchling_sweep)
291
                        swatchling_sweep = true;
292
                }
293
            }
294
            if (!swatchling_sweep)
295
            {
296
                swatchsweep = instance_create(1085, 522, obj_npc_room_animated);
297
                swatchsweep.sprite_index = spr_npc_swatchling_sweep;
298
                swatchsweep.image_speed = 0.1;
299
                with (swatchsweep)
300
                    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
301
            }
302
        }
303
        if (x > 250 && x < 280 && y > 550 && y < 650)
304
        {
305
            if (global.flag[633 recruit_plugboy] == 1)
306
            {
307
                sprite_index = spr_npc_werewire;
308
                image_xscale = -2;
309
                x = 353;
310
                y = 612;
311
                depth = 93000;
312
                depthcancel = 1;
313
            }
314
            else
315
            {
316
                sprite_index = spr_blockler_b;
317
            }
318
        }
319
        if (x > 230 && x < 250 && y > 910 && y < 930)
320
        {
321
            sprite_index = spr_diamond_overworld;
322
            image_xscale = -2;
323
            x = 320;
324
        }
325
        if (x > 320 && x < 350 && y > 910 && y < 930)
326
        {
327
            if (global.flag[635 recruit_viro] == 1)
328
            {
329
                var viro_exists = false;
330
                if (i_ex(obj_npc_room_animated))
331
                {
332
                    with (obj_npc_room_animated)
333
                    {
334
                        if (sprite_index == spr_virovirokun_idle)
335
                            viro_exists = true;
336
                    }
337
                }
338
                if (!viro_exists)
339
                {
340
                    viro = instance_create(x, y - 20, obj_npc_room_animated);
341
                    viro.sprite_index = spr_virovirokun_idle;
342
                    with (viro)
343
                        
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
344
                }
345
                instance_destroy();
346
            }
347
            else
348
            {
349
                sprite_index = spr_daimond_knight_idle;
350
            }
351
        }
352
        if (x > 820 && x < 840 && y > 670 && y < 690)
353
        {
354
            if (global.flag[633 recruit_plugboy] == 1)
355
                sprite_index = spr_npc_plugboy_static_outline;
356
            else
357
                instance_destroy();
358
        }
359
    }
360
    if (room == room_cc_lancer)
361
    {
362
        if (scr_get_total_recruits(2) >= 9)
363
            instance_destroy();
364
        else
365
            sprite_index = spr_lancer_dt;
366
    }
367
    if (room == room_dw_castle_dungeon)
368
    {
369
        sprite_index = spr_king_left;
370
        depthcancel = 1;
371
    }
372
    if (room == room_dw_castle_west_cliff)
373
    {
374
        if (x < 210)
375
            instance_destroy();
376
        else if (global.flag[357 recruit_hacker] == 1)
377
            sprite_index = spr_npc_cursor_walk_right;
378
        else
379
            instance_destroy();
380
    }
381
    if (room == room_dw_teevie_dust_south)
382
    {
383
        sprite_index = spr_shutta_idle;
384
        mask_index = spr_shutta_npc_idlehitbox;
385
    }
386
}
387
if (depthcancel == 0)
388
    
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();