Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_feisty_four_moray_legs_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_dalv_dead)
10
    instance_destroy()
11
    return;
12
}
13
else if (enemy_spared == true)
14
{
15
    sprite_index = spr_dalv_spared
16
    x = starting_point_x
17
    y = starting_point_y
18
    image_xscale = starting_point_xscale
19
    image_yscale = starting_point_yscale
20
    image_alpha = 0.5
21
    if (no_loop_create_clouds == false)
22
    {
23
        for (i = 0; i <= 11; i += 1)
24
            instance_create(x, (y - 100), obj_spare_cloud)
25
    }
26
    no_loop_create_clouds = true
27
}
28
obj_feisty_four_moray_head.image_alpha = image_alpha
29
obj_feisty_four_moray_hand_left.image_alpha = image_alpha
30
obj_feisty_four_moray_hand_right.image_alpha = image_alpha
31
if (damage_disjoint_count > 0)
32
    damage_disjoint_count -= 1
33
else if (enemy_dead == false && enemy_spared == false)
34
{
35
    if (global.current_hp_enemy <= 0)
36
        sprite_index = spr_feisty_four_moray_body_legs
37
    else
38
        sprite_index = spr_feisty_four_moray_body_legs
39
}
40
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
41
{
42
    time_elapsed = 0
43
    sign_modifier = 1
44
    damage_disjoint_count = 12
45
    no_loop_damage_disjoint_count = true
46
}
47
else if (!instance_exists(obj_text_damage_count))
48
    no_loop_damage_disjoint_count = false
49
if (damage_disjoint_count == 12)
50
    damage_disjoint_x = -50
51
else if (damage_disjoint_count == 10)
52
    damage_disjoint_x = 50
53
else if (damage_disjoint_count == 8)
54
    damage_disjoint_x = -20
55
else if (damage_disjoint_count == 6)
56
    damage_disjoint_x = 20
57
else if (damage_disjoint_count == 4)
58
    damage_disjoint_x = -10
59
else if (damage_disjoint_count == 2)
60
    damage_disjoint_x = 10
61
else if (damage_disjoint_count == 0)
62
    damage_disjoint_x = 0
63
if (damage_disjoint_count > 0)
64
{
65
    if (global.current_hp_enemy <= 0)
66
        sprite_index = spr_feisty_four_moray_body_legs
67
    else
68
        sprite_index = hurt_sprite
69
    image_xscale = starting_point_xscale
70
    image_yscale = starting_point_yscale
71
}
72
else if (sprite_index == hurt_sprite)
73
    sprite_index = spr_feisty_four_moray_body_legs
74
if (global.current_hp_enemy <= 0)
75
{
76
    time_elapsed = 0
77
    sign_modifier = 1
78
}
79
x = draw_position_x + damage_disjoint_x
80
y = draw_position_y + damage_disjoint_y
81
if ((!((instance_exists(obj_text_damage_count) && global.fight_number == 1))) && enemy_dead == false && enemy_spared == false)
82
{
83
    game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
84
    animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math)
85
    image_yscale = draw_position_yscale + animation_disjoint_yscale
86
    image_xscale = draw_position_xscale - animation_disjoint_yscale * (max_rise_ext / max_rise)
87
    var image_yscale_store = image_yscale
88
    var time_elapsed_head = time_elapsed - time_elapsed_decrease_head
89
    if (time_elapsed_head < 0)
90
    {
91
        time_elapsed_head += time_max
92
        sign_modifier_head = (-sign_modifier)
93
    }
94
    else
95
        sign_modifier_head = sign_modifier
96
    game_maker_cannot_do_math = power((time_elapsed_head / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
97
    animation_disjoint_yscale = sign_modifier_head * (max_rise - game_maker_cannot_do_math)
98
    image_yscale = draw_position_yscale + animation_disjoint_yscale
99
    head_displacement_y = bbox_top + sprite_height * head_displacement_y_multiplier
100
    image_yscale = image_yscale_store
101
    var time_elapsed_hand_left = time_elapsed - time_elapsed_decrease_hand_left
102
    if (time_elapsed_hand_left < 0)
103
    {
104
        time_elapsed_hand_left += time_max
105
        sign_modifier_hand_left = (-sign_modifier)
106
    }
107
    else
108
        sign_modifier_hand_left = sign_modifier
109
    game_maker_cannot_do_math = power((time_elapsed_hand_left / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
110
    animation_disjoint_yscale = sign_modifier_hand_left * (max_rise - game_maker_cannot_do_math)
111
    image_yscale = draw_position_yscale + animation_disjoint_yscale
112
    hand_left_displacement_y = bbox_top + sprite_height * hand_left_displacement_y_multiplier
113
    image_yscale = image_yscale_store
114
    var time_elapsed_hand_right = time_elapsed - time_elapsed_decrease_hand_right
115
    if (time_elapsed_hand_right < 0)
116
    {
117
        time_elapsed_hand_right += time_max
118
        sign_modifier_hand_right = (-sign_modifier)
119
    }
120
    else
121
        sign_modifier_hand_right = sign_modifier
122
    game_maker_cannot_do_math = power((time_elapsed_hand_right / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
123
    animation_disjoint_yscale = sign_modifier_hand_right * (max_rise - game_maker_cannot_do_math)
124
    image_yscale = draw_position_yscale + animation_disjoint_yscale
125
    hand_right_displacement_y = bbox_top + sprite_height * hand_right_displacement_y_multiplier
126
    image_yscale = image_yscale_store
127
    time_elapsed += time_increase
128
    if (time_elapsed >= time_max)
129
    {
130
        time_elapsed = 0
131
        sign_modifier = (-sign_modifier)
132
    }
133
    animating = true
134
}
135
else
136
    animating = false
137
if (vanish == true)
138
{
139
    if (vanish_state == 1)
140
    {
141
        game_maker_cannot_do_math = power((time_elapsed_move / (time_max_move * 0.5 / 2 * (1 / (sqrt(max_rise_move * 0.15)))) - (sqrt(max_rise_move * 0.15))), 2)
142
        animation_disjoint_x_move = (-sign_modifier_move) * (max_rise_move * 0.15 - game_maker_cannot_do_math)
143
        x = draw_position_x + animation_disjoint_x_move
144
        time_elapsed_move += time_increase_move
145
        if (time_elapsed_move > (time_max_move * 0.5 / 2))
146
        {
147
            time_elapsed_move = 0
148
            vanish_state = 2
149
        }
150
    }
151
    if (vanish_state == 2)
152
    {
153
        game_maker_cannot_do_math = power((time_elapsed_move / (time_max_move / 2 * (1 / sqrt(max_rise_move))) - sqrt(max_rise_move)), 2)
154
        animation_disjoint_x_move = sign_modifier_move * (max_rise_move - game_maker_cannot_do_math)
155
        x = draw_position_x + animation_disjoint_x_move
156
        time_elapsed_move += time_increase_move
157
        if (time_elapsed_move > (time_max_move / 2))
158
            instance_destroy()
159
    }
160
}
161
if instance_exists(obj_feisty_four_moray_head)
162
{
163
    with (obj_feisty_four_moray_head)
164
        event_user(0)
165
}
166
if instance_exists(obj_feisty_four_moray_hand_left)
167
{
168
    with (obj_feisty_four_moray_hand_left)
169
        event_user(0)
170
}
171
if instance_exists(obj_feisty_four_moray_hand_right)
172
{
173
    with (obj_feisty_four_moray_hand_right)
174
        event_user(0)
175
}