Undertale Yellow script viewer

← back to main script listing

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