Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_ralsei_cherub_Draw_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
draw_set_color(#FFCF6D);
7
draw_set_alpha(image_alpha / 2);
8
d_ellipse(xstart - _width, _spotlight_height - (_width / 4), xstart + _width, _spotlight_height + (_width / 4), false);
9
if (timer == _descent)
10
{
11
    var _sparkle = snd_play(snd_sparkle_glock);
12
    snd_pitch(_sparkle, 1.1);
13
    var _feather = instance_create_depth(xstart - 10, ystart - 50, depth + 10, obj_cherub_feathers);
14
    _feather.direction = 270 + irandom_range(-30, -50);
15
    _feather = instance_create_depth(xstart, ystart - 50, depth + 10, obj_cherub_feathers);
16
    _feather.direction = 270 + irandom_range(-10, 10);
17
    _feather = instance_create_depth(xstart + 10, ystart - 50, depth + 10, obj_cherub_feathers);
18
    _feather.direction = 270 + irandom_range(30, 50);
19
}
20
d3d_set_fog(true, #FFB56C, 0, 1);
21
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);
22
d3d_set_fog(false, c_black, 0, 1);
23
draw_sprite_ext(target_char.sprite_index, target_char.image_index, target_char.x, target_char.y, 2, 2, 0, #807976, _spread * image_alpha);
24
with (obj_cherub_feathers)
25
    draw_self();
26
surface_set_target(silhouette_surf);
27
draw_clear_alpha(c_black, 0);
28
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);
29
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);
30
gpu_set_alphatestenable(true);
31
draw_set_blend_mode(bm_subtract);
32
with (obj_cherub_feathers)
33
    draw_self_surfacespace(other.xstart - 64, other.ystart - 300);
34
gpu_set_alphatestenable(false);
35
surface_reset_target();
36
surface_set_target(light_surf);
37
draw_clear_alpha(c_black, 0);
38
draw_set_blend_mode(bm_normal);
39
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; var _col = draw_get_color(); var _alpha = draw_get_alpha(); 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); draw_set_color(_col); draw_set_alpha(_alpha); }
(64, 0, _length, _spread, 270, c_white, 1, false);
40
draw_set_alpha(1);
41
d3d_set_fog(true, c_white, 0, 1);
42
d_ellipse(64 - _width, 360 - (_width / 4), 64 + _width, 360 + (_width / 4), false);
43
draw_set_alpha(1);
44
draw_set_blend_mode(bm_subtract);
45
gpu_set_alphatestenable(true);
46
draw_surface(silhouette_surf, 0, 0);
47
gpu_set_alphatestenable(false);
48
draw_set_blend_mode(bm_normal);
49
d3d_set_fog(false, c_black, 0, 1);
50
surface_reset_target();
51
draw_surface_ext(light_surf, xstart - 64, ystart - 300, 1, 1, 0, #FFB56C, image_alpha * 0.5);
52
if (timer >= (_descent + 24))
53
{
54
    x = xstart;
55
    y = ystart;
56
    if (timer == (_descent + 24))
57
    {
58
        var d = instance_create(xstart + 30 + xoff, ystart + yoff, obj_animation);
59
        d.sprite_index = sprite_index;
60
        d.image_yscale = 2;
61
        d.image_xscale = 2;
62
    }
63
    else if (timer == (_descent + 48))
64
    {
65
    }
66
    else if (timer >= (_descent + 48))
67
    {
68
        image_alpha -= 0.1;
69
        if (image_alpha <= 0)
70
        {
71
            surface_free(silhouette_surf);
72
            surface_free(light_surf);
73
            instance_destroy();
74
        }
75
    }
76
}
77
else if (timer >= _descent && timer <= (_descent + 24))
78
{
79
    x = xstart;
80
    var _ylerp = timer - _descent;
81
    y = lerp(yspawn, ystart + yoff, clamp(_ylerp / 25, 0, 1));
82
    if ((timer % 2) == 0)
83
    {
84
        var d = instance_create(x + (cos((timer / 3) + offset) * 30), y + (sin((timer / 3) + offset) * 10), obj_animation);
85
        d.sprite_index = spr_sparestar_anim;
86
        d.image_speed = 0.5;
87
        d.image_blend = choose(#FFE04D, #FFB56C);
88
        d.image_xscale = 2;
89
        d.image_yscale = 2;
90
    }
91
}
92
timer++;