Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_ch4_DCC01_fountain_Draw_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (con == 0)
3
{
4
    if (timer == 1)
5
        snd_play(snd_titan_wingshut, 1, 0.65);
6
    if (timer == 64)
7
    {
8
        fountainmakesound = snd_play(snd_fountain_make, 1, 0.2);
9
        snd_pitch_time(fountainmakesound, 0.8, 12);
10
    }
11
}
12
if (con < 2)
13
{
14
    with (fountain_marker)
15
        
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
().image_alpha = 0.3;
16
    for (var i = 0; i < array_length(fountain_loop); i++)
17
    {
18
        if (fountain_loop[i].sprite_index != spr_tower_fizzleout)
19
        {
20
            with (fountain_loop[i])
21
            {
22
                with (
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
())
23
                {
24
                    image_alpha = 0.3;
25
                    depth = other.depth + 2;
26
                }
27
            }
28
        }
29
    }
30
}
31
if ((con == 1 && timer >= 60) || (con > 1 && con <= 10))
32
{
33
    var indent = 0.98;
34
    shader_set(shd_fountaineffect);
35
    shader_set_uniform_f(u_iPosOffset, 0, cameray() / 480);
36
    shader_set_uniform_f(u_iResolution, 280 * indent, 480);
37
    shader_set_uniform_f(u_uvs, s_uvs[0], s_uvs[1], s_uvs[2] - s_uvs[0], s_uvs[3] - s_uvs[1]);
38
    var col = 
scr_make_color_hsv
scr_make_color_hsv

function
scr_make_color_hsv(arg0, arg1, arg2)
{ var hue = arg0; if (hue < 0) hue = 256 - (-hue % 256); else hue %= 256; return make_color_hsv(hue, arg1, arg2); }
(current_time / 400, 50, (sin(current_time / 1600) * 10) + 70);
39
    var t = 1;
40
    if (con == 2)
41
    {
42
        t = 0.2;
43
        fountainanimtimer = fountainanimtimer + 2 + (t * 80);
44
    }
45
    else if (con == 1)
46
    {
47
        t = 1 - clamp((timer - 120) / 84, 0, 0.8);
48
        fountainanimtimer = fountainanimtimer + 2 + (t * 80);
49
    }
50
    else
51
    {
52
        fountainanimtimer += 2;
53
    }
54
    shader_set_uniform_f(u_iTime, fountainanimtimer / 50);
55
    col = merge_color(col, merge_color(c_teal, c_white, 0.5), t);
56
    draw_sprite_ext(bg_fountain1, 0, (0.5 * camerawidth()) - (140 * indent), camera_get_view_y(view_camera[0]), (280 * indent) / sprite_get_width(bg_fountain1), 480 / sprite_get_height(bg_fountain1), 0, col, 1);
57
    shader_reset();
58
}
59
if (con == 1)
60
{
61
    var delay = 180;
62
    var enddelay = 132;
63
    if (timer == delay)
64
    {
65
        for (var i = 0; i < 4; i++)
66
        {
67
            fountain_loop[i].sprite_index = spr_tower_fizzleout;
68
            fountain_loop[i].image_index = 0;
69
            fountain_loop[i].image_speed = 0.4;
70
        }
71
        snd_pitch_time(fountainmakesound, 0.15, 52);
72
    }
73
    if (timer == (delay + 28))
74
    {
75
        for (var i = 0; i < 4; i++)
76
            fountain_loop[i].visible = 0;
77
    }
78
    if (timer > (delay + enddelay))
79
    {
80
        con = 2;
81
        timer = 0;
82
        snd_volume(fountainmakesound, 0, 5);
83
        snd_play(snd_petrify, 0.8, 0.5);
84
    }
85
}
86
if (con == 2)
87
{
88
    if (timer == 5)
89
        snd_play(snd_petrify, 0.8, 0.45);
90
    var spd = 6;
91
    if ((timer % spd) == 0 && timer < (9 * spd))
92
    {
93
        var xx = camerax() + (0.5 * camerawidth()) + 6;
94
        var yy = (cameray() + cameraheight()) - (80 * (timer / spd));
95
        petrify_sequence[floor(timer / spd)] = 
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; }
(xx, yy, spr_tower_petrification);
96
        with (petrify_sequence[floor(timer / spd)])
97
        {
98
            image_index = 0;
99
            image_speed = 0.5;
100
            depth = other.depth - 2000;
101
            scr_delay_var("image_speed", 0, 19);
102
        }
103
        var afterimgidx = floor(timer / spd) - 2;
104
        if (afterimgidx >= 0 && afterimgidx < array_length(petrify_sequence) && (timer % spd) == 0)
105
        {
106
            with (petrify_sequence[afterimgidx])
107
            {
108
                var ai = 
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
109
                ai.depth = other.depth - 2000;
110
                
scr_lerpvar_instance
scr_lerpvar_instance

function
scr_lerpvar_instance()
{ __lerpvar = instance_create(0, 0, obj_lerpvar); __lerpvar.target = argument[0]; __lerpvar.varname = argument[1]; __lerpvar.pointa = argument[2]; __lerpvar.pointb = argument[3]; __lerpvar.maxtime = argument[4]; if (argument_count >= 6) __lerpvar.easetype = argument[5]; if (argument_count >= 7) __lerpvar.easeinout = argument[6]; return __lerpvar; } function scr_lerp_var_instance() { if (argument_count >= 6) return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7) return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
} function scr_lerp_instance_var() { if (argument_count >= 6) return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5);
else if (argument_count >= 7) return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4, argument5, argument6);
else return
scr_lerpvar_instance(argument0, argument1, argument2, argument3, argument4);
}
(ai, "image_xscale", ai.image_xscale, ai.image_xscale + 0.1, 30);
111
                ai.image_blend = c_white;
112
                ai.image_index = image_index;
113
                ai.image_speed = 0;
114
            }
115
        }
116
    }
117
    if (timer == (10 * spd))
118
    {
119
        con = 3;
120
        timer = 0;
121
    }
122
}
123
if (con == 3)
124
{
125
    var eyeappeardelay = 60;
126
    if (timer == (eyeappeardelay + 20))
127
    {
128
        var xx = (camerax() + (0.5 * camerawidth())) - 50;
129
        var yy = (cameray() + (0.5 * cameraheight())) - 120;
130
        with (instance_create_depth(xx, yy, depth - 2500, obj_marker))
131
        {
132
            sprite_index = spr_tower_petrifycrack1;
133
            image_speed = 0.25;
134
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
135
            scr_delay_var("image_speed", 0, ((sprite_get_number(sprite_index) - 1) * 1) / image_speed);
136
        }
137
        with (instance_create_depth(xx, yy, depth - 2500, obj_marker))
138
        {
139
            sprite_index = spr_tower_petrifycrack1_debris;
140
            image_speed = 0.25;
141
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
142
            scr_delay_var("image_speed", 0, ((sprite_get_number(sprite_index) - 1) * 1) / image_speed);
143
        }
144
        snd_play(snd_petrify_gravel, 0.2, 1);
145
    }
146
    if (timer == (eyeappeardelay + 35))
147
    {
148
        var xx = camerax() + (0.5 * camerawidth()) + 60;
149
        var yy = cameray() + (0.5 * cameraheight()) + 220;
150
        with (instance_create_depth(xx, yy, depth - 2500, obj_marker))
151
        {
152
            sprite_index = spr_tower_petrifycrack2;
153
            image_speed = 0.25;
154
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
155
            scr_delay_var("image_speed", 0, ((sprite_get_number(sprite_index) - 1) * 1) / image_speed);
156
        }
157
        with (instance_create_depth(xx, yy, depth - 2500, obj_marker))
158
        {
159
            sprite_index = spr_tower_petrifycrack2_debris;
160
            image_speed = 0.25;
161
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
162
            scr_delay_var("image_speed", 0, ((sprite_get_number(sprite_index) - 1) * 1) / image_speed);
163
        }
164
        snd_play(snd_petrify_gravel, 0.25, 0.9);
165
    }
166
    if (timer == (eyeappeardelay + 50))
167
    {
168
        var xx = (camerax() + (0.5 * camerawidth())) - 80;
169
        var yy = cameray() + (0.5 * cameraheight()) + 50;
170
        with (instance_create_depth(xx, yy, depth - 2500, obj_marker))
171
        {
172
            depth = other.depth - 2500;
173
            sprite_index = spr_tower_petrifycrack3;
174
            image_speed = 0.25;
175
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
176
            scr_delay_var("image_speed", 0, ((sprite_get_number(sprite_index) - 1) * 1) / image_speed);
177
        }
178
        with (instance_create_depth(xx, yy, depth - 2500, obj_marker))
179
        {
180
            depth = other.depth - 2500;
181
            sprite_index = spr_tower_petrifycrack3_debris;
182
            image_speed = 0.25;
183
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
184
            scr_delay_var("image_speed", 0, ((sprite_get_number(sprite_index) - 1) * 1) / image_speed);
185
        }
186
        snd_play(snd_petrify_gravel, 0.18, 1.03);
187
    }
188
    if (timer == (eyeappeardelay + 140))
189
    {
190
        var xx = camerax() + (0.5 * camerawidth());
191
        var yy = cameray() + (0.5 * cameraheight()) + 26;
192
        with (instance_create_depth(xx, yy, depth - 2100, obj_marker))
193
        {
194
            sprite_index = spr_tower_handburst;
195
            image_speed = 0.25;
196
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
197
            scr_delay_var("image_speed", 0, ((sprite_get_number(sprite_index) - 1) * 1) / image_speed);
198
        }
199
        with (instance_create_depth(xx, yy, depth - 2400, obj_marker))
200
        {
201
            sprite_index = spr_tower_handburst_debris;
202
            image_speed = 0.25;
203
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
204
            scr_delay_var("hspeed", 14, 32);
205
            scr_delay_var("image_speed", 0, ((sprite_get_number(sprite_index) - 1) * 1) / image_speed);
206
        }
207
    }
208
    if (timer == (eyeappeardelay + 170))
209
    {
210
        var randoffset = choose(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
211
        var xx = camerax() + (0.5 * camerawidth());
212
        var yy = cameray() + (0.5 * cameraheight()) + 26;
213
        for (var i = 0; i < 12; i++)
214
        {
215
            with (instance_create_depth(xx + random_range(0, 20), yy + random_range(-240, 40), depth - 2900, obj_marker))
216
            {
217
                sprite_index = spr_tower_handburst_debris_isolated;
218
                image_speed = 0;
219
                image_index = (randoffset + i) % 12;
220
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
221
                hspeed = random_range(-5, 5) + 12 + (i * 3);
222
                vspeed = -12 - random_range(4 * (i % 4), 8 * (i % 4));
223
                gravity = 3;
224
                
scr_doom
scr_doom

function
scr_doom(arg0 = id, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; persistent = arg0.persistent; } }
(self, 100);
225
            }
226
        }
227
    }
228
    if (timer == (eyeappeardelay + 138))
229
        snd_play(snd_petrify_gravel_thunder, 1, 1);
230
    if (timer == (eyeappeardelay + 166))
231
    {
232
        var xx = 0.5 * camerawidth();
233
        var yy = cameray() + (0.5 * cameraheight()) + 26;
234
        with (instance_create_depth(xx, yy, depth - 2300, obj_marker))
235
        {
236
            sprite_index = spr_tower_handburst_foreground;
237
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
238
        }
239
    }
240
    if (timer == (eyeappeardelay + 164))
241
        snd_play(snd_petrify_wallblast, 1, 1);
242
    var handstart = eyeappeardelay + 168;
243
    var handdelay = eyeappeardelay + 80;
244
    if (timer == (handstart + 2))
245
        
scr_pan_lerp
scr_pan_lerp

function
scr_pan_lerp(arg0, arg1, arg2, arg3 = -1)
{ panner = instance_create(arg0, arg1, obj_panner); panner.panmax = arg2; panner.type = 1; if (arg3 != -1) panner.locktype = arg3; }
(640, cameray(), 4, 0);
246
    if (timer >= handstart)
247
    {
248
        if (timer == handstart)
249
        {
250
            var xx = (0.5 * camerawidth()) - 280;
251
            var yy = cameray() + (0.5 * cameraheight()) + 26;
252
            hand = instance_create_depth(xx, yy, depth - 2150, obj_marker);
253
            with (hand)
254
            {
255
                sprite_index = spr_tower_titanhand;
256
                hspeed = 150;
257
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("hspeed", hspeed, 0, 12, 1, "out");
258
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
259
            }
260
        }
261
        obj_mainchara.cutscene = 1;
262
    }
263
    if (hand != -4)
264
    {
265
        var idx = hand.image_index;
266
        if (idx == 220)
267
            snd_play(snd_petrify_titanblast, 1, 1);
268
        if (idx == 257)
269
        {
270
            beam = instance_create(hand.x, hand.y, obj_marker);
271
            with (beam)
272
            {
273
                sprite_index = spr_tower_titanbeam_start;
274
                scr_delay_var("sprite_index", 1836, 20);
275
                
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
276
                depth = other.depth - 2500;
277
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("x", other.hand.x + 288, other.hand.x + 432, 10);
278
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("y", other.hand.y + 112, other.hand.y + -80, 10);
279
                image_angle = -35;
280
            }
281
        }
282
        if (idx == 296)
283
        {
284
            hand.image_index = 294;
285
            loops++;
286
            if (loops == 10)
287
                con = 10;
288
        }
289
    }
290
}
291
if (con >= 10)
292
{
293
    if (hand.image_index == 296)
294
        hand.image_index = 294;
295
}
296
if (con == 10)
297
{
298
    con = 11;
299
    instance_destroy(base_marker);
300
    instance_destroy(fountain_marker);
301
    var xx = 324;
302
    var yy = 1260;
303
    for (var i = 0; i < 6; i++)
304
    {
305
        with (instance_create(xx, yy + (80 * i) + 20, obj_marker))
306
        {
307
            
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
308
            sprite_index = spr_tower_petrifiedbase;
309
            image_speed = 0;
310
            depth = other.depth;
311
        }
312
    }
313
    with (instance_create(xx, yy + 400 + 12, obj_marker))
314
    {
315
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
316
        sprite_index = spr_tower_base_gradient;
317
        image_speed = 0;
318
        depth = other.depth - 1;
319
        image_xscale = 2;
320
        image_yscale = 2;
321
    }
322
    callback();
323
}