Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_cuttableflower_example_Step_0

(view raw script w/o annotations or w/e)
1
if (
scr_debug
scr_debug

function
scr_debug()
{ return global.debug == 1; }
())
2
{
3
    if (keyboard_check_pressed(ord("R")))
4
        room_restart();
5
    if (keyboard_check_pressed(vk_space))
6
    {
7
        con = 1;
8
        timer = 0;
9
    }
10
    if (mouse_x > x && mouse_x < (x + sprite_width) && mouse_y > y && mouse_y < (y + sprite_height))
11
    {
12
        if (con == 0)
13
        {
14
            con = 1;
15
            timer = 0;
16
        }
17
    }
18
}
19
if (con == 1)
20
{
21
    sprite_index = spr_dw_garden_cuttableflower_bloom;
22
    image_index = 0;
23
    image_speed = 0;
24
    var count = 8;
25
    var ang = random(33);
26
    for (var i = 0; i < count; i++)
27
    {
28
        with (
scr_marker_ext
scr_marker_ext

function
scr_marker_ext(arg0, arg1, arg2, arg3 = 1, arg4 = 1, arg5 = 0, arg6 = 0, arg7 = 16777215, arg8 = depth, arg9 = false, arg10 = -1, arg11 = 1, arg12 = false)
{ var objinst = 1238; if (arg12) objinst = 1496; var thismarker = instance_create(arg0, arg1, objinst); with (thismarker) { depth = arg8; sprite_index = arg2; image_speed = arg5; image_xscale = arg3; image_yscale = arg4; image_index = arg6; image_blend = arg7; image_alpha = arg11; if (arg9)
scr_depth_alt();
} if (arg10 > 0)
scr_doom(thismarker, arg10);
return thismarker; } function scr_marker_fromasset(arg0, arg1 = depth, arg2 = false, arg3 = false) { if (is_undefined(arg0)) { debug_message("Warning: scr_marker_fromasset() sprite_instance didn't exist"); return -4; } var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var imagespeed = layer_sprite_get_speed(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var markertype = 1238; if (arg3) markertype = 1496; var thismarker = instance_create_depth(xloc, yloc, arg1, markertype); with (thismarker) { sprite_index = sprite; image_index = index; image_speed = imagespeed; image_xscale = xscale; image_yscale = yscale; image_angle = angle; image_blend = blend; image_alpha = alpha; if (arg2)
scr_depth_alt(id, arg2);
} return thismarker; } function scr_assetgetinfo(arg0) { var sprite = layer_sprite_get_sprite(arg0); var index = layer_sprite_get_index(arg0); var xloc = layer_sprite_get_x(arg0); var yloc = layer_sprite_get_y(arg0); var xscale = layer_sprite_get_xscale(arg0); var yscale = layer_sprite_get_yscale(arg0); var angle = layer_sprite_get_angle(arg0); var blend = layer_sprite_get_blend(arg0); var alpha = layer_sprite_get_alpha(arg0); var imagespeed = layer_sprite_get_speed(arg0); return [sprite, index, xloc, yloc, xscale, yscale, angle, blend, alpha, imagespeed]; }
(x + 20, y + 20, spr_dw_garden_cuttableflowerpetals))
29
        {
30
            var life = 6;
31
            speed = 8;
32
            direction = ((i / count) * 360) + ang;
33
            friction = 1;
34
            
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; }
(id, life);
35
            image_speed = 0;
36
            
scr_size
scr_size

function
scr_size(arg0 = image_xscale, arg1 = image_yscale, arg2 = id)
{ with (arg2) { image_xscale = arg0; image_yscale = arg1; } }
(2, 2);
37
            image_index = random(4);
38
            vspeed *= 0.95;
39
            
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", 4, 0, life);
40
        }
41
    }
42
    con = 2;
43
    timer = 0;
44
}
45
if (con == 2)
46
{
47
    timer++;
48
    var resettime = 60;
49
    if (timer >= resettime)
50
    {
51
        con = 3;
52
        timer = 0;
53
    }
54
}
55
if (con == 3)
56
{
57
    timer++;
58
    image_index = timer * 0.2;
59
    if ((timer * 0.2) > (sprite_get_number(sprite_index) - 1))
60
    {
61
        sprite_index = spr_dw_garden_cuttableflower;
62
        image_index = 0;
63
        con = 0;
64
    }
65
}