Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_glacier_switch2_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_switch2); i++)
19
    {
20
        button[i] = instance_find(obj_board_glacier_switch2, i);
21
        if (button[i].pressed == true)
22
            a++;
23
    }
24
    if (a == 4 && used == false)
25
    {
26
        used = true;
27
        with (obj_board_enemy_spawner)
28
        {
29
            if (image_index == 19 && type == 1)
30
                instance_destroy();
31
        }
32
        with (obj_board_enemy_spawner)
33
        {
34
            if (x > 128 && x < 480 && y > 64 && y < 288 && image_index == 20)
35
                instance_destroy();
36
        }
37
        with (obj_board_icepuzzle_wall)
38
            con = 1;
39
        snd_play(snd_impact);
40
    }
41
}
42
else
43
{
44
    if (pressinit == 1)
45
        snd_play_pitch(snd_noise, 1.1);
46
    pressinit = 0;
47
}