Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_rabbick_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
animsiner += 1;
2
image_xscale = 2 - (blowamt / 100);
3
if (blown == 1)
4
    image_xscale = 2;
5
xoff = 0;
6
if (image_xscale < 2)
7
    xoff = (originalwidth - sprite_width) / 2;
8
blowanimtimer -= 1;
9
if (blowanimtimer > 6 && blown == 0)
10
{
11
    if (onoff == 2)
12
        onoff = 0;
13
    if (onoff == 1.5)
14
        onoff = 2;
15
    if (onoff == 0.5)
16
        onoff = 1;
17
    if (onoff == 0)
18
    {
19
        ashake = -shakeamt;
20
        onoff = 0.5;
21
    }
22
    if (onoff == 1)
23
    {
24
        ashake = shakeamt;
25
        if (shakeamt > 0)
26
            shakeamt -= 1;
27
        onoff = 1.5;
28
    }
29
    if (image_xscale > 1.5)
30
        draw_sprite_ext(spr_rabbick_enemy_hurt, 0, x + xoff + ashake, y, image_xscale, image_yscale, 0, c_white, 1);
31
    else
32
        draw_sprite_ext(spr_rabbick_enemy_hurt, 1, (x + xoff + ashake) - 8, y, image_xscale + 0.5, image_yscale, 0, c_white, 1);
33
}
34
else
35
{
36
    if (state == 3)
37
    {
38
        if (global.monsterhp[myself] <= (global.monstermaxhp[myself] / 3))
39
        {
40
            global.monsterstatus[myself] = 1;
41
            if (global.monstercomment[myself] == " ")
42
                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_rabbick_enemy_slash_Draw_0_gml_45_0")
;
43
        }
44
        hurttimer -= 1;
45
        if (hurttimer < 0)
46
        {
47
            state = 0;
48
        }
49
        else
50
        {
51
            if (global.monster[myself] == 0)
52
                
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(); }
();
53
            hurtshake += 1;
54
            if (hurtshake > 1)
55
            {
56
                if (shakex > 0)
57
                    shakex -= 1;
58
                if (shakex < 0)
59
                    shakex += 1;
60
                shakex = -shakex;
61
                hurtshake = 0;
62
            }
63
            thissprite = hurtsprite;
64
            if (image_xscale > 1.5)
65
                draw_sprite_ext(thissprite, 0, x + xoff + shakex, y, image_xscale, image_yscale, 0, c_white, 1);
66
            else
67
                draw_sprite_ext(thissprite, 1, (x + xoff + shakex) - 8, y, image_xscale + 0.5, image_yscale, 0, c_white, 1);
68
        }
69
    }
70
    if (state == 0)
71
    {
72
        thissprite = idlesprite;
73
        if (global.mercymod[myself] >= global.mercymax[myself] || blown == 1)
74
            thissprite = sparedsprite;
75
        draw_sprite_ext(thissprite, animsiner / 5, x + xoff, y, image_xscale, image_yscale, 0, image_blend, 1);
76
        if (flash == 1)
77
        {
78
            fsiner += 1;
79
            d3d_set_fog(true, c_white, 0, 1);
80
            draw_sprite_ext(thissprite, animsiner / 5, x + xoff, y, image_xscale, image_yscale, 0, c_white, (-cos(fsiner / 5) * 0.4) + 0.6);
81
            d3d_set_fog(false, c_black, 0, 0);
82
        }
83
    }
84
    if (becomeflash == 0)
85
        flash = 0;
86
    becomeflash = 0;
87
}