Deltarune script viewer

← back to main script listing

gml_Object_obj_city_cyberballoon_mouse_Step_0

(view raw script w/o annotations or w/e)
1
if (falling == 1)
2
{
3
    if (d_ex())
4
    {
5
        if (paused == 0)
6
        {
7
            remvspeed = vspeed;
8
            remx = x;
9
            remy = y;
10
            paused = 1;
11
        }
12
        setxy(remx, remy);
13
    }
14
    else
15
    {
16
        if (paused == 1)
17
        {
18
            vspeed = remvspeed;
19
            paused = 0;
20
        }
21
        vspeed += 0.4;
22
        vspeed = clamp(vspeed, 0, 8);
23
    }
24
    if (i_ex(obj_kris_headobj))
25
    {
26
        if (y <= (obj_kris_headobj.bbox_bottom - 20))
27
            depth = obj_kris_headobj.depth + 100;
28
        else
29
            depth = obj_kris_headobj.depth - 100;
30
    }
31
    var boxcheck = instance_place(x, y, obj_kris_headobj);
32
    if (boxcheck >= 100)
33
    {
34
        var qualify = 0;
35
        var xpush = 0;
36
        if (y >= (boxcheck.bbox_top - 8))
37
            qualify = 1;
38
        if (y >= (boxcheck.bbox_bottom - 20))
39
            qualify = 0;
40
        if (x <= (boxcheck.bbox_left + 4))
41
        {
42
            qualify = 0;
43
            xpush = -4;
44
        }
45
        if (x >= (boxcheck.bbox_right - 4))
46
        {
47
            qualify = 0;
48
            xpush = 4;
49
        }
50
        x += xpush;
51
        if (qualify)
52
        {
53
            obj_kris_headobj.miceheld++;
54
            cloud = scr_afterimage
scr_afterimage

function scr_afterimage() { afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
55
            cloud.depth = depth - 200;
56
            cloud.vspeed = -1 - random(1.4);
57
            cloud.friction = 0.2;
58
            cloud.y -= 8;
59
            cloud.sprite_index = spr_fx_mushroomcloud;
60
            snd_play(snd_bump);
61
            snd_play(snd_wing);
62
            instance_destroy();
63
        }
64
    }
65
    if (y >= ythreshold || y > (cameray() + 480))
66
    {
67
        if (balloonid >= 0)
68
            obj_room_dw_city_postbaseball.balloondestroyed[balloonid] = 1;
69
        if (obj_kris_headobj.mousefailcon == 0 && obj_room_dw_city_postbaseball.minigame == 1)
70
            obj_kris_headobj.mousefailcon = 1;
71
        snd_play(snd_mouse);
72
        jumper = scr_afterimage
scr_afterimage

function scr_afterimage() { afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
73
        with (jumper)
74
            scr_jump_to_point
scr_jump_to_point

function scr_jump_to_point(arg0, arg1, arg2, arg3) { return scr_jump_to_point_sprite(arg0, arg1, arg2, arg3, 0, 0); }
(x + random_range(-40, 40), room_height + (sprite_height * 2), 20, 16);
75
        instance_destroy();
76
    }
77
}