Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shadowman_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
firstframe++;
2
if (firstframe == 1 && room != room_dw_teevie_large_01)
3
    exit;
4
if (image_alpha == 0 && i_ex(obj_tenna_board4_enemy))
5
    exit;
6
draw_set_color(c_white);
7
scr_enemy_drawhurt_generic
scr_enemy_drawhurt_generic

function
scr_enemy_drawhurt_generic()
{ if (state == 3 && hurttimer >= 0) draw_sprite_ext(hurtsprite, 0, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1); }
();
8
if (state == 4)
9
{
10
    thissprite = idlesprite;
11
    draw_monster_body_part(thissprite, siner, x, y);
12
}
13
if (state == 0)
14
{
15
    if (idlesprite == spr_shadowman_firing)
16
    {
17
        var xx = 0;
18
        var yy = 0;
19
        var index = 0;
20
        guntimer++;
21
        if (guntimer == 29)
22
        {
23
            xx = 10;
24
            index = 1;
25
        }
26
        draw_sprite_ext(spr_shadowman_gun, index, x + 10 + xx, y + 70 + yy, 2, 2, 0, c_white, 1);
27
    }
28
    fsiner += 1;
29
    siner += 0.16666666666666666;
30
    thissprite = idlesprite;
31
    if (global.mercymod[myself] >= global.mercymax[myself] && idlesprite != spr_shadowman_firing && !i_ex(obj_shadowman_sharpshoot_cursor))
32
        thissprite = sparedsprite;
33
    draw_monster_body_part(thissprite, siner, x, y);
34
}
35
if (becomeflash == 0)
36
    flash = 0;
37
becomeflash = 0;
38
if (darken == 1 && darkenalpha < 0.45)
39
    darkenalpha += 0.05;
40
else if (darken == 0 && darkenalpha > 0)
41
    darkenalpha -= 0.05;
42
if (darkenalpha > 0 && state == 0 && image_alpha == 1)
43
{
44
    d3d_set_fog(true, c_black, 0, 1);
45
    thissprite = idlesprite;
46
    if (global.mercymod[myself] >= global.mercymax[myself] && !i_ex(obj_shadowman_sharpshoot_cursor))
47
        thissprite = sparedsprite;
48
    draw_sprite_ext(thissprite, siner, x, y, image_xscale, image_yscale, image_angle, image_blend, darkenalpha);
49
    d3d_set_fog(false, c_black, 0, 0);
50
}
51
if (i_ex(obj_shadowman_sharpshoot_cursor) && obj_shadowman_sharpshoot_cursor.disableactui == true)
52
    exit;
53
if (acting == 30)
54
{
55
    var b = 180 - (sharpshootlength * 0.911);
56
    ossafe_fill_rectangle_color(camerax() + 240, cameray() + 290, camerax() + 240 + b, cameray() + 300, c_aqua, c_aqua, c_aqua, c_aqua, 0);
57
    draw_sprite_ext(spr_poppup_hourglass, 1, camerax() + 240, cameray() + 295, 2, 2, 0, c_white, 1);
58
}