Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_spotlight_Draw_0

(view raw script w/o annotations or w/e)
1
if (con > 0)
2
{
3
    draw_set_blend_mode(bm_add);
4
    draw_sprite_ext(sprite_index, 3, x, y, image_xscale, image_yscale, image_angle, light_color, 1);
5
    var _pointX = x + lengthdir_x(20, direction - 180);
6
    var _pointY = y + lengthdir_y(20, direction - 180);
7
    if (auto_floor)
8
        floor_y = (target.y + target.sprite_height) - target.sprite_xoffset;
9
    var _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 - (size / 2), floor_y);
10
    var _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 + (size / 2), floor_y);
11
    draw_set_color(light_color);
12
    draw_ellipse(_pointA, floor_y - 10, _pointB, floor_y + 10, false);
13
    draw_set_color(merge_color(light_color, c_black, 0.9));
14
    draw_triangle(_pointX, _pointY, _pointA, floor_y, _pointB, floor_y, false);
15
    draw_set_blend_mode(bm_normal);
16
}
17
draw_sprite_ext(sprite_index, 0, x, y, image_xscale, image_yscale, image_angle, light_color, 1);
18
if (con > 0)
19
{
20
    draw_set_blend_mode(bm_add);
21
    draw_sprite_ext(sprite_index, 1, x, y, image_xscale, image_yscale, image_angle, light_color, 1);
22
    draw_set_blend_mode(bm_normal);
23
    d3d_set_fog(true, other.dark_mode ? #0B152A : #3967D2, 0, 1);
24
    with (target)
25
    {
26
        if (object_index == obj_actor_tenna)
27
            scr_copy_tenna_ext(id, x, y, image_xscale, -image_yscale, 1, true);
28
        else
29
            draw_sprite_part_ext(sprite_index, image_index, 0, (sprite_height / image_yscale) - 16, sprite_width / image_xscale, 18, x + sprite_xoffset, (y - sprite_yoffset) + sprite_height + 20, image_xscale, -image_yscale, c_black, 1);
30
        d3d_set_fog(false, c_black, 0, 0);
31
        if (other.dark_mode)
32
        {
33
            if (object_index == obj_actor_tenna)
34
                scr_copy_tenna(id, x, y);
35
            else
36
                draw_self();
37
        }
38
    }
39
}