Deltarune 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(argument0, argument1, argument2) //gml_Script_scr_marker { thismarker = instance_create(argument0, argument1, obj_marker) with (thismarker) { sprite_index = argument2 image_speed = 0 } return thismarker; }
(81, 122, spr_npc_graveyardfence)
28
        with (fence)
29
            scr_depth
scr_depth

function scr_depth() //gml_Script_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() //gml_Script_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() //gml_Script_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
                instance_destroy()
264
        }
265
    }
266
    if (room == room_dw_castle_area_2)
267
        sprite_index = spr_susiel_wall_eyes
268
    if (room == room_dw_castle_area_2_transformed)
269
    {
270
        if (x > 600 && x < 640 && y > 750 && y < 780)
271
        {
272
            sprite_index = spr_diamond_overworld
273
            image_xscale = -2
274
        }
275
        if (x > 1100 && x < 1300 && y > 870 && y < 890)
276
            sprite_index = spr_heartenemy_overworld
277
        if (x > 1150 && x < 1170 && y > 590 && y < 610)
278
        {
279
            if (global.flag[636 recruit_butler] != 1)
280
                sprite_index = spr_npc_rabbick_clean
281
            else
282
            {
283
                rabbicksweep = instance_create(1222, 562, obj_npc_room_animated)
284
                rabbicksweep.sprite_index = spr_npc_rabbick_sweep
285
                rabbicksweep.image_speed = 0.1
286
                with (rabbicksweep)
287
                    scr_depth
scr_depth

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

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

function scr_depth() //gml_Script_scr_depth { depth = 100000 - (y * 10 + sprite_height * 10) }
()
350
                }
351
                instance_destroy()
352
            }
353
            else
354
                sprite_index = spr_daimond_knight_idle
355
        }
356
        if (x > 820 && x < 840 && y > 670 && y < 690)
357
        {
358
            if (global.plot < 200)
359
            {
360
                x = 859
361
                y = 796
362
                sprite_index = spr_rurus_idle
363
            }
364
            else if (global.flag[633 recruit_plugboy] == 1)
365
                sprite_index = spr_npc_plugboy_static_outline
366
            else
367
                instance_destroy()
368
        }
369
    }
370
    if (room == room_cc_lancer)
371
    {
372
        if (global.plot >= 200 && scr_get_total_recruits
scr_get_total_recruits

function scr_get_total_recruits() //gml_Script_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)
373
            instance_destroy()
374
        else
375
            sprite_index = spr_lancer_dt
376
    }
377
    if (room == room_dw_castle_dungeon)
378
    {
379
        sprite_index = spr_king_left
380
        depthcancel = 1
381
    }
382
    if (room == room_dw_cyber_intro_2)
383
    {
384
        if (global.plot < 51)
385
            sprite_index = spr_plugboy_cower
386
        else
387
            instance_destroy()
388
    }
389
    if (room == room_dw_city_big_1)
390
    {
391
        if (y < 270)
392
        {
393
            if (global.flag[309 spamton_plot] == 9)
394
                instance_destroy()
395
            else
396
                sprite_index = spr_npc_addison_blue
397
        }
398
        else if (global.flag[309 spamton_plot] == 9)
399
        {
400
            sprite_index = spr_npc_plugboy_static_outline
401
            x = 500
402
            y = 384
403
        }
404
        else
405
            sprite_index = spr_npc_addison_orange
406
    }
407
    if (room == room_dw_city_traffic_2)
408
        sprite_index = spr_npc_plugboy_static
409
    if (room == room_dw_city_big_2)
410
    {
411
        if (global.flag[309 spamton_plot] == 9)
412
            instance_destroy()
413
    }
414
    if (room == room_dw_city_big_3)
415
    {
416
        if (x < 600)
417
        {
418
            if (global.flag[309 spamton_plot] == 9)
419
                instance_destroy()
420
            else
421
                sprite_index = spr_npc_addison_blue
422
        }
423
        if (x > 1000)
424
        {
425
            if (global.flag[309 spamton_plot] == 9)
426
            {
427
                var viro_npc = instance_create(x, y, obj_npc_room_animated)
428
                viro_npc.sprite_index = spr_virovirokun_idle
429
                instance_destroy()
430
            }
431
            else
432
                sprite_index = spr_npc_addison_orange
433
        }
434
    }
435
    if (room == room_dw_castle_west_cliff)
436
    {
437
        if (global.chapter == 2 && global.flag[302 toy_deliver_progress] >= 1)
438
        {
439
            if (x < 210)
440
            {
441
                if (global.flag[314 mr_society_left] == 0 && global.plot < 200)
442
                    sprite_index = spr_npc_mrsociety
443
                else
444
                    instance_destroy()
445
            }
446
            else if (global.flag[357 recruit_hacker] == 1)
447
                sprite_index = spr_npc_cursor_walk_right
448
            else
449
                instance_destroy()
450
        }
451
        else
452
            instance_destroy()
453
    }
454
    if (room == room_dw_cyber_keyboard_puzzle_1)
455
    {
456
        sprite_index = spr_npc_nubert
457
        image_xscale = -2
458
        if (global.plot >= 70)
459
            instance_destroy()
460
    }
461
    if (room == room_dw_mansion_bridges_funny)
462
    {
463
        scr_depth
scr_depth

function scr_depth() //gml_Script_scr_depth { depth = 100000 - (y * 10 + sprite_height * 10) }
()
464
        sprite_index = spr_npc_butler
465
        image_xscale = 2
466
        x = 1280
467
        y = 140
468
    }
469
    if (room == room_dw_city_mirrorfriend)
470
        sprite_index = spr_npc_iconman
471
    if (room == room_dw_mansion_east_3f_toilet)
472
        sprite_index = spr_dw_mansion_toilet
473
    if (room == room_dw_cyber_music_bullet)
474
        sprite_index = spr_plugboy_cower
475
    if (room == room_dw_cyber_tasque_battle)
476
    {
477
        if (x < 300)
478
            sprite_index = spr_npc_plugboy_hat
479
        else
480
            sprite_index = spr_npc_plugboy_girl
481
    }
482
    if (room == room_dw_cyber_maze_queenscreen)
483
        sprite_index = spr_npc_plugboy_hat
484
    if (room == room_dw_cyber_battle_maze_2)
485
    {
486
        normalanim = 3
487
        remanimspeed = 0.25
488
    }
489
    if (room == room_dw_city_postbaseball_1)
490
    {
491
        sprite_index = spr_noelle_walk_right_dw
492
        normalanim = 4
493
    }
494
}
495
if (depthcancel == 0)
496
    scr_depth
scr_depth

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