Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_credits_ch5_transition_Draw_0

(view raw script w/o annotations or w/e)
1
index += 1;
2
if (con == 16)
3
{
4
    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("overlay_alpha", 1, 0, 90);
5
    sus_index += 0.25;
6
    if (sus_v >= 0)
7
    {
8
        sus_f = 0;
9
        sus_v += 0.005;
10
    }
11
    timer += 1;
12
    threshold = 80;
13
    if (quick_mode == 1)
14
        threshold = 30;
15
    if (timer >= threshold)
16
    {
17
        timer = 0;
18
        con = 17;
19
        sus_index = 0;
20
    }
21
}
22
if (con == 17)
23
{
24
    draw_rect = 0;
25
    linecon = 1;
26
    sus_x_current = sus_x;
27
    kris_x_current = kris_x;
28
    sus_sprite = spr_susie_lw_fall_turn;
29
    kris_sprite = spr_kris_fall_turnaround;
30
    con = 18;
31
    soundcon = 1;
32
    radius = 60;
33
}
34
if (soundcon == 1)
35
{
36
    dronetimer = 0;
37
    soundcon = 2;
38
}
39
if (soundcon == 2)
40
{
41
    dronetimer++;
42
    if (quick_mode == 1)
43
        dronetimer++;
44
    dronepitch = dronetimer / 80;
45
    if (dronepitch >= 1)
46
    {
47
        dronepitch = 1;
48
        soundcon = 3;
49
    }
50
}
51
if (con == 18)
52
{
53
    timer += 1;
54
    if (quick_mode == 1)
55
        timer += 1;
56
    sus_index = (timer / 36) * 5;
57
    if (kris_only == 0)
58
        kris_x = kris_x_current + (sin(degtorad(timer * 2.5)) * radius);
59
    if (timer >= 35)
60
    {
61
        sus_sprite = spr_susie_lw_fall_d;
62
        kris_sprite = spr_kris_fall_d_lw;
63
        sus_index = 0;
64
        con = 19;
65
        timer = 0;
66
    }
67
}
68
if (con == 19)
69
{
70
    sus_index += 0.2;
71
    timer += 1;
72
    if (quick_mode == 1)
73
        timer = 8;
74
    if (timer >= 8)
75
    {
76
        con = 30;
77
        timer = 0;
78
        sus_draw = 0;
79
    }
80
}
81
if (con == 30)
82
{
83
    if (kris_only == 0)
84
        draw_sprite_ext(spr_susie_lw_fall_d, index / 4, sus_x, sus_y, 1, 1, 0, c_white, char_alpha);
85
    timer += 1;
86
    if (quick_mode == 1)
87
        timer += 1;
88
    if (timer >= 15)
89
    {
90
        con = 31;
91
        timer = 0;
92
        sus_width = sprite_get_width(spr_susie_dw_fall_d);
93
        sus_height = sprite_get_height(spr_susie_dw_fall_d);
94
        sus_top = sus_height;
95
        kris_width = sprite_get_width(spr_kris_fall_d_dw);
96
        kris_height = sprite_get_height(spr_kris_fall_d_dw);
97
        kris_top = kris_height;
98
    }
99
}
100
if (con == 31)
101
{
102
    timer += 1;
103
    if (kris_only == 0)
104
        draw_sprite_part(spr_susie_lw_fall_d, index / 4, 0, 0, sus_width, sus_top, sus_x, sus_y);
105
    if (kris_only == 0)
106
        draw_sprite_part(spr_susie_dw_fall_d, index / 4, 0, sus_top, sus_width, sus_height - sus_top, sus_x, sus_y + sus_top);
107
    if (timer >= 4)
108
    {
109
        if (sus_top > 2)
110
        {
111
            sus_top -= 0.5;
112
            if (quick_mode == 1)
113
                sus_top -= 1.5;
114
        }
115
        else
116
        {
117
            sus_top = 0;
118
        }
119
        if (sus_top >= 2 && kris_only == 0)
120
        {
121
            sus_particle = instance_create(sus_x + 3 + random(sus_width - 6), sus_y + sus_top, obj_dw_transition_particle);
122
            draw_sprite_part(spr_susie_white_fall_d, index / 4, 0, sus_top, sus_width, 1, sus_x, sus_y + sus_top);
123
        }
124
    }
125
    threshold = 130;
126
    if (quick_mode == 1)
127
        threshold = 40;
128
    if (timer >= threshold)
129
    {
130
        if (quick_mode == 1)
131
            linecon = 0;
132
        sus_y = round(sus_y);
133
        sus_x = round(sus_x);
134
        kris_y = round(kris_y);
135
        kris_x = round(kris_x);
136
        timer = 0;
137
        sus_v = -0.2;
138
        sus_f = 0.01;
139
        con = 32;
140
    }
141
}
142
else if (con == 32)
143
{
144
    if (timer == 0)
145
    {
146
        megablack = 
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; }
(-10, -10, spr_whitepixel);
147
        with (megablack)
148
        {
149
            depth = 150;
150
            image_alpha = 1;
151
            y = -999;
152
            image_xscale = 999;
153
            image_yscale = 999;
154
            image_blend = c_black;
155
            persistent = 1;
156
        }
157
    }
158
    if (timer == 2)
159
        megablack.y = 0;
160
    timer += 1;
161
    if (timer >= 0 && timer < 8)
162
    {
163
        sus_v -= 0.5;
164
        if (kris_only == 0)
165
            draw_sprite_ext(spr_susie_dw_fall_smear, 0, sus_x, sus_y, 1, 1, 0, c_white, char_alpha);
166
    }
167
    if (timer >= 8 && timer < 12)
168
    {
169
        sus_v += 1;
170
        sus_f = 0;
171
        if (kris_only == 0)
172
            draw_sprite_ext(spr_susie_dw_fall_smear, 1, sus_x, sus_y, 1, 1, 0, c_white, char_alpha);
173
    }
174
    if (timer >= 12 && timer <= 13)
175
    {
176
        sus_v += 4;
177
        if (kris_only == 0)
178
            draw_sprite_ext(spr_susie_dw_fall_smear, 2, sus_x, sus_y, 1, 1, 0, c_white, char_alpha);
179
    }
180
    if (timer >= 14)
181
    {
182
        soundcon = 4;
183
        sus_v = 13;
184
        sus_f = 0;
185
        timer = 0;
186
        con = 33;
187
        rect_draw = 0;
188
    }
189
}
190
if (con == 33)
191
{
192
    timer += 1;
193
    if (quick_mode == 1 && timer < 31)
194
        timer = 31;
195
    if (kris_only == 0)
196
    {
197
        draw_sprite_ext(spr_susie_dw_fall_ball, timer / 2, sus_x, sus_y - (sus_v * 2), 1, 1, 0, c_white, 0.25);
198
        draw_sprite_ext(spr_susie_dw_fall_ball, timer / 2, sus_x, sus_y - sus_v, 1, 1, 0, c_white, 0.5);
199
        draw_sprite_ext(spr_susie_dw_fall_ball, timer / 2, sus_x, sus_y, 1, 1, 0, c_white, 1);
200
    }
201
    if (timer == 14)
202
        linecon = 0;
203
    if (timer == 30)
204
    {
205
        sus_y = -20;
206
        kris_y = -14;
207
    }
208
    if (timer > 30)
209
    {
210
        if (skiprunback == 1)
211
        {
212
            var _offset = -1;
213
            if (room == room_schooldoor)
214
                _offset = 0;
215
            if (timer == (36 + _offset))
216
            {
217
            }
218
        }
219
        else
220
        {
221
            var _offset = -1;
222
            if (room == room_schooldoor)
223
                _offset = 0;
224
        }
225
        if (sus_y >= (finaly - 8))
226
        {
227
            con = 34;
228
            timer = 0;
229
            sus_v = 0;
230
            kris_y = finaly + 6;
231
            sus_y = finaly;
232
            getup_index = 0;
233
            fake_screenshake = 1;
234
            fake_shakeamount = 8;
235
            remkrisx = kris_x - camerax();
236
            remkrisy = kris_y - cameray();
237
            remsusx = sus_x - camerax();
238
            remsusy = sus_y - cameray();
239
        }
240
    }
241
}
242
if (con == 34)
243
{
244
    timer += 1;
245
    if (quick_mode == 1 && timer < 15)
246
        timer = 15;
247
    if (timer > 1)
248
    {
249
        if (kris_only == 0)
250
            draw_sprite_ext(spr_susie_dw_landed, getup_index, (sus_x * dz) + fake_shakeamount, sus_y * dz, 1 * dz, 1 * dz, 0, c_white, 1);
251
    }
252
    if (timer == 26)
253
    {
254
        kris_x = remkrisx;
255
        kris_y = remkrisy;
256
        sus_x = remsusx;
257
        sus_y = remsusy;
258
        
scr_become_dark
scr_become_dark

function
scr_become_dark()
{ global.darkzone = 1; scr_equip_dw_weapon_by_lw_id(global.lweapon); for (var i = 0; i < 8; i++) { var weapon = get_weapon_by_lw_id(global.litem[i]); if (weapon != -4) { if (!
scr_weaponcheck_inventory(weapon.dw_id) && !
scr_weaponcheck_equipped_any(weapon.dw_id))
scr_weaponget(weapon.dw_id);
} } global.hp[1] = ceil((global.lhp / global.lmaxhp) * global.maxhp[1]); if (global.hp[1] < 1) global.hp[1] = 1; if (global.hp[1] > global.maxhp[1]) global.hp[1] = global.maxhp[1]; }
();
259
        dz = global.darkzone + 1;
260
        room_goto(nextroom);
261
    }
262
    if (timer == 27)
263
    {
264
        with (obj_mainchara)
265
        {
266
            x = -999;
267
            cutscene = 1;
268
            visible = 0;
269
        }
270
        with (obj_caterpillarchara)
271
        {
272
            x = -999;
273
            visible = 0;
274
        }
275
    }
276
    if (timer >= 30 && timer < 60)
277
    {
278
        with (megablack)
279
            image_alpha -= 0.05;
280
        if (quick_mode == 1)
281
        {
282
            with (megablack)
283
                image_alpha -= 0.05;
284
        }
285
    }
286
    if (timer == 50)
287
        getup_index = 1;
288
    if (timer == 53)
289
        getup_index = 2;
290
    if (timer == 55)
291
    {
292
        with (megablack)
293
            instance_destroy();
294
        persistent = 0;
295
        if (i_ex(global.cinstance[1]))
296
        {
297
            with (global.cinstance[1])
298
                instance_destroy();
299
        }
300
        if (kris_only == 0 && i_ex(global.cinstance[0]))
301
        {
302
            global.cinstance[0].x = (sus_x * 2) + 10;
303
            global.cinstance[0].y = sus_y * 2;
304
            with (obj_caterpillarchara)
305
            {
306
                visible = 1;
307
                
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; } }
();
308
                facing[target] = 0;
309
                sprite_index = dsprite;
310
            }
311
        }
312
        instance_destroy();
313
    }
314
}
315
if (con >= 17)
316
{
317
    if (sus_draw == 1)
318
    {
319
        if (instance_exists(obj_kris_headobj))
320
        {
321
            obj_kris_headobj.x = kris_x + 14;
322
            obj_kris_headobj.y = kris_y - 2;
323
        }
324
        if (global.darkzone == 0)
325
        {
326
            if (kris_only == 0)
327
                draw_sprite_ext(sus_sprite, sus_index, sus_x + fake_shakeamount, sus_y, 1, 1, 0, c_white, char_alpha);
328
        }
329
        else if (kris_only == 0)
330
        {
331
            draw_sprite_ext(sus_sprite, sus_index, (sus_x * 2) + fake_shakeamount, sus_y * 2, 2, 2, 0, c_white, char_alpha);
332
        }
333
    }
334
}