Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_darkshape_Step_0

(view raw script w/o annotations or w/e)
1
if (!i_ex(obj_darkshape_manager))
2
    exit;
3
var hx = obj_heart.x + 10;
4
var hy = obj_heart.y + 10;
5
if (fast_timer)
6
{
7
    timer += fastval;
8
    fast_timer--;
9
}
10
else
11
{
12
    timer++;
13
}
14
true_timer++;
15
if (!irandom(20))
16
    fast_timer = 10 + irandom(6);
17
if (image_alpha != 1)
18
{
19
    image_alpha = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(image_alpha, 1, 0.025);
20
    if (image_alpha == 1)
21
        direction = 
scr_at_player
scr_at_player

function
scr_at_player(arg0 = x, arg1 = y)
{ return point_direction(arg0, arg1, obj_heart.x + (obj_heart.sprite_width / 2), obj_heart.y + (obj_heart.sprite_height / 2)); }
(x, y);
22
}
23
y += ypush;
24
ypush *= 0.9;
25
if (image_alpha == 1)
26
{
27
    xscale = image_alpha;
28
    yscale = image_alpha;
29
}
30
else
31
{
32
    xscale = image_alpha + ((timer % 2) * 0.1);
33
    yscale = image_alpha + ((timer % 2) * 0.1);
34
}
35
if (image_alpha == 1)
36
    active = true;
37
else
38
    exit;
39
tracking_val = 
scr_approach
scr_approach

function
scr_approach(arg0, arg1, arg2)
{ if (arg0 < arg1) { arg0 += arg2; if (arg0 > arg1) return arg1; } else { arg0 -= arg2; if (arg0 < arg1) return arg1; } return arg0; }
(tracking_val, 16, 0.025);
40
chase_heart();
41
do_shrivel();
42
if (x < (__view_get(e__VW.XView, 0) - 80))
43
    instance_destroy();
44
if (x > (__view_get(e__VW.XView, 0) + 760))
45
    instance_destroy();
46
if (y < (__view_get(e__VW.YView, 0) - 80))
47
    instance_destroy();
48
if (y > (__view_get(e__VW.YView, 0) + 580))
49
    instance_destroy();
50
do_pushback();
51
check_death();
52
53
enum e__VW
54
{
55
    XView,
56
    YView,
57
    WView,
58
    HView,
59
    Angle,
60
    HBorder,
61
    VBorder,
62
    HSpeed,
63
    VSpeed,
64
    Object,
65
    Visible,
66
    XPort,
67
    YPort,
68
    WPort,
69
    HPort,
70
    Camera,
71
    SurfaceID
72
}