Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_dw_b3bs_zapper_a_Step_0

(view raw script w/o annotations or w/e)
1
if (ccon == 0)
2
{
3
    if (obj_mainchara.x >= 240)
4
    {
5
        ccon = 1;
6
        cctimer = 0;
7
        global.interact = 1;
8
        camx = camerax();
9
    }
10
}
11
if (ccon == 1)
12
{
13
    ccon = -1;
14
    cutscene_master = 
scr_cutscene_make
scr_cutscene_make

function
scr_cutscene_make()
{ _cutscene_master = instance_create(0, 0, obj_cutscene_master); _cutscene_master.master_object = id; return _cutscene_master; }
();
15
    
scr_maincharacters_actors
scr_maincharacters_actors

function
scr_maincharacters_actors()
{ actor_count = 0; kr = 0; kr_actor = instance_create(obj_mainchara.x, obj_mainchara.y, obj_actor);
scr_actor_setup(kr, kr_actor, "kris");
kr_actor.sprite_index = obj_mainchara.sprite_index; kr_actor.depth = obj_mainchara.depth; with (obj_mainchara) visible = 0; for (__jj = 0; __jj < array_length_1d(global.cinstance); __jj++) { if (i_ex(global.cinstance[__jj])) { if (global.cinstance[__jj].name == "susie") { actor_count++; su = __jj + 1; su_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(su, su_actor, "susie");
su_actor.sprite_index = global.cinstance[__jj].sprite_index; su_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } if (global.cinstance[__jj].name == "ralsei") { actor_count++; ra = __jj + 1; ra_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(ra, ra_actor, "ralsei");
ra_actor.sprite_index = global.cinstance[__jj].sprite_index; ra_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } if (global.cinstance[__jj].name == "noelle") { actor_count++; no = __jj + 1; no_actor = instance_create(global.cinstance[__jj].x, global.cinstance[__jj].y, obj_actor);
scr_actor_setup(no, no_actor, "noelle");
no_actor.sprite_index = global.cinstance[__jj].sprite_index; no_actor.depth = global.cinstance[__jj].depth; with (global.cinstance[__jj]) visible = 0; } } } }
();
16
    
c_pannable
c_pannable

function
c_pannable(arg0)
{
c_cmd("pannable", arg0, 0, 0, 0);
}
(1);
17
    
c_pan
c_pan

function
c_pan(arg0, arg1, arg2)
{
c_cmd("pan", arg0, arg1, arg2, 0);
}
(332, 0, 30);
18
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(40);
19
    
c_speaker
c_speaker

function
c_speaker(arg0)
{
c_cmd("speaker", arg0, 0, 0, 0);
}
("susie");
20
    
c_msgsetloc
c_msgsetloc

function
c_msgsetloc(arg0, arg1, arg2)
{ var msg_index = arg0; var english = arg1; var localized_string_id = arg2; var str = english; if (!is_english()) str =
scr_84_get_lang_string(localized_string_id);
c_msgset(msg_index, str);
}
(0,
Face 2* Hell yeah. Security lights. That means going stealth mode.Wait for input
"\\E2* Hell yeah. Security lights. That means going stealth mode./", "obj_dw_b3bs_zapper_a_slash_Step_0_gml_27_0"
);
21
    
c_msgnextloc
c_msgnextloc

function
c_msgnextloc(arg0, arg1)
{ var str = arg0; var localized_string_id = arg1; if (!is_english()) str =
scr_84_get_lang_string(localized_string_id);
c_msgnext(str);
}
(
Face A* Always wanted to sneak like this.Delay 11 Let's hit the wall,Delay 11 Kris.Wait for inputClose Message
"\\EA* Always wanted to sneak like this^1. Let's hit the wall^1, Kris./%", "obj_dw_b3bs_zapper_a_slash_Step_0_gml_28_0"
);
22
    
c_talk_wait
c_talk_wait

function
c_talk_wait()
{
c_talk();
c_waittalk();
} function c_talkwait() {
c_talk_wait();
}
();
23
    
c_pan
c_pan

function
c_pan(arg0, arg1, arg2)
{
c_cmd("pan", arg0, arg1, arg2, 0);
}
(camx, 0, 30);
24
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(30);
25
    
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(id, "ccon", 99);
26
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(kr);
27
    
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("r");
28
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
29
    
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("r");
30
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
31
    
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("r");
32
    
c_pannable
c_pannable

function
c_pannable(arg0)
{
c_cmd("pannable", arg0, 0, 0, 0);
}
(0);
33
    
c_actortokris
c_actortokris

function
c_actortokris()
{
c_cmd("actortokris", 0, 0, 0, 0);
}
();
34
    
c_actortocaterpillar
c_actortocaterpillar

function
c_actortocaterpillar()
{
c_cmd("actortocaterpillar", 0, 0, 0, 0);
}
();
35
    
c_terminatekillactors
c_terminatekillactors

function
c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
}
();
36
}
37
if (ccon == 99 && !i_ex(cutscene_master))
38
{
39
    with (obj_caterpillarchara)
40
        
scr_caterpillar_interpolate
scr_caterpillar_interpolate

function
scr_caterpillar_interpolate()
{ _newfacing =
scr_facing_letter_to_number(
scr_get_cardinal_direction(point_direction(x, y, obj_mainchara.x, obj_mainchara.y)));
remx[0] = obj_mainchara.x; remy[0] = obj_mainchara.y; facing[0] = _newfacing; for (_iaia = target; _iaia > 0; _iaia -= 1) { remx[_iaia] = lerp(obj_mainchara.x, x, _iaia / target); if (global.darkzone == 1) remy[_iaia] = lerp(obj_mainchara.y, y + 16, _iaia / target); else remy[_iaia] = lerp(obj_mainchara.y, y + 6, _iaia / target); facing[_iaia] = _newfacing; } }
();
41
    global.interact = 0;
42
    global.flag[1135 unlocked_stealth] = 1;
43
    ccon++;
44
}
45
if (con == 0)
46
{
47
    with (obj_b3bs_stealth)
48
    {
49
        if (alert == 2)
50
        {
51
            other.con = 1;
52
            other.timer = 0;
53
        }
54
    }
55
}
56
if (con == 1)
57
{
58
    headct[0] = 0;
59
    var headrange = 50;
60
    with (obj_dw_ch3_b3bs_zapperhead)
61
    {
62
        if (x > (camerax() + headrange) && x < ((camerax() + 640) - headrange))
63
            array_push(other.headct, id);
64
    }
65
    array_delete(headct, 0, 1);
66
    show_debug_message(string(headct));
67
    head = headct[irandom_range(0, array_length(headct) - 1)];
68
    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);
69
    with (zapper)
70
        
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);
71
    zapper.vspeed = -40;
72
    zapper.gravity = 2;
73
    zapper.image_xscale = -2;
74
    zapper.image_blend = c_black;
75
    
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");
76
    snd_play(snd_jump);
77
    var desxloc = obj_mainchara.x - 48;
78
    if (head.x > (obj_mainchara.x + 17))
79
    {
80
        desxloc = obj_mainchara.x + 90;
81
        zapper.image_xscale = 2;
82
        zapper.x -= 92;
83
    }
84
    with (zapper)
85
        
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");
86
    safe_delete(head);
87
    con = 2;
88
}
89
var groundpos = 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(obj_mainchara.y - 60);
90
if (con == 2)
91
{
92
    if (zapper.y < groundpos)
93
        con = 3;
94
}
95
if (con == 3)
96
{
97
    if (zapper.y >= groundpos)
98
    {
99
        zapper.y = groundpos;
100
        zapper.image_index = 7;
101
        with (zapper)
102
            scr_delay_var("image_index", 8, 4);
103
        zapper.gravity = 0;
104
        zapper.vspeed = 0;
105
        zapper.depth = obj_mainchara.depth;
106
        snd_play(snd_wing);
107
        con = 4;
108
    }
109
}
110
if (con == 4)
111
{
112
    
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; ...
("no_name");
113
    msgsetloc(0, 
* What the -- you's ain't allowed in here!Wait for inputClose Message
"* What the -- you's ain't allowed in here!/%", "obj_dw_b3bs_zapper_a_slash_Step_0_gml_148_0"
);
114
    d_make();
115
    con = 5;
116
}
117
if (con == 5 && !d_ex())
118
{
119
    roomtarg = 177;
120
    change = instance_create(x, y, obj_tvturnoff_manager);
121
    change.kind = 1;
122
    global.entrance = 4;
123
    change.roomtarg = roomtarg;
124
    con = 6;
125
}
126
if (paannounce == 0)
127
{
128
    var trig = 0;
129
    with (obj_b3bs_stealth)
130
    {
131
        if (active)
132
            trig = 1;
133
    }
134
    if (trig == 1)
135
    {
136
        paannounce = 1;
137
        patime = 0;
138
    }
139
}
140
if (fastcon == 1)
141
{
142
    if (global.interact == 0 && !d_ex() && i_ex(obj_mainchara) && obj_mainchara.x > 740)
143
    {
144
        global.interact = 1;
145
        
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; ...
("susie");
146
        msgsetloc(0, 
Face K* Hey,Delay 11 uh,Delay 11 Kris?Wait for input
"\\EK* Hey^1, uh^1, Kris?/", "obj_dw_b3bs_zapper_a_slash_Step_0_gml_205_0"
);
147
        msgnextloc(
Face 1* So,Delay 11 uh,Delay 11 sneaking actually really sucks.Wait for input
"\\E1* So^1, uh^1, sneaking actually really sucks./", "obj_dw_b3bs_zapper_a_slash_Step_0_gml_206_0"
);
148
        msgnextloc(
Face 2* Let's just go super fast.Wait for input
"\\E2* Let's just go super fast./", "obj_dw_b3bs_zapper_a_slash_Step_0_gml_207_0"
);
149
        
scr_anyface_next
scr_anyface_next

function
scr_anyface_next(arg0, arg1)
{ global.msgno++;
scr_anyface(arg0, global.msgno, arg1);
}
("none", 0);
150
        msgnextloc(
* (You and Susie decided to go really really fast in every Stealth Zone.)Wait for inputClose Message
"* (You and Susie decided to go really really fast in every Stealth Zone.)/%", "obj_dw_b3bs_zapper_a_slash_Step_0_gml_209_0"
);
151
        d_make();
152
        fastcon = 2;
153
        global.flag[1184 sneaking_fast] = 1;
154
    }
155
}
156
if (fastcon == 2)
157
{
158
    if (!d_ex())
159
    {
160
        fastcon = 3;
161
        global.interact = 0;
162
    }
163
}
164
if (i_ex(doortrig))
165
{
166
    with (doortrig)
167
    {
168
        if (myinteract == 3)
169
        {
170
            global.interact = 1;
171
            
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; ...
("no_name");
172
            msgsetloc(0, 
* (The door is locked by some garbage mechanism.)Wait for inputClose Message
"* (The door is locked by some garbage mechanism.)/%", "obj_dw_b3bs_zapper_a_slash_Step_0_gml_223_0"
);
173
            d_make();
174
            myinteract = 4;
175
        }
176
        if (myinteract == 4 && !d_ex())
177
        {
178
            global.interact = 0;
179
            myinteract = 0;
180
        }
181
    }
182
}