Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_mike_crowd_Step_0

(view raw script w/o annotations or w/e)
1
if (wall_destroy == 1)
2
{
3
    if (x < (__view_get(e__VW.XView, 0) - 80))
4
        instance_destroy();
5
    if (x > (__view_get(e__VW.XView, 0) + 760))
6
        instance_destroy();
7
    if (y < (__view_get(e__VW.YView, 0) - 80))
8
        instance_destroy();
9
    if (y > (__view_get(e__VW.YView, 0) + 580))
10
        instance_destroy();
11
}
12
else if (!
scr_outside_camera
scr_outside_camera

function
scr_outside_camera(arg0)
{ _offcamera = 0; rightx = x + sprite_width; leftx = x; bottomy = y + sprite_height; topy = y; if (x > (__view_get(e__VW.XView, 0) + __view_get(e__VW.WView, 0) + arg0)) _offcamera = 1; if (rightx < (__view_get(e__VW.XView, 0) - arg0)) _offcamera = 1; if (y > (__view_get(e__VW.YView, 0) + __view_get(e__VW.HView, 0) + arg0)) _offcamera = 1; if (bottomy < (__view_get(e__VW.YView, 0) - arg0)) _offcamera = 1; return _offcamera; } enum e__VW { XView, YView, WView, HView, Angle, HBorder, VBorder, HSpeed, VSpeed, Object, Visible, XPort, YPort, WPort, HPort, Camera, SurfaceID }
(0))
13
{
14
    wall_destroy = 1;
15
}
16
if (type == 0)
17
{
18
    if (instance_number(obj_mike_quiet) > 0)
19
    {
20
        var _ob = instance_nearest(x, y, obj_mike_quiet);
21
        if (point_distance(x, y, x, _ob.y) < 300)
22
            vspeed += 3;
23
    }
24
    if ((hspeed > 0 && x > (camerax() + (camerawidth() / 2))) || ((hspeed < 0 && x < (camerax() + (camerawidth() / 2))) && obj_mike_controller.type < 3))
25
        friction = -0.5;
26
    if (vspeed == 0)
27
        y = ystart + (sin((xstart * 2) + (current_time / (400 + (type * 200)))) * wave_height);
28
}
29
if (type == 2)
30
{
31
    wait += 1;
32
    hspeed = 0;
33
    if (wait > 150)
34
    {
35
        y = 
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; }
(y, ystart, 24);
36
        if (y == ystart)
37
            instance_destroy();
38
    }
39
    else if (wait > 15)
40
    {
41
        y = 
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; }
(y, cameray() + (ytarget + (sin((xstart * 2) + (current_time / 400)) * 10)), wave_speed);
42
    }
43
}
44
45
enum e__VW
46
{
47
    XView,
48
    YView,
49
    WView,
50
    HView,
51
    Angle,
52
    HBorder,
53
    VBorder,
54
    HSpeed,
55
    VSpeed,
56
    Object,
57
    Visible,
58
    XPort,
59
    YPort,
60
    WPort,
61
    HPort,
62
    Camera,
63
    SurfaceID
64
}