Deltarune (Chapter 1) script viewer

← back to main script listing

gml_Object_obj_blocktree_bg_Step_0

(view raw script w/o annotations or w/e)
1
oo = 0;
2
if (spec == 1)
3
{
4
    if (instance_exists(obj_darkponman_ow))
5
    {
6
        oo = -0.8 + (obj_darkponman_ow.battlealpha * obj_darkponman_ow.max_battlealpha * 1.5);
7
        if (oo < 0)
8
            oo = 0;
9
        if (oo > 1)
10
            oo = 1;
11
        image_blend = merge_color(c_white, c_black, oo);
12
    }
13
}
14
if (spec == 2)
15
{
16
    if (instance_exists(obj_darkponman_ow))
17
    {
18
        oo = 4 - (obj_darkponman_ow.battlealpha * obj_darkponman_ow.max_battlealpha * 4);
19
        if (oo > 1)
20
            oo = 1;
21
        if (oo < 0)
22
            oo = 0;
23
        image_blend = merge_color(c_white, c_black, oo);
24
    }
25
}
26
if (spec < 2)
27
    blocktimer += 1;
28
if (blocktimer == 20)
29
{
30
    xv = x + (sprite_width / 4) + random(sprite_width / 2);
31
    yv = y + (sprite_height / 4) + random(sprite_height / 4);
32
    block = scr_dark_marker
scr_dark_marker

function scr_dark_marker(arg0, arg1, arg2) { thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(xv, yv, spr_blocktree_block);
33
    with (block)
34
    {
35
        hspeed = 0.4 + random(1);
36
        vspeed = 0.7 + random(1.5);
37
        gravity_direction = 0;
38
        gravity = 0.1;
39
        image_alpha = 0;
40
        friction = -0.1;
41
    }
42
    block.depth = depth - 1;
43
    block.image_blend = merge_color(c_white, c_black, oo);
44
    if (oo >= 0.8)
45
    {
46
        with (block)
47
            instance_destroy();
48
    }
49
}
50
if (blocktimer >= 20 && blocktimer <= 30)
51
{
52
    with (block)
53
    {
54
        if (image_alpha < 1)
55
            image_alpha += 0.2;
56
    }
57
}
58
if (blocktimer >= 38)
59
{
60
    with (block)
61
        image_alpha -= 0.1;
62
}
63
if (blocktimer >= 48)
64
{
65
    blocktimer = 0;
66
    with (block)
67
        instance_destroy();
68
}