Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_ch2_room_mansion_east_1f_e_Step_0

(view raw script w/o annotations or w/e)
1
if (hacker != -4)
2
{
3
    if (!hacker_init_path && hacker.path_position == 1)
4
    {
5
        pause_timer++;
6
        hacker.path_speed = 0;
7
        hacker.image_speed = 0;
8
        with (hacker)
9
            path_end();
10
        if (pause_timer >= 60)
11
        {
12
            pause_timer = 0;
13
            hacker_init_path = true;
14
            with (hacker)
15
                path_start(path_hacker_loop, 2, path_action_reverse, 1);
16
        }
17
    }
18
    if (hacker_init_path && hacker_can_pause)
19
    {
20
        if (hacker.path_position == 0 || hacker.path_position == 1)
21
        {
22
            hacker.path_speed = 0;
23
            pause_timer++;
24
            if (pause_timer >= 60)
25
            {
26
                pause_timer = 0;
27
                hacker.path_speed = 2;
28
                hacker.image_index = 0;
29
                hacker_can_pause = false;
30
            }
31
        }
32
    }
33
    if (!hacker_can_pause)
34
    {
35
        pause_timer++;
36
        if (pause_timer >= 15)
37
        {
38
            pause_timer = 0;
39
            hacker_can_pause = true;
40
        }
41
    }
42
    with (hacker)
43
    {
44
        
scr_depth
scr_depth

function
scr_depth()
{ depth = 100000 - ((y * 10) + (sprite_height * 10)); }
();
45
        image_speed = (path_speed == 0) ? 0 : 0.25;
46
        if (direction == 180)
47
        {
48
            if (x > 1318 && x < 1388)
49
                sprite_index = spr_npc_pointer_walk_left;
50
            else
51
                sprite_index = spr_npc_cursor_walk_left;
52
        }
53
        else if (x > 1380 && x < 1450)
54
        {
55
            sprite_index = spr_npc_pointer_walk_right;
56
        }
57
        else
58
        {
59
            sprite_index = spr_npc_cursor_walk_right;
60
        }
61
        if (global.interact != 0 && myinteract == 0)
62
            myinteract = 14;
63
        if (global.interact == 0 && myinteract == 14)
64
            myinteract = 0;
65
        if (d_ex() && myinteract == 0)
66
            myinteract = 32;
67
        if (!d_ex() && myinteract == 32)
68
            myinteract = 0;
69
        if (myinteract != 0 && path_speed != 0)
70
        {
71
            currentspeed = path_speed;
72
            path_speed = 0;
73
            image_index = 0;
74
            pathpause = true;
75
        }
76
        if (myinteract == 0 && pathpause)
77
        {
78
            path_speed = currentspeed;
79
            pathpause = false;
80
        }
81
    }
82
}
83
if (con == 1)
84
{
85
    con = -1;
86
    global.flag[339 found_basement_switch] = 1;
87
    layer_set_visible("TILES_Secret", false);
88
    layer_set_visible("TILES_Secret_BG", false);
89
    if (i_ex(exitcollider))
90
        instance_destroy(exitcollider);
91
}