Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_knight_roaring_star_Other_11

(view raw script w/o annotations or w/e)
1
var _xscale = (sprite_width + 16) / sprite_get_width(sprite_index);
2
var _yscale = (sprite_height + 16) / sprite_get_height(sprite_index);
3
var _alpha = (sin(timer * 3) + 1) * 0.25;
4
var _topx = screenx() + (splitease / 2);
5
var _topy = screeny() + splitease;
6
var _bottomx = screenx() - (splitease / 2);
7
var _bottomy = screeny() - splitease;
8
if (con == 2 || con == 2.5 || con == 3)
9
{
10
    var _a = 1;
11
    var _length = 120;
12
    if (con == 2)
13
    {
14
        _a = clamp01((timer / 30) - _alpha);
15
        _length = (50 * clamp01((timer / 30) - ((timer % 2) * 0.75))) + 50;
16
    }
17
    draw_set_blend_mode(bm_add);
18
    scr_draw_beam_color(_topx, _topy, _length, 10, 90, c_white, 0, _a, false);
19
    scr_draw_beam_color(_bottomx, _bottomy, _length, 10, 156, c_white, 0, _a, false);
20
    scr_draw_beam_color(_topx, _topy, _length, 10, 24, c_white, 0, _a, false);
21
    scr_draw_beam_color(_bottomx, _bottomy, _length, 10, 270, c_white, 0, _a, false);
22
    scr_draw_beam_color(_topx, _topy, _length, 10, 336, c_white, 0, _a, false);
23
    scr_draw_beam_color(_bottomx, _bottomy, _length, 10, 204, c_white, 0, _a, false);
24
    draw_set_blend_mode(bm_normal);
25
}
26
if (con == 1 || con == 2 || con == 2.5)
27
{
28
    var _color = merge_color(c_gray, c_red, clamp01(timer / 30));
29
    draw_sprite_ext(sprite_index, 1, _topx, _topy, _xscale + 0.1, _yscale + 0.1, 0, c_white, _alpha);
30
    draw_sprite_ext(sprite_index, 0, _topx, _topy, _xscale, _yscale, 0, _color, 1);
31
    if (split >= 2)
32
    {
33
        draw_sprite_ext(spr_knight_bullet_star_bottom, 1, _bottomx, _bottomy, _xscale + 0.1, _yscale + 0.1, 0, c_white, _alpha);
34
        draw_sprite_ext(spr_knight_bullet_star_bottom, 0, _bottomx, _bottomy, _xscale, _yscale, 0, _color, 1);
35
    }
36
}
37
if (con == 3 || con == 4)
38
{
39
    draw_sprite_ext(sprite_index, 2, _topx, _topy, _xscale + 0.1, _yscale + 0.1, 0, c_white, (sin(timer * 6) + 1) * 0.25);
40
    draw_sprite_ext(sprite_index, 2, _topx, _topy, _xscale, _yscale, 0, c_white, 1);
41
    if (split >= 2)
42
    {
43
        draw_sprite_ext(spr_knight_bullet_star_bottom, 2, _bottomx, _bottomy, _xscale + 0.1, _yscale + 0.1, 0, c_white, (sin(timer * 6) + 1) * 0.25);
44
        draw_sprite_ext(spr_knight_bullet_star_bottom, 2, _bottomx, _bottomy, _xscale, _yscale, 0, c_white, 1);
45
    }
46
}