Deltarune (Chapter 4) 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
skip = false;
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.chapter == 1)
21
        {
22
            if (global.plot >= 250)
23
                sprite_index = spr_chairiel;
24
        }
25
        if (global.chapter == 4)
26
        {
27
            if (global.plot >= 40 && global.plot < 300)
28
                sprite_index = spr_chairiel;
29
        }
30
    }
31
    if (room == room_graveyard)
32
    {
33
        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);
34
        with (fence)
35
            
scr_depth
scr_depth

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

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();