Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_mike_Draw_0

(view raw script w/o annotations or w/e)
1
if (act == 1)
2
{
3
    xoff = -sprite_width / 2;
4
    yoff = -sprite_height / 2;
5
}
6
else
7
{
8
    xoff = 0;
9
    yoff = 0;
10
}
11
if (act < 3)
12
{
13
    draw_sprite_ext(sprite_index, image_index, x + xoff, y + yoff, image_xscale, image_yscale, 0, c_white, 1);
14
}
15
else
16
{
17
    var _yoff = 8;
18
    if (sprite_index == spr_mike_m)
19
        _yoff = 0;
20
    if (sprite_index == spr_mike_l)
21
        _yoff = -12;
22
    draw_sprite_part_ext(sprite_index, image_index, 0, 0, sprite_width, sprite_height - (cutoff * 0.75), x, y + yy + (cutoff * 0.75), 2, 2, c_white, 1);
23
    cutoff = lerp(cutoff, sprite_height, 0.5);
24
    yy = lerp(yy, _yoff, 0.5);
25
}
26
if (blush && act != 1)
27
{
28
    blush_alpha = lerp(blush_alpha, 1, 0.05);
29
    if (sprite_index == spr_mike_s)
30
    {
31
        var bx = 8;
32
        var by = 12;
33
        draw_sprite_ext(spr_blush, 0, x + 50 + (bx * image_xscale), y + (by * image_yscale), 1, 1, 0, c_white, blush_alpha);
34
        draw_sprite_ext(spr_blush, 0, (x + 50) - (bx * image_xscale), y + (by * image_yscale), 1, 1, 0, c_white, blush_alpha);
35
    }
36
    else if (sprite_index == spr_mike_m)
37
    {
38
        var bx = 7;
39
        var by = 20;
40
        var bxx = 50 - (round((sin((image_index + 2) / 2) * 8) / 4) * 4);
41
        bx2 += ((bxx - bx2) * 0.75);
42
        draw_sprite_ext(spr_blush, 0, x + bx2 + (bx * image_xscale), y + (by * image_yscale), 1, 1, 0, c_white, blush_alpha);
43
        draw_sprite_ext(spr_blush, 0, (x + bx2) - (bx * image_xscale), y + (by * image_yscale), 1, 1, 0, c_white, blush_alpha);
44
    }
45
    else if (sprite_index == spr_mike_l)
46
    {
47
        var bx = 6;
48
        var by = 20;
49
        draw_sprite_ext(spr_blush, 0, x + 26 + (bx * image_xscale), y + (by * image_yscale), 1, 1, 0, c_white, blush_alpha);
50
        draw_sprite_ext(spr_blush, 0, (x + 26) - (bx * image_xscale), y + (by * image_yscale), 1, 1, 0, c_white, blush_alpha);
51
    }
52
}
53
else
54
{
55
    blush_alpha = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(blush_alpha, 0, 0.1);
56
}