Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_controller_dw_cyber_music_final_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (i_ex(movingwall1))
3
    movingwall1.x = obj_MovingPlat_dw_cyber_music_final.x;
4
if (state == 0 && obj_mainchara.x >= 480)
5
{
6
    timer = 0;
7
    with (obj_fakeWalkway_dw_cyber_music_final)
8
        instance_destroy();
9
    snd_play(snd_impact);
10
    instance_create(0, 0, obj_shake);
11
    movingwall1 = instance_create(obj_MovingPlat_dw_cyber_music_final.x, obj_MovingPlat_dw_cyber_music_final.y, obj_invisMovingWall_dw_cyber_music_final);
12
    movingwall1.image_xscale = 2;
13
    movingwall1.image_yscale = 2;
14
    movingwall1.image_alpha = 0;
15
    global.flag[7 disable_menu?] = 1;
16
    global.interact = 1;
17
    state = 1;
18
}
19
if (state == 1)
20
{
21
    with (obj_caterpillarchara)
22
    {
23
        if (image_alpha > 0.1)
24
            image_alpha *= 0.6;
25
        else
26
            image_alpha = 0;
27
    }
28
    if (timer >= 10)
29
        state = 2;
30
}
31
if (state == 2)
32
{
33
    obj_mainchara.x += 16;
34
    obj_MovingPlat_dw_cyber_music_final.x += 16;
35
    if (obj_MovingPlat_dw_cyber_music_final.x >= 640)
36
    {
37
        timer = 0;
38
        bulletarea = instance_create(648, 200, obj_overworld_bulletarea);
39
        bulletarea.image_xscale = 7;
40
        bulletarea.image_yscale = 5;
41
        state = 2.1;
42
    }
43
}
44
if (state == 2.1)
45
{
46
    global.interact = 1;
47
    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; }
();
48
    state = 2.11;
49
}
50
if (state == 2.11)
51
{
52
    state = -999;
53
    
c_pannable
c_pannable

function
c_pannable(arg0)
{
c_cmd("pannable", arg0, 0, 0, 0);
}
(1);
54
    
c_panobj
c_panobj

function
c_panobj(arg0, arg1)
{
c_cmd("panobj", arg0, arg1, 0, 0);
}
(84, 1);
55
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(1);
56
    
c_pannable
c_pannable

function
c_pannable(arg0)
{
c_cmd("pannable", arg0, 0, 0, 0);
}
(0);
57
    
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(id, "state", 2.2);
58
    
c_terminatekillactors
c_terminatekillactors

function
c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
}
();
59
}
60
if (state == 2.2)
61
{
62
    global.interact = 0;
63
    state = 3;
64
}
65
if (state == 3)
66
{
67
    with (obj_caterpillarchara)
68
    {
69
        x = room_width * 2;
70
        y = room_height * 2;
71
        
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; } }
();
72
    }
73
    with (obj_parallaxer_layer)
74
        auto -= 1;
75
    obj_cyber_music_battleBullets.active = true;
76
    obj_mainchara.cutscene = 1;
77
    global.interact = 0;
78
    if (obj_cyber_music_battleBullets.sndinit == 2)
79
    {
80
        with (bulletarea)
81
        {
82
            x = room_width;
83
            y = room_height;
84
        }
85
        state = 4;
86
        timer = 0;
87
    }
88
}
89
if (state == 4)
90
{
91
    obj_mainchara.x += 16;
92
    camerax_set(camerax() + 16);
93
    obj_MovingPlat_dw_cyber_music_final.x += 16;
94
    if (obj_MovingPlat_dw_cyber_music_final.x >= 1640)
95
    {
96
        obj_MovingPlat_dw_cyber_music_final.x = 1640;
97
        timer = 0;
98
        snd_play(snd_impact);
99
        with (movingwall1)
100
            instance_destroy();
101
        endwall = instance_create(1600, 120, obj_soliddark);
102
        endwall.image_xscale = 1;
103
        endwall.image_yscale = 7;
104
        state = 5;
105
    }
106
}
107
if (state == 5)
108
{
109
    global.interact = 1;
110
    if (obj_mainchara.x < 1640)
111
        obj_mainchara.x = 1640;
112
    with (obj_caterpillarchara)
113
        x = 0;
114
    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; }
();
115
    
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; } } } }
();
116
    state = 6;
117
}
118
if (state == 6)
119
{
120
    state = -999;
121
    
c_panobj
c_panobj

function
c_panobj(arg0, arg1)
{
c_cmd("panobj", arg0, arg1, 0, 0);
}
(kr_actor, 8);
122
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(su);
123
    
c_visible
c_visible

function
c_visible(arg0)
{
c_cmd("visible", arg0, 0, 0, 0);
}
(false);
124
    
c_setxy
c_setxy

function
c_setxy(arg0, arg1)
{
c_cmd("setxy", arg0, arg1, 0, 0);
}
(1710, 174);
125
    
c_sel
c_sel

function
c_sel(arg0)
{
c_cmd("select", arg0, 0, 0, 0);
}
(ra);
126
    
c_visible
c_visible

function
c_visible(arg0)
{
c_cmd("visible", arg0, 0, 0, 0);
}
(false);
127
    
c_setxy
c_setxy

function
c_setxy(arg0, arg1)
{
c_cmd("setxy", arg0, arg1, 0, 0);
}
(1812, 174);
128
    
c_var_instance
c_var_instance

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(id, "state", 7);
129
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(8);
130
    
c_pannable
c_pannable

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

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

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

function
c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
}
();
134
}
135
if (state == 7)
136
{
137
    if (!i_ex(obj_cutscene_master))
138
    {
139
        global.flag[7 disable_menu?] = 0;
140
        global.interact = 0;
141
        state++;
142
    }
143
}
144
if (state == 8)
145
{
146
    with (obj_caterpillarchara)
147
    {
148
        if (image_alpha < 1)
149
            image_alpha += 0.1;
150
    }
151
}