Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ch2_sceneex2_special_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    if (scr_debug
scr_debug

function scr_debug() { return 0; }
())
4
        global.interact = 1;
5
    init = 1;
6
    input_timer = 0;
7
}
8
if (con == 1)
9
{
10
    snd_play(snd_spamton_laugh);
11
    snd_play_pitch(snd_spamton_laugh, 0.8);
12
    for (i = 0; i < 3; i++)
13
    {
14
        enemyrow[0][i] = instance_create(camerax() + 760 + (60 * i), cameray() + 100, obj_sneo_lilguy);
15
        enemyrow[0][i].mei = i;
16
    }
17
    for (i = 0; i < 9; i++)
18
    {
19
        enemyrow[1][i] = instance_create(camerax() + 840 + (40 * i), cameray() + 180, obj_sneo_lilguy);
20
        enemyrow[1][i].mei = i;
21
    }
22
    for (i = 0; i < 3; i++)
23
    {
24
        enemyrow[2][i] = instance_create(camerax() + 760 + (60 * i), cameray() + 280, obj_sneo_lilguy);
25
        enemyrow[2][i].mei = i;
26
    }
27
    with (obj_sneo_lilguy)
28
    {
29
        destroyable = 1;
30
        cutscene = 1;
31
        image_speed = 2;
32
        hspeed = -20;
33
        _cutsceneremy = y;
34
    }
35
    with (enemyrow[1][0])
36
    {
37
        image_xscale *= 2;
38
        image_yscale *= 2;
39
        x -= 40;
40
        bighead = 1;
41
    }
42
    con = 2;
43
}
44
if (con == 2)
45
{
46
    if (enemyrow[0][0].x < (camerax() + 570))
47
    {
48
        with (obj_sneo_lilguy)
49
        {
50
            if (hspeed < -2)
51
                hspeed += 1;
52
            y = _cutsceneremy + random_range(-2, 2);
53
        }
54
    }
55
    if (enemyrow[0][0].x <= (camerax() + 240))
56
    {
57
        with (obj_sneo_lilguy)
58
        {
59
            speed = 0;
60
            friction = 0;
61
            image_speed = 0;
62
            image_index = 0;
63
            y = _cutsceneremy;
64
        }
65
        snd_play(snd_noise);
66
        blackall = 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; }
(camerax(), cameray(), spr_whitepx_10);
67
        blackall.image_xscale = 70;
68
        blackall.image_yscale = 70;
69
        blackall.image_blend = c_black;
70
        blackall.depth = 100000;
71
        with (obj_marker)
72
            visible = 0;
73
        with (obj_actor)
74
            image_alpha = 0.5;
75
        with (obj_ch2_sceneex2)
76
            drawtrack = 0;
77
        con = 3;
78
        alarm[4] = 1;
79
    }
80
}
81
if (con == 4)
82
{
83
    var heartx = camerax() + 88;
84
    var hearty = cameray() + 95;
85
    heart = instance_create(heartx, hearty, obj_heart);
86
    heart.sprite_index = spr_dodgeheart_centered_white;
87
    heart.image_blend = c_red;
88
    heart.depth = -10;
89
    with (heart)
90
        scr_oflash
scr_oflash

function scr_oflash() { _oflash = instance_create(x, y, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_speed = 0; _oflash.image_index = image_index; _oflash.image_yscale = image_yscale; if (global.chapter == 2 && object_index == obj_mauswheel_enemy) _oflash.sprite_index = spr_mauswheel_idle; else _oflash.sprite_index = sprite_index; _oflash.depth = depth - 1; _oflash.target = id; return _oflash; }
();
91
    heart.canmove = 0;
92
    con = 5;
93
    alarm[4] = 60;
94
}
95
if (con == 6)
96
{
97
    tracknoise = snd_play(snd_spearrise);
98
    snd_pitch(tracknoise, 0.9);
99
    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; }
(heart, "image_angle", 0, 90, 10, -1, "out");
100
    con = 7;
101
    alarm[4] = 20;
102
}
103
if (con == 8)
104
{
105
    snd_stop(tracknoise);
106
    con = 9;
107
    alarm[4] = 4;
108
}
109
if (con == 10)
110
{
111
    heart.image_blend = c_yellow;
112
    with (heart)
113
    {
114
        for (i = 0; i < 3; i++)
115
        {
116
            afterimage = instance_create(x, y, obj_afterimage_grow);
117
            afterimage.sprite_index = sprite_index;
118
            afterimage.image_blend = image_blend;
119
            afterimage.image_angle = image_angle;
120
            afterimage.xrate = 0.2 * i;
121
            afterimage.yrate = 0.2 * i;
122
            afterimage.image_alpha = 1 * i;
123
            afterimage.depth = depth + 1;
124
        }
125
        sprite_index = spr_yellowheart;
126
        image_blend = c_white;
127
        image_angle = 0;
128
        x -= 10;
129
        y -= 10;
130
        scr_oflash
scr_oflash

function scr_oflash() { _oflash = instance_create(x, y, obj_oflash); _oflash.image_xscale = image_xscale; _oflash.image_speed = 0; _oflash.image_index = image_index; _oflash.image_yscale = image_yscale; if (global.chapter == 2 && object_index == obj_mauswheel_enemy) _oflash.sprite_index = spr_mauswheel_idle; else _oflash.sprite_index = sprite_index; _oflash.depth = depth - 1; _oflash.target = id; return _oflash; }
();
131
    }
132
    heart.canmove = 0;
133
    con = 11;
134
    alarm[4] = 60;
135
    snd_play_pitch(snd_great_shine, 0.8);
136
    snd_play_pitch(snd_great_shine, 1);
137
    snd_play_pitch(snd_closet_impact, 1.5);
138
    instance_create(0, 0, obj_shake);
139
}
140
if (con == 12)
141
{
142
    snd_play_pitch(snd_swing, 0.5);
143
    var goenemy = enemyrow[0][0];
144
    with (heart)
145
        scr_move_to_point_over_time
scr_move_to_point_over_time

function scr_move_to_point_over_time(arg0, arg1, arg2) { _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(goenemy.x - 80, goenemy.y - 10, 10);
146
    con = 13;
147
    alarm[4] = 10;
148
}
149
if (con == 13)
150
{
151
    with (heart)
152
        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; }
();
153
}
154
if (con == 14)
155
{
156
    snd_play(snd_impact);
157
    with (heart)
158
        color = 1;
159
    con = 15;
160
}
161
if (con == 15)
162
{
163
    if (!i_ex(enemyrow[0][2]))
164
    {
165
        con = 16;
166
        with (heart)
167
            color = 0;
168
        snd_play_pitch(snd_swing, 0.5);
169
        var goenemy = enemyrow[2][0];
170
        with (heart)
171
            scr_move_to_point_over_time
scr_move_to_point_over_time

function scr_move_to_point_over_time(arg0, arg1, arg2) { _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(goenemy.x - 80, goenemy.y - 10, 10);
172
        alarm[4] = 10;
173
    }
174
}
175
if (con == 16)
176
{
177
    with (heart)
178
        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; }
();
179
}
180
if (con == 17)
181
{
182
    snd_play(snd_impact);
183
    with (heart)
184
        color = 1;
185
    con = 18;
186
}
187
if (con == 18)
188
{
189
    if (!i_ex(enemyrow[2][2]))
190
    {
191
        con = 19;
192
        with (heart)
193
            color = 0;
194
        snd_play_pitch(snd_swing, 0.5);
195
        var goenemy = enemyrow[1][0];
196
        with (heart)
197
            scr_move_to_point_over_time
scr_move_to_point_over_time

function scr_move_to_point_over_time(arg0, arg1, arg2) { _mmm = instance_create(x, y, obj_move_to_point); _mmm.target = id; _mmm.movex = arg0; _mmm.movey = arg1; _mmm.movemax = arg2; return _mmm; }
(goenemy.x - 110, goenemy.y - 10, 10);
198
        alarm[4] = 10;
199
    }
200
}
201
if (con == 19)
202
{
203
    with (heart)
204
        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; }
();
205
}
206
if (con == 20)
207
{
208
    snd_play(snd_impact);
209
    with (heart)
210
        color = 1;
211
    con = 22;
212
}
213
if (con == 22)
214
{
215
    if (!i_ex(obj_sneo_lilguy))
216
    {
217
        alarm[4] = 15;
218
        con = 29;
219
        with (heart)
220
            color = 0;
221
    }
222
}
223
if (con == 30)
224
{
225
    with (obj_spamton_neo_enemy)
226
    {
227
        x = camerax() + 400;
228
        y = cameray() + 80;
229
        partmode = 1;
230
        facing = 1;
231
        headforceframe = 1;
232
        gravity = 0;
233
        speed = 0;
234
    }
235
    snd_play(snd_noise);
236
    with (heart)
237
        instance_destroy();
238
    with (obj_yheart_shot)
239
        instance_destroy();
240
    with (blackall)
241
        instance_destroy();
242
    with (obj_ch2_sceneex2)
243
        drawtrack = 1;
244
    con = 40;
245
    instance_destroy();
246
}