Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_glacier_switch_Step_0

(view raw script w/o annotations or w/e)
1
if (used == false)
2
{
3
    if (place_meeting(x, y, obj_mainchara_board) || place_meeting(x, y, obj_pushableblock_board))
4
        pressed = 1;
5
    else
6
        pressed = 0;
7
}
8
else
9
{
10
    exit;
11
}
12
if (pressed)
13
{
14
    if (pressinit == 0)
15
        snd_play_pitch(snd_noise, 1.4);
16
    pressinit = 1;
17
    var a = 0;
18
    for (var i = 0; i < instance_number(obj_board_glacier_switch); i++)
19
    {
20
        button[i] = instance_find(obj_board_glacier_switch, i);
21
        if (button[i].pressed == true)
22
            a++;
23
    }
24
    if (a == 2 && used == false)
25
    {
26
        used = true;
27
        with (obj_board_enemy_spawner)
28
        {
29
            if (x >= 128 && x <= 480 && y >= 64 && y <= 288)
30
            {
31
                if (image_index == 19 && type == 0)
32
                    instance_destroy();
33
            }
34
        }
35
        with (obj_board_enemy_spawner)
36
        {
37
            if (x > 128 && x < 480 && y > 64 && y < 288 && image_index == 20)
38
                instance_destroy();
39
        }
40
        with (obj_board_icepuzzle_wall)
41
            con = 1;
42
        snd_play(snd_impact);
43
    }
44
}
45
else
46
{
47
    if (pressinit == 1)
48
        snd_play_pitch(snd_noise, 1.1);
49
    pressinit = 0;
50
}