Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_npc_room_Create_0

related scripts: Alarm_11Create_0 Other_10Step_1

(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_graveyard)
15
    {
16
        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);
17
        with (fence)
18
            
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
19
        if (x < 30)
20
            sprite_index = spr_npc_bench;
21
    }
22
    if (room == room_hospital_lobby)
23
        sprite_index = spr_npc_nurse;
24
    if (room == room_hospital_rudy)
25
    {
26
        if (global.chapter == 1)
27
            sprite_index = spr_rudy_d;
28
        if (global.chapter >= 2)
29
            sprite_index = spr_rudy_l;
30
    }
31
    if (room == room_library)
32
        sprite_index = spr_normalnpc;
33
    if (room == room_townhall)
34
    {
35
        sprite_index = spr_npc_businessguy;
36
        if (x > 100)
37
            sprite_index = spr_npc_receptionist;
38
        if (x > 200)
39
            sprite_index = spr_npc_politicsbear;
40
    }
41
    if (room == room_diner)
42
    {
43
        if (global.chapter == 1)
44
        {
45
            if (x < 120)
46
                sprite_index = spr_npc_cattiwaitress;
47
            if (x < 60)
48
                sprite_index = spr_npc_dragonfamily;
49
            if (x >= 120 && x <= 140)
50
                sprite_index = spr_npc_qc;
51
            if (y > 130)
52
            {
53
                if (x > 180)
54
                    sprite_index = spr_npc_dresslion;
55
                if (x > 240)
56
                {
57
                    sprite_index = spr_npc_greenfire;
58
                    depth = 4000;
59
                    depthcancel = 1;
60
                }
61
                if (x > 260)
62
                {
63
                    sprite_index = spr_npc_flanneldemon;
64
                    depth = 4000;
65
                    depthcancel = 1;
66
                }
67
            }
68
            if (y < 120)
69
            {
70
                if (x > 160)
71
                    sprite_index = spr_npc_most_improved_1997;
72
                if (x > 200)
73
                    sprite_index = spr_npc_icewolf;
74
            }
75
        }
76
        if (global.chapter >= 2)
77
        {
78
            if (y < 85)
79
                sprite_index = spr_npc_qc;
80
            if (x > 150 && x < 180 && y < 115)
81
                sprite_index = spr_jockington_lt;
82
            if (x > 80 && x < 120)
83
                sprite_index = spr_npc_cattiwaitress;
84
        }
85
    }
86
    if (room == room_town_south)
87
    {
88
        if (global.chapter == 1)
89
        {
90
            if (x > 560)
91
                sprite_index = spr_npc_donutcar;
92
            if (x > 720)
93
                sprite_index = spr_npc_snailcar;
94
        }
95
    }
96
    if (room == room_town_church)
97
    {
98
        if (global.chapter == 1)
99
            sprite_index = spr_npc_alvin;
100
        if (global.chapter >= 2)
101
        {
102
            if (x > 270 && y < 320)
103
                sprite_index = spr_npc_terry;
104
            if (x > 220 && x < 260 && y > 310)
105
                sprite_index = spr_npc_icecap_r;
106
            if (x > 230 && x < 245 && y > 300)
107
                sprite_index = spr_npc_icecap_g;
108
            if (x > 250 && x < 260 && y > 300)
109
                sprite_index = spr_npc_icecap_b;
110
            if (x > 380)
111
                sprite_index = spr_npc_rgbun;
112
            if (x > 400)
113
                sprite_index = spr_npc_rgdragon;
114
            if (x > 590)
115
                sprite_index = spr_npc_rabbitkid;
116
        }
117
    }
118
    if (room == room_town_mid)
119
    {
120
        if (x >= 1800 && x < 1840)
121
        {
122
            if (global.chapter == 1)
123
                sprite_index = spr_mkid_dt;
124
            else
125
                instance_destroy();
126
        }
127
        if (x >= 1900 && x < 1920)
128
        {
129
            if (global.chapter == 1)
130
                sprite_index = spr_snowy_dt;
131
            else
132
                instance_destroy();
133
        }
134
    }
135
    if (room == room_beach)
136
    {
137
        if (global.chapter == 1)
138
        {
139
            if (x >= 60)
140
                sprite_index = spr_npc_rgbun;
141
            if (x >= 100)
142
                sprite_index = spr_npc_rgdragon;
143
        }
144
        if (global.chapter >= 2)
145
            instance_destroy();
146
    }
147
}
148
if (room == room_flowershop_1f)
149
{
150
    if (global.chapter >= 2)
151
        sprite_index = spr_asgored;
152
    else
153
        instance_destroy();
154
}
155
if (room == room_lw_police)
156
{
157
    if (x > 80)
158
        sprite_index = spr_npc_napstablook_police_down;
159
    if (x > 140)
160
        sprite_index = spr_undyne_dt;
161
    if (x > 170)
162
    {
163
        sprite_index = spr_npc_prisoner_dog_m;
164
        depthcancel = 1;
165
    }
166
    if (x > 190)
167
    {
168
        sprite_index = spr_npc_prisoner_dog_f;
169
        depthcancel = 1;
170
    }
171
}
172
if (room == room_alphysalley)
173
    sprite_index = spr_npc_bratty;
174
if (room == room_lw_conbini)
175
{
176
    if (x > 280)
177
        sprite_index = spr_npc_diamond_tallboy;
178
    else
179
        sprite_index = spr_npc_milklooker;
180
}
181
if (global.darkzone == 1)
182
{
183
    image_xscale = 2;
184
    image_yscale = 2;
185
    if (room == room_cc_lancer)
186
    {
187
        if (scr_get_total_recruits(2) >= 9)
188
            instance_destroy();
189
        else
190
            sprite_index = spr_lancer_dt;
191
    }
192
    if (room == room_dw_castle_dungeon)
193
    {
194
        sprite_index = spr_king_left;
195
        depthcancel = 1;
196
    }
197
    if (room == room_dw_castle_west_cliff)
198
    {
199
        if (x < 210)
200
            instance_destroy();
201
        else if (global.flag[357 recruit_hacker] == 1)
202
            sprite_index = spr_npc_cursor_walk_right;
203
        else
204
            instance_destroy();
205
    }
206
}
207
if (depthcancel == 0)
208
    
scr_depth
scr_depth

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