Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sneo_throwkris_vine_controller_Draw_0

(view raw script w/o annotations or w/e)
1
for (i = 0; i < 6; i += 1)
2
{
3
    x1[i] = obj_spamton_neo_enemy.x + obj_spamton_neo_enemy.partx[i] + (obj_spamton_neo_enemy.partxoff[i] / 1.2) + (i * 5) + (sin(obj_spamton_neo_enemy.partsiner[i] / 30) * 2);
4
    y1[i] = ((obj_spamton_neo_enemy.y + obj_spamton_neo_enemy.party[i]) - 10) + obj_spamton_neo_enemy.partyoff[i];
5
}
6
if (con == 0)
7
{
8
    timer++;
9
    for (i = 0; i < 6; i += 1)
10
        x2[i] = lerp(x2[i], x2_target[i], timer / 20);
11
    if (timer == 20)
12
    {
13
        con = 1;
14
        for (i = 0; i < 6; i += 1)
15
        {
16
            if (weakened[i] != 0 && visiblevine[i] == 1)
17
            {
18
                target = instance_create(x, y, obj_sneo_throwtarget);
19
                target.maker = id;
20
                target.x1 = x1[i];
21
                target.x2 = x2[i];
22
                target.y1 = y1[i];
23
                target.y2 = y2[i];
24
                target.vineid = i;
25
                with (target)
26
                {
27
                    path = path_add();
28
                    path_set_kind(path, 0);
29
                    path_set_closed(path, false);
30
                    path_add_point(path, x1, y1, 100);
31
                    path_add_point(path, x2 - 3, y2, 100);
32
                    path_start(path, 4, path_action_stop, true);
33
                }
34
                target.image_angle = point_direction(x1[i], y1[i], x2[i], y2[i]) + 282;
35
            }
36
        }
37
        timer = 0;
38
    }
39
}
40
if (con == 2)
41
{
42
    timer++;
43
    if (timer < 11)
44
    {
45
        for (i = 0; i < 6; i += 1)
46
            x2[i] = lerp(x2[i], x2_origin[i], timer / 10);
47
    }
48
    if (timer == 20)
49
    {
50
        for (i = 0; i < 6; i += 1)
51
        {
52
            if (visiblevine[i] == 1)
53
                obj_spamton_neo_enemy.partvisible[i] = 1;
54
        }
55
        instance_destroy();
56
        if (obj_spamton_neo_enemy.vinebgcount > 0)
57
        {
58
            for (i = 0; i < 6; i += 1)
59
            {
60
                if (obj_spamton_neo_enemy.partvisible[i] == 0)
61
                {
62
                    obj_spamton_neo_enemy.vineid = i;
63
                    vine = instance_create(x, y, obj_sneo_vine_transition);
64
                }
65
            }
66
        }
67
    }
68
}