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