Deltarune script viewer

← back to main script listing

gml_Object_obj_spell_snowgrave_Draw_0

(view raw script w/o annotations or w/e)
1
xx = __view_get(e__VW.XView, 0);
2
yy = __view_get(e__VW.YView, 0);
3
if (init == 0)
4
{
5
    init = 1;
6
    fncon = 0;
7
    siner = 0;
8
    if (altpath == 1)
9
    {
10
        timer = -270;
11
        with (obj_heronoelle)
12
            visible = 0;
13
        fn = 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_heronoelle.x, obj_heronoelle.y, spr_noelleb_spell);
14
        fn.depth = obj_heronoelle.depth;
15
        fn.image_index = 0;
16
        fncon = 0;
17
    }
18
}
19
timer++;
20
if (altpath == 1)
21
{
22
    if (fncon == 0)
23
    {
24
        fn.image_index += 0.25;
25
        if (fn.image_index >= 8)
26
        {
27
            fntimer = 0;
28
            fncon = 0.5;
29
            mus_volume(global.batmusic[1], 0, 90);
30
        }
31
    }
32
    if (fncon == 0.5)
33
    {
34
        fntimer++;
35
        if (fntimer >= 120)
36
        {
37
            with (fn)
38
                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; }
();
39
            fn.sprite_index = spr_noelleb_spell_special;
40
            fn.image_speed = 0.5;
41
            fncon = 0.8;
42
            fntimer = 0;
43
            amplitude = 0;
44
            with (obj_berdlyb2_enemy)
45
                visible = 0;
46
            fb = 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_berdlyb2_enemy.x, obj_berdlyb2_enemy.y, spr_berdlyb_idle_shocked);
47
            fb.depth = obj_berdlyb2_enemy.depth;
48
        }
49
    }
50
    if (fncon == 0.8)
51
    {
52
        fntimer++;
53
        if (fntimer >= 30)
54
        {
55
            fntimer = 0;
56
            fncon = 1;
57
        }
58
    }
59
    if (fncon == 1 || fncon == 2)
60
    {
61
        if (amplitude < 1)
62
            amplitude += 0.03;
63
        if (fn.y > (fn.ystart - 70))
64
        {
65
            fn.y -= amplitude;
66
            fn.x += amplitude * 2.94;
67
        }
68
        fn.x += sin(timer / 3) * amplitude;
69
        fn.y += cos(timer / 3) * amplitude;
70
        if ((timer % 4) == 0 && timer < 70)
71
        {
72
            dustsnd = snd_play(snd_bell);
73
            snd_volume(dustsnd, 0.5, 0);
74
            snd_pitch(dustsnd, 0.5 + random(0.3));
75
            dust = instance_create(fn.x + 50, fn.y + 10 + 10, obj_afterimage_grow);
76
            dust.speed = random(2) + 1;
77
            dust.direction = random_range(0, 180);
78
            dust.gravity = 0.2 + random(0.3);
79
            dust.gravity_direction = random_range(70, 110);
80
            dust.image_xscale = 1;
81
            dust.image_yscale = 1;
82
            dust.sprite_index = spr_shine;
83
            dust.image_speed = 0.5;
84
            dust.image_alpha = 3;
85
        }
86
        if (timer >= 210)
87
        {
88
            fn.sprite_index = spr_noelleb_spell;
89
            fn.image_index = 2;
90
            fn.image_speed = 0;
91
            fn.gravity = 1;
92
            fncon = 3;
93
        }
94
    }
95
    if (fncon == 3)
96
    {
97
        if (fn.y >= (ystart - 6))
98
        {
99
            fn.y = ystart;
100
            fn.sprite_index = spr_noelleb_defeat;
101
            fn.speed = 0;
102
            fn.gravity = 0;
103
            with (fn)
104
                scr_shakeobj
scr_shakeobj

function scr_shakeobj() { shakeobj = instance_create(x, y, obj_shakeobj); shakeobj.target = id; with (shakeobj) event_user(0); }
();
105
            fncon = 4;
106
        }
107
    }
108
}
109
if (timer > 0)
110
{
111
    draw_set_alpha(bgalpha);
112
    draw_rectangle_colour(xx - 10, yy - 10, xx + 700, yy + 500, c_white, c_white, c_blue, c_blue, false);
113
}
114
draw_background_tiled_ext(bg_snowfall, snowspeed / 1.5, timer * 6, 2, 2, c_white, bgalpha);
115
draw_background_tiled_ext(bg_snowfall, snowspeed, timer * 8, 2, 2, c_white, bgalpha * 2);
116
if (timer <= 10 && timer >= 0)
117
{
118
    if (bgalpha < 0.5)
119
        bgalpha += 0.05;
120
}
121
if (timer >= 0)
122
    snowspeed += (20 + (timer / 5));
123
if (timer == 1)
124
    audio_play_sound(snd_snowgrave, 50, 0);
125
if (timer >= 20 && timer <= (75 + (altpath * 30)))
126
{
127
    stimer++;
128
    snowflake[0] = instance_create(xx + 455, yy + 560, obj_spell_snowgrave_snowflake);
129
    snowflake[1] = instance_create(xx + 500, yy + 600, obj_spell_snowgrave_snowflake);
130
    snowflake[2] = instance_create(xx + 545, yy + 520, obj_spell_snowgrave_snowflake);
131
    for (i = 0; i < 3; i++)
132
    {
133
        snowflake[i].gravity = -2;
134
        snowflake[i].vspeed = sin(timer / 2) * 0.5;
135
        snowflake[i].siner = timer / 2;
136
    }
137
    if (stimer >= 8)
138
        stimer = 0;
139
}
140
if (timer == 70 && altpath == 1)
141
{
142
    fb.sprite_index = spr_berdly_ice;
143
    fb.x -= 22;
144
    fb.y -= 48;
145
}
146
if (timer == (95 + (altpath * 30)) && damage > 0 && global.fighting == 1)
147
{
148
    for (i = 0; i < 3; i++)
149
    {
150
        if (global.monster[i])
151
        {
152
            if (i_ex(global.monsterinstance[i]))
153
            {
154
                global.hittarget[i] = 0;
155
                global.monsterinstance[i].fatal = 1;
156
                if (altpath == 0)
157
                {
158
                    scr_damage_enemy
scr_damage_enemy

function scr_damage_enemy(arg0, arg1) { dm = instance_create(global.monsterx[arg0], (global.monstery[arg0] + 20) - (global.hittarget[arg0] * 20), obj_dmgwriter); if (caster < 4) { dm.type = global.char[caster] - 1; if (global.char[caster] == 4) dm.type = 6; } if (caster == 5) dm.type = 5; dm.damage = arg1; global.monsterhp[arg0] -= arg1; if (arg1 > 0) { with (global.monsterinstance[arg0]) { shakex = 9; state = 3; hurttimer = 30; } if (i_ex(global.monsterinstance[arg0])) global.monsterinstance[arg0].hurtamt = arg1; } global.hittarget[arg0] += 1; if (arg1 == 0) { with (global.monsterinstance[arg0]) { hurtamt = 0; if (hurttimer <= 15 && candodge == 1) { dodgetimer = 0; state = 4; } } } if (global.chapter == 2 && i_ex(obj_sweet_enemy) && global.monsterhp[arg0] <= 0) global.monsterhp[arg0] = 1; var a = 0; if (global.chapter == 2 && i_ex(obj_queen_enemy)) a = 1; if (global.chapter == 2 && i_ex(obj_spamton_neo_enemy)) a = 2; if (global.chapter == 2 && i_ex(obj_berdlyb_enemy)) a = 3; if (global.monsterhp[arg0] <= 0 && a == 0) { with (global.monsterinstance[arg0]) scr_monsterdefeat(); } if (global.chapter == 2 && global.monsterhp[arg0] <= 0 && a == 3) { with (global.monsterinstance[arg0]) endcon = 1; } }
(i, damage + round(random(100)));
159
                }
160
                else
161
                {
162
                    global.hittarget[i] = 0;
163
                    dm = instance_create(global.monsterx[i], (global.monstery[i] + 20) - (global.hittarget[i] * 20), obj_dmgwriter);
164
                    dm.damage = damage + round(random(100));
165
                    dm.type = 6;
166
                }
167
                if (global.monsterhp[i] > 0 && altpath == 0)
168
                {
169
                    global.monsterinstance[i].fatal = 0;
170
                    with (global.monsterinstance[i])
171
                        __of = 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; }
();
172
                }
173
                if (altpath)
174
                {
175
                    with (fb)
176
                        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; }
();
177
                }
178
            }
179
        }
180
    }
181
}
182
if (timer >= (90 + (altpath * 30)))
183
{
184
    if (altpath == 0)
185
    {
186
        if (bgalpha > 0)
187
            bgalpha -= 0.02;
188
    }
189
    if (altpath == 1)
190
        bgalpha -= 0.005;
191
}
192
if (timer == (120 + (altpath * 150)))
193
{
194
    if (altpath)
195
    {
196
        with (obj_berdlyb2_enemy)
197
            sidebcon = 1;
198
        obj_berdlyb2_enemy.fn = fn;
199
        obj_berdlyb2_enemy.fb = fb;
200
    }
201
    instance_destroy();
202
}
203
204
enum e__VW
205
{
206
    XView,
207
    YView,
208
    WView,
209
    HView,
210
    Angle,
211
    HBorder,
212
    VBorder,
213
    HSpeed,
214
    VSpeed,
215
    Object,
216
    Visible,
217
    XPort,
218
    YPort,
219
    WPort,
220
    HPort,
221
    Camera,
222
    SurfaceID
223
}