Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_leafling_enemy_Draw_0

related scripts: Alarm_4Create_0Draw_0 Other_12Other_22Step_0

(view raw script w/o annotations or w/e)
1
if (state == 9)
2
    exit;
3
if (acting == 101)
4
{
5
    d_rectangle_color(camerax() + 240, cameray() + 290, (camerax() + 210 + 210) - (acttimer * 0.9), cameray() + 300, 16776960, 16776960, 16776960, 16776960, 0);
6
    draw_sprite_ext(spr_poppup_hourglass, 0, camerax() + 240, cameray() + 295, 2, 2, 0, c_white, image_alpha);
7
    d3d_set_fog(true, c_white, 0, 0);
8
    if (button1_p() == 1)
9
        draw_sprite_ext(spr_poppup_hourglass, 0, camerax() + 240, cameray() + 295, 2, 2, 0, c_white, image_alpha);
10
    d3d_set_fog(false, c_white, 0, 0);
11
}
12
xoff = 0;
13
animsiner += 1;
14
if (blown == 1)
15
    image_xscale = 2;
16
if (image_xscale < 2)
17
    xoff = (originalwidth - sprite_width) / 2;
18
blowanimtimer--;
19
if (blowanimtimer > 6)
20
{
21
    if (onoff == 2)
22
        onoff = 0;
23
    if (onoff == 1.5)
24
        onoff = 2;
25
    if (onoff == 0.5)
26
        onoff = 1;
27
    if (onoff == 0)
28
    {
29
        ashake = -shakeamt;
30
        onoff = 0.5;
31
    }
32
    if (onoff == 1)
33
    {
34
        ashake = shakeamt;
35
        if (shakeamt > 0)
36
            shakeamt -= 1;
37
        onoff = 1.5;
38
    }
39
    if (blown)
40
    {
41
        if (pinneddown)
42
        {
43
            if (global.mercymod[myself] >= global.mercymax[myself])
44
            {
45
                if (image_xscale > 1.5)
46
                    draw_sprite_ext(spr_leafling_serious_spare, 0, (x + xoff + ashake) - 4, y + 0, image_xscale, image_yscale, 0, c_white, 1);
47
                else
48
                    draw_sprite_ext(spr_leafling_serious_spare, 1, (x + xoff + ashake) - 4, y + 0, image_xscale + 0.5, image_yscale, 0, c_white, 1);
49
            }
50
            else if (image_xscale > 1.5)
51
            {
52
                draw_sprite_ext(spr_leafling_serious_idle, 0, (x + xoff + ashake) - 4, y + 0, image_xscale, image_yscale, 0, c_white, 1);
53
            }
54
            else
55
            {
56
                draw_sprite_ext(spr_leafling_serious_idle, 1, (x + xoff + ashake) - 4, y + 0, image_xscale + 0.5, image_yscale, 0, c_white, 1);
57
            }
58
        }
59
        else if (global.mercymod[myself] >= global.mercymax[myself])
60
        {
61
            if (image_xscale > 1.5)
62
                draw_sprite_ext(spr_leafling_spare2, 0, x + xoff + ashake + 4, y - 0, image_xscale, image_yscale, 0, c_white, 1);
63
            else
64
                draw_sprite_ext(spr_leafling_spare2, 1, x + xoff + ashake + 4, y - 0, image_xscale + 0.5, image_yscale, 0, c_white, 1);
65
        }
66
        else if (image_xscale > 1.5)
67
        {
68
            draw_sprite_ext(spr_leafling_idle2, 0, x + xoff + ashake + 4, y - 0, image_xscale, image_yscale, 0, c_white, 1);
69
        }
70
        else
71
        {
72
            draw_sprite_ext(spr_leafling_idle2, 1, x + xoff + ashake + 4, y - 0, image_xscale + 0.5, image_yscale, 0, c_white, 1);
73
        }
74
        exit;
75
    }
76
}
77
if (state == 10)
78
{
79
    if (global.mercymod[myself] >= global.mercymax[myself])
80
        draw_sprite_ext(spr_leafling_idle_squish_spare, 0, x + 20, y + 66, 2, 1, 0, c_white, 1);
81
    else
82
        draw_sprite_ext(spr_leafling_idle_squish, 0, x + 20, y + 66, 2, 1, 0, c_white, 1);
83
}
84
else if (state == 11)
85
{
86
    if (global.mercymod[myself] >= global.mercymax[myself])
87
        draw_sprite_ext(spr_leafling_serious_squish_spare, 0, x + 20, y + 72, 2, 1, 0, c_white, 1);
88
    else
89
        draw_sprite_ext(spr_leafling_serious_squish, 0, x + 20, y + 72, 2, 1, 0, c_white, 1);
90
}
91
else if (state == 12)
92
{
93
    shrinktimer++;
94
    if (global.mercymod[myself] >= global.mercymax[myself])
95
        draw_sprite_ext(spr_leafling_serious_squish_spare, 0, x + 22, y + 62, 2, 1 + (shrinktimer / 5), 0, c_white, 1);
96
    else
97
        draw_sprite_ext(spr_leafling_serious_squish, 0, x + 22, y + 62, 2, 1 + (shrinktimer / 5), 0, c_white, 1);
98
    if (shrinktimer == 6)
99
    {
100
        state = 0;
101
        exit;
102
    }
103
}
104
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); }
();
105
if (custom_draw_example == 0)
106
{
107
    if (global.mercymod[myself] >= global.mercymax[myself] && pinneddown)
108
        
scr_enemy_drawidle_generic
scr_enemy_drawidle_generic

function
scr_enemy_drawidle_generic(arg0)
{ if (state == 0) { fsiner += 1; siner += arg0; thissprite = idlesprite; if (global.mercymod[myself] >= global.mercymax[myself]) thissprite = sparedsprite; draw_monster_body_part(thissprite, siner, x, y); } }
(0.08333333333333333);
109
    else
110
        
scr_enemy_drawidle_generic
scr_enemy_drawidle_generic

function
scr_enemy_drawidle_generic(arg0)
{ if (state == 0) { fsiner += 1; siner += arg0; thissprite = idlesprite; if (global.mercymod[myself] >= global.mercymax[myself]) thissprite = sparedsprite; draw_monster_body_part(thissprite, siner, x, y); } }
(0.16666666666666666);
111
}
112
else if (state == 0)
113
{
114
    if (flash == 1)
115
        fsiner++;
116
    siner += 0.16666666666666666;
117
    if (global.mercymod[myself] >= global.mercymax[myself])
118
        draw_monster_body_part(sparedsprite, siner, x, y);
119
}
120
if (becomeflash == 0)
121
    flash = 0;
122
becomeflash = 0;