Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_overworld_lanternflame_Step_0

(view raw script w/o annotations or w/e)
1
active = 0;
2
if (i_ex(obj_mainchara) && obj_mainchara.battlemode == 1)
3
    active = 1;
4
if (active == 0)
5
    disappear = true;
6
timer++;
7
if (timer < 11)
8
{
9
    if ((floor(timer / 2) % 2) == 0)
10
        image_alpha = 0.5;
11
    else
12
        image_alpha = 1;
13
}
14
if (fakeheight > 0 && speed != 0)
15
    fakeheight -= 1.5;
16
else
17
    siner++;
18
fakey = -10 - (sin(siner / 4) * 4) - fakeheight;
19
if (global.inv < 0 && obj_mainchara.battlemode == 1)
20
{
21
    if (collision_rectangle(x - 6, (y - 10) + fakey, x, y + 12 + fakey, obj_mainchara, true, true))
22
        event_user(5);
23
}
24
if (hitwall == 1)
25
{
26
    active = 0;
27
    speed = 0;
28
    image_xscale = lerp(image_xscale, -1, 0.07);
29
    image_yscale = lerp(image_yscale, -1, 0.07);
30
}
31
if (disappear)
32
    image_alpha = lerp(image_alpha, -1, 0.07);
33
if (image_alpha < 0)
34
    instance_destroy();
35
if (x < 0)
36
    instance_destroy();
37
if (x > room_width)
38
    instance_destroy();
39
if (y > room_height)
40
    instance_destroy();
41
if (y < 0)
42
    instance_destroy();