Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_feisty_four_moray_legs_Step_0

related scripts: Create_0Destroy_0Draw_0Step_0

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