Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_rhythmgame_spotlights_Draw_0

(view raw script w/o annotations or w/e)
1
light_color = 15245445;
2
if (con > 0)
3
{
4
    draw_set_blend_mode(bm_add);
5
    draw_sprite_ext(sprite_index, 3, x, y, image_xscale, image_yscale, image_angle, light_color, 1);
6
    var _pointX = x + lengthdir_x(20, direction - 180);
7
    var _pointY = y + lengthdir_y(20, direction - 180);
8
    floorY = obj_rhythmgame.y + 370 + (cos(siner / 20) * (range / 2));
9
    pointA = 
scr_intercept_x
scr_intercept_x

function
scr_intercept_x(arg0, arg1, arg2, arg3, arg4)
{ var __ylength = lengthdir_y(arg2, arg3); var __xlength = lengthdir_x(arg2, arg3); var __dist = arg4 - arg1; if (sign(__ylength) != sign(__dist) || abs(__ylength) < abs(__dist)) return arg0 + __xlength; else return arg0 + (__xlength * (__dist / __ylength)); }
(_pointX, _pointY, 900, direction - 17, floorY);
10
    pointB = 
scr_intercept_x
scr_intercept_x

function
scr_intercept_x(arg0, arg1, arg2, arg3, arg4)
{ var __ylength = lengthdir_y(arg2, arg3); var __xlength = lengthdir_x(arg2, arg3); var __dist = arg4 - arg1; if (sign(__ylength) != sign(__dist) || abs(__ylength) < abs(__dist)) return arg0 + __xlength; else return arg0 + (__xlength * (__dist / __ylength)); }
(_pointX, _pointY, 900, direction + 17, floorY);
11
    if (obj_rhythmgame.bg_con == 0)
12
    {
13
        draw_set_color(merge_color(light_color, c_black, 0.9));
14
        draw_triangle(_pointX, _pointY, pointA, floorY, pointB, floorY, false);
15
    }
16
    draw_set_blend_mode(bm_normal);
17
    scr_draw_set_mask(true);
18
    draw_sprite(spr_rhythmgame_bg_overlay, 1, obj_rhythmgame.x, obj_rhythmgame.y + 100);
19
    scr_draw_in_mask_begin();
20
    draw_set_color(light_color);
21
    draw_ellipse(pointA, floorY - 10, pointB, floorY + 10, false);
22
}
23
if (con > 0)
24
{
25
    if (i_ex(obj_rhythmgame))
26
        d3d_set_fog(true, obj_rhythmgame.floor_color, 0, 1);
27
    else
28
        d3d_set_fog(true, #3967D2, 0, 1);
29
    with (obj_marker2)
30
    {
31
        if (visible)
32
            draw_sprite_ext(sprite_index, image_index, x, ((y - sprite_yoffset) + (sprite_height * 1.5)) - 6, image_xscale, -image_yscale / 2, 0, c_black, 1);
33
    }
34
    with (obj_rhythmgame_performer)
35
    {
36
        if (visible)
37
            draw_sprite_ext(sprite_index, image_index, x, ((y - sprite_yoffset) + (sprite_height * 1.5)) - 6, image_xscale, -image_yscale / 2, 0, c_black, 1);
38
    }
39
    with (obj_actor)
40
    {
41
        if (visible)
42
            draw_sprite_ext(sprite_index, image_index, x, ((y - sprite_yoffset) + (sprite_height * 1.5)) - 6, image_xscale, -image_yscale / 2, 0, c_black, 1);
43
    }
44
    with (obj_actor_tenna)
45
        scr_copy_tenna_ext(id, x, y, image_xscale, -image_yscale / 2, 1, false);
46
    d3d_set_fog(false, c_black, 0, 0);
47
    scr_draw_in_mask_end();
48
}
49
draw_sprite_ext(sprite_index, 0, x, y, image_xscale, image_yscale, image_angle, light_color, 1);
50
draw_set_blend_mode(bm_add);
51
draw_sprite_ext(sprite_index, 1, x, y, image_xscale, image_yscale, image_angle, light_color, 1);
52
draw_set_blend_mode(bm_normal);