Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_church_candle_lightable_Draw_0

(view raw script w/o annotations or w/e)
1
extinguishTarget = 500;
2
if (room == room_dw_church_candlesroom1)
3
    extinguishTarget = 600;
4
siner++;
5
scaler = sin(siner / 10) * 1;
6
if (place_meeting(x, y, obj_candle_flamebullet))
7
{
8
    with (instance_place(x, y, obj_candle_flamebullet))
9
    {
10
        snd_play(snd_wing);
11
        instance_destroy();
12
    }
13
    lit = 1;
14
    timer = extinguishTarget;
15
}
16
if (lit == 1)
17
{
18
    timer--;
19
    if (timer == 0)
20
        lit = 0;
21
}
22
if (lit == 2)
23
    timer = lerp(timer, extinguishTarget, 0.25);
24
if (boss && lit < 2)
25
{
26
    var candlecount = 0;
27
    with (object_index)
28
    {
29
        if (lit != 0)
30
            candlecount++;
31
    }
32
    if (candlecount == instance_number(object_index))
33
    {
34
        safe_delete(door2blocker);
35
        layer_set_visible("TILES_DOOR2", 1);
36
        safe_delete(obj_candle_flamebullet);
37
        with (object_index)
38
            lit = 2;
39
        with (obj_church_candleLighter)
40
        {
41
            if (active == 1)
42
                active = 2;
43
        }
44
        global.flag[705] = 1;
45
        safe_delete(obj_overworld_bulletarea);
46
    }
47
}
48
if (lit == 0)
49
{
50
    mylight.x = room_width * 20;
51
    mylight.y = room_height * 20;
52
    mylight.smallerLight = 0;
53
    mylight.biggerLight = 0;
54
}
55
else
56
{
57
    mylight.x = x;
58
    mylight.y = y;
59
    mylight.smallerLight = ((timer / extinguishTarget) * 240) + (scaler * 4);
60
    mylight.biggerLight = ((timer / extinguishTarget) * 260) + (scaler * 3);
61
}
62
draw_self();