Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_playercamera_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
if (obj_board_camera.con != 0)
3
    instance_destroy();
4
if (init == 0)
5
{
6
    with (obj_mainchara_board)
7
    {
8
        if (name == "kris")
9
            other.kris = id;
10
    }
11
    kris.canfreemove = 0;
12
    init = 1;
13
}
14
if (instance_exists(kris))
15
{
16
    if (kris.iframes > 0)
17
        _end = 99;
18
}
19
if (con == 0 && global.interact == 0)
20
{
21
    if (controllable)
22
    {
23
        if (up_h() || remoteu)
24
            uholdbuff++;
25
        else
26
            uholdbuff = -1;
27
        if (down_h() || remoted)
28
            dholdbuff++;
29
        else
30
            dholdbuff = -1;
31
        if (left_h() || remotel)
32
            lholdbuff++;
33
        else
34
            lholdbuff = -1;
35
        if (right_h() || remoter)
36
            rholdbuff++;
37
        else
38
            rholdbuff = -1;
39
        if (up_h() && down_h())
40
        {
41
            dholdbuff = -1;
42
            uholdbuff = -1;
43
        }
44
        if (left_h() && right_h())
45
        {
46
            lholdbuff = -1;
47
            rholdbuff = -1;
48
        }
49
    }
50
    else
51
    {
52
        if (remoteu)
53
            uholdbuff++;
54
        else
55
            uholdbuff = -1;
56
        if (remoted)
57
            dholdbuff++;
58
        else
59
            dholdbuff = -1;
60
        if (remotel)
61
            lholdbuff++;
62
        else
63
            lholdbuff = -1;
64
        if (remoter)
65
            rholdbuff++;
66
        else
67
            rholdbuff = -1;
68
    }
69
    buffmodrate = 2;
70
    if ((dholdbuff % buffmodrate) == 0)
71
    {
72
        y += 16;
73
        snd_stop(snd_menumove);
74
        snd_play_x(snd_menumove, 0.5, 1.1);
75
    }
76
    if ((uholdbuff % buffmodrate) == 0)
77
    {
78
        y -= 16;
79
        snd_stop(snd_menumove);
80
        snd_play_x(snd_menumove, 0.5, 1.2);
81
    }
82
    if ((lholdbuff % buffmodrate) == 0)
83
    {
84
        x -= 16;
85
        snd_stop(snd_menumove);
86
        snd_play_x(snd_menumove, 0.5, 1.1);
87
    }
88
    if ((rholdbuff % buffmodrate) == 0)
89
    {
90
        x += 16;
91
        snd_stop(snd_menumove);
92
        snd_play_x(snd_menumove, 0.5, 1.2);
93
    }
94
    if (controllable)
95
    {
96
        if (button2_p())
97
            _end = 99;
98
        else if (button1_p())
99
            event_user(1);
100
    }
101
}
102
if (con == 1)
103
{
104
    timer++;
105
    if (timer == 1)
106
    {
107
        if (i_ex(ralsei))
108
        {
109
            memralfun = ralsei.fun;
110
            memralspr = ralsei.sprite_index;
111
            ralsei.fun = true;
112
        }
113
        if (i_ex(susie))
114
        {
115
            memsusfun = susie.fun;
116
            memsusspr = susie.sprite_index;
117
            susie.fun = true;
118
        }
119
        if (i_ex(kris))
120
        {
121
            memkrsfun = kris.fun;
122
            memkrsspr = kris.sprite_index;
123
            kris.fun = true;
124
        }
125
    }
126
    var shutterwait = 1;
127
    var closetime = 4;
128
    var opentime = 3;
129
    var closepause = 3;
130
    var photowaittime = 15;
131
    if (timer == 1)
132
        camshot = true;
133
    if (timer == shutterwait)
134
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("rectprog", 0, 1, closetime);
135
    if (timer == (shutterwait + closetime))
136
        event_user(0);
137
    if (timer == (shutterwait + closepause + closetime))
138
    {
139
        
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("rectprog", 1, 0, opentime);
140
        kris.canfreemove = 0;
141
    }
142
    if (createphoto)
143
    {
144
        if (timer == ((shutterwait + closepause + closetime + opentime) - 1))
145
        {
146
        }
147
        if (timer == 61)
148
        {
149
            var photox = (x + ((camwidth / 2) * 32)) - 16;
150
            var photoy = (y + ((camheight / 2) * 32)) - 16;
151
            photo = 
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(photox, photoy, spr_board_photo, 0, depth + 1, 2);
152
            with (photo)
153
            {
154
                var starcount = 16;
155
                for (var i = 0; i < starcount; i++)
156
                {
157
                    var star = 
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(x, y, spr_board_star_8px, 0, depth + 1);
158
                    with (star)
159
                    {
160
                        direction = (i / starcount) * 360;
161
                        speed = 20;
162
                        friction = 0.1;
163
                        image_index = irandom(3);
164
                        
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 15);
165
                    }
166
                }
167
            }
168
            timer = -15;
169
            cameraframe = false;
170
            con++;
171
        }
172
    }
173
    else if (timer == 21)
174
    {
175
        _end = true;
176
    }
177
}
178
if (con == 2)
179
{
180
    timer++;
181
    if (timer == 5)
182
    {
183
        if (i_ex(kris))
184
        {
185
            kris.fun = true;
186
            kris.facing = 0;
187
            kris.sprite_index = kris.dsprite_item;
188
            var _kris = kris;
189
            with (photo)
190
            {
191
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("x", x, _kris.x, 5, 2, "in");
192
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("y", y, _kris.y - 32, 5, 2, "out");
193
            }
194
        }
195
    }
196
    if (timer == 20)
197
    {
198
        snd_play(snd_link_sfx_itemget);
199
        makestars = true;
200
    }
201
    var photodescendtime = 6;
202
    if (timer == 50)
203
    {
204
        photo.depth = kris.depth;
205
        with (photo)
206
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpvar_respect() { if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("y", y, y + 30, photodescendtime, 2, "out");
207
        
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(photo, photodescendtime);
208
    }
209
    if (timer == ((60 + photodescendtime) - 10))
210
        _end = true;
211
}
212
if (_end)
213
{
214
    if (i_ex(kris))
215
    {
216
        kris.fun = 0;
217
        kris.canfreemove = true;
218
    }
219
    if (_end != 99)
220
    {
221
        if (i_ex(susie))
222
        {
223
            susie.fun = memsusfun;
224
            susie.sprite_index = memsusspr;
225
        }
226
        if (i_ex(ralsei))
227
        {
228
            ralsei.fun = memralfun;
229
            ralsei.sprite_index = memralspr;
230
        }
231
    }
232
    if (flagtoset != 0)
233
    {
234
        global.flag[flagtoset] = 1;
235
        with (obj_b2pantheonentrance)
236
            flagtoset = other.flagtoset;
237
        var photocount = global.flag[1041 got_half_flower] + global.flag[1042 got_spring_photo] + global.flag[1043 got_cactus_photo] + global.flag[1227 got_antlion_photo];
238
        if (global.flag[1022 tenna_board_absent] == 1)
239
            notalk = true;
240
        var tetalk = stringsetloc(
You got SPECIAL PHOTO! Just 2 more!!!
"You got SPECIAL PHOTO! Just 2 more!!!", "obj_board_playercamera_slash_Step_0_gml_290_0"
);
241
        if (photocount == 2)
242
            tetalk = stringsetloc(
Another SPECIAL PHOTO! Just 1 more!!!
"Another SPECIAL PHOTO! Just 1 more!!!", "obj_board_playercamera_slash_Step_0_gml_290_0_b"
);
243
        if (photocount == 3)
244
            tetalk = stringsetloc(
Three SPECIAL PHOTOs! Head back to KODAKODA SHRINE...
"Three SPECIAL PHOTOs! Head back to KODAKODA SHRINE...", "obj_board_playercamera_slash_Step_0_gml_287_0"
);
245
        if (photocount == 4)
246
            tetalk = stringsetloc(
A FOURTH SPECIAL PHOTO?! Unbelievable!!!
"A FOURTH SPECIAL PHOTO?! Unbelievable!!!", "obj_board_playercamera_slash_Step_0_gml_292_0"
);
247
        if (flagtoset != 0)
248
        {
249
            if (notalk == false)
250
            {
251
                with (obj_actor_tenna)
252
                    bounce = 1;
253
                
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; }
(tetalk, "tenna", 2, 120);
254
            }
255
        }
256
    }
257
    for (var i = 0; i < array_length(photoarray); i++)
258
    {
259
        if (i_ex(photoarray[i]))
260
            photoarray[i].frozen = false;
261
    }
262
    instance_destroy();
263
}
264
if (makestars == true && i_ex(photo))
265
{
266
    var stardepth = kris.depth + 1;
267
    makestarstimer++;
268
    if ((makestarstimer % 2) == 0)
269
    {
270
        var star = 
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(photo.x, photo.y, spr_board_star_8px, 0, stardepth);
271
        with (star)
272
        {
273
            direction = other.makestarstimer * 20;
274
            speed = 5;
275
            friction = 0.25;
276
            image_index = irandom(3);
277
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, random_range(13, 16));
278
        }
279
        star = 
scr_board_marker
scr_board_marker

function
scr_board_marker()
{ var _thismarker = instance_create(argument0, argument1, obj_board_marker); _thismarker.sprite_index = argument2; _thismarker.image_xscale = 2; _thismarker.image_yscale = 2; if (argument_count >= 4) _thismarker.image_speed = argument3; if (argument_count >= 5) { if (argument4 != -1) _thismarker.depth = argument4; } if (argument_count >= 6) _thismarker.image_xscale = argument5; if (argument_count >= 6) _thismarker.image_yscale = argument5; if (argument_count >= 7) _thismarker.animateonce = argument6; return _thismarker; }
(photo.x, photo.y, spr_board_star_8px, 0, stardepth);
280
        with (star)
281
        {
282
            direction = (other.makestarstimer * 20) + 180;
283
            speed = 5;
284
            friction = 0.25;
285
            image_index = irandom(3);
286
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, random_range(13, 16));
287
        }
288
    }
289
    if (makestarstimer >= 16)
290
        makestars = false;
291
}
292
remoted = 0;
293
remoteu = 0;
294
remotel = 0;
295
remoter = 0;