Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_attack_blue_flowerbullet_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 0)
2
{
3
    timer = 0;
4
    var angleoffset = irandom(360);
5
    for (var i = 0; i < bulletCount; i++)
6
    {
7
        if (i_ex(obj_dbulletcontroller))
8
            bullet[i] = instance_create(x, y, obj_regularbullet);
9
        else
10
            bullet[i] = instance_create(x, y, obj_marker);
11
        bullet[i].direction = ((i / bulletCount) * 360) + angleoffset;
12
        bullet[i].friction = -0.05;
13
        bullet[i].sprite_index = spr_bullet_werewire_spark;
14
        bullet[i].image_speed = 0;
15
        bullet[i].image_alpha = 0;
16
        with (bullet[i])
17
            
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", 0, 1 / other.bulletCount, other.flowerwait - 1);
18
        with (bullet[i])
19
            
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; } function scr_script_delayed_until() { var __scriptdelay = instance_create(0, 0, obj_script_delayed_function); __scriptdelay.script = argument[0]; __scriptdelay.condition = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; } function delay_function(arg0, arg1) { return
scr_script_delayed(arg0, arg1);
}
(scr_var, other.flowerwait, "image_alpha", 1);
20
        bullet[i].image_xscale = 0;
21
        bullet[i].image_yscale = 0;
22
        with (bullet[i])
23
            
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, other.flowerwait, 2, "out");
24
        with (bullet[i])
25
            
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_yscale", 0, 2, other.flowerwait, 2, "in");
26
        if (type == 0)
27
        {
28
            with (bullet[i])
29
                
scr_script_delayed
scr_script_delayed

function
scr_script_delayed()
{ var __scriptdelay = instance_create(0, 0, obj_script_delayed); __scriptdelay.script = argument[0]; __scriptdelay.alarm[0] = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; } function scr_script_delayed_until() { var __scriptdelay = instance_create(0, 0, obj_script_delayed_function); __scriptdelay.script = argument[0]; __scriptdelay.condition = argument[1]; __scriptdelay.target = id; for (var __i = 0; __i < (argument_count - 2); __i++) __scriptdelay.script_arg[__i] = argument[__i + 2]; __scriptdelay.arg_count = argument_count - 2; return __scriptdelay; } function delay_function(arg0, arg1) { return
scr_script_delayed(arg0, arg1);
}
(scr_var, other.flowerwait, "speed", 0.5);
30
            
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; }
(bullet[i], 120);
31
        }
32
    }
33
    if (type == 0)
34
        instance_destroy();
35
    con = 1;
36
}
37
if (con == 1)
38
{
39
    var triggered = false;
40
    timer++;
41
    if (timer > autoexplodetime)
42
        triggered = true;
43
    var mx = mouse_x;
44
    var my = mouse_y;
45
    if (point_in_rectangle(mx, my, x - 10, y - 10, x + 10, y + 10))
46
        triggered = true;
47
    if (collision_rectangle(x - 10, y - 10, x + 10, y + 10, obj_attack_yellow_reticle_bullet, 0, 1))
48
        triggered = true;
49
    if (triggered == true)
50
    {
51
        for (var i = 0; i < array_length(bullet); i++)
52
        {
53
            if (i_ex(bullet[i]))
54
            {
55
                bullet[i].speed = bulspeed;
56
                bullet[i].friction = bulfrict;
57
                
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; }
(bullet[i], 120);
58
            }
59
        }
60
        instance_destroy();
61
    }
62
}