Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_sneo_phoneshooter_Collision_obj_yheart_shot

(view raw script w/o annotations or w/e)
1
if (destroyable == 1)
2
{
3
    if (other.big == 0)
4
    {
5
        with (other)
6
            event_user(0);
7
    }
8
    hp--;
9
    if (other.big || hp <= 0)
10
    {
11
        anim = instance_create(x, y, obj_yshot_anim);
12
        anim.image_xscale = image_xscale;
13
        anim.image_yscale = image_yscale;
14
        with (anim)
15
            sprite_index = spr_yheart_shot_hit3;
16
        instance_destroy();
17
    }
18
    else
19
    {
20
        flash = 1;
21
        if (sin((siner + swingdir) / 20) < sin(siner / 20))
22
            swingdir *= -1;
23
    }
24
}
25
else if (destroyable == -1)
26
{
27
    with (other)
28
        event_user(0);
29
}