Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_event_room_Create_0

(view raw script w/o annotations or w/e)
1
con = 0;
2
timer = 0;
3
entrance = global.entrance;
4
rem_facing = -1;
5
facing_timer = 0;
6
if (room == room_field2 && global.plot >= 34)
7
    instance_destroy();
8
if (room == room_field2A || room == room_field_puzzle1)
9
{
10
    if (room == room_field2A)
11
        candyflag = 101;
12
    if (room == room_field_puzzle1)
13
        candyflag = 102;
14
    siner = 0;
15
    if (global.flag[candyflag] >= 2)
16
    {
17
        instance_destroy();
18
    }
19
    else
20
    {
21
        candytree = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(obj_npc_room.x, obj_npc_room.y, spr_candytree_candies);
22
        with (candytree)
23
        {
24
            siner = 0;
25
            
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
26
            depth -= 5;
27
        }
28
    }
29
}
30
if (room == room_torhouse)
31
{
32
    if (global.entrance == 0 && obj_mainchara.x <= (room_width / 2))
33
        instance_destroy();
34
    if (global.entrance == 1)
35
        instance_destroy();
36
    if (global.entrance == 2)
37
        instance_destroy();
38
    if (global.entrance == 24)
39
    {
40
        global.facing = 3;
41
        rem_facing = 3;
42
    }
43
    if (global.entrance == 4)
44
    {
45
        global.facing = 0;
46
        rem_facing = 0;
47
    }
48
    if (global.plot < 250)
49
    {
50
        instance_destroy();
51
    }
52
    else
53
    {
54
        if (global.flag[262 bouquet_quest_stage] == 3)
55
            global.flag[262 bouquet_quest_stage] = 4;
56
        pie = 
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; }
(274, 96, spr_pie);
57
        with (pie)
58
            depth = 100000;
59
        if (!snd_is_playing(global.currentsong[1]))
60
        {
61
            global.currentsong[0] = snd_init("home.ogg");
62
            global.currentsong[1] = mus_loop_ext(global.currentsong[0], 0.8, 0.97);
63
        }
64
    }
65
}
66
if (room == room_town_krisyard)
67
{
68
    if (global.plot < 250)
69
    {
70
        instance_destroy();
71
    }
72
    else if (global.entrance == 24)
73
    {
74
        global.facing = 0;
75
        rem_facing = 0;
76
    }
77
}
78
if (room == room_krishallway)
79
{
80
    global.facing = 0;
81
    rem_facing = 0;
82
}
83
if (room == room_cc_prison_prejoker)
84
{
85
    global.flag[31 disable_loud_steps] = 0;
86
    songplayed = 0;
87
    m = 0;
88
    maxm = 0;
89
    if (!snd_is_playing(global.currentsong[1]) && global.flag[241 JEVIL_plot] < 6)
90
    {
91
        songplayed = 1;
92
        global.currentsong[0] = snd_init("prejoker.ogg");
93
        global.currentsong[1] = mus_loop_ext(global.currentsong[0], 1, 0.85);
94
        mus_volume(global.currentsong[1], 0, 0);
95
    }
96
    doorimg = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(x - 48, y - 170, spr_jokerdoor);
97
    with (doorimg)
98
        depth = 500000;
99
    doorsolid = instance_create(x, y, obj_soliddark);
100
    doorevent = instance_create(x, y, obj_readable_room1);
101
    if (global.flag[241 JEVIL_plot] == 5)
102
    {
103
        with (doorimg)
104
            image_index = 2;
105
        with (doorsolid)
106
            instance_destroy();
107
        with (doorevent)
108
            instance_destroy();
109
        door_door = instance_create(x + 15, y, obj_doorA);
110
    }
111
    if (global.flag[241 JEVIL_plot] >= 6)
112
    {
113
        with (doorsolid)
114
            instance_destroy();
115
        with (doorevent)
116
            instance_destroy();
117
        with (doorimg)
118
            instance_destroy();
119
        finalsolid = instance_create(1600, 1040, obj_soliddark);
120
    }
121
}
122
if (room == room_cc_throneroom)
123
{
124
    if (global.plot >= 240)
125
    {
126
        block = instance_create(260, 740, obj_soliddark);
127
        block.image_xscale = 8;
128
        with (obj_readable_room1)
129
            instance_destroy();
130
        th = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(obj_npc_sign.x, obj_npc_sign.y, spr_darkthrone);
131
        with (th)
132
            
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
133
        with (obj_npc_sign)
134
        {
135
            chairsolid = instance_create(x, y, obj_solidblock);
136
            chairsolid.sprite_index = sprite_index;
137
            chairsolid.image_xscale = 2;
138
            chairsolid.image_yscale = 2;
139
            visible = 1;
140
            with (chairsolid)
141
                
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
142
            instance_destroy();
143
        }
144
    }
145
}
146
if (room == room_forest_savepoint3)
147
{
148
    if (global.tempflag[9] == 1)
149
    {
150
        if (global.hp[1] < 1)
151
            global.hp[1] = 10;
152
        if (global.hp[3] < 1)
153
            global.hp[3] = 10;
154
        global.fighting = 0;
155
        global.interact = 1;
156
        blackmarker = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(-100, -100, spr_pixel_white);
157
        with (blackmarker)
158
        {
159
            image_blend = c_black;
160
            image_xscale = 600;
161
            image_yscale = 600;
162
            depth = 1000;
163
        }
164
        con = 10;
165
        alarm[4]
 = 30;
gml_Object_obj_event_room_Alarm_4.gml

con += 1;
166
    }
167
    else
168
    {
169
        instance_destroy();
170
    }
171
}
172
if (room == room_field_secret1)
173
{
174
    pcon = 0;
175
    ptimer = 0;
176
    puzzle = instance_create(1000, 100, obj_suitspuzz);
177
    with (puzzle)
178
    {
179
        max_suit = 4;
180
        drawclue = 0;
181
        sol[0] = 2;
182
        sol[1] = 4;
183
        sol[2] = 3;
184
        sol[3] = 1;
185
    }
186
    spikee[0] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(1300, 240, spr_spiketile);
187
    spikee[1] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(1300, 280, spr_spiketile);
188
    with (spikee[0])
189
        depth = 900000;
190
    with (spikee[1])
191
        depth = 900000;
192
    spike_solid = instance_create(1300, 240, obj_soliddark);
193
    with (spike_solid)
194
        image_yscale = 3;
195
}
196
if (room == room_forest_beforeclover)
197
{
198
    pcon = 0;
199
    ptimer = 0;
200
    hinta = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(320, 680, spr_suitsicon_fade);
201
    hintb = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(840, 680, spr_suitsicon_fade);
202
    hintc = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(1400, 680, spr_suitsicon_fade);
203
    with (hinta)
204
        depth = 800000;
205
    with (hintb)
206
    {
207
        image_index = 1;
208
        depth = 800000;
209
    }
210
    with (hintc)
211
    {
212
        image_index = 2;
213
        depth = 800000;
214
    }
215
    puzzle = instance_create(180, 140, obj_suitspuzz);
216
    with (puzzle)
217
    {
218
        max_suit = 3;
219
        drawclue = 0;
220
        sol[0] = 1;
221
        sol[1] = 2;
222
        sol[2] = 3;
223
    }
224
    spikee[0] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(400, 240, spr_spiketile);
225
    spikee[1] = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(440, 240, spr_spiketile);
226
    with (spikee[0])
227
        depth = 900000;
228
    with (spikee[1])
229
        depth = 900000;
230
    spike_solid = instance_create(400, 240, obj_soliddark);
231
    with (spike_solid)
232
        image_xscale = 2;
233
    if (global.flag[290 solved_dice_puzzle] == 1)
234
    {
235
        with (spikee[0])
236
            image_index = 1;
237
        with (spikee[1])
238
            image_index = 1;
239
        with (spike_solid)
240
            instance_destroy();
241
        with (puzzle)
242
            won = 1;
243
    }
244
}
245
if (room == room_forest_savepoint_relax)
246
{
247
    if (global.plot >= 85)
248
        instance_destroy();
249
    else
250
        con = 1;
251
}
252
if (room == room_forest_maze_susie)
253
{
254
    global.flag[291 maze_progress] = 5;
255
    if (global.plot >= 100)
256
    {
257
        instance_destroy();
258
    }
259
    else
260
    {
261
        image_speed = 0;
262
        visible = 1;
263
        
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
264
        con = 1;
265
        sprite_index = spr_susied_dark_unhappy;
266
    }
267
}
268
talked = 0;
269
timer = 0;