Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_gravity_hoop_Collision_obj_gravity_ball

(view raw script w/o annotations or w/e)
1
if (other.score_buffer < 0 && other.vspeed > 0 && other.can_score)
2
{
3
    other.can_score = 0;
4
    snd_play(snd_bell, 0.8, 0.8 + random(0.2));
5
    score_timer = 10;
6
    if (instance_number(obj_gravity_ball) < 15)
7
    {
8
        with (other)
9
        {
10
            var _a = instance_create(x, y, obj_gravity_ball);
11
            _a.score_buffer = 15;
12
            _a.vspeed = vspeed / 2;
13
            _a.hspeed = hspeed / 2;
14
            _a.image_angle = image_angle;
15
        }
16
        with (obj_mike_minigame_controller)
17
            new_cat = 2.5;
18
    }
19
    var _score = 10 + (10 * other.level);
20
    var _mult = 1;
21
    with (other)
22
    {
23
        repeat (5 + floor(_score / 4))
24
            instance_create(x + random_range(-4, 4), y + random_range(-4, 4), obj_gravity_confetti);
25
    }
26
    if (obj_mike_minigame_controller.countdown > 0)
27
    {
28
        if (obj_mike_minigame_controller.combo_buffer > 25)
29
            obj_mike_minigame_controller.combo = 0;
30
        if (obj_mike_minigame_controller.combo > 0)
31
        {
32
            _mult += (0.5 * obj_mike_minigame_controller.combo);
33
            if (_mult >= 3)
34
                _mult = 3;
35
            _score *= max(1, _mult);
36
            if (_mult >= 2.5)
37
            {
38
                other.fever_timer = 10;
39
                snd_play(snd_badexplosion, 0.8, 0.8);
40
                
scr_shakescreen
scr_shakescreen

function
scr_shakescreen(arg0 = 4, arg1 = 4)
{ var shaker = instance_create(x, y, obj_shake); if (i_ex(shaker)) { shaker.shakex = arg0; shaker.shakey = arg1; } }
(0, 8);
41
            }
42
        }
43
        var _newscore = ceil(_score);
44
        var _a = instance_create(other.x, other.y, obj_gravity_text);
45
        _a.str = string(_newscore);
46
        with (obj_mike_minigame_controller)
47
        {
48
            myscore += _newscore;
49
            combo_buffer = 0;
50
            combo++;
51
        }
52
        if (other.level == 0)
53
        {
54
            with (obj_mike_minigame_controller)
55
                countdown += 60;
56
        }
57
    }
58
    other.level++;
59
    if (other.level > 3)
60
        other.level = 3;
61
}
62
other.score_buffer = 3;