Deltarune (Chapter 3) script viewer

← back to main script listing

gml_GlobalScript_scr_draw_tenna

(view raw script w/o annotations or w/e)
1
function scr_copy_tenna(arg0, arg1, arg2)
2
{
3
    scr_copy_tenna_ext(arg0, arg1, arg2, arg0.xscale, arg0.yscale, 1, arg0.outline, arg0.dropshadow);
4
}
5
6
function scr_copy_tenna_ext(arg0, arg1, arg2, arg3, arg4, arg5, arg6 = true, arg7 = false)
7
{
8
    with (arg0)
9
    {
10
        var _x1 = (x1 - x) + arg1;
11
        var _x2 = (x2 - x) + arg1;
12
        var _x3 = (x3 - x) + arg1;
13
        var _x4 = (x4 - x) + arg1;
14
        var _y1 = (y1 - y) + arg2;
15
        var _y2 = (y2 - y) + arg2;
16
        var _y3 = (y3 - y) + arg2;
17
        var _y4 = (y4 - y) + arg2;
18
        if (drawtype == 0)
19
        {
20
            if (arg3 != xscale)
21
            {
22
                _x1 = arg1 + ((_x1 - arg1) * (arg3 / 2));
23
                _x2 = arg1 + ((_x2 - arg1) * (arg3 / 2));
24
                _x3 = arg1 + ((_x3 - arg1) * (arg3 / 2));
25
                _x4 = arg1 + ((_x4 - arg1) * (arg3 / 2));
26
            }
27
            if (arg4 != yscale)
28
            {
29
                _y1 = arg2 + ((_y1 - arg2) * (arg4 / 2));
30
                _y2 = arg2 + ((_y2 - arg2) * (arg4 / 2));
31
                _y3 = arg2 + ((_y3 - arg2) * (arg4 / 2));
32
                _y4 = arg2 + ((_y4 - arg2) * (arg4 / 2));
33
            }
34
            if (arg6)
35
            {
36
                d3d_set_fog(true, c_black, 0, 1);
37
                draw_sprite_pos(sprite_index, image_index, _x1 - 2, _y1, _x2 - 2, _y2, _x3 - 2, _y3, _x4 - 2, _y4, 1);
38
                draw_sprite_pos(sprite_index, image_index, _x1, _y1 - 2, _x2, _y2 - 2, _x3, _y3 - 2, _x4, _y4 - 2, 1);
39
                draw_sprite_pos(sprite_index, image_index, _x1, _y1 + 2, _x2, _y2 + 2, _x3, _y3 + 2, _x4, _y4 + 2, 1);
40
                draw_sprite_pos(sprite_index, image_index, _x1 + 2, _y1, _x2 + 2, _y2, _x3 + 2, _y3, _x4 + 2, _y4, 1);
41
                d3d_set_fog(false, c_black, 0, 0);
42
            }
43
            if (arg7)
44
            {
45
                d3d_set_fog(true, c_black, 0, 1);
46
                draw_sprite_pos(sprite_index, image_index, _x1 + dropdist, _y1 + dropdist, _x2 + dropdist, _y2 + dropdist, _x3 + dropdist, _y3 + dropdist, _x4 + dropdist, _y4 + dropdist, 1);
47
                d3d_set_fog(false, c_white, 0, 0);
48
            }
49
            draw_sprite_pos(sprite_index, image_index, _x1, _y1, _x2, _y2, _x3, _y3, _x4, _y4, 1);
50
        }
51
        if (drawtype == 1)
52
        {
53
            if (arg7)
54
                draw_sprite_ext(sprite_index, image_index, x + dropdist, y + dropdist, image_xscale, image_yscale, image_angle, c_black, image_alpha);
55
            draw_sprite_ext(sprite_index, image_index, arg1, arg2, arg3, arg4, image_angle, image_blend, arg5);
56
        }
57
    }
58
}
59
60
function scr_tenna_marker(arg0, arg1, arg2)
61
{
62
    var __marker = instance_create(arg0, arg1, obj_tenna_marker);
63
    with (__marker)
64
        scr_copy_tenna_vars(arg2);
65
    return __marker;
66
}
67
68
function scr_tenna_afterimage(arg0 = -4)
69
{
70
    if (arg0 == -4)
71
        arg0 = id;
72
    var __afterimage = instance_create(arg0.x, arg0.y, obj_tenna_afterimage);
73
    with (__afterimage)
74
        scr_copy_tenna_vars(arg0);
75
    return __afterimage;
76
}
77
78
function scr_copy_tenna_vars(arg0)
79
{
80
    sprite_index = arg0.sprite_index;
81
    image_index = arg0.image_index;
82
    image_speed = 0;
83
    image_angle = arg0.image_angle;
84
    image_blend = arg0.image_blend;
85
    image_xscale = arg0.image_xscale;
86
    image_yscale = arg0.image_yscale;
87
    depth = arg0.depth;
88
    outline = arg0.outline;
89
    drawtype = arg0.drawtype;
90
    dropdist = arg0.dropdist;
91
    dropshadow = arg0.dropshadow;
92
    xscale = arg0.xscale;
93
    yscale = arg0.yscale;
94
    x1 = arg0.x1 - arg0.x;
95
    x2 = arg0.x2 - arg0.x;
96
    x3 = arg0.x3 - arg0.x;
97
    x4 = arg0.x4 - arg0.x;
98
    y1 = arg0.y1 - arg0.y;
99
    y2 = arg0.y2 - arg0.y;
100
    y3 = arg0.y3 - arg0.y;
101
    y4 = arg0.y4 - arg0.y;
102
}