Deltarune (Chapter 5) script viewer

← back to main script listing

gml_Object_obj_audience_hitbox_Step_0

(view raw script w/o annotations or w/e)
1
event_inherited();
2
switch (phase)
3
{
4
    case 1:
5
        pattern_time++;
6
        audience_popout *= 0.9;
7
        if (audience_popout > -0.1 && audience_popout < 0.1)
8
            audience_popout = 0;
9
        hater_popout *= 0.9;
10
        if (hater_popout > -0.1 && hater_popout < 0.1)
11
            hater_popout = 0;
12
        if (pattern_time >= 20)
13
        {
14
            if (audience_hater == 0)
15
            {
16
                if (audience_shoottime > 0)
17
                {
18
                    audience_shoottime -= 1;
19
                }
20
                else if (audience_shoottime == 0)
21
                {
22
                    var _shot = instance_create_depth(x, y, depth - 2, obj_audienceheart);
23
                    _shot.speed = 1;
24
                    _shot.pattern_time = -irandom(4);
25
                    _shot.direction = image_angle + 90;
26
                    audience_shoottime = -1;
27
                }
28
            }
29
        }
30
        if (pattern_time == 55)
31
        {
32
            if (audience_hater == 1)
33
            {
34
                var _shot = instance_create_depth(x, y, depth - 6, obj_audiencehater);
35
                _shot.image_angle = lengthdir_y(30, other.audience_angle);
36
                _shot.image_angle += image_angle;
37
                instance_destroy();
38
            }
39
        }
40
        if (pattern_time >= 60)
41
        {
42
            audience_popout = -0.1;
43
            pattern_time = 0;
44
            phase++;
45
        }
46
        break;
47
    case 2:
48
        pattern_time++;
49
        audience_popout = clamp(audience_popout * 1.25, -40, 40);
50
        if (pattern_time >= 30)
51
        {
52
            audience_popout = 0;
53
            hater_popout = 0;
54
            instance_destroy();
55
        }
56
        break;
57
}
58
audience_y += 18;
59
if (audience_y >= 360)
60
    audience_y -= 360;
61
audience_angle += audience_sway;
62
if (audience_angle >= 360)
63
    audience_angle -= 360;
64
var _jump, _popout;
65
if (audience_hater == 0)
66
{
67
    _jump = 10;
68
    _popout = audience_popout;
69
    var _curtainpeek = 0;
70
}
71
else
72
{
73
    _jump = 5;
74
    _popout = hater_popout;
75
    var _curtainpeek = 6;
76
}
77
if (image_angle == 270)
78
{
79
    x = start_x + abs(lengthdir_y(_jump, audience_y)) + _popout;
80
    y = start_y;
81
}
82
else if (image_angle == 0)
83
{
84
    x = start_x;
85
    y = start_y - abs(lengthdir_y(_jump, audience_y)) - _popout;
86
}
87
else if (image_angle == 90)
88
{
89
    x = start_x - abs(lengthdir_y(_jump, audience_y)) - _popout;
90
    y = start_y;
91
}