Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_climbstarter_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    var trig = 0;
4
    if (global.flag[23 can_climb] && !i_ex(obj_climb_kris))
5
    {
6
        with (obj_climbstartertrig)
7
        {
8
            if (exitmarkerflag == other.exitmarkerflag)
9
            {
10
                if (myinteract == 3)
11
                {
12
                    trig = 10;
13
                    myinteract++;
14
                }
15
            }
16
        }
17
    }
18
    if (forcetoclimb == true)
19
        trig = 10;
20
    if (i_ex(obj_climb_kris))
21
        trig = -1;
22
    if (!global.flag[23 can_climb])
23
        trig = -1;
24
    if (trig == 10)
25
    {
26
        forcetoclimb = false;
27
        con = 1;
28
        timer = 0;
29
    }
30
}
31
if (con == 1)
32
{
33
    timer++;
34
    if (timer == 1)
35
    {
36
        obj_mainchara.visible = false;
37
        obj_mainchara.freeze = true;
38
        obj_mainchara.cutscene = true;
39
        endtime = 8;
40
        if (i_ex(obj_rotating_tower_controller_new) && center_if_tower == 1)
41
        {
42
            with (obj_rotating_tower_controller_new)
43
                
scr_pan_lerp
scr_pan_lerp

function
scr_pan_lerp(arg0, arg1, arg2)
{ panner = instance_create(arg0, arg1, obj_panner); panner.panmax = arg2; panner.type = 1; }
(tower_x - (0.5 * camerawidth()), cameray(), other.endtime);
44
        }
45
        var xx = x;
46
        var yy = y;
47
        var et = endtime;
48
        with (obj_caterpillarchara)
49
        {
50
            if (obj_mainchara.climb_with_caterpillars)
51
            {
52
                var spr = 83;
53
                var xxx = -40;
54
                if (name == "ralsei")
55
                {
56
                    spr = 484;
57
                    xxx = 40;
58
                }
59
                var gm = scr_genmarker(other.exitmarkerflag + name);
60
                if (gm != -4)
61
                {
62
                    xxx = 0;
63
                    xx = gm.x + 20;
64
                    yy = gm.y + 20;
65
                }
66
                if (instance_exists(obj_dw_cliff_climbrefresher) && y < 1000)
67
                    yy += 40;
68
                visible = 0;
69
                var jm = 
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1, arg12 = false)
{ var objinst = 1238; if (arg12) objinst = 1496; var thismarker = instance_create(arg0, arg1, objinst); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth_alt();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; } function scr_marker_fromasset(arg0, arg1 = depth, arg2 = false, arg3 = false) { if (is_undefined(arg0)) { debug_message("Warning: scr_marker_fromasset() sprite_instance didn't exist"); return -4; } var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var imagespeed = layer_sprite_get_speed(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var markertype = 1238; if (arg3) markertype = 1496; var thismarker = instance_create_depth(xloc, yloc, arg1, markertype); with (thismarker) { sprite_index = sprite; image_index = index; image_speed = imagespeed; image_xscale = xscale; image_yscale = yscale; image_angle = angle; image_blend = blend; image_alpha = alpha; if (arg2)
scr_depth_alt(id, arg2);
} return thismarker; } function scr_assetgetinfo(arg0) { var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var imagespeed = layer_sprite_get_speed(arg0); return [sprite, index, xloc, yloc, xscale, yscale, angle, blend, alpha, imagespeed]; }
(x, y, spr, 2, 2, 0.25, 0, c_white, depth);
70
                with (jm)
71
                {
72
                    
scr_jump_to_point
scr_jump_to_point

function
scr_jump_to_point(arg0, arg1, arg2, arg3, arg4 = 0)
{ var ___jump =
scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0);
with (___jump) { trackalpha = arg4; trackblend = arg4; trackindex = arg4; tracksprite = arg4; trackangle = arg4; } return ___jump; }
((xx - 2) + xxx, yy - 22, 8, et, true).end_step = true;
73
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ var _doom = instance_create_depth(0, 0, 0, obj_doom); with (_doom) { alarm[0] target = arg0; } return _doom; }
(self, et);
74
                }
75
            }
76
            else
77
            {
78
                with (obj_lerpvar)
79
                {
80
                    if (instance_exists(target) && target.id == other.id)
81
                        instance_destroy();
82
                }
83
                visible = 1;
84
                image_alpha = 1;
85
                
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; }
(id, c_white, c_gray, 7);
86
                
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; 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_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_alpha", 1, 0, 7);
87
            }
88
        }
89
        jumpmarker = 
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1, arg12 = false)
{ var objinst = 1238; if (arg12) objinst = 1496; var thismarker = instance_create(arg0, arg1, objinst); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth_alt();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; } function scr_marker_fromasset(arg0, arg1 = depth, arg2 = false, arg3 = false) { if (is_undefined(arg0)) { debug_message("Warning: scr_marker_fromasset() sprite_instance didn't exist"); return -4; } var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var imagespeed = layer_sprite_get_speed(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var markertype = 1238; if (arg3) markertype = 1496; var thismarker = instance_create_depth(xloc, yloc, arg1, markertype); with (thismarker) { sprite_index = sprite; image_index = index; image_speed = imagespeed; image_xscale = xscale; image_yscale = yscale; image_angle = angle; image_blend = blend; image_alpha = alpha; if (arg2)
scr_depth_alt(id, arg2);
} return thismarker; } function scr_assetgetinfo(arg0) { var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var imagespeed = layer_sprite_get_speed(arg0); return [sprite, index, xloc, yloc, xscale, yscale, angle, blend, alpha, imagespeed]; }
(obj_mainchara.x, obj_mainchara.y, spr_kris_jump_ball_fixed, 2, 2, 0.25, 0, c_white, obj_mainchara.depth);
90
        with (obj_mainchara)
91
            
scr_stickto
scr_stickto

function
scr_stickto(arg0, arg1)
{ _stickto = instance_create(0, 0, obj_stickto); _stickto.stickingobj = id; _stickto.stucktoobj = arg0; _stickto.relativedepth = arg1; with (_stickto) event_user(0); }
(other.jumpmarker, 0);
92
        with (jumpmarker)
93
        {
94
            
scr_jump_to_point
scr_jump_to_point

function
scr_jump_to_point(arg0, arg1, arg2, arg3, arg4 = 0)
{ var ___jump =
scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0);
with (___jump) { trackalpha = arg4; trackblend = arg4; trackindex = arg4; tracksprite = arg4; trackangle = arg4; } return ___jump; }
(other.x - 2, other.y - 22, 8, other.endtime, true).end_step = true;
95
            
scr_addtosunshadows
scr_addtosunshadows

function
scr_addtosunshadows(arg0, arg1 = draw_self, arg2 = false)
{ if (i_ex(obj_sunshadows)) { _shadowdraw_func = arg1; __cast_shadow = arg2; with (obj_sunshadows) array_push(inst_list, arg0); } }
(id);
96
        }
97
        snd_play(snd_wing);
98
    }
99
    if (timer == (1 + endtime))
100
    {
101
        global.interact = 0;
102
        snd_play(snd_noise);
103
        safe_delete(jumpmarker);
104
        with (instance_create(x + 20, y + 20, obj_climb_kris))
105
        {
106
            if (other.e_up)
107
                yclimb = 1;
108
        }
109
        if (obj_mainchara.climb_with_caterpillars)
110
        {
111
            var xx = obj_climb_kris.x - 40;
112
            var yy = obj_climb_kris.y;
113
            var gm = scr_genmarker(exitmarkerflag + "susie");
114
            if (gm != -4)
115
            {
116
                xx = gm.x + 20;
117
                yy = gm.y + 20;
118
            }
119
            if (instance_exists(obj_dw_cliff_climbrefresher) && y < 1000)
120
                yy += 40;
121
            var su = instance_create(xx, yy, obj_climb_susie);
122
            su.caterpillartarget = 1164;
123
            su.depth = obj_climb_kris.depth + 1;
124
            xx = obj_climb_kris.x + 40;
125
            yy = obj_climb_kris.y;
126
            gm = scr_genmarker(exitmarkerflag + "ralsei");
127
            if (gm != -4)
128
            {
129
                xx = gm.x + 20;
130
                yy = gm.y + 20;
131
            }
132
            if (instance_exists(obj_dw_cliff_climbrefresher) && y < 1000)
133
                yy += 40;
134
            var ra = instance_create(xx, yy, obj_climb_ralsei);
135
            ra.caterpillartarget = su;
136
            ra.depth = obj_climb_kris.depth + 2;
137
        }
138
        con = 0;
139
    }
140
}
141
if (susieball != -4)
142
{
143
    susietimer++;
144
    if (susietimer >= 20)
145
    {
146
        snd_play(snd_noise);
147
        safe_delete(susieball);
148
        instance_create(x + 20, y + 20, obj_climb_susie);
149
        susietimer = 0;
150
        susieball = -4;
151
    }
152
}