Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_ch5_DW40_Create_0

(view raw script w/o annotations or w/e)
1
con = 0;
2
flower_con = 0;
3
customcon = 0;
4
flowers_talked = 0;
5
max_flowers = 6;
6
clean_up_queue = [];
7
_trigger = -4;
8
bgm_track[0] = -4;
9
bgm_track[1] = -4;
10
_flowery_marker = 
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; }
(899, 644, spr_flowery_walk_upright);
11
with (_flowery_marker)
12
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
13
_flower_readable = -4;
14
_flowery_solid = -4;
15
_green_marker = 
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; }
(1481, 806, spr_enemy_green_behind);
16
with (_green_marker)
17
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
18
_green_readable = instance_create(_green_marker.x + 10, _green_marker.y + 50, obj_readable_room1);
19
with (_green_readable)
20
{
21
    extflag = "green";
22
    image_xscale = 2;
23
    image_yscale = 2;
24
}
25
_green_solid = instance_create(_green_marker.x + 4, _green_marker.y + 40, obj_solidblock);
26
with (_green_solid)
27
{
28
    image_xscale = 2.5;
29
    image_yscale = 3;
30
}
31
_yellow_marker = 
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; }
(1493, 523, spr_yellow_walk_up);
32
with (_yellow_marker)
33
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
34
_yellow_readable = instance_create(_yellow_marker.x + 4, _yellow_marker.y + 80, obj_readable_room1);
35
with (_yellow_readable)
36
{
37
    extflag = "yellow";
38
    image_xscale = 2;
39
    image_yscale = 3;
40
}
41
_yellow_solid = instance_create(_yellow_marker.x + 4, _yellow_marker.y + 80, obj_solidblock);
42
with (_yellow_solid)
43
{
44
    image_xscale = 2;
45
    image_yscale = 3;
46
}
47
_blue_marker = 
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; }
(1803, 536, spr_blue_up);
48
with (_blue_marker)
49
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
50
_blue_readable = instance_create(_blue_marker.x + 20, _blue_marker.y + 90, obj_readable_room1);
51
with (_blue_readable)
52
{
53
    extflag = "blue";
54
    image_xscale = 2;
55
    image_yscale = 2;
56
}
57
_blue_solid = instance_create(_blue_marker.x + 8, _blue_marker.y + 70, obj_solidblock);
58
with (_blue_solid)
59
{
60
    image_xscale = 3;
61
    image_yscale = 3;
62
}
63
_aqua_marker = 
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; }
(1297, 715, spr_aqua_walk_up);
64
with (_aqua_marker)
65
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
66
_aqua_readable = instance_create(_aqua_marker.x, _aqua_marker.y + 40, obj_readable_room1);
67
with (_aqua_readable)
68
{
69
    extflag = "aqua";
70
    image_xscale = 2;
71
    image_yscale = 2;
72
}
73
_aqua_solid = instance_create(_aqua_marker.x, _aqua_marker.y + 40, obj_solidblock);
74
with (_aqua_solid)
75
{
76
    image_xscale = 2;
77
    image_yscale = 2;
78
}
79
_orange_marker = 
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; }
(1808, 870, spr_enemy_orange_walk_up);
80
with (_orange_marker)
81
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
82
_orange_readable = instance_create(_orange_marker.x, _orange_marker.y, obj_readable_room1);
83
with (_orange_readable)
84
{
85
    extflag = "orange";
86
    image_xscale = 2;
87
    image_yscale = 2;
88
}
89
_orange_solid = instance_create(_orange_marker.x, _orange_marker.y, obj_solidblock);
90
with (_orange_solid)
91
{
92
    image_xscale = 2;
93
    image_yscale = 2;
94
}
95
_seth_marker = 
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; }
(2004, 699, spr_seth_walk_up);
96
with (_seth_marker)
97
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
98
_seth_readable = instance_create(_seth_marker.x + 10, _seth_marker.y + 40, obj_readable_room1);
99
with (_seth_readable)
100
{
101
    extflag = "seth";
102
    image_xscale = 2;
103
    image_yscale = 2;
104
}
105
_seth_solid = instance_create(_seth_marker.x + 10, _seth_marker.y + 40, obj_solidblock);
106
with (_seth_solid)
107
{
108
    image_xscale = 2;
109
    image_yscale = 2;
110
}
111
_susie_marker = 
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; }
(2310, 650, spr_susied_dark_unhappy);
112
with (_susie_marker)
113
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
114
_susie_readable = instance_create(_susie_marker.x, _susie_marker.y + 40, obj_readable_room1);
115
with (_susie_readable)
116
{
117
    extflag = "susie";
118
    image_xscale = 2;
119
    image_yscale = 2;
120
}
121
_ralsei_marker = 
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; }
(2250, 656, spr_ralsei_walk_down_unhappy);
122
with (_ralsei_marker)
123
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();
124
_ralsei_readable = instance_create(_ralsei_marker.x, _ralsei_marker.y + 40, obj_readable_room1);
125
with (_ralsei_readable)
126
{
127
    extflag = "ralsei";
128
    image_xscale = 2;
129
    image_yscale = 2;
130
}
131
_sr_solid = instance_create(_ralsei_marker.x, _susie_marker.y + 50, obj_solidblock);
132
with (_sr_solid)
133
{
134
    image_xscale = 5;
135
    image_yscale = 2;
136
}
137
138
set_up = function()
139
{
140
    
scr_miniface_init_flowers
scr_miniface_init_flowers

function
scr_miniface_init_flowers()
{ var face_list = [4883, 2166, 3293, 2554, 4857, 1689]; for (var i = 0; i < array_length(face_list); i++) global.writerimg[i] = face_list[i]; }
();
141
    layer_set_visible("TILES_GRASS_DARK", true);
142
    layer_set_visible("TILES_GRASS_BRIGHT", false);
143
    _trigger = instance_create(840, 640, obj_trigger);
144
    with (_trigger)
145
        image_yscale = 20;
146
};
147
148
regain_control = function()
149
{
150
    global.interact = 0;
151
    global.facing = 0;
152
    var kr_x = kr_actor.x;
153
    var kr_y = kr_actor.y;
154
    obj_mainchara.x = kr_x;
155
    obj_mainchara.y = kr_y;
156
    obj_mainchara.visible = 1;
157
    obj_mainchara.cutscene = 0;
158
    if (global.plot >= 510)
159
    {
160
        var su_x = su_actor.x;
161
        var su_y = su_actor.y;
162
        var ra_x = ra_actor.x;
163
        var ra_y = ra_actor.y;
164
        with (obj_caterpillarchara)
165
        {
166
            if (name == "susie")
167
            {
168
                x = su_x;
169
                y = su_y;
170
            }
171
            else if (name == "ralsei")
172
            {
173
                x = ra_x;
174
                y = ra_y;
175
            }
176
            
scr_caterpillar_interpolate
scr_caterpillar_interpolate

function
scr_caterpillar_interpolate(arg0 = "none")
{ if (arg0 == "all") { with (obj_caterpillarchara) scr_caterpillar_interpolate_old(); } else if (arg0 == "none") { if (object_index == obj_caterpillarchara) scr_caterpillar_interpolate_old(); } else { with (obj_caterpillarchara) { if (name == arg0) scr_caterpillar_interpolate_old(); } } } function scr_caterinterp(arg0 = "none") {
scr_caterpillar_interpolate(arg0);
} function scr_caterpillar_interpolate_old() { var _newfacing = direction_to_object_bbox(id, 1198, true); remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = _newfacing; for (var _iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(obj_mainchara.x, x + halign, _iaia / target); remy[_iaia] = lerp(obj_mainchara.y, y + valign, _iaia / target); facing[_iaia] = _newfacing; } }
();
177
            visible = 1;
178
        }
179
    }
180
    with (obj_actor)
181
        visible = 0;
182
};
183
184
lose_control = function()
185
{
186
    global.interact = 1;
187
    kr_actor.x = obj_mainchara.x;
188
    kr_actor.y = obj_mainchara.y;
189
    kr_actor.sprite_index = obj_mainchara.sprite_index;
190
    if (global.plot < 510)
191
    {
192
        su_actor.x = _susie_marker.x;
193
        su_actor.y = _susie_marker.y;
194
        su_actor.sprite_index = _susie_marker.sprite_index;
195
        ra_actor.x = _ralsei_marker.x;
196
        ra_actor.y = _ralsei_marker.y;
197
        ra_actor.sprite_index = _ralsei_marker.sprite_index;
198
    }
199
    else
200
    {
201
        var su_x = 0;
202
        var su_y = 0;
203
        var su_sprite = -4;
204
        var ra_x = 0;
205
        var ra_y = 0;
206
        var ra_sprite = -4;
207
        with (obj_caterpillarchara)
208
        {
209
            if (name == "susie")
210
            {
211
                su_x = x;
212
                su_y = y;
213
                su_sprite = sprite_index;
214
            }
215
            else if (name == "ralsei")
216
            {
217
                ra_x = x;
218
                ra_y = y;
219
                ra_sprite = sprite_index;
220
            }
221
        }
222
        su_actor.x = su_x;
223
        su_actor.y = su_y;
224
        ra_actor.x = ra_x;
225
        ra_actor.y = ra_y;
226
    }
227
    with (obj_actor)
228
        visible = 1;
229
    with (obj_caterpillarchara)
230
        visible = 0;
231
    with (obj_mainchara)
232
        visible = 0;
233
};
234
235
show_convo = function(arg0, arg1 = 0)
236
{
237
    con = 5;
238
    customcon = 1;
239
    flower_con = arg0;
240
    queue_clean_up(arg0);
241
    switch (arg0)
242
    {
243
        case "flowery":
244
            con = (arg1 < 1) ? 10 : 11;
245
            if (flowers_talked >= max_flowers)
246
                con = (arg1 < 1) ? 30 : 40;
247
            break;
248
        case "green":
249
            flowers_talked++;
250
            break;
251
        case "yellow":
252
            flowers_talked++;
253
            break;
254
        case "blue":
255
            flowers_talked++;
256
            break;
257
        case "aqua":
258
            flowers_talked++;
259
            break;
260
        case "orange":
261
            flowers_talked++;
262
            break;
263
        case "seth":
264
            flowers_talked++;
265
            break;
266
        case "susie":
267
            con = (arg1 < 1) ? 12 : 14;
268
            if (flowers_talked >= max_flowers)
269
                con = (arg1 < 1) ? 20 : 22;
270
            break;
271
        case "ralsei":
272
            con = (arg1 < 1) ? 16 : 18;
273
            if (flowers_talked >= max_flowers)
274
                con = 24;
275
            break;
276
    }
277
};
278
279
show_particles = function(arg0, arg1)
280
{
281
    for (var i = 0; i < 12; i++)
282
    {
283
        var shine = instance_create(arg0.x + irandom_range(-20, 20), arg0.y - 40 - irandom_range(-4, 40), obj_afterimage);
284
        shine.image_speed = 0.25;
285
        shine.image_alpha = 1;
286
        shine.sprite_index = spr_shine;
287
        shine.visible = true;
288
        shine.gravity = -0.1;
289
        shine.hspeed = irandom_range(2, 4);
290
        shine.depth = arg0.depth - 5;
291
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
(shine);
292
    }
293
};
294
295
queue_clean_up = function(arg0)
296
{
297
    if (arg0 == "flowery")
298
        exit;
299
    if (arg0 == "susie")
300
        exit;
301
    if (arg0 == "ralsei")
302
        exit;
303
    clean_up_queue[array_length(clean_up_queue)] = arg0;
304
};
305
306
dequeue_clean_up = function()
307
{
308
    var adjusted_list = [];
309
    for (var i = 0; i < array_length(clean_up_queue); i++)
310
    {
311
        var extflag = clean_up_queue[i];
312
        clean_up(extflag);
313
        adjusted_list[array_length(adjusted_list)] = extflag;
314
    }
315
    clean_up_queue = adjusted_list;
316
};
317
318
clean_up = function(arg0)
319
{
320
    switch (arg0)
321
    {
322
        case "green":
323
            with (gr_actor)
324
                instance_destroy();
325
            with (_green_marker)
326
                instance_destroy();
327
            with (_green_solid)
328
                instance_destroy();
329
            break;
330
        case "yellow":
331
            with (ye_actor)
332
                instance_destroy();
333
            with (_yellow_marker)
334
                instance_destroy();
335
            with (_yellow_solid)
336
                instance_destroy();
337
            break;
338
        case "blue":
339
            with (bl_actor)
340
                instance_destroy();
341
            with (_blue_marker)
342
                instance_destroy();
343
            with (_blue_solid)
344
                instance_destroy();
345
            break;
346
        case "aqua":
347
            with (aq_actor)
348
                instance_destroy();
349
            with (_aqua_marker)
350
                instance_destroy();
351
            with (_aqua_solid)
352
                instance_destroy();
353
            break;
354
        case "orange":
355
            with (ar_actor)
356
                instance_destroy();
357
            with (_orange_marker)
358
                instance_destroy();
359
            with (_orange_solid)
360
                instance_destroy();
361
            break;
362
        case "seth":
363
            with (se_actor)
364
                instance_destroy();
365
            with (_seth_marker)
366
                instance_destroy();
367
            with (_seth_solid)
368
                instance_destroy();
369
            break;
370
    }
371
    var target_flag = arg0;
372
    with (obj_readable_room1)
373
    {
374
        if (extflag == target_flag)
375
            instance_destroy();
376
    }
377
};