Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_climb_leafling_Step_0

(view raw script w/o annotations or w/e)
1
if (con == -1 && scr_trigcheck_ext("leafling", 1164))
2
    con = 0;
3
if (con == 0)
4
{
5
    timer++;
6
    var lastx = x;
7
    var lasty = y;
8
    x = xstart + (sin(degtorad(startphase + (timer * 3))) * 140);
9
    y += (sin(degtorad(((startphase + (timer * 2)) % 90) * 2)) * 3);
10
    var dist = point_distance(x, y, lastx, lasty);
11
    image_speed = 0.15 * abs(dist);
12
    if (x > lastx)
13
        image_xscale = -2;
14
    else
15
        image_xscale = 2;
16
    if (i_ex(obj_climb_kris) && obj_climb_kris.y < (y - 60))
17
    {
18
        con = 1;
19
        timer = 0;
20
        snd_play(snd_b);
21
        var targalarm = 8;
22
        var excl = instance_create(x, y - (0.5 * sprite_height) - 40, obj_excblcon);
23
        excl.alarm[0] = targalarm;
24
        if (x < obj_climb_kris.x)
25
            image_xscale = -2;
26
        else
27
            image_xscale = 2;
28
        gravity_direction = 90;
29
        targetwind = 2;
30
        scr_vfx_windboost(90);
31
    }
32
}
33
else if (con == 1 && i_ex(obj_climb_kris))
34
{
35
    timer++;
36
    if (timer == 16)
37
    {
38
        var pdir = point_direction(x, y, obj_climb_kris.x, obj_climb_kris.y);
39
        speed = 8;
40
        direction = pdir;
41
        gravity = 0.2;
42
    }
43
    if (y < (cameray() - 100))
44
    {
45
        y = cameray() - 100;
46
        gravity = 0;
47
        vspeed = 0;
48
        hspeed = 0;
49
        con = 0;
50
        timer = 0;
51
    }
52
}
53
if (!i_ex(obj_climb_kris))
54
    con = -1;
55
visible = con >= 0;
56
if (!encountered && place_meeting(x, y, obj_climb_kris))
57
{
58
    encountered = true;
59
    sprite_index = spr_leafling_flydown;
60
    x -= (0.5 * sprite_width);
61
    y -= (0.5 * sprite_height);
62
    if (image_xscale == -2)
63
        x += sprite_width;
64
    with (obj_climb_kris)
65
    {
66
        if (jumpchargecon > 0)
67
        {
68
            image_blend = c_white;
69
            if (jumpchargesfx != -4)
70
                snd_stop(jumpchargesfx);
71
            button2buffer = 10;
72
            jumpchargecon = 0;
73
            jumpchargetimer = 0;
74
            jumpchargecon = 0;
75
            neutralcon = 1;
76
        }
77
        freeze = true;
78
        obj_mainchara.x = x;
79
        obj_mainchara.y = y;
80
        with (obj_caterpillarchara)
81
        {
82
            x = other.x;
83
            y = other.y;
84
        }
85
    }
86
    depth = obj_climb_kris.depth - 1;
87
    
scr_plat_encounter
scr_plat_encounter

function
scr_plat_encounter(arg0, arg1 = -1, arg2 = false)
{ with (obj_plat_game) paused = true; if (!instance_exists(obj_mainchara)) { with (obj_plat_player) { var mc = instance_create(x, y, obj_mainchara); mc.sprite_index = sprite_index; mc.image_index = image_index; mc.image_speed = 0; mc.cutscene = 1; mc.fun = 1; mc.depth = depth; } } with (obj_plat_player) instance_destroy(); with (obj_plat_follower) { restore_default_behavior(); with (back_marker)
scr_doom(self, 30).respects_platmode = false;
var cp = instance_create(x, y, obj_caterpillarchara); with (cp) { depth = other.depth; name = other.name; initialize(); x = other.x; y = other.y; sprite_index = other.sprite_index; image_index = other.image_index; image_speed = 0; fun = 1; follow = 0; var after_sprite = sprite_index; if (name == "ralsei") { after_sprite = 4371; parent = obj_mainchara; target = 24; global.cinstance[1] = id; } else { after_sprite = 8042; parent = obj_mainchara; global.cinstance[0] = id; } image_xscale = other.image_xscale; encounter_return_offset = [after_sprite, sprite_xoffset, sprite_yoffset, 2]; } instance_destroy(); } if (is_array(arg0)) { for (var i = 0; i < array_length(arg0); i++) { with (arg0[i]) { newme = instance_create(x, y, obj_testoverworldenemy); newme.image_xscale = image_xscale; newme.image_yscale = image_yscale; newme.sprite_index = touchsprite; newme.touchsprite = touchsprite; newme.slidesprite = sprite_index; newme.depth = depth; newme.silent = arg2; newme.eraser = false; newme.washit = false; newme.whichmonster = whichmonster; newme.platmode = true; if (i == 0) { if (arg1 > 0) global.flag[54 encounter_pointer] = arg1; global.flag[55 enemy_x] = x; global.flag[56 enemy_y] = y; global.encounterno = myencounter; with (newme) event_user(0); } } } } else { with (arg0) { if (arg1 > 0) global.flag[54 encounter_pointer] = arg1; global.flag[55 enemy_x] = x; global.flag[56 enemy_y] = y; newme = instance_create(x, y, obj_testoverworldenemy); newme.image_xscale = image_xscale; newme.image_yscale = image_yscale; newme.sprite_index = touchsprite; newme.touchsprite = touchsprite; newme.slidesprite = sprite_index; ...
(self);
88
    instance_destroy();
89
}