Deltarune script viewer

← back to main script listing

gml_Object_obj_sneo_faceattack_Collision_obj_yheart_shot

(view raw script w/o annotations or w/e)
1
if (type == 0 || image_alpha < 0.9)
2
    exit;
3
if (broken == 1)
4
{
5
    snd_play(snd_bell);
6
    with (other)
7
        event_user(0);
8
    exit;
9
}
10
if (invincibilitytimer > 0 && other.big == 0)
11
{
12
    with (other)
13
        instance_destroy();
14
    exit;
15
}
16
shake = 6;
17
if (other.big == 0)
18
{
19
    if (type == 1)
20
        obj_spamton_neo_enemy.eyeshp -= 1;
21
    if (type == 2)
22
        obj_spamton_neo_enemy.nosehp -= 1;
23
    if (type == 3)
24
        obj_spamton_neo_enemy.mouthhp -= 1;
25
}
26
else
27
{
28
    var takedamageamount = 4;
29
    if (obj_spamton_neo_enemy.hellmode == 1)
30
        takedamageamount = 2;
31
    if (type == 1)
32
        obj_spamton_neo_enemy.eyeshp -= takedamageamount;
33
    if (type == 2)
34
        obj_spamton_neo_enemy.nosehp -= takedamageamount;
35
    if (type == 3)
36
        obj_spamton_neo_enemy.mouthhp -= takedamageamount;
37
}
38
snd_play(snd_damage);
39
invincibilitytimer = 10;
40
hurtflashtimer = 3;
41
if ((type == 1 && obj_spamton_neo_enemy.eyeshp <= 0) || (type == 2 && obj_spamton_neo_enemy.nosehp <= 0) || (type == 3 && obj_spamton_neo_enemy.mouthhp <= 0))
42
{
43
    broken = 1;
44
    image_index = 2;
45
    snd_volume(snd_rocket, 1, 0);
46
    snd_play(snd_rocket);
47
    explodetimer = 16;
48
}
49
with (other)
50
    event_user(0);