Deltarune script viewer

← back to main script listing

gml_Object_obj_checkers_enemy_ch1_Draw_0

(view raw script w/o annotations or w/e)
1
if (state == 3)
2
{
3
    hurttimer -= 1;
4
    if (hurttimer < 0)
5
    {
6
        state = 0;
7
    }
8
    else
9
    {
10
        if (global.monster[myself] == 0)
11
        {
12
            hspeed = 12;
13
            turnt -= 8;
14
            vspeed = -4;
15
        }
16
        hurtshake += 1;
17
        if (hurtshake > 1)
18
        {
19
            if (shakex > 0)
20
                shakex -= 1;
21
            if (shakex < 0)
22
                shakex += 1;
23
            shakex = -shakex;
24
            hurtshake = 0;
25
        }
26
        siner = 0;
27
        draw_sprite_ext(spr_checkers_idle_ch1, 0, x + shakex, y, 2, 2, 0, image_blend, 1);
28
    }
29
}
30
if (state == 0)
31
{
32
    siner += 1;
33
    thissprite = spr_checkers_idle_ch1;
34
    if (global.mercymod[myself] >= global.mercymax[myself])
35
        thissprite = spr_checkers_idle_ch1;
36
    draw_sprite_ext(thissprite, siner / 3, x, y, 2, 2, 0, image_blend, 1);
37
    if (flash == 1)
38
    {
39
        fsiner += 1;
40
        d3d_set_fog_ch1(true, 16777215, 0, 1);
41
        draw_sprite_ext(thissprite, siner / 3, x, y, 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
42
        d3d_set_fog_ch1(false, 0, 0, 0);
43
    }
44
}
45
if (becomeflash == 0)
46
    flash = 0;
47
becomeflash = 0;
48
sprite_index = thissprite;
49
image_index = siner / 3;