Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_house_breakable_Other_10

(view raw script w/o annotations or w/e)
1
if (destroyed == 0)
2
{
3
    obj_susiezilla.smallbuildingsdestroyed++;
4
    if (obj_susiezilla.smallbuildingsdestroyed == 3)
5
    {
6
        collectible = instance_create(x + 16, y + 12, obj_susiezilla_collectible);
7
        collectible.depth = depth - 100;
8
        collectible.itemtype = 1;
9
        with (collectible)
10
            event_user(0);
11
    }
12
    if (obj_susiezilla.smallbuildingsdestroyed >= 6)
13
    {
14
        collectible = instance_create(x + 16, y + 12, obj_susiezilla_collectible);
15
        collectible.depth = depth - 100;
16
        collectible.itemtype = 9;
17
        with (collectible)
18
            event_user(0);
19
        obj_susiezilla.smallbuildingsdestroyed = 0;
20
    }
21
    destroyed = 1;
22
    repeat (11)
23
    {
24
        effect = instance_create(x + random(20), y + random(20), obj_house_placed_effect);
25
        effect.image_xscale = random_range(0.4, 0.5) * choose(-1, 1);
26
        effect.image_yscale = image_xscale * choose(-1, 1);
27
        effect = instance_create(x + random(20), y + random(20), obj_house_placed_effect);
28
        effect.image_xscale = random_range(0.4, 0.5) * choose(-1, 1);
29
        effect.image_yscale = image_xscale * choose(-1, 1);
30
    }
31
    image_index = 1;
32
    anim = instance_create(x + 16, y + 16, obj_animation);
33
    anim.sprite_index = spr_susiezilla_explosion1;
34
    anim.image_speed = 0.25;
35
    anim.image_xscale = 2;
36
    anim.image_yscale = 2;
37
    anim.depth = depth - 1000;
38
    snd_stop(snd_explosion_firework);
39
    snd_play(snd_explosion_firework);
40
}