Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b3bs_watercooler_Step_0

(view raw script w/o annotations or w/e)
1
if (i_ex(obj_mainchara) && i_ex(watercooler))
2
{
3
    if (obj_mainchara.x > 1080 && obj_mainchara.y > 840)
4
        watercooler.visible = true;
5
    else
6
        watercooler.visible = false;
7
}
8
if (doorcon == 0)
9
{
10
    if (global.flag[1103 ice_key_fail] != 0 && !d_ex())
11
    {
12
        safe_delete(block);
13
        safe_delete(black);
14
        snd_play(snd_locker);
15
        
scr_shakescreen
scr_shakescreen

function
scr_shakescreen()
{ instance_create(x, y, obj_shake); }
();
16
        doorcon = 99;
17
    }
18
}
19
if (con == 0)
20
{
21
    if (stealth.alert == 2)
22
    {
23
        con = 1;
24
        timer = 0;
25
    }
26
}
27
if (con == 1)
28
{
29
    headct[0] = 0;
30
    var headrange = 50;
31
    var tag = "";
32
    with (obj_mainchara)
33
    {
34
        var region = instance_place(x, y, obj_b3bs_stealthSolid);
35
        if (i_ex(region))
36
        {
37
            tag = region.extflag;
38
            debug_print("tag=" + tag);
39
        }
40
    }
41
    zone = tag;
42
    with (obj_dw_ch3_b3bs_zapperhead)
43
    {
44
        if (extflag == tag)
45
        {
46
            if (x > (camerax() + headrange) && x < ((camerax() + 640) - headrange))
47
                array_push(other.headct, id);
48
        }
49
    }
50
    array_delete(headct, 0, 1);
51
    show_debug_message(string(headct));
52
    head = headct[irandom_range(0, array_length(headct) - 1)];
53
    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);
54
    with (zapper)
55
        
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);
56
    zapper.vspeed = -36;
57
    zapper.gravity = 2;
58
    zapper.image_xscale = -2;
59
    zapper.image_blend = c_black;
60
    
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");
61
    snd_play(snd_jump);
62
    var desxloc = obj_mainchara.x - 48;
63
    if (head.x > (obj_mainchara.x + 17))
64
    {
65
        desxloc = obj_mainchara.x + 90;
66
        zapper.image_xscale = 2;
67
        zapper.x -= 92;
68
    }
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; }
("x", x, desxloc, 30, 2, "out");
71
    safe_delete(head);
72
    con = 2;
73
}
74
var groundpos = 
scr_even
scr_even

function
scr_even(arg0)
{ return round(arg0 / 2) * 2; }
(obj_mainchara.y - 60);
75
if (con == 2)
76
{
77
    if (zapper.y < groundpos)
78
        con = 3;
79
}
80
if (con == 3)
81
{
82
    if (zapper.y >= groundpos)
83
    {
84
        zapper.y = groundpos;
85
        zapper.image_index = 7;
86
        with (zapper)
87
            scr_delay_var("image_index", 8, 4);
88
        zapper.gravity = 0;
89
        zapper.vspeed = 0;
90
        zapper.depth = obj_mainchara.depth;
91
        snd_play(snd_wing);
92
        con = 4;
93
    }
94
}
95
if (con == 4)
96
{
97
    
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");
98
    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_b3bs_watercooler_slash_Step_0_gml_25_0"
);
99
    d_make();
100
    con = 5;
101
}
102
if (con == 5 && !d_ex())
103
{
104
    switch (zone)
105
    {
106
        case "topleft":
107
            global.flag[1126 times_caught_wc_topleft]++;
108
            break;
109
        case "topright":
110
            global.flag[1127 times_caught_wc_topright]++;
111
            break;
112
        case "botleft":
113
            global.flag[1128 times_caught_wc_botleft]++;
114
            break;
115
        case "hard1":
116
            global.flag[1129 times_caught_wc_hard1]++;
117
            break;
118
        case "hard2":
119
            global.flag[1130 times_caught_wc_hard2]++;
120
            break;
121
    }
122
    change = instance_create(x, y, obj_tvturnoff_manager);
123
    change.kind = 1;
124
    change.roomtarg = 180;
125
    change.entrance = 8;
126
    con = 6;
127
}
128
if (watercon == 0)
129
{
130
    var trig = 0;
131
    with (watertrig)
132
    {
133
        if (place_meeting(x, y, obj_mainchara) || myinteract == 3)
134
            trig = true;
135
    }
136
    if (trig)
137
        watercon = 1;
138
}
139
if (watercon == 1)
140
{
141
    watertimer++;
142
    if (watertimer == 1)
143
    {
144
        snd_play_x(snd_b, 1, 0.8);
145
        with (watercooler)
146
        {
147
            excl = instance_create(x + (sprite_width / 2), y - 20, obj_excblcon);
148
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(excl, 20);
149
        }
150
        global.interact = 1;
151
    }
152
    if (watertimer == 35)
153
    {
154
        snd_play(snd_tensionhorn);
155
        snd_play_delay(snd_tensionhorn, 8, 1, 1.1);
156
    }
157
    if (watertimer == 65)
158
    {
159
        watercooler.depth = -1;
160
        
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, watercooler);
161
        watercon = 2;
162
        watertimer = 0;
163
    }
164
}
165
if (stealthend == 0)
166
{
167
    if (global.flag[1138 got_nothing] == 1 && !d_ex())
168
        stealthend = 1;
169
}
170
if (stealthend == 1)
171
{
172
    with (obj_b3bs_stealtharea)
173
        instance_destroy();
174
    with (obj_b3bs_stealthSolid)
175
        instance_destroy();
176
    with (obj_dw__backstagelight)
177
        instance_destroy();
178
    stealthend = 2;
179
}