Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_martlet_g_body_Step_0

related scripts: Create_0Destroy_0Other_10Other_11Other_25Step_0 Step_2

(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
event_user(0);
6
if (enemy_dead == true)
7
{
8
    x = starting_point_x;
9
    y = starting_point_y;
10
    instance_create(starting_point_x, starting_point_y, obj_dalv_dead);
11
    instance_destroy();
12
    exit;
13
    image_alpha = 0.5;
14
}
15
else if (enemy_spared == true)
16
{
17
    sprite_index = spr_martlet_g_spared;
18
    x = starting_point_x;
19
    y = starting_point_y;
20
    image_xscale = starting_point_xscale;
21
    image_yscale = starting_point_yscale;
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, y - 112, obj_spare_cloud);
27
    }
28
    no_loop_create_clouds = true;
29
}
30
if (damage_disjoint_count > 0)
31
{
32
    damage_disjoint_count -= 1;
33
}
34
else if (enemy_dead == false && enemy_spared == false)
35
{
36
    if (fight_mode == true)
37
        sprite_index = spr_martlet_g_body;
38
    else
39
        sprite_index = spr_martlet_body;
40
}
41
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
42
{
43
    time_elapsed = 0;
44
    sign_modifier = 1;
45
    time_elapsed_g = 0;
46
    sign_modifier_g = 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 (fight_mode == true)
71
        sprite_index = spr_martlet_g_hit;
72
    else
73
        sprite_index = spr_martlet_hit;
74
    image_xscale = starting_point_xscale;
75
    image_yscale = starting_point_yscale;
76
}
77
x = draw_position_x + damage_disjoint_x;
78
y = draw_position_y + damage_disjoint_y;
79
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false && image_alpha > 0)
80
{
81
    if (fight_mode == 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
        {
96
            sign_modifier_head = sign_modifier;
97
        }
98
        game_maker_cannot_do_math = power((time_elapsed_head / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
99
        animation_disjoint_yscale = sign_modifier_head * (max_rise - game_maker_cannot_do_math);
100
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
101
        head_displacement_y = bbox_top + (sprite_height * head_displacement_y_multiplier);
102
        image_yscale = image_yscale_store;
103
        var time_elapsed_hand_left = time_elapsed - time_elapsed_decrease_hand_left;
104
        if (time_elapsed_hand_left < 0)
105
        {
106
            time_elapsed_hand_left += time_max;
107
            sign_modifier_hand_left = -sign_modifier;
108
        }
109
        else
110
        {
111
            sign_modifier_hand_left = sign_modifier;
112
        }
113
        game_maker_cannot_do_math = power((time_elapsed_hand_left / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
114
        animation_disjoint_yscale = sign_modifier_hand_left * (max_rise - game_maker_cannot_do_math);
115
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
116
        hand_left_displacement_y = floor(bbox_top + (sprite_height * hand_left_displacement_y_multiplier));
117
        image_yscale = image_yscale_store;
118
        var time_elapsed_hand_right = time_elapsed - time_elapsed_decrease_hand_right;
119
        if (time_elapsed_hand_right < 0)
120
        {
121
            time_elapsed_hand_right += time_max;
122
            sign_modifier_hand_right = -sign_modifier;
123
        }
124
        else
125
        {
126
            sign_modifier_hand_right = sign_modifier;
127
        }
128
        game_maker_cannot_do_math = power((time_elapsed_hand_right / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
129
        animation_disjoint_yscale = sign_modifier_hand_right * (max_rise - game_maker_cannot_do_math);
130
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
131
        hand_right_displacement_y = floor(bbox_top + (sprite_height * hand_right_displacement_y_multiplier));
132
        image_yscale = image_yscale_store;
133
        time_elapsed += time_increase;
134
        if (time_elapsed >= time_max)
135
        {
136
            time_elapsed = 0;
137
            sign_modifier = -sign_modifier;
138
        }
139
    }
140
    else
141
    {
142
        game_maker_cannot_do_math = power((time_elapsed_g / ((time_max_g / 2) * (1 / sqrt(max_rise_g)))) - sqrt(max_rise_g), 2);
143
        animation_disjoint_yscale = sign_modifier_g * (max_rise_g - game_maker_cannot_do_math);
144
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
145
        image_xscale = draw_position_xscale - (animation_disjoint_yscale * (max_rise_ext_g / max_rise_g));
146
        var image_yscale_store = image_yscale;
147
        var time_elapsed_head = time_elapsed_g - time_elapsed_decrease_head_g;
148
        if (time_elapsed_head < 0)
149
        {
150
            time_elapsed_head += time_max_g;
151
            sign_modifier_head = -sign_modifier_g;
152
        }
153
        else
154
        {
155
            sign_modifier_head = sign_modifier_g;
156
        }
157
        game_maker_cannot_do_math = power((time_elapsed_head / ((time_max_g / 2) * (1 / sqrt(max_rise_g)))) - sqrt(max_rise_g), 2);
158
        animation_disjoint_yscale = sign_modifier_head * (max_rise_g - game_maker_cannot_do_math);
159
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
160
        head_displacement_y = bbox_top + (sprite_height * head_displacement_y_multiplier_g);
161
        image_yscale = image_yscale_store;
162
        var time_elapsed_hand_left = time_elapsed_g - time_elapsed_decrease_hand_left_g;
163
        if (time_elapsed_hand_left < 0)
164
        {
165
            time_elapsed_hand_left += time_max_g;
166
            sign_modifier_hand_left = -sign_modifier_g;
167
        }
168
        else
169
        {
170
            sign_modifier_hand_left = sign_modifier_g;
171
        }
172
        game_maker_cannot_do_math = power((time_elapsed_hand_left / ((time_max_g / 2) * (1 / sqrt(max_rise_g)))) - sqrt(max_rise_g), 2);
173
        animation_disjoint_yscale = sign_modifier_hand_left * (max_rise_g - game_maker_cannot_do_math);
174
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
175
        hand_left_displacement_y = floor(bbox_top + (sprite_height * hand_left_displacement_y_multiplier_g));
176
        image_yscale = image_yscale_store;
177
        var time_elapsed_hand_right = time_elapsed_g - time_elapsed_decrease_hand_right_g;
178
        if (time_elapsed_hand_right < 0)
179
        {
180
            time_elapsed_hand_right += time_max_g;
181
            sign_modifier_hand_right = -sign_modifier_g;
182
        }
183
        else
184
        {
185
            sign_modifier_hand_right = sign_modifier_g;
186
        }
187
        game_maker_cannot_do_math = power((time_elapsed_hand_right / ((time_max_g / 2) * (1 / sqrt(max_rise_g)))) - sqrt(max_rise_g), 2);
188
        animation_disjoint_yscale = sign_modifier_hand_right * (max_rise_g - game_maker_cannot_do_math);
189
        image_yscale = draw_position_yscale + animation_disjoint_yscale;
190
        hand_right_displacement_y = floor(bbox_top + (sprite_height * hand_right_displacement_y_multiplier_g));
191
        image_yscale = image_yscale_store;
192
        time_elapsed_g += time_increase_g;
193
        if (time_elapsed_g >= time_max_g)
194
        {
195
            time_elapsed_g = 0;
196
            sign_modifier_g = -sign_modifier_g;
197
        }
198
    }
199
    animating = true;
200
}
201
else
202
{
203
    animating = false;
204
}
205
event_user(1);
206
with (obj_martlet_g_body_shadow)
207
    event_user(0);