Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_dungeon3_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_board_enemy_black_deer))
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_dungeon3_switch); i++)
19
    {
20
        button[i] = instance_find(obj_board_dungeon3_switch, i);
21
        if (button[i].pressed == true)
22
            a++;
23
    }
24
    if (a == 2 && used == false)
25
    {
26
        with (obj_board_dungeon3_switch)
27
            used = true;
28
        with (obj_board_puzzle_wall)
29
            instance_destroy();
30
        obj_mainchara_board.controlled = false;
31
        with (obj_board_enemy_black_deer)
32
        {
33
            abouttoregaincontrol = true;
34
            hp = 1;
35
            maxhp = 1;
36
        }
37
        instance_create(x, y, obj_shake);
38
        snd_play(snd_impact);
39
        wall = instance_create(board_tilex(0), board_tiley(3), obj_board_puzzle_wall);
40
        wall.sprite_index = spr_board_door_right;
41
        wall.image_xscale = 2;
42
        wall.image_yscale = 2;
43
        wall.image_speed = 0.5;
44
        wall = instance_create(board_tilex(0), board_tiley(4), obj_board_puzzle_wall);
45
        wall.sprite_index = spr_board_door_right;
46
        wall.image_xscale = 2;
47
        wall.image_yscale = 2;
48
        wall.image_speed = 0.5;
49
        with (obj_board_puzzle_wall)
50
            
scr_depth_board
scr_depth_board

function
scr_depth_board()
{ depth = 1000000 - ((y * 10) + ((sprite_height - sprite_yoffset) * 10)); } function scr_board_depth() {
scr_depth_board();
}
();
51
    }
52
}
53
else
54
{
55
    if (pressinit == 1)
56
        snd_play_pitch(snd_noise, 1.1);
57
    pressinit = 0;
58
}