Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b3bs_zapper_b_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    if (stealth.alert == 2)
4
    {
5
        global.interact = 1;
6
        con = 1;
7
        timer = 0;
8
        debug_print("caught time");
9
    }
10
}
11
if (con == 1)
12
{
13
    headct[0] = 0;
14
    var headrange = 50;
15
    with (obj_dw_ch3_b3bs_zapperhead)
16
    {
17
        if (x > (camerax() + headrange) && x < ((camerax() + 640) - headrange))
18
            array_push(other.headct, id);
19
    }
20
    array_delete(headct, 0, 1);
21
    show_debug_message(string(headct));
22
    head = headct[irandom_range(0, array_length(headct) - 1)];
23
    zapper = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(head.x + 64, head.y - 36, spr_zapper_jump_noshadow);
24
    with (zapper)
25
        
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; }
("image_index", 0, 4, 7);
26
    zapper.vspeed = -36;
27
    zapper.gravity = 2;
28
    zapper.image_xscale = -2;
29
    zapper.image_blend = c_black;
30
    
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; }
(zapper, c_black, c_white, 8, 2, "out");
31
    snd_play(snd_jump);
32
    var desxloc = obj_mainchara.x - 48;
33
    if (head.x > (obj_mainchara.x + 17))
34
    {
35
        desxloc = obj_mainchara.x + 90;
36
        zapper.image_xscale = 2;
37
        zapper.x -= 92;
38
    }
39
    with (zapper)
40
        
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, desxloc, 30, 2, "out");
41
    safe_delete(head);
42
    con = 2;
43
}
44
var groundpos = 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(obj_mainchara.y - 60);
45
if (con == 2)
46
{
47
    if (zapper.y < groundpos)
48
        con = 3;
49
}
50
if (con == 3)
51
{
52
    if (zapper.y >= groundpos)
53
    {
54
        zapper.y = groundpos;
55
        zapper.image_index = 7;
56
        with (zapper)
57
            scr_delay_var("image_index", 8, 4);
58
        zapper.gravity = 0;
59
        zapper.vspeed = 0;
60
        zapper.depth = obj_mainchara.depth;
61
        snd_play(snd_wing);
62
        con = 4;
63
    }
64
}
65
if (con == 4)
66
{
67
    if (endreached == false)
68
    {
69
        if (global.flag[1243 zapper_jail_2] == 0)
70
            global.flag[1243 zapper_jail_2] = 1;
71
        
scr_speaker
scr_speaker

function
scr_speaker(arg0)
{ _speaker = arg0; global.typer = 5; if (global.darkzone == 1) global.typer = 6; if (global.fighting == 1) global.typer = 4; global.fc = 0; global.fe = 0; if (_speaker == "silent" && global.darkzone == 0) global.typer = 2; if (_speaker == "silent" && global.darkzone == 1) global.typer = 36; if (_speaker == "balloon" || _speaker == "enemy") global.typer = 50; if (_speaker == "sans") { global.typer = 14; global.fc = 6; } if (_speaker == "undyne" || _speaker == "und") { global.typer = 17; global.fc = 9; } if (_speaker == "temmie" || _speaker == "tem") global.typer = 21; if (_speaker == "jevil") global.typer = 35; if (_speaker == "catti") global.fc = 13; if (_speaker == "jockington" || _speaker == "joc") global.fc = 14; if (_speaker == "catty" || _speaker == "caddy") global.fc = 16; if (_speaker == "bratty" || _speaker == "bra") global.fc = 17; if (_speaker == "rouxls" || _speaker == "rou") global.fc = 18; if (_speaker == "burgerpants" || _speaker == "bur") global.fc = 19; if (_speaker == "spamton") { if (global.fighting == 0) global.typer = 66; else global.typer = 68; } if (_speaker == "sneo") global.typer = 67; if (_speaker == "tenna") { global.typer = 80; if (global.fighting == 1) global.typer = 81; } if (_speaker == "susie" || _speaker == "sus") { global.fc = 1; global.typer = 10; if (global.darkzone == 1) { global.typer = 30; if (global.fighting == 1) global.typer = 47; } } if (_speaker == "ralsei" || _speaker == "ral") { global.fc = 2; global.typer = 31; if (global.fighting == 1) global.typer = 45; if (global.flag[30 ralsei_hat_state] == 1) global.typer = 6; } if (_speaker == "noelle" || _speaker == "noe") { global.fc = 3; if (global.darkzone == 0) global.typer = 12; else global.typer = 56; if (global.fighting == 1) global.typer = 59; } if (_speaker == "toriel" || _speaker == "tor") { global.fc = 4; global.typer = 7; } if (_speaker == "asgore" || _speaker == "asg") { global.fc = 10; global.typer = 18; } if (_speaker == "king" || _speaker == "kin") { global.fc = 20; global.typer = 33; ...
("zapper");
72
        msgsetloc(0, 
* Hey!Delay 11 Youse ain't supposed to be back here!Wait for inputClose Message
"* Hey^1! Youse ain't supposed to be back here!/%", "obj_b3bs_zapper_b_slash_Step_0_gml_98_0"
);
73
        d_make();
74
        con = 12;
75
    }
76
}
77
if (con == 12 && !d_ex())
78
{
79
    change = instance_create(x, y, obj_tvturnoff_manager);
80
    change.kind = 1;
81
    change.roomtarg = room;
82
    global.entrance = 6;
83
    con++;
84
}
85
if (global.interact == 0)
86
{
87
    var icount = 0;
88
    lighttimer++;
89
    type = 0;
90
    if (type == 0)
91
    {
92
        if ((lighttimer % rate) == 0)
93
        {
94
            for (var i = 0; i < count; i++)
95
            {
96
                if (lightconfig == 0)
97
                {
98
                    light1 = instance_create(xloc + (xspace * i), -130 - (70 * i), obj_dw__backstagelight);
99
                    light1.type = 1;
100
                    light1.vspeed = lightspeed;
101
                    light1.wally = 280;
102
                    light1.drawlamp = false;
103
                    light2 = instance_create(xloc + secondXloc + (xspace * i), -130 - (70 * i), obj_dw__backstagelight);
104
                    light2.type = 1;
105
                    light2.vspeed = lightspeed;
106
                    light2.wally = 280;
107
                    light2.drawlamp = false;
108
                }
109
                if (lightconfig == 1)
110
                {
111
                    light1 = instance_create(xloc + (xspace * i), -130 - (70 * i), obj_dw__backstagelight);
112
                    light1.type = 1;
113
                    light1.vspeed = lightspeed;
114
                    light1.wally = 280;
115
                    light1.drawlamp = false;
116
                    light2 = instance_create(xloc + secondXloc + (xspace * i), -130 - (70 * i), obj_dw__backstagelight);
117
                    light2.type = 1;
118
                    light2.vspeed = lightspeed;
119
                    light2.wally = 280;
120
                    light2.drawlamp = false;
121
                }
122
                if (lightconfig == 2)
123
                {
124
                    light1 = instance_create((xloc + (xspace * (count - 1))) - (xspace * i), -130 - (70 * i), obj_dw__backstagelight);
125
                    light1.type = 1;
126
                    light1.vspeed = lightspeed;
127
                    light1.wally = 280;
128
                    light1.drawlamp = false;
129
                    light2 = instance_create((xloc + secondXloc + (xspace * (count - 1))) - (xspace * i), -130 - (70 * i), obj_dw__backstagelight);
130
                    light2.type = 1;
131
                    light2.vspeed = lightspeed;
132
                    light2.wally = 280;
133
                    light2.drawlamp = false;
134
                }
135
                icount++;
136
            }
137
        }
138
    }
139
}
140
with (obj_dw__backstagelight)
141
{
142
    if (global.interact == 0)
143
        vspeed = other.lightspeed;
144
    else
145
        vspeed = 0;
146
}
147
if (watercon == 0)
148
{
149
    var trig = 0;
150
    with (obj_trigger_interact)
151
    {
152
        if (extflag == "watercooler")
153
        {
154
            if (place_meeting(x, y, obj_mainchara) || myinteract == 3)
155
            {
156
                other.des = id;
157
                trig = true;
158
            }
159
        }
160
    }
161
    if (trig)
162
        watercon = 1;
163
}
164
if (watercon == 1)
165
{
166
    watertimer++;
167
    if (watertimer == 1)
168
    {
169
        snd_play_x(snd_b, 1, 0.8);
170
        with (des)
171
        {
172
            excl = instance_create(x + (sprite_width / 2), y - 20, obj_excblcon);
173
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(excl, 20);
174
        }
175
        global.interact = 1;
176
    }
177
    if (watertimer == 35)
178
    {
179
        snd_play(snd_tensionhorn);
180
        snd_play_delay(snd_tensionhorn, 8, 1, 1.1);
181
    }
182
    if (watertimer == 65)
183
    {
184
        des.depth = -1;
185
        global.flag[54 encounter_pointer] = encounterflag;
186
        
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; } } } }
(139, 0, des);
187
        global.flag[1143 cooler_avoid_num] = 50;
188
        watercon = 2;
189
        watertimer = 0;
190
        watermarker = 0;
191
        watercon = 999;
192
    }
193
}
194
if (watercon == 999)
195
{
196
    if (i_ex(obj_battleback))
197
    {
198
        watercon = -1;
199
        scr_delay_var("watercon", 1000, 30);
200
    }
201
}
202
if (watercon == 1000)
203
{
204
    with (obj_trigger_interact)
205
    {
206
        if (extflag == "watercooler")
207
            instance_destroy();
208
    }
209
    watercon++;
210
}
211
if (tempsave == 0)
212
{
213
    with (obj_doorAny)
214
    {
215
        if (doorRoom == room_dw_teevie_watercooler)
216
        {
217
            if (touched)
218
            {
219
                other.tempsave = 1;
220
                
scr_tempsave
scr_tempsave

function
scr_tempsave()
{ filechoicebk2 = global.filechoice; global.filechoice = 9;
scr_saveprocess(global.filechoice);
global.filechoice = filechoicebk2; }
();
221
                debug_print("Temp save!!");
222
            }
223
        }
224
    }
225
}