Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_bullet_submoon_Step_0

(view raw script w/o annotations or w/e)
1
event_inherited();
2
if (y > (obj_growtangle.y + 86))
3
{
4
    image_alpha -= 0.1;
5
    if (image_alpha <= 0)
6
        instance_destroy();
7
}
8
slowed = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(slowed, 1 + sqrt(slow_factor), 9);
9
slow_factor = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(slow_factor, 0, 1);
10
mydir += (rotspd / slowed);
11
image_angle += (turnrate / slowed / (1 + (3 * touched_water)));
12
if (push)
13
    y += (push / (1 + touched_water));
14
push = 
scr_approach_curve
scr_approach_curve

function
scr_approach_curve(arg0, arg1, arg2)
{ return
scr_approach(arg0, arg1, max(0.1, abs(arg1 - arg0) / arg2));
}
(push, 0, 12 - (touched_water * 4));
15
if (touched_water)
16
{
17
    hspeed = 
scr_approach_curve
scr_approach_curve

function
scr_approach_curve(arg0, arg1, arg2)
{ return
scr_approach(arg0, arg1, max(0.1, abs(arg1 - arg0) / arg2));
}
(hspeed, 0, 15);
18
    vspeed = 
scr_approach_curve
scr_approach_curve

function
scr_approach_curve(arg0, arg1, arg2)
{ return
scr_approach(arg0, arg1, max(0.1, abs(arg1 - arg0) / arg2));
}
(vspeed, 1, 12);
19
    image_xscale *= 0.99;
20
    image_yscale *= 0.99;
21
    if (image_xscale < 0.1)
22
        instance_destroy();
23
}
24
if (instance_exists(master))
25
{
26
    disttarg = 
scr_approach_curve
scr_approach_curve

function
scr_approach_curve(arg0, arg1, arg2)
{ return
scr_approach(arg0, arg1, max(0.1, abs(arg1 - arg0) / arg2));
}
(disttarg, metadisttarg, 18);
27
    mydist = 
scr_approach_curve
scr_approach_curve

function
scr_approach_curve(arg0, arg1, arg2)
{ return
scr_approach(arg0, arg1, max(0.1, abs(arg1 - arg0) / arg2));
}
(mydist, disttarg, 20);
28
    x = master.x + lengthdir_x(mydist, mydir);
29
    y = master.y + lengthdir_y(mydist, mydir);
30
    if ((master.timer % 4) == 0)
31
        grazed = false;
32
    image_alpha = master.image_alpha;
33
    if (master.timer == 200)
34
        metadisttarg = 0;
35
}
36
else if (master != noone)
37
{
38
    instance_destroy();
39
}
40
if (slowdown == true)
41
{
42
    if (gotopointer == false)
43
    {
44
        friction = 0.1;
45
        gravity = 0;
46
        if (turnrate > 0)
47
            turnrate -= 0.1;
48
        if (turnrate < 0)
49
            turnrate = 0;
50
    }
51
    else if (i_ex(obj_rouxls_laser_pointer_controller))
52
    {
53
        direction = point_direction(x, y, obj_rouxls_laser_pointer_controller._mouse_x, obj_rouxls_laser_pointer_controller._mouse_y);
54
        if (speed < 3)
55
            speed += 0.2;
56
        if (turnrate < 2)
57
            turnrate += 0.1;
58
    }
59
}