Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_controller_dw_mansion_potBalance_Step_0

(view raw script w/o annotations or w/e)
1
if (!init_butler)
2
{
3
    if (i_ex(obj_npc_butler))
4
    {
5
        with (obj_npc_butler)
6
        {
7
            if (y <= 650 && x <= 700)
8
                image_xscale = -2;
9
            if (y > 900 && x <= 400)
10
                image_xscale = -2;
11
        }
12
    }
13
}
14
if (instance_exists(obj_mainchara) && triggered == 0)
15
{
16
    if ((obj_mainchara.y + obj_mainchara.sprite_height) >= 520)
17
    {
18
        if (spawnVase == 0)
19
        {
20
            spawnVase = 1;
21
            instance_create(x, y, obj_balancepot);
22
        }
23
    }
24
}
25
if (i_ex(obj_npc_room) && readtrigger == 0)
26
{
27
    readcount = 0;
28
    with (obj_npc_room)
29
    {
30
        if (talked != 0)
31
            other.readcount++;
32
    }
33
    if (readcount == 8)
34
        readtrigger = 1;
35
}
36
if (spawnVase == 1 && !instance_exists(obj_balancepot))
37
    alarm[0]
 = 1;
gml_Object_obj_controller_dw_mansion_potBalance_Alarm_0.gml

if (instance_exists(obj_npc_butler)) { with (obj_npc_butler) { var modifier; if (image_xscale == -2) modifier = -100; else modifier = -36; newenem = instance_create(x + modifier, y, obj_chaseenemy); with (newenem) { myencounter = 56; sprite_index = spr_npc_swatchling_sweep_walk; if (other.image_xscale == -2) facing = 1; touchsprite = spr_npc_swatchling_sweep_walk; radius = 10000; ignoresolid = 0; alertcon = 0; eraser = 1; noAlertSound = 1; frozen = 0; offscreen_frozen = 0; } instance_destroy(); } snd_play(snd_b); } spawnVase = 2; triggered = 1; if (con == 0) global.interact = 0;
38
if (
scr_debug
scr_debug

function
scr_debug()
{ return 0; }
())
39
{
40
    if (keyboard_check_pressed(vk_space))
41
    {
42
        if (i_ex(obj_balancepot))
43
            obj_balancepot.falling = 3;
44
    }
45
}
46
if (con == 1)
47
{
48
    obj_balancepot.falling = 3;
49
    obj_balancepot.balance = 0;
50
    obj_balancepot.image_angle = 0;
51
    global.interact = 1;
52
    snd_play(snd_won);
53
    timer = 0;
54
    con++;
55
}
56
if (con == 2)
57
{
58
    timer++;
59
    if (timer == 30)
60
    {
61
        with (obj_npc_butler)
62
        {
63
            sprite_index = spr_npc_butler_clap;
64
            image_speed = 0.25;
65
            normalanim = 3;
66
            remanimspeed = 0.25;
67
        }
68
        snd_play(snd_applause);
69
    }
70
    if (timer == 72)
71
        con++;
72
}
73
if (con == 3)
74
{
75
    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; }
();
76
    
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; } } } }
();
77
    con++;
78
}
79
if (con == 4)
80
{
81
    if (i_ex(obj_balancepot))
82
        obj_balancepot.con = 1;
83
    con = 5;
84
    alarm[1]
 = 30;
gml_Object_obj_controller_dw_mansion_potBalance_Alarm_1.gml

con++;
85
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
86
    
c_walkdirect
c_walkdirect

function
c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
}
(kr_actor.x + 35, kr_actor.y - 14, 14);
87
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
88
    
c_walkdirect
c_walkdirect

function
c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
}
(kr_actor.x + 120, kr_actor.y - 7, 20);
89
    
c_delayfacing
c_delayfacing

function
c_delayfacing(arg0, arg1)
{
c_cmd_x("delaycmd", arg0, "facing", arg1, 0, 0, 0);
}
(21, "l");
90
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(14);
91
    
c_sel
c_sel

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

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("l");
93
    
c_speaker
c_speaker

function
c_speaker(arg0)
{
c_cmd("speaker", arg0, 0, 0, 0);
}
("susie");
94
    
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,
* Heh,Delay 11 not bad,Delay 11 Kris!Wait for inputClose Message
"* Heh^1, not bad^1, Kris!/%", "obj_controller_dw_mansion_potBalance_slash_Step_0_gml_83_0"
);
95
    
c_talk_wait
c_talk_wait

function
c_talk_wait()
{
c_talk();
c_waittalk();
}
();
96
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(6);
97
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
98
    
c_sprite
c_sprite

function
c_sprite(arg0)
{
c_cmd("sprite", arg0, 0, 0, 0);
}
(spr_susie_playful_punch_dw);
99
    
c_addxy
c_addxy

function
c_addxy(arg0, arg1)
{
c_cmd("addxy", arg0, arg1, 0, 0);
}
(-4, 2);
100
    
c_animate
c_animate

function
c_animate(arg0, arg1, arg2)
{
c_cmd("animate", arg0, arg1, arg2, 0);
}
(0, 2, 0.1);
101
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(10);
102
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(kr);
103
    
c_shakeobj
c_shakeobj

function
c_shakeobj()
{
c_cmd("shakeobj", 0, 0, 0, 0);
}
();
104
    
c_soundplay
c_soundplay

function
c_soundplay(arg0)
{
c_cmd("soundplay", arg0, 0, 0, 0);
}
(snd_damage);
105
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(15);
106
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
107
    
c_autowalk
c_autowalk

function
c_autowalk(arg0)
{
c_cmd("autowalk", arg0, 0, 0, 0);
}
(0);
108
    
c_facing
c_facing

function
c_facing(arg0)
{
c_cmd("facing", arg0, 0, 0, 0);
}
("l");
109
    
c_addxy
c_addxy

function
c_addxy(arg0, arg1)
{
c_cmd("addxy", arg0, arg1, 0, 0);
}
(4, -2);
110
    
c_autowalk
c_autowalk

function
c_autowalk(arg0)
{
c_cmd("autowalk", arg0, 0, 0, 0);
}
(1);
111
    
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(id, "timer", 0);
112
    
c_actortokris
c_actortokris

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

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

function
c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
}
();
115
}
116
if (con == 6 && !i_ex(obj_cutscene_master))
117
{
118
    with (obj_balancepot)
119
    {
120
        if (image_angle < 7)
121
            image_angle++;
122
        else
123
            other.con++;
124
    }
125
}
126
if (con == 7)
127
{
128
    with (obj_balancepot)
129
    {
130
        if (image_angle > -7)
131
            image_angle--;
132
        else
133
            other.con = 8;
134
    }
135
}
136
if (con == 8)
137
{
138
    with (obj_balancepot)
139
    {
140
        if (image_angle < 0)
141
        {
142
            image_angle++;
143
        }
144
        else
145
        {
146
            other.con++;
147
            other.timer = 0;
148
        }
149
    }
150
}
151
if (con == 9)
152
{
153
    timer++;
154
    if (timer == 15)
155
    {
156
        with (obj_balancepot)
157
        {
158
            falling = 1;
159
            remy = y;
160
        }
161
    }
162
    if (timer > 15)
163
    {
164
        if (!instance_exists(obj_balancepot))
165
            con++;
166
    }
167
}
168
if (con == 10)
169
{
170
    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; }
();
171
    
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; } } } }
();
172
    con++;
173
}
174
if (con == 11)
175
{
176
    con = 12;
177
    alarm[1]
 = 30;
gml_Object_obj_controller_dw_mansion_potBalance_Alarm_1.gml

con++;
178
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
179
    
c_sprite
c_sprite

function
c_sprite(arg0)
{
c_cmd("sprite", arg0, 0, 0, 0);
}
(spr_susie_shock);
180
    
c_emote
c_emote

function
c_emote()
{ if (argument_count == 0)
c_cmd("emote", "!", 30, 0, 0);
else if (argument_count == 1)
c_cmd("emote", argument[0], 30, 0, 0);
else if (argument_count == 2)
c_cmd("emote", argument[0], argument[1], 0, 0);
else if (argument_count == 3)
c_cmd("emote", argument[0], argument[1], argument[2], 0);
}
("!", 30);
181
    
c_shakeobj
c_shakeobj

function
c_shakeobj()
{
c_cmd("shakeobj", 0, 0, 0, 0);
}
();
182
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
183
    
c_sprite
c_sprite

function
c_sprite(arg0)
{
c_cmd("sprite", arg0, 0, 0, 0);
}
(spr_ralsei_surprised_down);
184
    
c_emote
c_emote

function
c_emote()
{ if (argument_count == 0)
c_cmd("emote", "!", 30, 0, 0);
else if (argument_count == 1)
c_cmd("emote", argument[0], 30, 0, 0);
else if (argument_count == 2)
c_cmd("emote", argument[0], argument[1], 0, 0);
else if (argument_count == 3)
c_cmd("emote", argument[0], argument[1], argument[2], 0);
}
("!", 30);
185
    
c_shakeobj
c_shakeobj

function
c_shakeobj()
{
c_cmd("shakeobj", 0, 0, 0, 0);
}
();
186
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(30);
187
    
c_imageindex
c_imageindex

function
c_imageindex(arg0)
{
c_cmd("imageindex", arg0, 0, 0, 0);
}
(1);
188
    
c_autowalk
c_autowalk

function
c_autowalk(arg0)
{
c_cmd("autowalk", arg0, 0, 0, 0);
}
(0);
189
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
190
    if (su_actor.y > 1140)
191
        
c_walkdirect_wait
c_walkdirect_wait

function
c_walkdirect_wait(arg0, arg1, arg2)
{
c_walkdirect(arg0, arg1, arg2);
c_wait(arg2);
}
(su_actor.x, 1078, 10);
192
    
c_walk_wait
c_walk_wait

function
c_walk_wait(arg0, arg1, arg2)
{
c_walk(arg0, arg1, arg2);
c_wait(arg2);
}
("r", 16, 20);
193
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(30);
194
    
c_actortokris
c_actortokris

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

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

function
c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
}
();
197
}
198
if (con == 13 && !i_ex(obj_cutscene_master))
199
{
200
    with (obj_caterpillarchara)
201
    {
202
        if (name == "susie")
203
        {
204
            image_alpha = 0;
205
        }
206
        else
207
        {
208
            parent = obj_mainchara;
209
            target = 12;
210
            
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; } }
();
211
        }
212
    }
213
    global.interact = 0;
214
    con++;
215
}
216
if (con == 14)
217
    con++;
218
if (con > 14)
219
{
220
    with (obj_caterpillarchara)
221
    {
222
        if (name == "susie")
223
        {
224
            x = obj_mainchara.x + 60;
225
            y = obj_mainchara.y;
226
        }
227
    }
228
}