Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_mizzle_spotlight_controller_Step_2

(view raw script w/o annotations or w/e)
1
if (global.turntimer < 1)
2
{
3
    instance_destroy();
4
    exit;
5
}
6
if (init == 0)
7
{
8
    init = 1;
9
    with (obj_dbulletcontroller)
10
    {
11
        if (type == 110.5)
12
            other.eyeattackcount++;
13
    }
14
    if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 1)
15
        difficulty = 0;
16
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 2 && eyeattackcount == 2)
17
        difficulty = 0;
18
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 3 && eyeattackcount == 3)
19
        difficulty = 0;
20
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 2 && eyeattackcount == 1)
21
        difficulty = 1;
22
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 3 && eyeattackcount == 2)
23
        difficulty = 1;
24
    else if (
scr_monsterpop
scr_monsterpop

function
scr_monsterpop()
{ return global.monster[0] + global.monster[1] + global.monster[2]; }
() == 3 && eyeattackcount == 1)
25
        difficulty = 2;
26
}
27
if (init == 1 && i_ex(obj_growtangle))
28
{
29
    init = 2;
30
    x = obj_growtangle.x;
31
    y = obj_growtangle.y;
32
    var _dir = 28;
33
    len = 150;
34
    instance_create(x + lengthdir_x(len, _dir), y + lengthdir_y(len, _dir), obj_mizzle_spotlight_eye);
35
    _dir += 30;
36
    instance_create(x + lengthdir_x(len, _dir), y + lengthdir_y(len, _dir), obj_mizzle_spotlight_eye);
37
    _dir += 30;
38
    instance_create(x + lengthdir_x(len, _dir), y + lengthdir_y(len, _dir), obj_mizzle_spotlight_eye);
39
    _dir += 30;
40
    instance_create(x + lengthdir_x(len, _dir), y + lengthdir_y(len, _dir), obj_mizzle_spotlight_eye);
41
    _dir += 30;
42
    instance_create(x + lengthdir_x(len, _dir), y + lengthdir_y(len, _dir), obj_mizzle_spotlight_eye);
43
    _dir += 30;
44
    len = 90;
45
    angle1 = irandom(360);
46
    angle2 = angle1 + 120;
47
    angle3 = angle2 + 120;
48
    spot1 = instance_create(x + lengthdir_x(len, angle1), y + lengthdir_y(len, angle1), obj_mizzle_spotlight);
49
    spot2 = instance_create(x + lengthdir_x(len, angle2), y + lengthdir_y(len, angle2), obj_mizzle_spotlight);
50
    spot3 = instance_create(x + lengthdir_x(len, angle3), y + lengthdir_y(len, angle3), obj_mizzle_spotlight);
51
}
52
if (difficulty == 0 && init == 2 && !alert)
53
{
54
    timer++;
55
    angle_speed = 2;
56
    len += len_speed;
57
    angle1 += angle_speed;
58
    angle2 += angle_speed;
59
    angle3 += angle_speed;
60
    spot1.x = x + lengthdir_x(len, angle1);
61
    spot1.y = y + lengthdir_y(len, angle1);
62
    spot2.x = x + lengthdir_x(len, angle2);
63
    spot2.y = y + lengthdir_y(len, angle2);
64
    spot3.x = x + lengthdir_x(len, angle3);
65
    spot3.y = y + lengthdir_y(len, angle3);
66
}
67
if (difficulty == 1 && init == 2 && !alert)
68
{
69
    timer++;
70
    angle_speed = 2;
71
    len += len_speed;
72
    angle1 += angle_speed;
73
    angle2 += angle_speed;
74
    angle3 += angle_speed;
75
    spot1.x = x + lengthdir_x(len, angle1);
76
    spot1.y = y + lengthdir_y(len, angle1);
77
    spot2.x = x + lengthdir_x(len, angle2);
78
    spot2.y = y + lengthdir_y(len, angle2);
79
    spot3.x = x + lengthdir_x(len, angle3);
80
    spot3.y = y + lengthdir_y(len, angle3);
81
}
82
if (difficulty == 2 && init == 2 && !alert)
83
{
84
}
85
if (!alert)
86
{
87
    with (obj_mizzle_spotlight)
88
    {
89
        if (place_meeting(x, y, obj_heart))
90
        {
91
            other.alert = true;
92
            with (obj_mizzle_enemy)
93
            {
94
                if (global.monsterstatus[myself] != 0)
95
                    wakeuptext();
96
                global.monsterstatus[myself] = 0;
97
                global.monstercomment[myself] = "";
98
                awake = true;
99
            }
100
        }
101
    }
102
}
103
if (alert)
104
{
105
    with (obj_mizzle_spotlight)
106
    {
107
        repeat (5)
108
        {
109
            if (x < ((obj_heart.x + 10) - 1))
110
                x += 1;
111
            if (x > (obj_heart.x + 10 + 1))
112
                x -= 1;
113
            if (y < ((obj_heart.y + 10) - 1))
114
                y += 1;
115
            if (y > (obj_heart.y + 10 + 1))
116
                y -= 1;
117
        }
118
    }
119
    if (init == 2)
120
    {
121
        init = 3;
122
        snd_play(snd_tv_alarm, 1, 1.55);
123
        with (obj_mizzle_spotlight_eye)
124
            con = 1;
125
    }
126
}