Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_vertical_dark_shockwave_new1_Step_0

(view raw script w/o annotations or w/e)
1
if (con == 1)
2
{
3
    timer++;
4
    if (position == "above")
5
    {
6
        if (timer == 1)
7
            spd = -10;
8
        else
9
            spd += 0.75;
10
    }
11
    if (position == "below")
12
    {
13
        if (timer == 1)
14
            spd = 10;
15
        else
16
            spd -= 0.75;
17
    }
18
    if (timer > 5 && timer < 12)
19
    {
20
        _xoffset = -4 + random(8);
21
        _yoffset = -4 + random(8);
22
    }
23
    if (timer == 17 || timer == 19 || timer == 21 || timer == 23)
24
    {
25
        if (image_index == 0)
26
            image_index = 1;
27
        else
28
            image_index = 0;
29
    }
30
    if (timer == 26)
31
    {
32
        snd_stop(snd_wallclaw);
33
        snd_play_pitch(snd_wallclaw, 0.7);
34
        sprite_index = spr_titan_shockwave_bullet;
35
        image_yscale = 1;
36
        image_xscale = 1;
37
        anim = instance_create(x, y, obj_animation);
38
        anim.sprite_index = spr_titan_shockwave_bullet_explosion;
39
        anim.image_xscale = 0.5;
40
        anim.image_yscale = 0.5;
41
        anim.depth = depth;
42
        timer = 0;
43
        con = 2;
44
        if (position == "above")
45
            spd = 30;
46
        if (position == "below")
47
            spd = -30;
48
    }
49
}
50
if (con == 2)
51
{
52
    timer++;
53
    var __y;
54
    if (position == "above")
55
        __y = 30;
56
    if (position == "below")
57
        __y = -30;
58
    repeat (2)
59
    {
60
        bullet = instance_create(314 + random(12), (y - 24) + random(48) + __y, obj_vertical_dark_shockwave_new2);
61
        bullet.angle_position = angle_position;
62
        bullet.mode = 4;
63
        bullet._x = x;
64
        bullet._y = (y - 24) + random(48) + __y;
65
        bullet.depth = depth + 1;
66
    }
67
    if (timer == 20)
68
        instance_destroy();
69
}
70
event_inherited();
71
if (con == 1)
72
{
73
    if (image_xscale < 2)
74
        image_xscale += 0.2;
75
    if (image_yscale < 2)
76
        image_yscale += 0.2;
77
}
78
yoffset += spd;
79
if (con == 2)
80
{
81
    if (spd > 0)
82
    {
83
        image_yscale = image_xscale * -1.5;
84
        spd -= 0.15;
85
    }
86
    if (spd < 0)
87
    {
88
        image_yscale = image_xscale * 1.5;
89
        spd += 0.15;
90
    }
91
}
92
if (position == "above")
93
    y = cameray() + 90 + yoffset;
94
if (position == "below")
95
    y = ((cameray() + cameraheight()) - 160) + yoffset;