Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_ch3_PTB02_roaringknight_speardodge_sequence_Draw_0

(view raw script w/o annotations or w/e)
1
timer++;
2
if (done == 0)
3
{
4
    if (con == 0)
5
    {
6
        con = -1;
7
        
scr_var_delay
scr_var_delay

function
scr_var_delay(arg0, arg1, arg2)
{
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_var_delayed(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_delay_var(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
}
("spear_dodge", 1, 10);
8
        
scr_var_delay
scr_var_delay

function
scr_var_delay(arg0, arg1, arg2)
{
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_var_delayed(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_delay_var(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
}
("con", 3, 12);
9
        makespear = 1;
10
        image_index = 12;
11
        
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_index", 12, 3, 18, 2, "out");
12
        sprite_index = spr_roaringknight_ball_transition;
13
        directshot = 1;
14
        image_speed = 0;
15
    }
16
    if (con == 3)
17
    {
18
        makespear = 0;
19
        rotate = 1;
20
        con = 4;
21
        if (done == 0)
22
            
scr_var_delay
scr_var_delay

function
scr_var_delay(arg0, arg1, arg2)
{
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_var_delayed(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
} function scr_delay_var(arg0, arg1, arg2) {
scr_script_delayed(scr_var, arg2, arg0, arg1);
}
("con", 0, 6);
23
    }
24
}
25
if (done == 1)
26
    makespear = 0;
27
if (spear_dodge == 1)
28
{
29
    var gox = xstart + (choose(40, 50, 60, 70) * choose(rem1));
30
    var goy = ystart + (choose(20, 30, 40) * choose(-1, 1));
31
    if (done)
32
        gox = xstart;
33
    if (done)
34
        goy = ystart;
35
    con = 2;
36
    
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; }
("x", x, gox, 12, 2, "out");
37
    
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; }
("y", y, goy, 12, 2, "out");
38
    rem1 *= -1;
39
    spear_dodge = 0;
40
}
41
if (rotate)
42
    image_index = 3 + (sin(timer / 2) * 1.6);
43
var speargfx = 4401;
44
var directshot = 1;
45
if (makespear == 1 && (timer % 4) == 0)
46
{
47
    snd_play_x(snd_swing, 0.4 + random(0.3), 1.1 + random(0.4));
48
    var spear = 
scr_dark_marker
scr_dark_marker

function
scr_dark_marker(arg0, arg1, arg2)
{ thismarker = instance_create(arg0, arg1, obj_marker); with (thismarker) { sprite_index = arg2; image_speed = 0; image_xscale = 2; image_yscale = 2; } return thismarker; }
(camerax() + 480 + random(200), cameray() - 80, speargfx);
49
    with (spear)
50
    {
51
        depth = other.depth - 100;
52
        
scr_doom
scr_doom

function
scr_doom(arg0, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; } }
(id, 40);
53
        friction = -1;
54
        direction = point_direction(x, y, other.x + 110, other.y + 80) + random_range(-1, 1);
55
        if (directshot == 0)
56
            direction += random_range(-20, 20);
57
        image_angle = direction + 90;
58
        speed = 7;
59
    }
60
}
61
if ((timer % 2) == 0)
62
{
63
    var afterimage = 
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
64
    afterimage.image_alpha = 0.8;
65
    afterimage.direction = random(360);
66
    afterimage.speed = 2;
67
    with (obj_marker)
68
    {
69
        if (sprite_index == speargfx)
70
        {
71
            afterimage = 
scr_afterimage
scr_afterimage

function
scr_afterimage()
{ afterimage = instance_create(x, y, obj_afterimage); afterimage.sprite_index = sprite_index; afterimage.image_index = image_index; afterimage.image_blend = image_blend; afterimage.image_speed = 0; afterimage.depth = depth; afterimage.image_xscale = image_xscale; afterimage.image_yscale = image_yscale; afterimage.image_angle = image_angle; return afterimage; }
();
72
            afterimage.image_alpha = 0.5;
73
        }
74
    }
75
}
76
draw_self();