Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_ch5_DWCL01_Create_0

(view raw script w/o annotations or w/e)
1
layer_set_visible("CUTSCENE_ELEMENTS", false);
2
layer_set_visible("NPCs", false);
3
npc_yellow = 
scr_plat_makeactor_fromasset
scr_plat_makeactor_fromasset

function
scr_plat_makeactor_fromasset(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
{ var sourcenpc = arg0; var _npc = instance_create_depth(sourcenpc.x, sourcenpc.y, 0, obj_plat_npc); arg1 = arg1 ?? sourcenpc.sprite_index; arg2 = arg2 ?? arg1; arg3 = arg3 ?? arg1; arg4 = arg4 ?? arg2; arg5 = arg5 ?? arg2; arg6 = arg6 ?? arg5; arg7 = arg7 ?? arg1; with (_npc) { spr_idle = arg1; spr_run = arg2; spr_halt = arg3; spr_turn = arg4; spr_jump = arg5; spr_fall = arg6; spr_land = arg7; jumpheight = 21; set_sprite(arg1); } depth = 2200; return _npc; }
(findspriteinfo(spr_yellow_walk_right, undefined));
4
con = 0;
5
npc_key = scr_marker_fromasset(findsprite(spr_fcastle_yellow_key));
6
npc_glow = instance_create(npc_key.x, npc_key.y + 4, obj_marker_fancy);
7
with (npc_glow)
8
{
9
    sprite_index = spr_dw_feather_glow;
10
    siner = 0;
11
    depth = other.npc_key.depth + 1;
12
    image_speed = 0.25;
13
    image_alpha = 0.5;
14
    
15
    step_func = function()
16
    {
17
        siner += 0.03;
18
        image_xscale = 1.75 + (0.25 * sin(siner));
19
        image_yscale = 1.75 + (0.25 * sin(siner + 0.3));
20
    };
21
}
22
if (global.flag[1454] >= 10)
23
{
24
    npc_yellow.visible = 0;
25
    npc_key.visible = 0;
26
    npc_glow.visible = 0;
27
}
28
hattimer = 0;
29
supershock = false;
30
camy = 0;
31
npc_hat = instance_create(-100, -100, obj_marker_fancy);
32
with (npc_hat)
33
{
34
    con = 0;
35
    yel = other.npc_yellow;
36
    timer = 0;
37
    sprite_index = spr_yellow_hat_spin;
38
    
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
39
    image_speed = 0.25;
40
    y = yel.y - 300;
41
    
42
    step_func = function()
43
    {
44
        if (con == 1)
45
        {
46
            timer++;
47
            vspeed = min(vspeed + 0.1, 3);
48
            var goalx = yel.x + 14;
49
            var goaly = yel.y;
50
            var amp = abs(y - yel.y) * 0.2;
51
            image_speed = 0.25 + (sin(0.15 * timer) * 0.3) + (sin(0.05 * timer) * 0.1);
52
            x = (goalx + (amp * sin(timer * 0.08))) - (sin((timer + 0.32) * 0.03) * amp * 1.3);
53
            if (y >= (goaly - 40))
54
            {
55
                snd_play(snd_item);
56
                
c_waitcustom_end
c_waitcustom_end

function
c_waitcustom_end()
{ with (obj_cutscene_master) { cs_wait_custom = 0; waiting = 0; } }
();
57
                with (yel)
58
                {
59
                    force_animation(106);
60
                    x += 3;
61
                }
62
                instance_destroy();
63
            }
64
        }
65
    };
66
}
67
gallopsnd = -4;
68
dark_overlay = -4;
69
npc_yellow.visible = 0;
70
flower_ruined = 0;
71
72
destroy_guns = function()
73
{
74
    with (obj_plat_enm_gun)
75
    {
76
        hit = 1;
77
        hp = 0;
78
        instance_destroy();
79
    }
80
    audio_stop_sound(snd_punchweak);
81
    snd_play(snd_punchweak);
82
};
83
84
makeguns = function()
85
{
86
    for (var i = 0; i < 6; i++)
87
    {
88
        var gm = scr_genmarker("gun" + string(i + 1));
89
        if (gm != -4)
90
        {
91
            
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);
}
(function(arg0, arg1)
92
            {
93
                var gun = instance_create(arg0.x, arg0.y + random_range(80, 100), obj_flower_spawner);
94
                with (gun)
95
                {
96
                    obj_index = 376;
97
                    _memory.targetindex = floor(arg1 / 2);
98
                    _memory.aiming = true;
99
                    _memory.generated = true;
100
                    _memory.catchup_lerp = 1;
101
                    _memory.shotdelay_start = -1;
102
                    _memory.volleys = [[3]];
103
                }
104
            }, 1 + (2 * i), gm, i);
105
        }
106
    }
107
};