Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dojofx_front_Draw_0

(view raw script w/o annotations or w/e)
1
depth = 202;
2
if (global.fighting == 1)
3
{
4
    if (image_alpha < 1)
5
        image_alpha += 0.02;
6
    for (i = 0; i < 6; i++)
7
    {
8
        myy[i] = 0;
9
        exists[i] = 0;
10
        if (i <= 2)
11
        {
12
            if (global.char[i] != 0)
13
            {
14
                if (i_ex(global.charinstance[i]))
15
                {
16
                    exists[i] = 1;
17
                    instance[i] = global.charinstance[i];
18
                    width[i] = 80;
19
                    myy[i] = instance[i].y + (sprite_get_height(instance[i].idlesprite) * 2);
20
                    myx[i] = instance[i].x + 20;
21
                    if (global.char[i] == 2)
22
                        myx[i] += 15;
23
                    if (global.char[i] == 3)
24
                        myx[i] += 15;
25
                }
26
            }
27
        }
28
        if (i >= 3 && i <= 6)
29
        {
30
            if (i_ex(global.monsterinstance[i - 3]))
31
                exists[i] = 1;
32
            if (exists[i])
33
            {
34
                var xx = 0;
35
                var yy = 0;
36
                if (global.encounterno == 178)
37
                {
38
                    if (i == 3)
39
                        xx = 3;
40
                    if (i == 4)
41
                        xx = -5;
42
                    if (i == 3)
43
                        yy = -7;
44
                    if (i == 4)
45
                        yy = -15;
46
                }
47
                instance[i] = global.monsterinstance[i - 3];
48
                myx[i] = instance[i].x + xx + (instance[i].sprite_width / 2);
49
                myy[i] = instance[i].y + instance[i].sprite_height + yy;
50
                width[i] = global.monsterinstance[i - 3].sprite_width;
51
            }
52
        }
53
        if (exists[i] && i_ex(instance[i]))
54
        {
55
            if ((global.encounterno == 90 || global.encounterno == 91 || global.encounterno == 92 || global.encounterno == 93 || global.encounterno == 94) && i > 2)
56
            {
57
            }
58
            else
59
            {
60
                var lightHeight = 280;
61
                draw_sprite_pos(spr_whitegradientdown_40, 0, myx[i], myy[i] - lightHeight, myx[i], myy[i] - lightHeight, (myx[i] - (width[i] / 2)) + 2, myy[i] - 2, myx[i] + (width[i] / 2), myy[i] - 2, 0.25);
62
                draw_set_color(c_gray);
63
                d_ellipse(myx[i] - (width[i] / 2), myy[i] + 4, myx[i] + (width[i] / 2), myy[i] - 10, false);
64
            }
65
        }
66
    }
67
    draw_set_alpha(1);
68
}
69
else if (image_alpha > 0)
70
{
71
    image_alpha -= 0.02;
72
}