Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_heartenemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (state == 3)
2
{
3
    if (global.monsterhp[myself] <= (global.monstermaxhp[myself] / 3))
4
    {
5
        global.monsterstatus[myself] = 1;
6
        if (global.monstercomment[myself] == " ")
7
            global.monstercomment[myself] = 
(Tired)
scr_84_get_lang_string
scr_84_get_lang_string

function scr_84_get_lang_string(arg0) { return ds_map_find_value(global.lang_map, arg0); }
("obj_heartenemy_slash_Draw_0_gml_6_0")
;
8
    }
9
    hurttimer -= 1;
10
    if (hurttimer < 0)
11
    {
12
        state = 0;
13
    }
14
    else
15
    {
16
        if (global.monster[myself] == 0)
17
        {
18
            if (global.flag[51 + myself] == 5)
19
                global.flag[524 hathy_susie_whacks] += 1;
20
            global.flag[521 hathy_violences] += 1;
21
            scr_defeatrun
scr_defeatrun

function scr_defeatrun() { defeatanim = instance_create(x, y, obj_defeatanim); defeatanim.sprite_index = sprite_index; defeatanim.sprite_index = hurtsprite; defeatanim.image_index = 0; defeatanim.image_xscale = image_xscale; defeatanim.image_yscale = image_yscale; instance_destroy(); }
();
22
        }
23
        hurtshake += 1;
24
        if (hurtshake > 1)
25
        {
26
            if (shakex > 0)
27
                shakex -= 1;
28
            if (shakex < 0)
29
                shakex += 1;
30
            shakex = -shakex;
31
            hurtshake = 0;
32
        }
33
        draw_sprite_ext(spr_heartenemy_hurt, 0, x + shakex, y, 2, 2, 0, image_blend, 1);
34
    }
35
}
36
if (state == 0)
37
{
38
    siner += 1;
39
    thissprite = spr_heartenemy_idle;
40
    if (global.mercymod[myself] >= global.mercymax[myself])
41
        thissprite = spr_heartenemy_spared;
42
    draw_sprite_ext(thissprite, siner / 5, x, y, 2, 2, 0, image_blend, 1);
43
    if (flash == 1)
44
    {
45
        fsiner += 1;
46
        d3d_set_fog(true, c_white, 0, 1);
47
        draw_sprite_ext(thissprite, siner / 5, x, y, 2, 2, 0, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
48
        d3d_set_fog(false, c_black, 0, 0);
49
    }
50
}
51
if (becomeflash == 0)
52
    flash = 0;
53
becomeflash = 0;