Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_frostermit_body_a_Step_0

(view raw script w/o annotations or w/e)
1
var enemy_low_hp = global.enemy_low_hp
2
var enemy_dead = global.enemy_dead
3
var enemy_spared = global.enemy_spared
4
var enemy_mode = global.enemy_mode
5
if (enemy_dead == false && enemy_spared == false)
6
    image_alpha = global.image_alpha_enemy_attacking
7
if (enemy_dead == true)
8
{
9
    x = starting_point_x
10
    y = starting_point_y
11
    image_xscale = starting_point_xscale
12
    image_yscale = starting_point_yscale
13
    instance_create(starting_point_x, starting_point_y, obj_frostermit_dead)
14
    instance_destroy()
15
    return;
16
}
17
else if (enemy_spared == true)
18
{
19
    sprite_index = spr_frostermit_spared
20
    x = starting_point_x
21
    y = starting_point_y
22
    image_alpha = 0.5
23
    if (no_loop_create_clouds == false)
24
    {
25
        for (i = 0; i <= 11; i += 1)
26
            instance_create((x + 6), y, obj_spare_cloud)
27
    }
28
    no_loop_create_clouds = true
29
}
30
if (damage_disjoint_count > 0)
31
    damage_disjoint_count -= 1
32
else if (enemy_dead == false && enemy_spared == false)
33
{
34
    if (getting_out == false)
35
    {
36
        if (enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy)
37
        {
38
            if (enemy_mode == 0)
39
                sprite_index = spr_frostermit_body_critical
40
            else if (enemy_mode == 1)
41
                sprite_index = spr_frostermit_body_critical_crab
42
        }
43
        else if (enemy_mode == 0)
44
            sprite_index = spr_frostermit_body
45
        else if (enemy_mode == 1)
46
            sprite_index = spr_frostermit_body_crab
47
    }
48
}
49
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
50
{
51
    time_elapsed_head = 0
52
    sign_modifier_head = 1
53
    claw_right_angle = claw_right_angle_default
54
    claw_left_angle = claw_left_angle_default
55
    time_elapsed = 0
56
    sign_modifier = -1
57
    damage_disjoint_count = 12
58
    no_loop_damage_disjoint_count = true
59
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch)
60
}
61
else if (!instance_exists(obj_text_damage_count))
62
    no_loop_damage_disjoint_count = false
63
if (damage_disjoint_count == 12)
64
    damage_disjoint_x = -50
65
else if (damage_disjoint_count == 10)
66
    damage_disjoint_x = 50
67
else if (damage_disjoint_count == 8)
68
    damage_disjoint_x = -20
69
else if (damage_disjoint_count == 6)
70
    damage_disjoint_x = 20
71
else if (damage_disjoint_count == 4)
72
    damage_disjoint_x = -10
73
else if (damage_disjoint_count == 2)
74
    damage_disjoint_x = 10
75
else if (damage_disjoint_count == 0)
76
    damage_disjoint_x = 0
77
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0)
78
{
79
    if (getting_out == false)
80
    {
81
        if (enemy_mode == 0)
82
        {
83
            if (enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy)
84
                sprite_index = spr_frostermit_body_critical
85
            else
86
                sprite_index = spr_frostermit_body
87
        }
88
        else if (enemy_mode == 1)
89
            sprite_index = spr_frostermit_dead
90
    }
91
}
92
x = draw_position_x + damage_disjoint_x
93
y = draw_position_y + damage_disjoint_y
94
image_xscale = starting_point_xscale
95
image_yscale = starting_point_yscale
96
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && enemy_dead == false && enemy_spared == false)
97
{
98
    if (enemy_mode == 1 && getting_out == false)
99
    {
100
        game_maker_cannot_do_math = power((time_elapsed_head / (time_max_head / 2 * (1 / sqrt(max_rise_head))) - sqrt(max_rise_head)), 2)
101
        animation_disjoint_y = sign_modifier_head * (max_rise_head - round(game_maker_cannot_do_math))
102
        time_elapsed_head += time_increase_head
103
        if (time_elapsed_head >= time_max_head)
104
        {
105
            time_elapsed_head = 0
106
            sign_modifier_head = (-sign_modifier_head)
107
        }
108
        head_displacement_y = y + animation_disjoint_y
109
        claw_angle_increase = 0
110
        claw_radius = 3
111
        claw_speed = 24
112
        if (enemy_low_hp == false)
113
            claw_right_x = obj_frostermit_body_a.x + claw_radius * (cos((claw_right_angle + claw_angle_increase) * claw_right_angle_direction * 0.008726646259971648))
114
        else
115
            claw_right_x = obj_frostermit_body_a.x
116
        claw_right_y = obj_frostermit_body_a.y - claw_radius * (sin((claw_right_angle + claw_angle_increase) * claw_right_angle_direction * 0.008726646259971648))
117
        if (enemy_low_hp == false)
118
            claw_left_x = obj_frostermit_body_a.x + claw_radius * (cos((claw_left_angle + claw_angle_increase) * claw_left_angle_direction * 0.008726646259971648))
119
        else
120
            claw_left_x = obj_frostermit_body_a.x
121
        claw_left_y = obj_frostermit_body_a.y - claw_radius * (sin((claw_left_angle + claw_angle_increase) * claw_left_angle_direction * 0.008726646259971648))
122
        claw_angle_increase += claw_speed
123
        claw_right_angle += claw_speed
124
        claw_left_angle += claw_speed
125
        game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
126
        animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math))
127
        time_elapsed += time_increase
128
        if (time_elapsed >= time_max)
129
            time_elapsed = 0
130
        var y_val = draw_position_y + animation_disjoint_y
131
        var y_store = y_val
132
        var time_elapsed_1 = time_elapsed - 4
133
        if (time_elapsed_1 < 0)
134
            time_elapsed_1 += time_max
135
        game_maker_cannot_do_math = power((time_elapsed_1 / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
136
        animation_disjoint_y = sign_modifier * (max_rise - game_maker_cannot_do_math)
137
        y_val = draw_position_y + animation_disjoint_y
138
        leg_1_displacement_y = y_val
139
        y_val = y_store
140
        var time_elapsed_2 = time_elapsed - 8
141
        if (time_elapsed_2 < 0)
142
            time_elapsed_2 += time_max
143
        game_maker_cannot_do_math = power((time_elapsed_2 / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
144
        animation_disjoint_y = sign_modifier * (max_rise - game_maker_cannot_do_math)
145
        y_val = draw_position_y + animation_disjoint_y
146
        leg_2_displacement_y = y_val
147
        y_val = y_store
148
        var time_elapsed_3 = time_elapsed - 12
149
        if (time_elapsed_3 < 0)
150
            time_elapsed_3 += time_max
151
        game_maker_cannot_do_math = power((time_elapsed_3 / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
152
        animation_disjoint_y = sign_modifier * (max_rise - game_maker_cannot_do_math)
153
        y_val = draw_position_y + animation_disjoint_y
154
        leg_3_displacement_y = y_val
155
        var position_var = draw_position_y + damage_disjoint_y
156
        y = head_displacement_y - (head_displacement_y - position_var) / 3
157
        var time_elapsed_head_new = time_elapsed_head - 4
158
        if (time_elapsed_head_new < 0)
159
        {
160
            time_elapsed_head_new += time_max_head
161
            sign_modifier_head_new = (-sign_modifier_head)
162
        }
163
        else
164
            sign_modifier_head_new = sign_modifier_head
165
        game_maker_cannot_do_math = power((time_elapsed_head_new / (time_max_head / 2 * (1 / sqrt(max_rise_head))) - sqrt(max_rise_head)), 2)
166
        animation_disjoint_y = sign_modifier_head_new * (max_rise_head - game_maker_cannot_do_math)
167
        head_new_displacement_y = draw_position_y + animation_disjoint_y
168
    }
169
    animating = true
170
}
171
else
172
    animating = false