Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_bullet_foxtrot_Step_0

(view raw script w/o annotations or w/e)
1
event_inherited();
2
timer--;
3
if (timer == 0)
4
{
5
    direction += clamp(angle_difference(
scr_at_player
scr_at_player

function
scr_at_player(arg0 = x, arg1 = y)
{ return point_direction(arg0, arg1, obj_heart.x + 10, obj_heart.y + 10); }
(), direction), -45, 45);
6
    side *= -1;
7
    with (
scr_bullet_create
scr_bullet_create

function
scr_bullet_create(arg0, arg1, arg2)
{ var __newbullet = instance_create(arg0, arg1, arg2); __newbullet.damage = damage; __newbullet.target = target; if (variable_instance_exists(self, "element")) __newbullet.element = element; return __newbullet; }
(x, y, obj_bullet_foxprint))
8
    {
9
        direction = other.direction;
10
        image_angle = direction;
11
        image_xscale = 2;
12
        image_yscale = 2;
13
        owner = other.id;
14
        damage = 92;
15
        target = 4;
16
        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 + lengthdir_x(14, direction), y + lengthdir_y(14, direction), obj_netskiebullet1, direction, 0, spr_bullet_toebean, true))
17
        {
18
            owner = other.id;
19
            image_xscale = 2;
20
            image_yscale = 2;
21
            image_speed = 0;
22
            destroyonhit = false;
23
        }
24
        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 + lengthdir_x(7, direction) + lengthdir_x(12, direction + 90), y + lengthdir_y(7, direction) + lengthdir_y(12, direction + 90), obj_netskiebullet1, direction + 20, 0, spr_bullet_toebean, true))
25
        {
26
            owner = other.id;
27
            image_xscale = 2;
28
            image_yscale = 2;
29
            image_speed = 0;
30
            image_index = 1;
31
            destroyonhit = false;
32
        }
33
        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 + lengthdir_x(7, direction) + lengthdir_x(12, direction - 90), y + lengthdir_y(7, direction) + lengthdir_y(12, direction - 90), obj_netskiebullet1, direction - 20, 0, spr_bullet_toebean, true))
34
        {
35
            owner = other.id;
36
            image_xscale = 2;
37
            image_yscale = -2;
38
            image_speed = 0;
39
            image_index = 1;
40
            destroyonhit = false;
41
        }
42
        if (other.ratio)
43
        {
44
            var rotate = 22.5;
45
            while (rotate < 360)
46
            {
47
                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 + lengthdir_x(16, direction + (rotate * other.side)), y + lengthdir_y(16, direction + (rotate * other.side)), obj_netskiebullet1, direction + (rotate * other.side), 1.8 + ((rotate % 90) / 90), spr_leafling_petal, true, false, 3))
48
                {
49
                    image_xscale = 0;
50
                    image_yscale = 2;
51
                    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_xscale", 0, 2, 9);
52
                }
53
                rotate += 45;
54
            }
55
        }
56
    }
57
    timer = 30 + (10 * sameattack);
58
    show_debug_message(timer);
59
}
60
else if (timer < 21 && timer > 4)
61
{
62
    direction += clamp(angle_difference(
scr_at_player
scr_at_player

function
scr_at_player(arg0 = x, arg1 = y)
{ return point_direction(arg0, arg1, obj_heart.x + 10, obj_heart.y + 10); }
(), direction), -1.5, 1.5);
63
    x += lengthdir_x(2 + (timer / 5), direction);
64
    y += lengthdir_y(2 + (timer / 5), direction);
65
    var rotate = random(360);
66
    var dist = random(28);
67
    if ((timer % 3) == 2)
68
    {
69
        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 + lengthdir_x(dist, rotate), y + lengthdir_y(dist, rotate), obj_bulletparent, (rotate + random(30)) - 15, random(1), spr_leafling_petal, false, false, 3))
70
        {
71
            image_blend = c_gray;
72
            
scr_lerp_imageblend
scr_lerp_imageblend

function
scr_lerp_imageblend()
{ var lerpblend = instance_create(x, y, obj_lerpimageblend); lerpblend.target = argument0; lerpblend.color1 = argument1; lerpblend.color2 = argument2; var ___time = argument3; if (argument_count > 4) { var _style = argument4; var _ease = argument5; lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time, _style, _ease); } else { lerpblend.mylerp = scr_lerp_var_instance(lerpblend, "blendindex", 0, 1, ___time); } with (lerpblend) alarm_set(0, ___time); return lerpblend; }
(id, c_gray, c_black, 30);
73
            
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ var _id = self; if (!is_struct(self)) _id = id; if (argument_count < 6) ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3]);
else ___lerpvar =
scr_lerpvar_instance(_id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]);
return ___lerpvar; } function scr_lerpcol() { if (argument_count < 6) ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3]); else ___lerpvar = scr_lerpcol_instance(id, argument[0], argument[1], argument[2], argument[3], argument[4], argument[5]); return ___lerpvar; }
("image_alpha", 1, 0, 30);
74
            
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ var _doom = instance_create_depth(0, 0, 0, obj_doom); with (_doom) { alarm[0] target = arg0; } return _doom; }
(id, 31);
75
            image_angle = (other.direction - 9) + random(18);
76
            image_xscale = 2;
77
            image_yscale = 2;
78
            friction = speed / 40;
79
        }
80
    }
81
}