Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_churchc_treasurechest_Step_0

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

function
scr_populatechars()
{ if (!variable_instance_exists(id, "kris")) kris = 0; if (!variable_instance_exists(id, "ralsei")) ralsei = 0; if (!variable_instance_exists(id, "susie")) susie = 0; if (!variable_instance_exists(id, "noelle")) noelle = 0; if (kris == 0) { with (obj_mainchara) other.kris = id; } if (susie == 0) { with (obj_caterpillarchara) { if (name == "susie") other.susie = id; } } if (ralsei == 0) { with (obj_caterpillarchara) { if (name == "ralsei") other.ralsei = id; } } if (noelle == 0) { with (obj_caterpillarchara) { if (name == "noelle") other.noelle = id; } } }
();
2
if (!init)
3
{
4
    with (obj_treasure_room)
5
        image_blend = c_black;
6
    if (global.flag[1595] == 0)
7
    {
8
        var block = scr_genmarker("hideaway");
9
        solidarea = instance_create(block.x, block.y, obj_solidblock);
10
        with (solidarea)
11
        {
12
            sprite_index = block.sprite_index;
13
            
scr_sizeexact
scr_sizeexact

function
scr_sizeexact(arg0, arg1, arg2 = id)
{ with (arg2) { if (!sprite_exists(sprite_index)) { debug_message("Can't size, no sprite"); exit; } var _w = sprite_get_width(sprite_index); var _h = sprite_get_width(sprite_index); image_xscale = arg0 / _w; image_yscale = arg1 / _h; } }
(block.sprite_width, block.sprite_height);
14
            depth = layer_get_depth("RIPPLEWALLS");
15
            visible = true;
16
            image_blend = c_black;
17
        }
18
        var pos = scr_genmarker("switchloc");
19
        floorswitch = instance_create(pos.x, pos.y, obj_dw_church_glowtile);
20
        floorswitch.doripple = false;
21
    }
22
    init = 1;
23
}
24
if (i_ex(floorswitch))
25
{
26
    with (floorswitch)
27
    {
28
        if (pressed)
29
        {
30
            snd_play(snd_churchbell_long, 1, 1);
31
            with (other.solidarea)
32
            {
33
                
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
34
                instance_destroy();
35
            }
36
            global.flag[1595] = 1;
37
            scr_fancy_ripple_alt(x, y, 270, 65535, 2500, 1, 15, 1999980, undefined, undefined, undefined, 1);
38
            scr_fancy_ripple_alt(x, y, 270, 65535, 2300, 1, 15, 1999980, undefined, undefined, undefined, 1);
39
            scr_fancy_ripple_alt(x, y, 270, 65535, 2100, 1, 15, 1999980, undefined, undefined, undefined, 1);
40
            scr_fancy_ripple_alt(x, y, 270, 65535, 1900, 1, 15, 1999980, undefined, undefined, undefined, 1);
41
            scr_fancy_ripple_alt(x, y, 270, 65535, 1700, 1, 15, 1999980, undefined, undefined, undefined, 1);
42
            scr_fancy_ripple_alt(x, y, 270, 65535, 1500, 1, 15, 1999980, undefined, undefined, undefined, 1);
43
            scr_fancy_ripple_alt(x, y, 270, 65535, 1300, 1, 15, 1999980, undefined, undefined, undefined, 1);
44
            scr_fancy_ripple_alt(x, y, 270, 65535, 1100, 1, 15, 1999980, undefined, undefined, undefined, 1);
45
            scr_fancy_ripple_alt(x, y, 270, 65535, 900, 1, 15, 1999980, undefined, undefined, undefined, 1);
46
            scr_fancy_ripple_alt(x, y, 270, 65535, 700, 1, 15, 1999980, undefined, undefined, undefined, 1);
47
            other.con = 1;
48
            instance_destroy();
49
        }
50
    }
51
}
52
if (con == 1)
53
{
54
    timer++;
55
    if (timer == 200)
56
        con = 2;
57
}