Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_pacifyspell_Step_0

(view raw script w/o annotations or w/e)
1
if (!i_ex(target) && con < 20)
2
{
3
    con = 99;
4
    instance_destroy();
5
    exit;
6
}
7
if (con == 1)
8
{
9
    if (fail == 0)
10
    {
11
        siner += 1;
12
        target.image_blend = merge_color(target.image_blend, flashcolor, 0.1);
13
        if ((siner % 2) == 0)
14
        {
15
            ai = instance_create(target.x + random(target.sprite_width), (target.y + target.sprite_height) - 20, obj_afterimage);
16
            ai.gravity = 0.5;
17
            ai.sprite_index = spr_savepoint;
18
            ai.image_speed = 0.2;
19
        }
20
        target.x += (siner / 4) + (sin(siner / 8) * 10);
21
        target.y -= siner / 5;
22
    }
23
    else
24
    {
25
        siner = 0;
26
        con = 5;
27
    }
28
}
29
if (con == 2)
30
{
31
    with (target)
32
        instance_destroy();
33
    instance_destroy();
34
}
35
if (con == 5)
36
{
37
    con = 6;
38
    alarm[4]
 = 8;
gml_Object_obj_pacifyspell_Alarm_4.gml

con += 1;
39
}
40
if (con == 6)
41
    target.image_blend = merge_color(target.image_blend, flashcolor, 0.12);
42
if (con == 7)
43
{
44
    con = 8;
45
    alarm[4]
 = 8;
gml_Object_obj_pacifyspell_Alarm_4.gml

con += 1;
46
}
47
if (con == 8)
48
    target.image_blend = merge_color(target.image_blend, c_white, 0.16);
49
if (con == 9)
50
{
51
    target.image_blend = c_white;
52
    instance_destroy();
53
}
54
if (con == 20)
55
{
56
    if (timer == 0 && zcounter == 0)
57
        snd_play(snd_pacify);
58
    timer--;
59
    if (timer <= 0)
60
    {
61
        var zobj = instance_create(x, y, obj_afterimage_grow);
62
        zobj.sprite_index = spr_spare_z;
63
        zobj.speed = 12;
64
        zobj.direction = zcounter * 40;
65
        zobj.friction = 1;
66
        timer = 2;
67
        zcounter++;
68
    }
69
    if (zcounter >= 9)
70
    {
71
        con++;
72
        instance_destroy();
73
    }
74
}