Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_board_writer_Step_0

(view raw script w/o annotations or w/e)
1
var cy = cameray();
2
var cx = camerax();
3
if (init == 0)
4
{
5
    if (side == -1)
6
    {
7
        side = 0;
8
        if (instance_exists(obj_dw_churchb_man))
9
        {
10
            depth = 5000;
11
            if (i_ex(obj_mainchara))
12
            {
13
                if (obj_mainchara.y > 250)
14
                    side = 0;
15
                else
16
                    side = 1;
17
            }
18
        }
19
    }
20
    if (side == 0)
21
    {
22
        y = cy + -80;
23
        endy = cy + 48 + yoff;
24
    }
25
    if (side == 1)
26
    {
27
        y = cy + 346;
28
        endy = cy + 218 + yoff;
29
    }
30
    x = cx + 128 + xoff;
31
    if (instance_exists(obj_dw_churchb_man))
32
    {
33
        movespeed = 16;
34
        if (side == 0)
35
        {
36
            y = (cy + 16) - 96;
37
            endy = cy + 16;
38
        }
39
        if (side == 1)
40
        {
41
            y = cy + 480;
42
            endy = (cy + 480) - 128;
43
        }
44
        x = cx + 128 + xoff;
45
    }
46
    init = 1;
47
    con = 1;
48
    if (skip == 0)
49
    {
50
        if (boardopensound == true)
51
            snd_play_x(snd_board_lift, 0.5, 1.2);
52
    }
53
    if (skip == 1)
54
    {
55
        y = endy;
56
        con = 2;
57
    }
58
}
59
if (con == 1)
60
{
61
    if (side == 1)
62
    {
63
        if (y > endy)
64
        {
65
            y -= movespeed;
66
        }
67
        else
68
        {
69
            y = endy;
70
            con = 2;
71
        }
72
    }
73
    if (side == 0)
74
    {
75
        if (y < endy)
76
        {
77
            y += movespeed;
78
        }
79
        else
80
        {
81
            y = endy;
82
            con = 2;
83
        }
84
    }
85
}
86
if (con == 2)
87
{
88
    global.typer = 100;
89
    global.fc = 0;
90
    global.msc = 0;
91
    if (mymessage != -1)
92
        global.msg[0] = mymessage;
93
    writer = instance_create(x + 16 + 2, (y + 30) - 2, obj_writer);
94
    writer.reachedend_sound = reachedend_sound;
95
    writer.reachedend_sound_play = reachedend_sound_play;
96
    writer.textsound = textsound;
97
    writer.mycolor = textcolor;
98
    writer.skippable = skippable;
99
    writer.noiseskip = noiseskip;
100
    writer.rate = rate;
101
    writer.depth = depth - 5;
102
    con = 3;
103
}
104
if (con == 3)
105
{
106
    if (!i_ex(writer))
107
    {
108
        if (stay > 0)
109
        {
110
            stayer = instance_create_depth(x, y, depth + 1, obj_board_writer_stay);
111
            stayer.boxcolor = boxcolor;
112
            
scr_doom
scr_doom

function
scr_doom(arg0 = id, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; persistent = arg0.persistent; } }
(stayer, stay);
113
        }
114
        instance_destroy();
115
    }
116
}