Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_rorrim_body_a_Step_0

(view raw script w/o annotations or w/e)
1
var enemy_dead = global.enemy_dead
2
var enemy_spared = global.enemy_spared
3
if (enemy_dead == false && enemy_spared == false)
4
    image_alpha = global.image_alpha_enemy_attacking
5
if (enemy_dead == true)
6
{
7
    x = starting_point_x
8
    y = starting_point_y
9
    instance_create(starting_point_x, starting_point_y, obj_rorrim_dead)
10
    instance_destroy()
11
    return;
12
}
13
else if (enemy_spared == true)
14
{
15
    sprite_index = spr_rorrim_spared
16
    x = starting_point_x
17
    y = starting_point_y
18
    image_alpha = 0.5
19
    if (no_loop_create_clouds == false)
20
    {
21
        for (i = 0; i <= 11; i += 1)
22
            instance_create(x, y, obj_spare_cloud)
23
    }
24
    no_loop_create_clouds = true
25
}
26
if (damage_disjoint_count > 0)
27
    damage_disjoint_count -= 1
28
else if (enemy_dead == false && enemy_spared == false)
29
{
30
    if (global.enemy_low_hp == true && global.current_hp_enemy < global.max_hp_enemy)
31
        sprite_index = spr_rorrim_body_critical
32
    else
33
        sprite_index = spr_rorrim_body
34
}
35
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
36
{
37
    time_elapsed = 0
38
    sign_modifier = -1
39
    damage_disjoint_count = 12
40
    no_loop_damage_disjoint_count = true
41
    audio_play_sound(enemy_hurt_noise, 1, 0, 1, 0, enemy_hurt_pitch)
42
}
43
else if (!instance_exists(obj_text_damage_count))
44
    no_loop_damage_disjoint_count = false
45
if (damage_disjoint_count == 12)
46
    damage_disjoint_x = -50
47
else if (damage_disjoint_count == 10)
48
    damage_disjoint_x = 50
49
else if (damage_disjoint_count == 8)
50
    damage_disjoint_x = -20
51
else if (damage_disjoint_count == 6)
52
    damage_disjoint_x = 20
53
else if (damage_disjoint_count == 4)
54
    damage_disjoint_x = -10
55
else if (damage_disjoint_count == 2)
56
    damage_disjoint_x = 10
57
else if (damage_disjoint_count == 0)
58
    damage_disjoint_x = 0
59
if (damage_disjoint_count > 0 || global.current_hp_enemy <= 0)
60
    sprite_index = spr_rorrim_dead
61
x = draw_position_x + damage_disjoint_x
62
y = draw_position_y + damage_disjoint_y
63
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && enemy_dead == false && enemy_spared == false)
64
{
65
    game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
66
    animation_disjoint_y = sign_modifier * (max_rise - round(game_maker_cannot_do_math))
67
    time_elapsed += time_increase
68
    if (time_elapsed >= time_max)
69
    {
70
        time_elapsed = 0
71
        sign_modifier = (-sign_modifier)
72
    }
73
    y = draw_position_y + animation_disjoint_y
74
}