Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_npc_room_Create_0

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

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

function scr_get_total_recruits() { var totalrecruits = 0; var chapter = -1; var start_index = 0; var max_index = 100; if (argument_count > 0) chapter = argument[0]; if (chapter == 2) { start_index = 30; max_index = 44; } for (var i = start_index; i < max_index; i++) { if (global.flag[i + 600] == 1) totalrecruits++; } return totalrecruits; }
(2) >= 9)
244
                sprite_index = spr_npc_ballperson_wig;
245
            else
246
                sprite_index = spr_ballperson;
247
        }
248
        if (x >= 650)
249
        {
250
            sprite_index = spr_npc_jackperson_hat;
251
            x = 740;
252
            y = 225;
253
        }
254
        if (x >= 350 && y >= 430)
255
        {
256
            if (global.plot >= 200 && scr_get_total_recruits
scr_get_total_recruits

function scr_get_total_recruits() { var totalrecruits = 0; var chapter = -1; var start_index = 0; var max_index = 100; if (argument_count > 0) chapter = argument[0]; if (chapter == 2) { start_index = 30; max_index = 44; } for (var i = start_index; i < max_index; i++) { if (global.flag[i + 600] == 1) totalrecruits++; } return totalrecruits; }
(2) >= 9)
257
            {
258
                sprite_index = spr_npc_nubert;
259
                image_xscale = -2;
260
                x = 410;
261
            }
262
            else
263
            {
264
                instance_destroy();
265
            }
266
        }
267
    }
268
    if (room == room_dw_castle_area_2)
269
        sprite_index = spr_susiel_wall_eyes;
270
    if (room == room_dw_castle_area_2_transformed)
271
    {
272
        if (x > 600 && x < 640 && y > 750 && y < 780)
273
        {
274
            sprite_index = spr_diamond_overworld;
275
            image_xscale = -2;
276
        }
277
        if (x > 1100 && x < 1300 && y > 870 && y < 890)
278
            sprite_index = spr_heartenemy_overworld;
279
        if (x > 1150 && x < 1170 && y > 590 && y < 610)
280
        {
281
            if (global.flag[636 recruit_butler] != 1)
282
            {
283
                sprite_index = spr_npc_rabbick_clean;
284
            }
285
            else
286
            {
287
                rabbicksweep = instance_create(1222, 562, obj_npc_room_animated);
288
                rabbicksweep.sprite_index = spr_npc_rabbick_sweep;
289
                rabbicksweep.image_speed = 0.1;
290
                with (rabbicksweep)
291
                    scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
292
                instance_destroy();
293
            }
294
        }
295
        if (global.flag[636 recruit_butler] == 1)
296
        {
297
            var swatchling_sweep = false;
298
            if (i_ex(obj_npc_room_animated))
299
            {
300
                with (obj_npc_room_animated)
301
                {
302
                    if (sprite_index == spr_npc_swatchling_sweep)
303
                        swatchling_sweep = true;
304
                }
305
            }
306
            if (!swatchling_sweep)
307
            {
308
                swatchsweep = instance_create(1085, 522, obj_npc_room_animated);
309
                swatchsweep.sprite_index = spr_npc_swatchling_sweep;
310
                swatchsweep.image_speed = 0.1;
311
                with (swatchsweep)
312
                    scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
313
            }
314
        }
315
        if (x > 250 && x < 280 && y > 550 && y < 650)
316
        {
317
            if (global.flag[633 recruit_plugboy] == 1)
318
            {
319
                sprite_index = spr_npc_werewire;
320
                image_xscale = -2;
321
                x = 353;
322
                y = 612;
323
                depth = 93000;
324
                depthcancel = 1;
325
            }
326
            else
327
            {
328
                sprite_index = spr_blockler_b;
329
            }
330
        }
331
        if (x > 230 && x < 250 && y > 910 && y < 930)
332
        {
333
            sprite_index = spr_diamond_overworld;
334
            image_xscale = -2;
335
            x = 320;
336
        }
337
        if (x > 320 && x < 350 && y > 910 && y < 930)
338
        {
339
            if (global.flag[635 recruit_viro] == 1)
340
            {
341
                var viro_exists = false;
342
                if (i_ex(obj_npc_room_animated))
343
                {
344
                    with (obj_npc_room_animated)
345
                    {
346
                        if (sprite_index == spr_virovirokun_idle)
347
                            viro_exists = true;
348
                    }
349
                }
350
                if (!viro_exists)
351
                {
352
                    viro = instance_create(x, y - 20, obj_npc_room_animated);
353
                    viro.sprite_index = spr_virovirokun_idle;
354
                    with (viro)
355
                        scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
356
                }
357
                instance_destroy();
358
            }
359
            else
360
            {
361
                sprite_index = spr_daimond_knight_idle;
362
            }
363
        }
364
        if (x > 820 && x < 840 && y > 670 && y < 690)
365
        {
366
            if (global.plot < 200)
367
            {
368
                x = 859;
369
                y = 796;
370
                sprite_index = spr_rurus_idle;
371
            }
372
            else if (global.flag[633 recruit_plugboy] == 1)
373
            {
374
                sprite_index = spr_npc_plugboy_static_outline;
375
            }
376
            else
377
            {
378
                instance_destroy();
379
            }
380
        }
381
    }
382
    if (room == room_cc_lancer)
383
    {
384
        if (global.plot >= 200 && scr_get_total_recruits
scr_get_total_recruits

function scr_get_total_recruits() { var totalrecruits = 0; var chapter = -1; var start_index = 0; var max_index = 100; if (argument_count > 0) chapter = argument[0]; if (chapter == 2) { start_index = 30; max_index = 44; } for (var i = start_index; i < max_index; i++) { if (global.flag[i + 600] == 1) totalrecruits++; } return totalrecruits; }
(2) >= 9)
385
            instance_destroy();
386
        else
387
            sprite_index = spr_lancer_dt;
388
    }
389
    if (room == room_dw_castle_dungeon)
390
    {
391
        sprite_index = spr_king_left;
392
        depthcancel = 1;
393
    }
394
    if (room == room_dw_cyber_intro_2)
395
    {
396
        if (global.plot < 51)
397
            sprite_index = spr_plugboy_cower;
398
        else
399
            instance_destroy();
400
    }
401
    if (room == room_dw_city_big_1)
402
    {
403
        if (y < 270)
404
        {
405
            if (global.flag[309 spamton_plot] == 9)
406
                instance_destroy();
407
            else
408
                sprite_index = spr_npc_addison_blue;
409
        }
410
        else if (global.flag[309 spamton_plot] == 9)
411
        {
412
            sprite_index = spr_npc_plugboy_static_outline;
413
            x = 500;
414
            y = 384;
415
        }
416
        else
417
        {
418
            sprite_index = spr_npc_addison_orange;
419
        }
420
    }
421
    if (room == room_dw_city_traffic_2)
422
        sprite_index = spr_npc_plugboy_static;
423
    if (room == room_dw_city_big_2)
424
    {
425
        if (global.flag[309 spamton_plot] == 9)
426
            instance_destroy();
427
    }
428
    if (room == room_dw_city_big_3)
429
    {
430
        if (x < 600)
431
        {
432
            if (global.flag[309 spamton_plot] == 9)
433
                instance_destroy();
434
            else
435
                sprite_index = spr_npc_addison_blue;
436
        }
437
        if (x > 1000)
438
        {
439
            if (global.flag[309 spamton_plot] == 9)
440
            {
441
                var viro_npc = instance_create(x, y, obj_npc_room_animated);
442
                viro_npc.sprite_index = spr_virovirokun_idle;
443
                instance_destroy();
444
            }
445
            else
446
            {
447
                sprite_index = spr_npc_addison_orange;
448
            }
449
        }
450
    }
451
    if (room == room_dw_castle_west_cliff)
452
    {
453
        if (global.chapter == 2 && global.flag[302 toy_deliver_progress] >= 1)
454
        {
455
            if (x < 210)
456
            {
457
                if (global.flag[314 mr_society_left] == 0 && global.plot < 200)
458
                    sprite_index = spr_npc_mrsociety;
459
                else
460
                    instance_destroy();
461
            }
462
            else if (global.flag[357 recruit_hacker] == 1)
463
            {
464
                sprite_index = spr_npc_cursor_walk_right;
465
            }
466
            else
467
            {
468
                instance_destroy();
469
            }
470
        }
471
        else
472
        {
473
            instance_destroy();
474
        }
475
    }
476
    if (room == room_dw_cyber_keyboard_puzzle_1)
477
    {
478
        sprite_index = spr_npc_nubert;
479
        image_xscale = -2;
480
        if (global.plot >= 70)
481
            instance_destroy();
482
    }
483
    if (room == room_dw_mansion_bridges_funny)
484
    {
485
        scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
486
        sprite_index = spr_npc_butler;
487
        image_xscale = 2;
488
        x = 1280;
489
        y = 140;
490
    }
491
    if (room == room_dw_city_mirrorfriend)
492
        sprite_index = spr_npc_iconman;
493
    if (room == room_dw_mansion_east_3f_toilet)
494
        sprite_index = spr_dw_mansion_toilet;
495
    if (room == room_dw_cyber_music_bullet)
496
        sprite_index = spr_plugboy_cower;
497
    if (room == room_dw_cyber_tasque_battle)
498
    {
499
        if (x < 300)
500
            sprite_index = spr_npc_plugboy_hat;
501
        else
502
            sprite_index = spr_npc_plugboy_girl;
503
    }
504
    if (room == room_dw_cyber_maze_queenscreen)
505
        sprite_index = spr_npc_plugboy_hat;
506
    if (room == room_dw_cyber_battle_maze_2)
507
    {
508
        normalanim = 3;
509
        remanimspeed = 0.25;
510
    }
511
    if (room == room_dw_city_postbaseball_1)
512
    {
513
        sprite_index = spr_noelle_walk_right_dw;
514
        normalanim = 4;
515
    }
516
}
517
if (depthcancel == 0)
518
    scr_depth
scr_depth

function scr_depth() { depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();