Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_cliff_crater_leaf_Step_0

(view raw script w/o annotations or w/e)
1
if (!init)
2
{
3
    center.x = xstart;
4
    center.y = ystart;
5
    if (target != -4)
6
    {
7
        offset.x = (target.x - target.sprite_xoffset) + (target.sprite_width / 2);
8
        offset.y = (target.y - target.sprite_yoffset) + target.sprite_height;
9
    }
10
    init = true;
11
    if (style == 1)
12
    {
13
        sprite_index = choose(spr_bush_leaf_pink, spr_bush_leaf2_pink, spr_bush_leaf3_pink);
14
        
scr_darksize
scr_darksize

function
scr_darksize()
{ var inst = id; if (argument_count) inst = argument0; inst.image_xscale = 2; inst.image_yscale = 2; }
();
15
    }
16
    start_depth = depth;
17
}
18
if (target != -4)
19
{
20
    center.x = target.x;
21
    center.y = target.y;
22
}
23
var _str = 1;
24
var has_owner = instance_exists(owner);
25
if (has_owner)
26
    _str = owner.strength;
27
x = (center.x + offset.x) - (sin(siner / 8) * ((distance + start_distance + (_str * 5)) - 1));
28
var _yner = cos(siner / 8);
29
if (_yner > 0)
30
    depth = start_depth + 1;
31
else
32
    depth = start_depth - 1;
33
var _ys = 1;
34
if (has_owner)
35
    _ys = 1 - owner.ys[0];
36
y = center.y + ((offset.y + (_yner * (distance + start_distance) * 0.5)) * _ys);
37
if (start_distance > 0)
38
    start_distance -= 5;
39
if (downward)
40
    height -= (floor(_str) + str_mod);
41
else
42
    height += floor(_str);
43
var col = 32768;
44
if (style == 1)
45
    col = 16711935;
46
if (_yner < 0)
47
{
48
    image_xscale = 1.75;
49
    image_yscale = 1.75;
50
}
51
else
52
{
53
    image_xscale = 2;
54
    image_yscale = 2;
55
}
56
image_blend = merge_color(c_white, c_gray, clamp01(-_yner));
57
str_mod += 0.05;
58
distance += 0.25;
59
siner += (0.5 + (_str / 2));
60
cosiner++;
61
lifetime--;
62
if (lifetime <= 0)
63
{
64
    image_alpha -= 0.1;
65
    if (image_alpha <= 0)
66
        instance_destroy();
67
}
68
else if (image_alpha < 1)
69
{
70
    image_alpha = min(image_alpha + 0.25, 1);
71
}