Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_spell_revivesong_Draw_0

related scripts: CleanUp_0Create_0Draw_0 Step_0

(view raw script w/o annotations or w/e)
1
var _descent = 10;
2
var _spread = 
scr_ease_inout
scr_ease_inout

function
scr_ease_inout(arg0, arg1)
{ if (arg1 < -3 || arg1 > 7) return arg0; if (arg1 == -3) return ease_inout_bounce(arg0, 0, 1, 1); else if (arg1 == -2) return ease_inout_elastic(arg0, 0, 1, 1); else if (arg1 == -1) return ease_inout_back(arg0, 0, 1, 1); else if (arg1 == 1) return -0.5 * cos((pi * arg0) - 1); else if (arg1 == 0) return arg0; arg0 *= 2; if (arg0 < 1) { return 0.5 *
scr_ease_in(arg0, arg1);
} else { arg0--; return 0.5 * (
scr_ease_out(arg0, arg1) + 1);
} }
(clamp01(timer / 20), 4) * 20;
3
var _length = 360 + (sin((_spread / 180) * pi) * 20);
4
var _width = lengthdir_x(_length, 270 + (_spread / 2));
5
var _spotlight_height = (ystart - 300) + 360;
6
var _y = 0;
7
if (i_ex(obj_flowery_enemy))
8
{
9
    if (i_ex(obj_herokris) && target_char.object_index == obj_herokris)
10
    {
11
        with (obj_flowery_enemy.krisflower)
12
            con = 1;
13
    }
14
    if (i_ex(obj_herosusie) && target_char.object_index == obj_herosusie)
15
    {
16
        with (obj_flowery_enemy.susieflower)
17
            con = 1;
18
    }
19
    if (i_ex(obj_heroralsei) && target_char.object_index == obj_heroralsei)
20
    {
21
        with (obj_flowery_enemy.ralseiflower)
22
            con = 1;
23
    }
24
}
25
draw_set_color(#FFCF6D);
26
draw_set_alpha(image_alpha / 2);
27
d_ellipse(xstart - _width, _spotlight_height - (_width / 4), xstart + _width, _spotlight_height + (_width / 4), false);
28
if (timer == _descent)
29
{
30
    var _sparkle = snd_play(snd_sparkle_glock);
31
    snd_pitch(_sparkle, 1.1);
32
    var _feather = instance_create_depth(xstart - 10, ystart - 50, depth + 10, obj_cherub_feathers);
33
    _feather.direction = 270 + irandom_range(-30, -50);
34
    _feather = instance_create_depth(xstart, ystart - 50, depth + 10, obj_cherub_feathers);
35
    _feather.direction = 270 + irandom_range(-10, 10);
36
    _feather = instance_create_depth(xstart + 10, ystart - 50, depth + 10, obj_cherub_feathers);
37
    _feather.direction = 270 + irandom_range(30, 50);
38
}
39
d3d_set_fog(true, #FFB56C, 0, 1);
40
draw_sprite_ext(target_char.sprite_index, target_char.image_index, target_char.x, target_char.y - 2, 2, 2, 0, #FFB56C, _spread * image_alpha);
41
d3d_set_fog(false, c_black, 0, 1);
42
draw_sprite_ext(target_char.sprite_index, target_char.image_index, target_char.x, target_char.y, 2, 2, 0, #807976, _spread * image_alpha);
43
with (obj_cherub_feathers)
44
    draw_self();
45
surface_set_target(silhouette_surf);
46
draw_clear_alpha(c_black, 0);
47
draw_sprite_ext(target_char.sprite_index, target_char.image_index, target_char.x - (xstart - 64), target_char.y - (ystart - 300) - 2, 2, 2, 0, #807976, 1);
48
draw_sprite_ext(target_char.sprite_index, target_char.image_index, target_char.x - (xstart - 64), target_char.y - (ystart - 300), 2, 2, 0, #807976, 1);
49
gpu_set_alphatestenable(true);
50
draw_set_blend_mode(bm_subtract);
51
with (obj_cherub_feathers)
52
    draw_self_surfacespace(other.xstart - 64, other.ystart - 300);
53
gpu_set_alphatestenable(false);
54
surface_reset_target();
55
surface_set_target(light_surf);
56
draw_clear_alpha(c_black, 0);
57
draw_set_blend_mode(bm_normal);
58
scr_draw_beam
scr_draw_beam

function
scr_draw_beam(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
{ var __xx = arg0; var __yy = arg1; var _end0 =
scr_rotatevector(new Vector2(arg2), arg4);
_end0.x += __xx; _end0.y += __yy; var _end1 =
scr_rotatevector(new Vector2(arg2), arg4 + (arg3 / 2));
_end1.x += __xx; _end1.y += __yy; var _end2 =
scr_rotatevector(new Vector2(arg2), arg4 - (arg3 / 2));
_end2.x += __xx; _end2.y += __yy; draw_set_color(arg5); draw_set_alpha(arg6); if (arg7) d_circle(_end0.x, _end0.y, arg3 / 2, 0); d_triangle(__xx, __yy, _end1.x, _end1.y, _end2.x, _end2.y, 0); }
(64, 0, _length, _spread, 270, c_white, 1, false);
59
draw_set_alpha(1);
60
d3d_set_fog(true, c_white, 0, 1);
61
d_ellipse(64 - _width, 360 - (_width / 4), 64 + _width, 360 + (_width / 4), false);
62
draw_set_alpha(1);
63
draw_set_blend_mode(bm_subtract);
64
gpu_set_alphatestenable(true);
65
draw_surface(silhouette_surf, 0, 0);
66
gpu_set_alphatestenable(false);
67
draw_set_blend_mode(bm_normal);
68
d3d_set_fog(false, c_black, 0, 1);
69
surface_reset_target();
70
draw_surface_ext(light_surf, xstart - 64, ystart - 300, 1, 1, 0, #FFB56C, image_alpha * 0.5);
71
if (timer == (_descent + 24))
72
{
73
}
74
if (timer >= (_descent + 24))
75
{
76
    x = xstart;
77
    y = ystart;
78
    if (timer == (_descent + 24))
79
    {
80
        var d = instance_create(xstart + 30 + xoff, ystart + yoff, obj_animation);
81
        d.sprite_index = (spamton == 1) ? spr_spamton_cherub : sprite_index;
82
        d.image_yscale = 2;
83
        d.image_xscale = 2;
84
        var d2 = instance_create((xstart + 30 + xoff) - spread, ystart + yoff, obj_animation);
85
        d2.sprite_index = (spamton == 2) ? spr_spamton_cherub : sprite_index;
86
        d2.image_yscale = 2;
87
        d2.image_xscale = -2;
88
    }
89
    else if (timer == (_descent + 48))
90
    {
91
    }
92
    else if (timer >= (_descent + 48))
93
    {
94
        if (image_alpha == 1)
95
            do_heal = true;
96
        image_alpha -= 0.1;
97
        if (image_alpha <= 0)
98
        {
99
            surface_free(silhouette_surf);
100
            surface_free(light_surf);
101
            with (obj_heroralsei)
102
                visible = 1;
103
            with (fn)
104
                instance_destroy();
105
            instance_destroy();
106
        }
107
    }
108
}
109
else if (timer >= _descent && timer <= (_descent + 24))
110
{
111
    x = xstart;
112
    var _ylerp = timer - _descent;
113
    y = lerp(yspawn, ystart + yoff, clamp(_ylerp / 25, 0, 1));
114
    if ((timer % 2) == 0)
115
    {
116
        var d = instance_create(x + (cos((timer / 3) + offset) * 30), y + (sin((timer / 3) + offset) * 10), obj_animation);
117
        d.sprite_index = spr_sparestar_anim;
118
        d.image_speed = 0.5;
119
        d.image_blend = choose(#FFE04D, #FFB56C);
120
        d.image_xscale = 2;
121
        d.image_yscale = 2;
122
        d = instance_create(x - (sin((timer / 3) + offset) * 30), y - (cos((timer / 3) + offset) * 10), obj_animation);
123
        d.sprite_index = spr_sparestar_anim;
124
        d.image_speed = 0.5;
125
        d.image_blend = choose(#FFE04D, #FFB56C);
126
        d.image_xscale = 2;
127
        d.image_yscale = 2;
128
    }
129
}
130
timer++;