Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dalv_head_Step_0

(view raw script w/o annotations or w/e)
1
if (obj_dalv_body.cloak_direction == 0)
2
{
3
    var enemy_dead = global.enemy_dead
4
    var enemy_spared = global.enemy_spared
5
    var enemy_mode = global.enemy_mode
6
    if (enemy_dead == false && enemy_spared == false)
7
        image_alpha = global.image_alpha_enemy_attacking
8
    if (enemy_dead == true)
9
    {
10
        instance_destroy()
11
        return;
12
    }
13
    else if (enemy_spared == true)
14
    {
15
        instance_destroy()
16
        return;
17
    }
18
    if (damage_disjoint_count > 0)
19
        damage_disjoint_count -= 1
20
    else if (enemy_dead == false && enemy_spared == false)
21
    {
22
        if (global.current_hp_enemy <= 0)
23
            head_sprite = spr_dalv_head_dead
24
        else
25
        {
26
            switch enemy_mode
27
            {
28
                case 0:
29
                    head_sprite = spr_dalv_head_regular
30
                    break
31
                case 1:
32
                    head_sprite = spr_dalv_head_sad_side
33
                    break
34
                case 2:
35
                    head_sprite = spr_dalv_head_sad_side_2
36
                    break
37
                default:
38
                    head_sprite = spr_dalv_head_regular
39
            }
40
41
        }
42
    }
43
    if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
44
    {
45
        damage_disjoint_count = 12
46
        no_loop_damage_disjoint_count = true
47
    }
48
    else if (!instance_exists(obj_text_damage_count))
49
        no_loop_damage_disjoint_count = false
50
    if (damage_disjoint_count == 12)
51
        damage_disjoint_x = -50
52
    else if (damage_disjoint_count == 10)
53
        damage_disjoint_x = 50
54
    else if (damage_disjoint_count == 8)
55
        damage_disjoint_x = -20
56
    else if (damage_disjoint_count == 6)
57
        damage_disjoint_x = 20
58
    else if (damage_disjoint_count == 4)
59
        damage_disjoint_x = -10
60
    else if (damage_disjoint_count == 2)
61
        damage_disjoint_x = 10
62
    else if (damage_disjoint_count == 0)
63
        damage_disjoint_x = 0
64
    if (damage_disjoint_count > 0)
65
        image_alpha = 0
66
}
67
else
68
    head_sprite = spr_dalv_head_sleepy