Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dalv_body_Step_0

related scripts: Create_0 • Other_7 • Step_0

(view raw script w/o annotations or w/e)
1
if (live_call())
2
    return global.live_result;
3
if (cloak_direction == 0)
4
{
5
    var enemy_dead = global.enemy_dead;
6
    var enemy_spared = global.enemy_spared;
7
    if (enemy_dead == false && enemy_spared == false)
8
        image_alpha = global.image_alpha_enemy_attacking;
9
    if (enemy_dead == true)
10
    {
11
        x = starting_point_x;
12
        y = starting_point_y;
13
        instance_create(starting_point_x, starting_point_y, obj_dalv_dead);
14
        instance_destroy();
15
        exit;
16
        image_alpha = 0.5;
17
    }
18
    else if (enemy_spared == true)
19
    {
20
        sprite_index = spr_dalv_spared;
21
        x = starting_point_x;
22
        y = starting_point_y;
23
        image_xscale = starting_point_xscale;
24
        image_yscale = starting_point_yscale;
25
        image_alpha = 0.5;
26
        if (no_loop_create_clouds == false)
27
        {
28
            for (i = 0; i <= 11; i += 1)
29
                instance_create(x, y - 100, obj_spare_cloud);
30
        }
31
        no_loop_create_clouds = true;
32
    }
33
    if (damage_disjoint_count > 0)
34
    {
35
        damage_disjoint_count -= 1;
36
    }
37
    else if (enemy_dead == false && enemy_spared == false)
38
    {
39
        if (global.current_hp_enemy <= 0)
40
            sprite_index = spr_dalv_body_critical;
41
        else
42
            sprite_index = spr_dalv_body;
43
    }
44
    if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
45
    {
46
        time_elapsed = 0;
47
        sign_modifier = 1;
48
        damage_disjoint_count = 12;
49
        no_loop_damage_disjoint_count = true;
50
    }
51
    else if (!instance_exists(obj_text_damage_count))
52
    {
53
        no_loop_damage_disjoint_count = false;
54
    }
55
    if (damage_disjoint_count == 12)
56
        damage_disjoint_x = -50;
57
    else if (damage_disjoint_count == 10)
58
        damage_disjoint_x = 50;
59
    else if (damage_disjoint_count == 8)
60
        damage_disjoint_x = -20;
61
    else if (damage_disjoint_count == 6)
62
        damage_disjoint_x = 20;
63
    else if (damage_disjoint_count == 4)
64
        damage_disjoint_x = -10;
65
    else if (damage_disjoint_count == 2)
66
        damage_disjoint_x = 10;
67
    else if (damage_disjoint_count == 0)
68
        damage_disjoint_x = 0;
69
    if (damage_disjoint_count > 0)
70
    {
71
        if (global.current_hp_enemy <= 0)
72
            sprite_index = spr_dalv_hit_2;
73
        else
74
            sprite_index = spr_dalv_hit;
75
        image_xscale = starting_point_xscale;
76
        image_yscale = starting_point_yscale;
77
        head_displacement_y = og_bbox_top / image_yscale;
78
    }
79
    if (global.current_hp_enemy <= 0)
80
    {
81
        time_elapsed = 0;
82
        sign_modifier = 1;
83
    }
84
    x = draw_position_x + damage_disjoint_x;
85
    y = draw_position_y + damage_disjoint_y;
86
    if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false)
87
    {
88
        game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
89
        animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math);
90
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
91
        image_xscale = draw_position_xscale - (animation_disjoint_yscale * (max_rise_ext / max_rise));
92
        var image_yscale_store = image_yscale;
93
        var time_elapsed_head = time_elapsed - time_elapsed_decrease_head;
94
        if (time_elapsed_head < 0)
95
        {
96
            time_elapsed_head += time_max;
97
            sign_modifier_head = -sign_modifier;
98
        }
99
        else
100
        {
101
            sign_modifier_head = sign_modifier;
102
        }
103
        game_maker_cannot_do_math = power((time_elapsed_head / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
104
        animation_disjoint_yscale = sign_modifier_head * (max_rise - game_maker_cannot_do_math);
105
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
106
        head_displacement_y = og_bbox_top / image_yscale;
107
        image_yscale = image_yscale_store;
108
        time_elapsed += time_increase;
109
        if (time_elapsed >= time_max)
110
        {
111
            time_elapsed = 0;
112
            sign_modifier = -sign_modifier;
113
        }
114
        animating = true;
115
    }
116
    else
117
    {
118
        animating = false;
119
    }
120
}
121
else if (cloak_direction == 1 && sprite_index != spr_dalv_body_open)
122
{
123
    sprite_index = spr_dalv_body_open;
124
    image_speed = 1;
125
    image_index = 0;
126
    image_xscale = 1;
127
    image_yscale = 1;
128
    time_elapsed = 0;
129
    sign_modifier = 1;
130
    head_displacement_y = og_bbox_top / image_yscale;
131
    with (obj_background_battle_parent)
132
    {
133
        custom_fade_direction = "out";
134
        custom_fade_alpha = 0;
135
        custom_fade_rate = 0.05;
136
    }
137
    animating = true;
138
}
139
else if (cloak_direction == 2 && sprite_index != spr_dalv_body_close)
140
{
141
    sprite_index = spr_dalv_body_close;
142
    image_speed = 1;
143
    image_index = 0;
144
    cloak_out = false;
145
    animating = true;
146
}
147
else
148
{
149
    animating = false;
150
}