Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_rouxls_moon_bullet_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 1)
2
{
3
    timer++;
4
    image_alpha += 0.05;
5
    if (timer == 20)
6
    {
7
        timer = 0;
8
        con = 2;
9
    }
10
}
11
if (con == 2)
12
{
13
    timer++;
14
    x = lerp(start_x, target_x, timer / 30);
15
    y = lerp(start_y, target_y, timer / 30);
16
    if (timer == 30)
17
    {
18
        timer = 0;
19
        con = 3;
20
        move_count++;
21
        start_x = x;
22
        start_y = y;
23
        if (move_count == 1)
24
        {
25
            target_x = x - 79;
26
            target_y = y;
27
        }
28
        if (move_count == 2)
29
        {
30
            target_x = x + 79;
31
            target_y = y;
32
        }
33
        if (move_count == 3)
34
        {
35
            target_x = x;
36
            target_y = y - 79;
37
        }
38
    }
39
}
40
if (con == 3)
41
{
42
    timer++;
43
    if (timer == 26)
44
    {
45
        timer = 0;
46
        con = 2;
47
    }
48
}
49
if (con == 4)
50
{
51
    if (i_ex(obj_rouxls_laser_pointer_controller))
52
    {
53
        var xx = real(obj_rouxls_laser_pointer_controller._mouse_x);
54
        var yy = real(obj_rouxls_laser_pointer_controller._mouse_y);
55
        if (point_distance(x, y, xx, yy) > 10)
56
        {
57
            move_towards_point(xx, yy, 2);
58
        }
59
        else
60
        {
61
            speed = 0;
62
            alarm[0]
 = 30;
gml_Object_obj_rouxls_moon_bullet_Alarm_0.gml

exit;
63
        }
64
    }
65
    else
66
    {
67
        speed = 0;
68
    }
69
    if (alarm[0] > 0)
70
        speed = 0;
71
}
72
if (sun == 1 && con > 1)
73
{
74
    suntimer++;
75
    var interval = 18;
76
    if (interval > 0)
77
    {
78
        if ((suntimer % interval) == 0)
79
        {
80
            if (i_ex(obj_rouxls_laser_pointer_controller))
81
            {
82
                var xx = real(obj_rouxls_laser_pointer_controller._mouse_x);
83
                var yy = real(obj_rouxls_laser_pointer_controller._mouse_y);
84
                for (n = 3; n < 6; n++)
85
                {
86
                    with (
scr_fire_bullet
scr_fire_bullet

function
scr_fire_bullet(arg0, arg1, arg2, arg3, arg4, arg5 = -4, arg6 = 0, arg7 = false, arg8 = 87135)
{ var bullet; if (arg8 != 87135) bullet = instance_create_depth(arg0, arg1, arg8, arg2); else bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; if (arg5 != -4) sprite_index = arg5; updateimageangle = arg6; if (arg6) image_angle = arg3; if (arg7) { with (other)
scr_bullet_inherit(other.id);
} } return bullet; } function scr_fire_bullet_colorize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 = 0) { var bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; sprite_index = arg5; image_blend = arg6; updateimageangle = arg7; if (arg7) image_angle = arg3; } return bullet; }
(x, y, obj_rouxls_suncloud_bullets, point_direction(x, y, xx, yy), 0.1, spr_sunbolt))
87
                    {
88
                        updateimageangle = 1;
89
                        image_angle = direction;
90
                        friction = -0.15;
91
                    }
92
                }
93
            }
94
            else
95
            {
96
                var basedir = irandom(360);
97
                for (n = 3; n < 6; n++)
98
                {
99
                    with (
scr_fire_bullet
scr_fire_bullet

function
scr_fire_bullet(arg0, arg1, arg2, arg3, arg4, arg5 = -4, arg6 = 0, arg7 = false, arg8 = 87135)
{ var bullet; if (arg8 != 87135) bullet = instance_create_depth(arg0, arg1, arg8, arg2); else bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; if (arg5 != -4) sprite_index = arg5; updateimageangle = arg6; if (arg6) image_angle = arg3; if (arg7) { with (other)
scr_bullet_inherit(other.id);
} } return bullet; } function scr_fire_bullet_colorize(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 = 0) { var bullet = instance_create(arg0, arg1, arg2); with (bullet) { direction = arg3; speed = arg4; sprite_index = arg5; image_blend = arg6; updateimageangle = arg7; if (arg7) image_angle = arg3; } return bullet; }
(x, y, obj_rouxls_suncloud_bullets, basedir + (120 * (n + (suntimer / interval))) + random(10), 0.1, spr_sunbolt))
100
                    {
101
                        updateimageangle = 1;
102
                        image_angle = direction;
103
                        friction = -0.15;
104
                    }
105
                }
106
            }
107
        }
108
    }
109
}
110
if (sun == 0 && con > 1)
111
{
112
    if ((timer % 4) == 0)
113
        grazed = false;
114
    tilt += 0.2;
115
    image_angle = sin(tilt) * 18;
116
    if (timer == 201)
117
    {
118
        with (obj_regularbullet)
119
        {
120
            if (sprite_index == spr_lanino_moon)
121
                active = false;
122
        }
123
    }
124
}