Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_susiezilla_Collision_obj_susiezilla_enemy_hitbox

(view raw script w/o annotations or w/e)
1
if (deadcon > 0)
2
    exit;
3
dashCon = 0;
4
slide = 0;
5
hit_me = 1;
6
if (invinciblecon == 1)
7
    hit_me = 0;
8
if (hit_me == 1)
9
{
10
    health_count -= other.damage;
11
    health_count_prev_timer = health_count_prev_timer_set;
12
    if (health_count <= 0 && deadcon == 0)
13
    {
14
        health_count = 0;
15
        deadcon = 1;
16
    }
17
    hurtcon = 1;
18
    hurttimer = 0;
19
    sprite_index = spr_susiezilla_hurt;
20
    image_index = 0;
21
    hspeed = 0;
22
    snd_play(snd_swing);
23
    snd_play(snd_hurt1);
24
    instance_create(x, y, obj_shake);
25
    if (other.hit_direction == -1)
26
    {
27
        var _hit_direction = -1;
28
        if (other.x < x)
29
            _hit_direction = 1;
30
        image_xscale = _hit_direction * -2;
31
        speed = 8 * _hit_direction;
32
        friction = 2;
33
    }
34
    else if (other.hit_direction > 0)
35
    {
36
        image_xscale = -2;
37
        speed = 8;
38
        friction = 2;
39
    }
40
    else
41
    {
42
        image_xscale = 2;
43
        speed = -8;
44
        friction = 2;
45
    }
46
    if (other.knockback)
47
        event_user(2);
48
    if (other.destroy_on_hit)
49
    {
50
        with (other)
51
            instance_destroy();
52
    }
53
    if (other.give_hurt > 0)
54
        hurt_length = other.give_hurt;
55
    if (other.give_invincibility > 0)
56
    {
57
        invinciblecon = 1;
58
        invincibilitytimer = -30;
59
    }
60
}