Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_dw_green_room_platter_Step_0

(view raw script w/o annotations or w/e)
1
scr_depth
scr_depth

function
scr_depth()
{ if (argument_count > 0) { with (argument0) depth = 100000 - ((y * 10) + (sprite_height * 10)); } else { depth = 100000 - ((y * 10) + (sprite_height * 10)); } }
();
2
if (mode == 0)
3
{
4
    if (con == 0 && myinteract == 1)
5
    {
6
        snd_play(snd_wing);
7
        lid = instance_create(x, y, obj_marker);
8
        lid.depth = depth - 100;
9
        lid.vspeed = -4 * multiplier;
10
        lid.friction = -0.2 * multiplier;
11
        lid.sprite_index = sprite_index;
12
        lid.image_speed = 0;
13
        lid.image_index = 2;
14
        lid.image_xscale = 2;
15
        lid.image_yscale = 2;
16
        image_index = 1;
17
        myinteract = 0;
18
        con = 1;
19
        makecontent = 0;
20
        if (content >= 2)
21
        {
22
            makecontent = 1;
23
            contentmarker = instance_create(x + xoffset, y + yoffset, obj_marker);
24
            contentmarker.depth = depth - 1;
25
            contentmarker.sprite_index = contentsprite;
26
            contentmarker.image_speed = 0.1 * multiplier;
27
            contentmarker.image_xscale = 2;
28
            contentmarker.image_yscale = 2;
29
        }
30
    }
31
}
32
if (mode == 1)
33
{
34
    if (con == 0 && myinteract == 1)
35
    {
36
        if (montyboss == 0 || montyboss == 1)
37
            snd_play(snd_wing);
38
        siner = 0;
39
        lid = instance_create(x, y, obj_marker);
40
        lid.depth = depth - 100;
41
        lid.sprite_index = sprite_index;
42
        lid.image_speed = 0;
43
        lid.image_index = 2;
44
        lid.image_xscale = 2;
45
        lid.image_yscale = 2;
46
        image_index = 1;
47
        myinteract = 0;
48
        con = 1;
49
        makecontent = 1;
50
        contentmarker = instance_create(x, y, obj_marker);
51
        contentmarker.sprite_index = spr_dw_green_room_tv_dinner;
52
        contentmarker.depth = depth - 1;
53
        contentmarker.image_speed = 0.1 * multiplier;
54
        contentmarker.image_xscale = 2;
55
        contentmarker.image_yscale = 2;
56
        var rand = irandom(99);
57
        if (rand == 1)
58
            contentmarker.sprite_index = spr_ch2_gimmick_saucer_dog;
59
    }
60
    if (con == 1)
61
    {
62
        done = 0;
63
        siner += 1;
64
        if (content == 1)
65
            height = sin(siner / (8 / multiplier)) * 60;
66
        else
67
            height = sin(siner / (15 / multiplier)) * 80;
68
        lid.y = lid.ystart - height;
69
        if (siner >= 10 && height <= 0)
70
        {
71
            if (montyboss == 0 || montyboss == 1)
72
                snd_play(snd_metalhit);
73
            height = 0;
74
            siner = 0;
75
            con = 0;
76
            myinteract = 0;
77
            lid.y = lid.ystart;
78
            image_index = 0;
79
            with (lid)
80
                instance_destroy();
81
            if (makecontent == 1)
82
            {
83
                with (contentmarker)
84
                    instance_destroy();
85
            }
86
        }
87
    }
88
}