Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_tenna_smashcut_attack_Step_0

(view raw script w/o annotations or w/e)
1
timer++;
2
var make_random_lightning = 0;
3
if (type == 0)
4
{
5
    if (timer == 10)
6
    {
7
        make_random_lightning = 1;
8
        timer = 0;
9
    }
10
}
11
if (type >= 1)
12
{
13
    if (timer == 10)
14
    {
15
        timer = -20;
16
        var vside = choose(-1, 1);
17
        var hside;
18
        if (type == 1 || type == 3)
19
        {
20
            hside = choose(-1, 1);
21
            if (hside == sideprevious)
22
                hside = choose(-1, 1);
23
            if (hside == sideprevious)
24
                hside = choose(-1, 1);
25
            if (type == 3)
26
            {
27
                side *= -1;
28
                vside = side;
29
            }
30
            timer = -16;
31
        }
32
        if (type == 2)
33
        {
34
            hside = choose(-1, 1, 2);
35
            if (hside == sideprevious)
36
                hside = choose(-1, 1, 2);
37
            if (hside == sideprevious)
38
                hside = choose(-1, 1, 2);
39
            timer = -16;
40
        }
41
        sideprevious = hside;
42
        var makex = obj_growtangle.x;
43
        var amount = 5;
44
        var randomhoz;
45
        if (type == 3)
46
        {
47
            amount = 3;
48
            randomhoz = random_range(-30, 30);
49
        }
50
        for (var i = 0; i < amount; i++)
51
        {
52
            if (hside == 1 || hside == -1)
53
                makex = obj_growtangle.x + ((70 - (i * 16)) * hside);
54
            else if ((i % 2) == 0)
55
                makex = obj_growtangle.x - (i * 8);
56
            else
57
                makex = obj_growtangle.x + (i * 8);
58
            if (type == 3)
59
                makex = obj_growtangle.x + (((60 - (i * 60)) + randomhoz) * hside);
60
            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; }
(makex, obj_growtangle.y + (140 * vside), obj_regularbullet, 180 - (90 * side), 0, spr_tenna_smash_lightning))
61
            {
62
                target = other.target;
63
                damage = other.damage;
64
                vspeed = vside * -(2 - (i / 4));
65
                friction = -0.08;
66
                grazepoints = 1.7;
67
                if (other.type == 3)
68
                    grazepoints = 4.5;
69
                mask_index = spr_tenna_smash_lightning_mask;
70
                image_xscale = 2;
71
                image_yscale = 2;
72
                if (other.type == 3)
73
                {
74
                    friction = -0.03;
75
                    image_alpha = 0;
76
                    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_alpha", 4, 0, 100);
77
                    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_alpha", 0, 1, 8);
78
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 100);
79
                }
80
                else
81
                {
82
                    
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 70);
83
                    image_alpha = 0;
84
                    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_alpha", 4, 0, 70);
85
                    
scr_lerpvar
scr_lerpvar

function
scr_lerpvar()
{ 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_lerpvar_respect() { 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]);
___lerpvar.respectglobalinteract = true; return ___lerpvar; }
("image_alpha", 0, 1, 8);
86
                }
87
            }
88
        }
89
    }
90
}
91
if (make_random_lightning)
92
{
93
    side *= -1;
94
    aim_counter++;
95
    var hoz = obj_growtangle.x + irandom_range(-85, 85);
96
    if (aim_counter >= 7 || (aim_counter > 4 && irandom(1)))
97
    {
98
        hoz = obj_heart.x + 10;
99
        aim_counter = 0;
100
    }
101
    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; }
(hoz, obj_growtangle.y + (120 * side), obj_regularbullet, 180 - (90 * side), 0, spr_tenna_smash_lightning))
102
    {
103
        x += 4;
104
        
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; }
(scr_var, 1, "x", x - 8);
105
        
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; }
(scr_var, 2, "x", x + 7);
106
        
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; }
(scr_var, 3, "x", x - 6);
107
        
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; }
(scr_var, 4, "x", x + 5);
108
        
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; }
(scr_var, 5, "x", x - 4);
109
        
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; }
(scr_var, 6, "x", x + 3);
110
        
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; }
(scr_var, 7, "x", x - 2);
111
        
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; }
(scr_var, 8, "x", x + 1);
112
        
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; }
(scr_lerpvar, 10, "speed", 2, 6, 20);
113
        visible = false;
114
        mask_index = spr_tenna_smash_lightning_mask;
115
        image_xscale = 2;
116
        image_yscale = 2;
117
        grazepoints = 2;
118
        target = other.target;
119
        damage = other.damage;
120
    }
121
}