Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_ch4_DCC00_sword_Step_0

(view raw script w/o annotations or w/e)
1
if (!is_active)
2
    exit;
3
sword_timer++;
4
if (sword_timer == 1)
5
{
6
    snd_play_x(snd_knight_jump_quick, 1, 1.3);
7
    var _xpos = flip_side ? (camerax() + 600) : (camerax() + 40);
8
    sword_marker = 
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; }
(_xpos, target_y_pos, spr_roaringknight_sword3);
9
    sword_marker.image_angle = 0;
10
    sword_marker.image_xscale = flip_side ? -2 : 2;
11
    sword_marker.image_yscale = 2;
12
    with (sword_marker)
13
    {
14
        image_alpha = 0;
15
        depth = 5900;
16
    }
17
}
18
if (sword_timer == 2)
19
{
20
    with (sword_marker)
21
    {
22
        var _xpos2 = other.flip_side ? (camerax() + 560) : (camerax() + 80);
23
        
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, _xpos2, 10, -1, "out");
24
        
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, 20, 3, "out");
25
    }
26
}
27
if (sword_timer == 15)
28
{
29
    snd_play(motor_swing_down);
30
    with (sword_marker)
31
    {
32
        hspeed = -25 * (other.flip_side ? -1 : 1);
33
        gravity_direction = other.flip_side ? 180 : 360;
34
        gravity = 4;
35
    }
36
    
scr_doom
scr_doom

function
scr_doom(arg0 = id, arg1)
{ with (instance_create_depth(0, 0, 0, obj_doom)) { alarm[0] target = arg0; persistent = arg0.persistent; } }
(sword_marker, 50);
37
}
38
if (sword_timer == 32)
39
{
40
    destroyed = true;
41
    instance_create(x, y, obj_shake);
42
    snd_play(snd_explosion_mmx3);
43
}
44
if (sword_timer == 38)
45
{
46
    is_active = false;
47
    sword_timer = 0;
48
    destroyed = false;
49
}
50
if (sword_timer == 75)
51
{
52
}