Deltarune (Chapter 3) 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
    debug_message("target does not exist");
4
    con = 99;
5
    instance_destroy();
6
    exit;
7
}
8
if (con == 1)
9
{
10
    if (fail == 0)
11
    {
12
        siner += 1;
13
        target.image_blend = merge_color(target.image_blend, flashcolor, 0.1);
14
        if ((siner % 2) == 0)
15
        {
16
            ai = instance_create(target.x + random(target.sprite_width), (target.y + target.sprite_height) - 20, obj_afterimage);
17
            ai.gravity = 0.5;
18
            ai.sprite_index = spr_savepoint;
19
            ai.image_speed = 0.2;
20
        }
21
        target.x += (siner / 4) + (sin(siner / 8) * 10);
22
        target.y -= siner / 5;
23
    }
24
    else
25
    {
26
        siner = 0;
27
        con = 5;
28
    }
29
}
30
if (con == 2)
31
{
32
    with (target)
33
        instance_destroy();
34
    instance_destroy();
35
}
36
if (con == 5)
37
{
38
    con = 6;
39
    alarm[4]
 = 8;
gml_Object_obj_pacifyspell_Alarm_4.gml

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

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