Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_bridgeSwapper_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 1)
2
{
3
    global.interact = 1;
4
    if (skip == 0)
5
    {
6
        notallcharactersaresafe = 0;
7
        with (obj_mainchara)
8
        {
9
            if (place_meeting(x, y, obj_solidblock) || place_meeting(x, y, obj_bridgeSwappable))
10
                other.notallcharactersaresafe++;
11
        }
12
        with (obj_caterpillarchara)
13
        {
14
            if (place_meeting(x, y, obj_solidblock) || place_meeting(x, y, obj_bridgeSwappable))
15
                other.notallcharactersaresafe++;
16
        }
17
        if (notallcharactersaresafe == 0)
18
            con = 99;
19
        else
20
            con = 2;
21
    }
22
    else
23
    {
24
        con = 99;
25
    }
26
}
27
if (con == 2)
28
{
29
    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; }
();
30
    
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; } } } }
();
31
    con++;
32
}
33
if (con == 3)
34
{
35
    if (dir == 0)
36
    {
37
        if (rax == 0)
38
            ralx = mtx;
39
        else
40
            ralx = rax;
41
        if (ray == 0)
42
            raly = mty - 4;
43
        else
44
            raly = ray;
45
        krisface = "d";
46
    }
47
    if (dir == 1)
48
    {
49
        if (rax == 0)
50
            ralx = mtx - 4;
51
        else
52
            ralx = rax;
53
        if (ray == 0)
54
            raly = mty;
55
        else
56
            raly = ray;
57
        krisface = "e";
58
    }
59
    if (dir == 2)
60
    {
61
        if (rax == 0)
62
            ralx = mtx;
63
        else
64
            ralx = rax;
65
        if (ray == 0)
66
            raly = mty + 4;
67
        else
68
            raly = ray;
69
        krisface = "u";
70
    }
71
    if (dir == 3)
72
    {
73
        if (rax == 0)
74
            ralx = mtx + 4;
75
        else
76
            ralx = rax;
77
        if (ray == 0)
78
            raly = mty;
79
        else
80
            raly = ray;
81
        krisface = "l";
82
    }
83
    panpoint = 
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; }
(mtx, mty, kr_actor.sprite_index);
84
    with (panpoint)
85
        visible = 0;
86
    
c_pannable
c_pannable

function
c_pannable(arg0)
{
c_cmd("pannable", arg0, 0, 0, 0);
}
(1);
87
    
c_sel
c_sel

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

function
c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
}
(mtx, mty, 4);
89
    
c_delayfacing
c_delayfacing

function
c_delayfacing(arg0, arg1)
{
c_cmd_x("delaycmd", arg0, "facing", arg1, 0, 0, 0);
}
(4, krisface);
90
    
c_sel
c_sel

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

function
c_walkdirect(arg0, arg1, arg2)
{
c_cmd("walkdirect", arg0, arg1, arg2, 0);
}
(ralx, raly, 4);
92
    
c_delayfacing
c_delayfacing

function
c_delayfacing(arg0, arg1)
{
c_cmd_x("delaycmd", arg0, "facing", arg1, 0, 0, 0);
}
(5, krisface);
93
    
c_panobj
c_panobj

function
c_panobj(arg0, arg1)
{
c_cmd("panobj", arg0, arg1, 0, 0);
}
(panpoint, 4);
94
    
c_wait
c_wait

function
c_wait(arg0)
{
c_cmd("wait", arg0, 0, 0, 0);
}
(6);
95
    
c_pannable
c_pannable

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

function
c_var_instance(arg0, arg1, arg2)
{
c_cmd_x("var", arg0, arg1, arg2, 0, 0, 0);
}
(id, "con", 98);
97
    
c_actortokris
c_actortokris

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

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

function
c_terminatekillactors()
{
c_cmd("terminatekillactors", 0, 0, 0, 0);
}
();
100
}
101
if (con == 98)
102
{
103
    con = 99;
104
    with (panpoint)
105
        instance_destroy();
106
}
107
if (con == 99)
108
{
109
    alarm[0]
 = 1;
gml_Object_obj_bridgeSwapper_Alarm_0.gml

if (swapped == 0) { with (obj_bridgeSwappable) { if (bridgetarget == other.bridgetarget) { replace = instance_create(x, y, obj_soliddark); replace.sprite_index = sprite_index; replace.image_xscale = image_xscale; replace.image_yscale = image_yscale; replace.image_index = image_index; replace.bridgetarget = bridgetarget; replace.image_blend = other.c_nred; instance_destroy(); } } with (obj_soliddark) { if (!is_undefined(bridgetarget)) { if (bridgetarget == other.bridgetarget2) { replace2 = instance_create(x, y, obj_bridgeSwappable); replace2.sprite_index = sprite_index; replace2.image_xscale = image_xscale; replace2.image_yscale = image_yscale; replace2.image_index = image_index; replace2.bridgetarget = other.bridgetarget2; replace2.image_blend = other.c_nred; instance_destroy(); } } } if (extflag == "swatchlingRescue") { extflag = "triggered"; if (instance_exists(obj_controller_dw_mansion_bridges_funny)) obj_controller_dw_mansion_bridges_funny.saved = true; } swapped = 1; } else { with (obj_bridgeSwappable) { if (bridgetarget == other.bridgetarget2) { replace = instance_create(x, y, obj_soliddark); replace.sprite_index = sprite_index; replace.image_index = image_index; replace.image_xscale = image_xscale; replace.image_yscale = image_yscale; replace.bridgetarget = bridgetarget; replace.image_blend = other.c_nblue; instance_destroy(); } } with (obj_soliddark) { if (!is_undefined(bridgetarget)) { if (bridgetarget == other.bridgetarget) { replace2 = instance_create(x, y, obj_bridgeSwappable); replace2.sprite_index = sprite_index; replace2.image_index = image_index; replace2.image_xscale = image_xscale; replace2.image_yscale = image_yscale; replace2.bridgetarget = other.bridgetarget; replace2.image_blend = other.c_nblue; instance_destroy(); } } } swapped = 0; } image_index = swapped; var housecolor = c_white; if (image_index == 0) housecolor = c_red; if (image_index == 1) housecolor = c_blue; if (dontskip == 1)
scr_fx_housesquare(x + (sprite_width / 2), y + (sprite_height / 2), housecolor);
110
    snd_play(snd_locker);
111
    instance_create(x, y, obj_shakeobj);
112
    global.interact = 0;
113
    con = 0;
114
}