Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_writer_Step_0

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

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(stayer, stay);
122
        }
123
        instance_destroy();
124
    }
125
}