Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_battlealphaer_Draw_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    init = 1;
4
    if (fadeplease == 1)
5
    {
6
        tile_layer_amount = 777777;
7
        alpha_changed = 0;
8
        tile_fade = 1;
9
        tilearray = tile_get_ids_at_depth(tile_layer_amount);
10
        for (var i = 0; i < array_length_1d(tilearray); i++)
11
            tile_set_alpha(tilearray[i], 0);
12
    }
13
}
14
cur_alpha = battlealpha;
15
if (autobattle == 1)
16
{
17
    if (instance_exists(obj_overworldbulletparent))
18
        obj_mainchara.battlemode = 1;
19
    else
20
        obj_mainchara.battlemode = 0;
21
}
22
if (obj_mainchara.battlemode == 1)
23
{
24
    if (battlealpha < 0.5)
25
        battlealpha += 0.04;
26
}
27
else if (battlealpha > 0)
28
{
29
    battlealpha -= 0.04;
30
}
31
if (tile_fade == 1)
32
{
33
    if (cur_alpha != battlealpha)
34
    {
35
        for (var i = 0; i < array_length_1d(tilearray); i++)
36
            tile_set_alpha(tilearray[i], battlealpha * 2);
37
    }
38
}
39
draw_set_alpha(battlealpha);
40
draw_set_color(c_black);
41
draw_rectangle(__view_get(e__VW.XView, 0) - 100, __view_get(e__VW.YView, 0) - 100, __view_get(e__VW.XView, 0) + 740, __view_get(e__VW.YView, 0) + 540, false);
42
draw_set_alpha(1);
43
if (instance_exists(obj_caterpillarchara))
44
{
45
    obj_caterpillarchara.image_blend = merge_color(c_white, c_black, battlealpha);
46
    if (battlealpha <= 0)
47
        obj_caterpillarchara.image_blend = c_white;
48
}
49
50
enum e__VW
51
{
52
    XView,
53
    YView,
54
    WView,
55
    HView,
56
    Angle,
57
    HBorder,
58
    VBorder,
59
    HSpeed,
60
    VSpeed,
61
    Object,
62
    Visible,
63
    XPort,
64
    YPort,
65
    WPort,
66
    HPort,
67
    Camera,
68
    SurfaceID
69
}