Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_swatchling_enemy_Draw_0

(view raw script w/o annotations or w/e)
1
if (!color_init)
2
    exit;
3
if (state == 3)
4
{
5
    pal_swap_set(sprite_palette, current_pal, false);
6
    
scr_enemy_drawhurt_generic
scr_enemy_drawhurt_generic

function
scr_enemy_drawhurt_generic()
{ hurttimer -= 1; if (hurttimer < 0) { state = 0; } else { if (global.monster[myself] == 0)
scr_defeatrun();
hurtshake += 1; if (hurtshake > 1) { if (shakex > 0) shakex -= 1; if (shakex < 0) shakex += 1; shakex = -shakex; hurtshake = 0; } draw_sprite_ext(hurtsprite, 0, x + shakex + hurtspriteoffx, y + hurtspriteoffy, 2, 2, 0, image_blend, 1); } }
();
7
    pal_swap_reset();
8
}
9
if (state == 0)
10
{
11
    if (flash == 1)
12
        fsiner++;
13
    timer += 1;
14
    pal_swap_set(sprite_palette, current_pal, false);
15
    draw_sprite_ext(spr_swatchling_legs, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
16
    pal_swap_reset();
17
    if (flash == 1)
18
        draw_sprite_ext_flash(spr_swatchling_legs, 0, x, y, image_xscale, image_yscale, image_angle, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
19
    pal_swap_set(sprite_palette, current_pal, false);
20
    draw_sprite_ext(spr_swatchling_body, 0, x, y + (sin(timer / 6) * 3), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
21
    pal_swap_reset();
22
    if (flash == 1)
23
        draw_sprite_ext_flash(spr_swatchling_body, 0, x, y + (sin(timer / 6) * 3), image_xscale, image_yscale, image_angle, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
24
    pal_swap_set(sprite_palette, current_pal, false);
25
    draw_sprite_ext(spr_swatchling_head, 0, x, y + sin(timer / 6), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
26
    pal_swap_reset();
27
    if (flash == 1)
28
        draw_sprite_ext_flash(spr_swatchling_head, 0, x, y + sin(timer / 6), image_xscale, image_yscale, image_angle, image_blend, (-cos(fsiner / 5) * 0.4) + 0.6);
29
}
30
if (becomeflash == 0)
31
    flash = 0;
32
becomeflash = 0;