Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_church_old_man_ripple_effect_Step_0

(view raw script w/o annotations or w/e)
1
active = true;
2
if (active && timer == 1 && type >= 3 && type < 7)
3
{
4
    var _count = (type == 3) ? 8 : 16;
5
    var _angle = 360 / _count;
6
    var _start_angle = 0;
7
    if (type >= 5)
8
    {
9
        if (type == 6)
10
            _count = 32;
11
        _angle = 120 / _count;
12
        _start_angle = (180 + random_range(-30, 30)) - 30;
13
    }
14
    var _half = false;
15
    for (var i = 0; i < _count; i++)
16
    {
17
        var _spark = instance_create(x, y, obj_church_parry_sparks);
18
        with (_spark)
19
        {
20
            direction = _start_angle + (i * _angle) + random_range(-_angle / 2, _angle / 2);
21
            image_angle = direction;
22
            image_blend = other.color;
23
            if (!_half && other.type >= 5 && i > (_count / 2))
24
            {
25
                _start_angle -= (180 + (i * _angle));
26
                _half = true;
27
            }
28
            depth = other.depth + 1;
29
            if (other.type == 3)
30
            {
31
                friction = 0.5;
32
                speed = random_range(5, 12);
33
                image_xscale = 2;
34
            }
35
            else if (other.type >= 5)
36
            {
37
                friction = 0.5;
38
                speed = random_range(5, 12);
39
                image_xscale = 2;
40
            }
41
            else
42
            {
43
                image_xscale = 3;
44
                friction = 1;
45
                speed = random_range(10, 30);
46
                image_xscale = speed / 10;
47
            }
48
            if (_half)
49
            {
50
                speed /= 2;
51
            }
52
            else if (other.type >= 5)
53
            {
54
            }
55
        }
56
    }
57
}