Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_chaseenemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (drawoffscreen == 0)
2
{
3
    dodraw = 1;
4
    tolerance = sprite_height + sprite_width;
5
    if (!scr_onscreen_tolerance
scr_onscreen_tolerance

function scr_onscreen_tolerance(arg0, arg1) { obj = arg0; spacer = arg1; if ((obj.x + obj.sprite_width + spacer) < camerax() || (obj.x - spacer) > (camerax() + 640) || (obj.y + obj.sprite_height + spacer) < cameray() || (obj.y - spacer) > (cameray() + 480)) return false; else return true; }
(id, tolerance))
6
        dodraw = 0;
7
}
8
else
9
{
10
    dodraw = true;
11
}
12
if (dodraw)
13
{
14
    drawx = 0;
15
    drawscale = 1;
16
    if (facing == 1 && specialspritecase == 0)
17
    {
18
        drawscale = -1;
19
        drawx = sprite_width;
20
    }
21
    drawsiner += 0.25;
22
    tempx = x;
23
    x += drawx;
24
    superscalex = 0;
25
    superdrawx = 0;
26
    superscalexb = 1;
27
    if (specialspritecase == 0)
28
    {
29
        if (facing == 0)
30
        {
31
            superscalex = 0;
32
        }
33
        else
34
        {
35
            superscalex = -4;
36
            superscalexb = -1;
37
            superdrawx = -sprite_width * 2;
38
        }
39
    }
40
    if (specialspritecase == "tasque")
41
    {
42
        if (facing == 1)
43
            sprite_index = spr_tasque_idle_flipped;
44
        if (facing == 0)
45
            sprite_index = spr_tasque_idle;
46
    }
47
    gpu_set_blendmode(bm_add);
48
    for (i = 0; i < 5; i++)
49
    {
50
        var aura = (i * 9) + ((drawsiner * 3) % 9);
51
        var aurax = (aura * 0.75) + (sin(aura / 4) * 4);
52
        var auray = 45 * scr_ease_in
scr_ease_in

function scr_ease_in(arg0, arg1) { if (arg1 < -3 || arg1 > 7) return arg0; switch (arg1) { case -3: return ease_in_bounce(arg0, 0, 1, 1); case -2: return ease_in_elastic(arg0, 0, 1, 1); case -1: var _s = 1.70158; return arg0 * arg0 * (((_s + 1) * arg0) - _s); case 0: return arg0; case 1: return -cos(arg0 * 1.5707963267948966) + 1; case 6: return power(2, 10 * (arg0 - 1)); case 7: return -(sqrt(1 - sqr(arg0)) - 1); default: return power(arg0, arg1); } }
(aura / 45, 1);
53
        var aurayscale = min(80 / sprite_height, 1);
54
        draw_sprite_ext(sprite_index, walk_index, x - ((aurax / 180) * drawscale * sprite_width), y - ((auray / 82) * sprite_height * aurayscale), (image_xscale + (aurax / 36)) * drawscale, image_yscale + ((auray / 36) * aurayscale), image_angle, c_red, image_alpha * (1 - (auray / 45)) * 0.5);
55
    }
56
    gpu_set_blendmode(bm_normal);
57
    var xmult = min((70 / sprite_width) * 4, 4);
58
    var ymult = min((80 / sprite_height) * 5, 5);
59
    var ysmult = min((80 / sprite_height) * 0.2, 0.2);
60
    draw_sprite_ext_centerscale(sprite_index, walk_index, x + superdrawx + (sin(drawsiner / 5) * xmult), y + (cos(drawsiner / 5) * ymult), image_xscale + superscalex, image_yscale + (sin(drawsiner / 5) * ysmult), image_angle, 255, image_alpha * 0.2);
61
    draw_sprite_ext_centerscale(sprite_index, walk_index, (x + superdrawx) - (sin(drawsiner / 5) * xmult), y - (cos(drawsiner / 5) * ymult), image_xscale + superscalex, image_yscale - (sin(drawsiner / 5) * ysmult), image_angle, 255, image_alpha * 0.2);
62
    scr_draw_outline_ext
scr_draw_outline_ext

function scr_draw_outline_ext(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { gpu_set_fog(true, arg7, 0, 0); var __xdirA = arg9; var __xdirB = 0; var __ydirA = 0; var __ydirB = arg9; if ((arg6 % 90) != 0) { __xdirA = lengthdir_x(arg9, arg6); __xdirB = lengthdir_x(arg9, arg6 + 90); __ydirA = lengthdir_y(arg9, arg6 + 90); __ydirB = lengthdir_y(arg9, arg6); } draw_sprite_ext(arg0, arg1, arg2 + __xdirA, arg3 + __ydirA, arg4, arg5, arg6, c_white, arg8); draw_sprite_ext(arg0, arg1, arg2 - __xdirA, arg3 - __ydirA, arg4, arg5, arg6, c_white, arg8); draw_sprite_ext(arg0, arg1, arg2 + __xdirB, arg3 + __ydirB, arg4, arg5, arg6, c_white, arg8); draw_sprite_ext(arg0, arg1, arg2 - __xdirB, arg3 - __ydirB, arg4, arg5, arg6, c_white, arg8); gpu_set_fog(false, c_white, 0, 0); }
(sprite_index, walk_index, x, y, image_xscale * drawscale, image_yscale, image_angle, c_red, image_alpha * 0.3, 2);
63
    draw_sprite_ext(sprite_index, walk_index, x, y, image_xscale * drawscale, image_yscale, image_angle, image_blend, image_alpha);
64
    x = tempx;
65
    mymidx = x + (sprite_width / 2);
66
    mymidy = y + ((bbox_bottom - y) / 2);
67
}