Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_tallbookcases_Draw_0

(view raw script w/o annotations or w/e)
1
if (global.interact == 0)
2
    siner++;
3
animindex++;
4
if (gueicheck)
5
{
6
    var version = 0;
7
    if (global.flag[encounterflag] != 0)
8
        version = 1;
9
    var gueicount = 5;
10
    if (version == 1)
11
    {
12
        gueicount = 3;
13
        gueitoskip = 99;
14
    }
15
    var xspace = 320;
16
    var i;
17
    for (i = 0; i < gueicount; i++)
18
    {
19
        if (i != gueitoskip && !dontdraw)
20
        {
21
            var side = 1;
22
            if ((i % 2) == 0)
23
                side = -1;
24
            var yloc = 382;
25
            var range = 140;
26
            var bonusspace = 0;
27
            if (version == 1)
28
            {
29
                yloc -= 48;
30
                range = 60;
31
                if (i == 2)
32
                    bonusspace = 320;
33
                movespeed = 15;
34
            }
35
            var xloc = 320 + (sin(siner / movespeed) * range * side) + (xspace * i) + bonusspace;
36
            var bonusalph = clamp((240 - abs(obj_mainchara.x - xloc)) / 240, 0.125, 0.35);
37
            if (i != dontdraw)
38
            {
39
                draw_sprite_ext(spr_guei_chase, (animindex + (i * 1.4) + 0) / 6, xloc, yloc + (cos(animindex / 12) * 8), 2, 2, 0, c_white, (0.05 + bonusalph) * image_alpha);
40
                draw_sprite_ext(spr_guei_chase, (animindex + (i * 1.4) + 1) / 6, xloc + (sin(animindex / 2) * 2), yloc + (cos(animindex / 12) * 8), 2, 2, 0, c_white, (0.025 + bonusalph) * image_alpha);
41
            }
42
            draw_set_color(c_red);
43
            draw_set_color(c_white);
44
        }
45
    }
46
    with (chaser)
47
    {
48
        if (other.con < 2)
49
        {
50
            draw_sprite_ext(spr_guei_chase, (other.siner + (i * 1.4) + 0) / 6, x, y + (cos(other.siner / 12) * 8), 2, 2, 0, image_blend, alpha);
51
            draw_sprite_ext(spr_guei_chase, (other.siner + (i * 1.4) + 1) / 6, x + (sin(other.siner / 2) * 2), y + (cos(other.siner / 12) * 8), 2, 2, 0, image_blend, alpha * 0.5);
52
        }
53
        else
54
        {
55
            var prog = clamp(other.timer / 20, 0, 1);
56
            sprite_index = spr_guei_idle_nowisp;
57
            draw_sprite_ext(spr_guei_chase, (other.siner + (i * 1.4) + 0) / 6, x, y + (cos(other.siner / 12) * 8), 2, 2, 0, image_blend, alpha - (prog * 2));
58
            draw_sprite_ext(spr_guei_chase, (other.siner + (i * 1.4) + 1) / 6, x + (sin(other.siner / 2) * 2), y + (cos(other.siner / 12) * 8), 2, 2, 0, image_blend, (alpha * 0.5) - (prog * 2));
59
            draw_sprite_ext(sprite_index, other.siner / 4, x - (60 * (1 - prog)), y - (80 * (1 - prog)), 2, 2, 0, c_white, prog * 4);
60
        }
61
    }
62
}