Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b2enrichmentenclosure_Step_0

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

function
scr_board_populatevars()
{ if (!variable_instance_exists(id, "kris")) kris = 0; if (!variable_instance_exists(id, "susie")) susie = 0; if (!variable_instance_exists(id, "ralsei")) ralsei = 0; if (kris == 0) { with (obj_mainchara_board) { if (name == "kris") other.kris = id; } } if (ralsei == 0) { with (obj_mainchara_board) { if (name == "ralsei") other.ralsei = id; } } if (susie == 0) { with (obj_mainchara_board) { if (name == "susie") other.susie = id; } } }
();
2
scr_gameshow_populatevars
scr_gameshow_populatevars

function
scr_gameshow_populatevars()
{ if (!variable_instance_exists(id, "kr_real")) kr_real = 0; if (!variable_instance_exists(id, "su_real")) su_real = 0; if (!variable_instance_exists(id, "ra_real")) ra_real = 0; if (!variable_instance_exists(id, "tenna")) tenna = 0; if (kr_real == 0) { with (obj_mainchara) other.kr_real = id; } if (su_real == 0) { with (obj_caterpillarchara) { if (name == "susie") other.su_real = id; } } if (ra_real == 0) { with (obj_caterpillarchara) { if (name == "ralsei") other.ra_real = id; } } if (tenna == 0) { with (obj_actor_tenna) other.tenna = id; } }
();
3
if (active == 1)
4
{
5
    var flowerspot = stringsetloc(
Oh! A flower cut in half! This is a photo spot!
"Oh! A flower cut in half! This is a photo spot!", "obj_b2enrichmentenclosure_slash_Step_0_gml_42_0"
);
6
    var prettyflower = stringsetloc(
Oh!! A pretty flower!
"Oh!! A pretty flower!", "obj_b2enrichmentenclosure_slash_Step_0_gml_10_0"
);
7
    if (con == 0 && obj_board_camera.con == 0)
8
    {
9
        if (global.flag[1190 control_unjumble] == 0)
10
        {
11
            susie.controlled = 0;
12
            kris.controlled = 0;
13
            susie.controlled = 1;
14
            kris.camera = true;
15
            ralsei.controlled = 0;
16
            kris.allow_diagonals = false;
17
            obj_b2ralseichoose.con = 10;
18
            obj_b2ralseichoose.timer = 0;
19
            global.flag[1024 board_transitioning?] = 0;
20
            
scr_resetgameshowcharacter
scr_resetgameshowcharacter

function
scr_resetgameshowcharacter(arg0)
{ if (room == room_dw_puzzlecloset_3) exit; var _name = arg0; var _smooth = 0; var __found = 0; if (argument_count == 2) _smooth = argument1; if (_name == "kris" || _name == "kr" || _name == "k" || _name == "Kris" || _name == "Kr" || _name == "K" || _name == "all") { var _krx = 248; var _kry = 400; if (
scr_swordroom())
{ _krx = 300; _kry = 298; } with (obj_mainchara) { if (_smooth == 0) { setxy(_krx, _kry); } else {
scr_lerpvar("x", x, _krx, _smooth);
scr_lerpvar("y", y, _kry, _smooth);
} fun = true; ignoredepth = true; depth = 95240; sprite_index = spr_krisu_dark; image_speed = 0; image_index = 0; if (
scr_swordroom())
{ sprite_index = spr_krisu_holdcontroller; depth = 96260; }
scr_darksize();
__found = 1; } } if (_name == "susie" || _name == "su" || _name == "Susie" || _name == "Su" || _name == "S" || _name == "s" || _name == "all") { with (obj_caterpillarchara) { if (name == "susie") { fun = true; ignoredepth = true; depth = 95165; var _sux = 140; var _suy = 392; if (_smooth == 0) { setxy(_sux, _suy); } else {
scr_lerpvar("x", x, _sux, _smooth);
scr_lerpvar("y", y, _suy, _smooth);
} sprite_index = spr_susie_walk_up_dw; image_speed = 0; image_index = 0;
scr_darksize();
__found = 1; } } } if (_name == "ralsei" || _name == "ra" || _name == "Ralsei" || _name == "Ra" || _name == "R" || _name == "r" || _name == "all") { with (obj_caterpillarchara) { if (name == "ralsei") { fun = true; ignoredepth = true; depth = 95145; var _rax = 342; var _ray = 396; if (_smooth == 0) { setxy(_rax, _ray); } else {
scr_lerpvar("x", x, _rax, _smooth);
scr_lerpvar("y", y, _ray, _smooth);
} sprite_index = spr_ralsei_walk_up; image_speed = 0; image_index = 0;
scr_darksize();
__found = 1; } } } if (_name == "tenna" || _name == "Tenna" || _name == "te" || _name == "t" || _name == "Te" || _name == "T" || _name == "all") ...
("all");
21
            timer = 0;
22
            con = 1;
23
        }
24
        else
25
        {
26
            con = 20;
27
        }
28
    }
29
    if (con == 1)
30
    {
31
        timer++;
32
        if (timer == 15)
33
        {
34
            kriswobblecon = 1;
35
            
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("kris", 4, 3, 0);
36
            
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; }
(scr_pathfind_to_point, 15, "ralsei", 1, 3, 0);
37
            con = 1.1;
38
            timer = 0;
39
        }
40
    }
41
    if (con == 1.1)
42
    {
43
        if (
scr_board_checklocation
scr_board_checklocation

function
scr_board_checklocation()
{ var _name = argument0; var _xloc = argument1; var _yloc = argument2; if (_xloc < 12) _xloc = board_tilex(_xloc); if (_yloc < 12) _yloc = board_tiley(_yloc); var _tol = 4; if (argument_count == 4) _tol = argument3; var targ = 0; with (obj_mainchara_board) { if (name == _name) targ = id; } if (!i_ex(targ)) { debug_message("target does not exist"); return false; } if (abs(targ.x - _xloc) < _tol && abs(targ.y - _yloc) < _tol) return true; }
("kris", 4, 3, 2))
44
        {
45
            ratalkd = 1;
46
            var ratalk = flowerspot;
47
            if (ralseiknows == 0)
48
                ratalk = prettyflower;
49
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(ratalk, "ralsei", 2, 60);
50
            con = 1.2;
51
            timer = 0;
52
        }
53
    }
54
    if (con == 1.2)
55
    {
56
        timer++;
57
        if ((timer > 5 && button3_h()) || timer == 71)
58
        {
59
            with (obj_couchwriter)
60
                instance_destroy();
61
            var ratalk = stringsetloc(
Umm, h... how do you take a photo?
"Umm, h... how do you take a photo?", "obj_b2enrichmentenclosure_slash_Step_0_gml_47_0"
);
62
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(ratalk, "ralsei", 2, 60);
63
            timer = 0;
64
            con = 1.3;
65
        }
66
    }
67
    if (con == 1.3)
68
    {
69
        timer++;
70
        if ((timer > 5 && button3_h()) || timer == 71)
71
        {
72
            with (kris)
73
            {
74
                takephoto = false;
75
                canfreemove = false;
76
                var playxround = round(x / 32) * 32;
77
                var playyround = round(y / 32) * 32;
78
                playxround -= ((camwidth / 2) * 32);
79
                playyround -= ((camheight / 2) * 32);
80
                playxround = round(playxround / 32) * 32;
81
                playyround = round(playyround / 32) * 32;
82
                mycam = instance_create(playxround, playyround, obj_board_playercamera);
83
                mycam.camwidth = camwidth;
84
                mycam.camheight = camheight;
85
                mycam.controllable = false;
86
            }
87
            con = 1.4;
88
            timer = 0;
89
        }
90
    }
91
    if (con == 1.4)
92
    {
93
        timer++;
94
        if ((timer > 5 && button3_h()) || timer == 70)
95
        {
96
            with (obj_board_playercamera)
97
                event_user(1);
98
            con = 1.5;
99
            timer = 0;
100
        }
101
    }
102
    if (con == 1.5)
103
    {
104
        timer++;
105
        if ((timer > 5 && button3_h() && !i_ex(obj_board_playercamera)) || timer == 20)
106
        {
107
            var ratalk = stringsetloc(
Oops.
"Oops.", "obj_b2enrichmentenclosure_slash_Step_0_gml_74_0"
);
108
            
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(ratalk, "ralsei", 2, 60);
109
            timer = 0;
110
            con = 1.6;
111
        }
112
    }
113
    if (con == 1.6)
114
    {
115
        timer++;
116
        if ((timer > 5 && button3_h()) || timer == 60)
117
        {
118
            with (kris)
119
            {
120
                takephoto = false;
121
                canfreemove = false;
122
                var playxround = round(x / 32) * 32;
123
                var playyround = round(y / 32) * 32;
124
                playxround -= ((camwidth / 2) * 32);
125
                playyround -= ((camheight / 2) * 32);
126
                playxround = round(playxround / 32) * 32;
127
                playyround = round(playyround / 32) * 32;
128
                mycam = instance_create(playxround, playyround, obj_board_playercamera);
129
                mycam.camwidth = camwidth;
130
                mycam.camheight = camheight;
131
                mycam.controllable = false;
132
            }
133
            timer = 0;
134
            con = 1.7;
135
        }
136
    }
137
    if (con == 1.7)
138
    {
139
        timer++;
140
        var delaytime = 12;
141
        for (var i = 0; i < 6; i++)
142
        {
143
            if (timer == (20 + (delaytime * i)))
144
            {
145
                with (obj_board_playercamera)
146
                    remoted = true;
147
            }
148
        }
149
        if (timer == (20 + (delaytime * 7)))
150
        {
151
            with (obj_board_playercamera)
152
                remoter = true;
153
        }
154
        if (timer == (20 + round(delaytime * 7.5)))
155
        {
156
            with (obj_board_playercamera)
157
                event_user(1);
158
            timer = 0;
159
            con = 1.8;
160
        }
161
    }
162
    if (con == 1.8 && !i_ex(obj_board_playercamera))
163
    {
164
        var ratalk = stringsetloc(
Haha, look, I got it!
"Haha, look, I got it!", "obj_b2enrichmentenclosure_slash_Step_0_gml_119_0"
);
165
        
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(ratalk, "ralsei", 2, 70);
166
        timer = 0;
167
        con = 1.9;
168
    }
169
    if (con == 1.9)
170
    {
171
        timer++;
172
        if (timer == 50 || (timer > 5 && button3_h()))
173
        {
174
            
scr_play_recording
scr_play_recording

function
scr_play_recording(arg0, arg1)
{ with (obj_mainchara_board) { if (name == arg0) { susierecordcon = 2; susierecordcount = 0; susierecordstring = arg1; susierecordsave = false; } } }
("kris", "0D0D0D0D0D0D0D0D0D0D0W0W0W0R0R0R0R0R0R0R0R0W0W0W0W0W0W0W0W0D0D0D0D0D0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W0W");
175
            con = 2;
176
            timer = 0;
177
        }
178
    }
179
    if (con == 2)
180
    {
181
        timer++;
182
        if ((timer > 5 && button3_h()) || timer == 30)
183
        {
184
            if (button3_h())
185
                
scr_play_recording
scr_play_recording

function
scr_play_recording(arg0, arg1)
{ with (obj_mainchara_board) { if (name == arg0) { susierecordcon = 2; susierecordcount = 0; susierecordstring = arg1; susierecordsave = false; } } }
("kris", "00");
186
            timer = 0;
187
            con = 10;
188
        }
189
    }
190
    if (con == 10)
191
    {
192
        var ratalk = stringsetloc(
Taking photos is fun!
"Taking photos is fun!", "obj_b2enrichmentenclosure_slash_Step_0_gml_135_0"
);
193
        
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(ratalk, "ralsei", 2, 60);
194
        
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("kris", 0, 3, 3);
195
        timer = 0;
196
        con = 11;
197
    }
198
    if (con == 11 && 
scr_board_checklocation
scr_board_checklocation

function
scr_board_checklocation()
{ var _name = argument0; var _xloc = argument1; var _yloc = argument2; if (_xloc < 12) _xloc = board_tilex(_xloc); if (_yloc < 12) _yloc = board_tiley(_yloc); var _tol = 4; if (argument_count == 4) _tol = argument3; var targ = 0; with (obj_mainchara_board) { if (name == _name) targ = id; } if (!i_ex(targ)) { debug_message("target does not exist"); return false; } if (abs(targ.x - _xloc) < _tol && abs(targ.y - _yloc) < _tol) return true; }
("kris", 0, 3, 2))
199
    {
200
        timer++;
201
        if (timer == 4)
202
        {
203
            global.interact = 1;
204
            with (obj_mainchara_board)
205
                controlled = 0;
206
            kris.controlled = 1;
207
            obj_board_camera.shift = "left";
208
            con = 12;
209
            timer = 0;
210
        }
211
    }
212
    if (con == 20)
213
    {
214
        if (ratalkd == 0)
215
        {
216
            rtim++;
217
            if (rtim == 40)
218
            {
219
                ratalkd = 1;
220
                var ratalk = flowerspot;
221
                if (ralseiknows == 0)
222
                    ratalk = prettyflower;
223
                
scr_couchtalk
scr_couchtalk

function scr_couchclear(arg0) { with (obj_couchwriter) { if (speaker == arg0) instance_destroy(); } } function
scr_couchtalk(arg0, arg1)
{ var ix = -1; var iy = -1; if (argument_count >= 6) { ix = argument4; iy = argument5; } var couchtext = instance_create_depth(ix, iy, 5000, obj_couchwriter); couchtext.mystring = arg0; couchtext.speaker = arg1; if (argument_count >= 3) couchtext.cleartext = argument2; if (argument_count >= 4) couchtext.drawtime = argument3; if (argument_count >= 7) couchtext.customsnd = argument6; if (argument_count >= 8) couchtext.customcolor = argument7; if (argument_count >= 9) couchtext.talkrate = argument8; if (argument_count >= 10) couchtext.talklength = argument9; return couchtext; }
(ratalk, "ralsei", 2, 60);
224
            }
225
        }
226
        if (suwalk == 0 && obj_board_camera.con == 0)
227
        {
228
            suwalktimer++;
229
            if (suwalktimer == 1)
230
                ralsei.follow = true;
231
            if (suwalktimer == 18)
232
            {
233
                
scr_pathfind_to_point
scr_pathfind_to_point

function
scr_pathfind_to_point(arg0, arg1, arg2)
{ var __destx = arg1 + 16; var __desty = arg2 + 16; if (arg1 < 12 && arg2 < 8) { __destx = 128 + (32 * arg1) + 16; __desty = 64 + (32 * arg2) + 16; } with (obj_mainchara_board) { if (name == arg0) { path_end(); is_moving_timer = 0; is_moving = true; path_target_x = __destx; path_target_y = __desty; follow = false; if (argument_count == 4) { if (argument3 != -1) path_end_facing = argument3; } if (argument_count == 5) { if (argument4 != -1) allow_diagonals = argument4; } } } }
("susie",
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(irandom_range(200, 312)),
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(irandom_range(156, 222)), 0);
234
                susie.sleepy = true;
235
                suwalktimer = 0;
236
                suwalk = 1;
237
            }
238
        }
239
    }
240
}
241
else
242
{
243
    if (con == 12)
244
        con = 20;
245
    suwalk = 0;
246
    suwalktimer = 0;
247
    rtim = 0;
248
}