Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_lightTriggerArea_Step_1

(view raw script w/o annotations or w/e)
1
if (init == 0)
2
{
3
    light = instance_find(obj_darkness_overlay, 0);
4
    if (light == -4)
5
    {
6
        debug_message("obj_lightTriggerArea couldn't find a obj_darkness_overlay: self-destructing");
7
        instance_destroy();
8
    }
9
    init = 1;
10
}
11
if (boss == 1)
12
{
13
    light.active = false;
14
    var activetrigs = 0;
15
    if (i_ex(obj_mainchara))
16
    {
17
        with (object_index)
18
        {
19
            if (place_meeting(x, y, obj_mainchara))
20
                activetrigs++;
21
        }
22
    }
23
    if (activetrigs != 0)
24
        light.active = true;
25
}