Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_blue_guidelines_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if ((timer % 3) == 0 || instance_number(obj_blue_guideline) < 4)
3
{
4
    var last_line = ds_list_find_value(line_list, ds_list_size(line_list) - 1);
5
    var last_dir = last_line.image_angle;
6
    var new_dir = 0;
7
    if (point_distance(last_line.x, last_line.y, obj_heart.x, obj_heart.y) > 20)
8
        new_dir = last_line.image_angle + 
scr_ease_towards_direction
scr_ease_towards_direction

function
scr_ease_towards_direction()
{ return median(-argument2, argument2, (1 - argument3) * angle_difference(argument1, argument0)); } function scr_ease_towards_direction_angle() { image_angle += median(-argument1, argument1, (1 - argument2) * angle_difference(argument0, image_angle)); exit; } function scr_ease_towards_direction_manual() { direction += median(-argument1, argument1, (1 - argument2) * angle_difference(argument0, direction)); exit; }
(last_line.image_angle, point_direction(last_line.x + lengthdir_x(8, last_dir), last_line.y + lengthdir_y(8, last_dir), obj_heart.x, obj_heart.y), 35, 0.5);
9
    else
10
        new_dir = last_line.image_angle + 
scr_ease_towards_direction
scr_ease_towards_direction

function
scr_ease_towards_direction()
{ return median(-argument2, argument2, (1 - argument3) * angle_difference(argument1, argument0)); } function scr_ease_towards_direction_angle() { image_angle += median(-argument1, argument1, (1 - argument2) * angle_difference(argument0, image_angle)); exit; } function scr_ease_towards_direction_manual() { direction += median(-argument1, argument1, (1 - argument2) * angle_difference(argument0, direction)); exit; }
(last_line.image_angle, point_direction(last_line.x + lengthdir_x(8, last_dir), last_line.y + lengthdir_y(8, last_dir), obj_heart.x, obj_heart.y), 15, 0.25);
11
    counter++;
12
    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; }
(last_line.x + lengthdir_x(8, last_dir) + lengthdir_x(10, new_dir), last_line.y + lengthdir_y(8, last_dir) + lengthdir_y(10, new_dir), obj_blue_guideline, 0, 0, -4, 0, true))
13
    {
14
        depth += (other.depth + 1.1);
15
        image_angle = new_dir;
16
        ds_list_add(other.line_list, id);
17
        if ((other.counter % (12 - (other.difficulty * 3))) == 0)
18
        {
19
            sprite_index = spr_enemy_blue_flower_reticle;
20
            depth -= 0.1;
21
            image_xscale = 2;
22
            image_yscale = 2;
23
            xscale_goal = 1.5;
24
            yscale_goal = 1.5;
25
        }
26
    }
27
}
28
if (timer == 32)
29
{
30
    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; }
(camerax() + 438, cameray() + 181, obj_yellow_guided_bullet, 0, 0, -4, 0, true))
31
    {
32
        with (obj_blue_guidelines)
33
        {
34
            other.speed = 4.5;
35
            other.direction = point_direction(other.x, other.y, ds_list_find_value(line_list, 0).x, ds_list_find_value(line_list, 0).y);
36
            other.image_angle = other.direction;
37
        }
38
    }
39
}