Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_dw_teevie_shuttahmaze_Step_0

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    depth = treasure.depth - 1;
4
    init = 1;
5
    if (didviolence)
6
    {
7
        with (obj_dw_teevie_cameras_cheer)
8
            instance_destroy();
9
        with (obj_trigger)
10
            extflag = "nah";
11
        safe_delete(treasure);
12
        safe_delete(treasuresolid);
13
    }
14
}
15
var audtrig = 0;
16
with (obj_trigger)
17
{
18
    if (extflag == "topleftCrowd" || extflag == "botRightCrowd")
19
    {
20
        if (place_meeting(x, y, obj_mainchara))
21
            audtrig = 1;
22
    }
23
}
24
with (obj_dw_teevie_cameras_cheer)
25
{
26
    if (extflag == "a" || extflag == "botRightCrowd")
27
        active = audtrig;
28
}
29
if (audtrig)
30
{
31
    if (cheer == 0)
32
    {
33
        cheervol = 1;
34
        cheer = snd_loop(snd_crowd_cheer_loop);
35
        snd_volume(cheer, cheervol, 0);
36
    }
37
    else
38
    {
39
        cheervol = lerp(cheervol, 1, 0.25);
40
        snd_volume(cheer, cheervol, 0);
41
    }
42
}
43
else if (cheer != 0)
44
{
45
    cheervol = lerp(cheervol, 0, 0.125);
46
    snd_volume(cheer, cheervol, 0);
47
}
48
if (laughcon == 0)
49
{
50
    var trig = 0;
51
    with (obj_mainchara)
52
    {
53
        if (x >= 1530 && y <= 400)
54
            trig = 1;
55
    }
56
    if (trig == 1)
57
    {
58
        global.flag[1005 found_maze_crowd] = 1;
59
        laughcon = 1;
60
    }
61
}
62
if (laughcon == 1)
63
{
64
    var trig = 0;
65
    with (obj_trigger)
66
    {
67
        if (extflag == "laughingRightCrowd")
68
        {
69
            if (place_meeting(x, y, obj_mainchara))
70
                trig = 1;
71
        }
72
    }
73
    with (obj_dw_teevie_cameras_cheer)
74
    {
75
        if (extflag == "b")
76
            active = trig;
77
    }
78
    if (trig)
79
    {
80
        if (boo == 0)
81
        {
82
            boovol = 1;
83
            boo = snd_loop(snd_crowd_ooh);
84
            snd_volume(boo, boovol, 0);
85
        }
86
        else
87
        {
88
            boovol = lerp(boovol, 1, 0.25);
89
            snd_volume(boo, boovol, 0);
90
        }
91
    }
92
    else if (boo != 0)
93
    {
94
        boovol = lerp(boovol, 0, 0.125);
95
        snd_volume(boo, boovol, 0);
96
    }
97
}
98
if (con == 0)
99
{
100
    var trig = 0;
101
    with (obj_triggervolume)
102
    {
103
        if (extflag == 2)
104
        {
105
            if (place_meeting(x, y, obj_mainchara))
106
                trig = 1;
107
        }
108
    }
109
    if (trig == 1 && global.flag[encounterflag] != 1)
110
        con = 1;
111
}
112
if (con == 1)
113
{
114
    con = 2;
115
    timer = 0;
116
    var time = 12;
117
    var endx = 850;
118
    var endy = 302;
119
    zap1 = instance_create(770, 426, obj_enemy_marker);
120
    with (zap1)
121
    {
122
        image_speed = 0;
123
        image_index = 4;
124
        image_blend = c_black;
125
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
126
        sprite_index = spr_zapper_jump_noshadow;
127
        lsprite = spr_zapper_jump_noshadow;
128
        rsprite = spr_zapper_jump_noshadow_right;
129
        specialfacings = true;
130
        snd_play(snd_jump);
131
        
scr_lerp_imageblend
scr_lerp_imageblend

function
scr_lerp_imageblend()
{ var lerpblend = instance_create(x, y, obj_lerpimageblend); lerpblend.target = argument0; lerpblend.color1 = argument1; lerpblend.color2 = argument2; var ___time = argument3; if (argument_count > 4) { var _style = argument4; var _ease = argument5; lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time, _style, _ease); } else { lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time); } with (lerpblend) alarm_set(0, ___time); return lerpblend; }
(id, c_black, c_white, time, 2, "out");
132
        
scr_jump_to_point
scr_jump_to_point

function
scr_jump_to_point(arg0, arg1, arg2, arg3, arg4 = 0)
{ var ___jump =
scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0);
with (___jump) { trackalpha = arg4; trackblend = arg4; trackindex = arg4; tracksprite = arg4; } return ___jump; }
(endx, endy, 30, time, 1);
133
        scr_delay_var("image_index", 5, time);
134
        scr_delay_var("image_index", 6, time + 1);
135
        scr_delay_var("image_index", 7, time + 3);
136
        scr_delay_var("image_index", 8, time + 5);
137
    }
138
    endx = 454;
139
    zap2 = instance_create(546, 584, obj_enemy_marker);
140
    with (zap2)
141
    {
142
        image_speed = 0;
143
        image_index = 4;
144
        image_blend = c_black;
145
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
146
        sprite_index = spr_zapper_jump_noshadow;
147
        lsprite = spr_zapper_jump_noshadow;
148
        rsprite = spr_zapper_jump_noshadow_right;
149
        specialfacings = true;
150
        
scr_lerp_imageblend
scr_lerp_imageblend

function
scr_lerp_imageblend()
{ var lerpblend = instance_create(x, y, obj_lerpimageblend); lerpblend.target = argument0; lerpblend.color1 = argument1; lerpblend.color2 = argument2; var ___time = argument3; if (argument_count > 4) { var _style = argument4; var _ease = argument5; lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time, _style, _ease); } else { lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time); } with (lerpblend) alarm_set(0, ___time); return lerpblend; }
(id, c_black, c_white, time, 2, "in");
151
        
scr_jump_to_point
scr_jump_to_point

function
scr_jump_to_point(arg0, arg1, arg2, arg3, arg4 = 0)
{ var ___jump =
scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0);
with (___jump) { trackalpha = arg4; trackblend = arg4; trackindex = arg4; tracksprite = arg4; } return ___jump; }
(endx, endy, 30, time, 1);
152
        scr_delay_var("image_index", 5, time);
153
        scr_delay_var("image_index", 6, time + 1);
154
        scr_delay_var("image_index", 7, time + 3);
155
        scr_delay_var("image_index", 8, time + 5);
156
    }
157
    scr_delay_var("maketrig", 1, time + 1);
158
    scr_delay_var("con", 3, time + 6);
159
}
160
if (maketrig == true)
161
{
162
    maketrig = false;
163
    zap1t = instance_create(x, y, obj_board_trigger);
164
    zap2t = instance_create(x, y, obj_board_trigger);
165
    if (
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
166
    {
167
    }
168
}
169
if (con == 3)
170
{
171
    var movespeed = 18;
172
    var pausetime = 4;
173
    if (global.interact == 0)
174
    {
175
        timer++;
176
        if (timer == (1 + ((movespeed + pausetime) * 1)))
177
        {
178
            movejump(zap1, 3, movespeed);
179
            movejump(zap2, 0, movespeed);
180
        }
181
        if (timer == (1 + ((movespeed + pausetime) * 2)))
182
        {
183
            movejump(zap1, 0, movespeed);
184
            movejump(zap2, 1, movespeed);
185
        }
186
        if (timer == (1 + ((movespeed + pausetime) * 3)))
187
        {
188
            movejump(zap1, 0, movespeed);
189
            movejump(zap2, 1, movespeed);
190
        }
191
        if (timer == (1 + ((movespeed + pausetime) * 4)))
192
        {
193
            movejump(zap1, 3, movespeed);
194
            movejump(zap2, 0, movespeed);
195
        }
196
        if (timer == (1 + ((movespeed + pausetime) * 5)))
197
        {
198
            movejump(zap1, 2, movespeed);
199
            movejump(zap2, 3, movespeed);
200
        }
201
        if (timer == (1 + ((movespeed + pausetime) * 6)))
202
        {
203
            movejump(zap1, 1, movespeed);
204
            movejump(zap2, 2, movespeed);
205
        }
206
        if (timer == (1 + ((movespeed + pausetime) * 7)))
207
        {
208
            movejump(zap1, 1, movespeed);
209
            movejump(zap2, 2, movespeed);
210
        }
211
        if (timer == (1 + ((movespeed + pausetime) * 8)))
212
        {
213
            movejump(zap1, 2, movespeed);
214
            movejump(zap2, 3, movespeed);
215
            timer = 0;
216
        }
217
    }
218
}
219
if (con == 4)
220
{
221
    timer++;
222
    if (timer == 1)
223
    {
224
        with (obj_lerpvar)
225
        {
226
            if (target == other.zap1)
227
                instance_destroy();
228
        }
229
        with (obj_lerpvar)
230
        {
231
            if (target == other.zap2)
232
                instance_destroy();
233
        }
234
        snd_play(snd_tensionhorn);
235
        snd_play_delay(snd_tensionhorn, 8, 1, 1.1);
236
    }
237
    if (timer == 30)
238
    {
239
        var sourcezap = zap1;
240
        if (trigd == 2)
241
            sourcezap = zap2;
242
        zapmarker = 
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1)
{ var thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; }
(sourcezap.x, sourcezap.y, sourcezap.lsprite, 2, 2, 0, 0, c_white, 0);
243
        sourcezap.visible = false;
244
        global.flag[54 encounter_pointer] = encounterflag;
245
        encounterno = 118;
246
        if (global.flag[656 recruit_zapper] == 0)
247
            encounterno = 112;
248
        
scr_battle
scr_battle

function
scr_battle(arg0, arg1, arg2, arg3, arg4)
{ global.specialbattle = arg1; global.encounterno = arg0; if (global.flag[9 battle_music] != 2) { global.flag[9 battle_music] = 1; var batmusic = "battle.ogg"; if (global.chapter == 3) { if (global.encounterno == 111 && room == room_board_2) batmusic = "rudebuster_boss.ogg"; if (room == room_dw_b3bs_watercooler || room == room_dw_teevie_watercooler || room == room_dw_b3bs_zapper_b || room == room_dw_ranking_c) batmusic = "battle_vapor.ogg"; if (room == room_dw_teevie_chef) batmusic = "rouxls_battle.ogg"; } global.batmusic[0] = snd_init(batmusic); mus_volume(global.batmusic[1], 1, 0); } instance_create(0, 0, obj_battleback); instance_create(0, 0, obj_encounterbasic); __enemymarker[0] = arg2; __enemymarker[1] = arg3; __enemymarker[2] = arg4; for (__ien = 0; __ien < 3; __ien++) { if (global.monstertype[__ien] != 0(None)) { if (!i_ex(__enemymarker[__ien])) { __enemymarker[__ien] =
scr_dark_marker(global.monstermakex[__ien] + 300, global.monstermakey[__ien], object_get_sprite(global.monsterinstancetype[__ien]));
__enemymarker[__ien].depth = -__ien; } __enemymarker[__ien].__ien = __ien; with (__enemymarker[__ien]) { if (global.monstertype[other.__ien] == 103Tenna) { x = camerax() + 510; y = cameray() + 288;
scr_move_to_point_over_time(camerax() + 526, cameray() + 260, 20);
sprite_index = spr_tenna_point_up; } else if (global.monstertype[other.__ien] == 104Knight) { with (obj_ch3_PTB02_roaringknight) stopsiner2 = true;
scr_move_to_point_over_time(global.monstermakex[__ien], obj_ch3_PTB02_roaringknight.ystart + (cos(obj_ch3_PTB02_roaringknight.siner2 / 8) * 8), 20);
} else {
scr_move_to_point_over_time(global.monstermakex[__ien], global.monstermakey[__ien], 20);
} __doom = instance_create(x, y, obj_doom); __doom.target = id; __doom.alarm[0] = 25; } } } }
(encounterno, 0, zapmarker);
249
    }
250
    if (timer == 31)
251
    {
252
        safe_delete(zap1);
253
        safe_delete(zap2);
254
        safe_delete(zap1t);
255
        safe_delete(zap2t);
256
    }
257
}
258
if (i_ex(treasure))
259
{
260
    depth = treasure.depth - 1;
261
    if (trcon == 0)
262
    {
263
        if (treasure.myinteract == 3)
264
        {
265
            global.flag[1004 got_crowd_treasure] = 1;
266
            trtimer = 0;
267
            trcon = 1;
268
            snd_play(snd_locker);
269
            treasure.image_index = 1;
270
        }
271
    }
272
    if (trcon == 1)
273
    {
274
        trtimer++;
275
        if (trtimer == 5)
276
        {
277
            var snd = 358;
278
            snd_stop(snd);
279
            snd_play_x(snd, 1, 1.2);
280
            
scr_lerp_imageblend
scr_lerp_imageblend

function
scr_lerp_imageblend()
{ var lerpblend = instance_create(x, y, obj_lerpimageblend); lerpblend.target = argument0; lerpblend.color1 = argument1; lerpblend.color2 = argument2; var ___time = argument3; if (argument_count > 4) { var _style = argument4; var _ease = argument5; lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time, _style, _ease); } else { lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time); } with (lerpblend) alarm_set(0, ___time); return lerpblend; }
(id, c_black, c_white, 10);
281
            
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; }
("tralpha", 0, 1, 4);
282
            
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; }
("trscale", 0, 1, 18, -1, "out");
283
        }
284
        if (trtimer == 48)
285
        {
286
            trcon = 2;
287
            trtimer = 0;
288
        }
289
    }
290
    if (trcon == 2)
291
    {
292
        audtrig = 0;
293
        with (obj_trigger)
294
        {
295
            if (extflag == "treasureBottomLeft")
296
            {
297
                if (place_meeting(x, y, obj_mainchara))
298
                    audtrig = 1;
299
            }
300
        }
301
        with (obj_dw_teevie_cameras_cheer)
302
        {
303
            if (extflag == "c")
304
                active = audtrig;
305
        }
306
        if (audtrig)
307
        {
308
            if (cheer2 == 0)
309
            {
310
                cheer2vol = 1;
311
                cheer2 = snd_loop(snd_crowd_cheer_loop);
312
                snd_volume(cheer2, cheer2vol, 0);
313
            }
314
            else
315
            {
316
                cheer2vol = lerp(cheer2vol, 1, 0.25);
317
                snd_volume(cheer2, cheer2vol, 0);
318
            }
319
        }
320
        else if (cheer2 != 0)
321
        {
322
            cheer2vol = lerp(cheer2vol, 0, 0.125);
323
            snd_volume(cheer2, cheer2vol, 0);
324
        }
325
    }
326
}