Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_martlet_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_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 (global.current_hp_enemy <= 0)
32
        sprite_index = spr_martlet_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
    damage_disjoint_count = 12
41
    no_loop_damage_disjoint_count = true
42
}
43
else if (!instance_exists(obj_text_damage_count))
44
    no_loop_damage_disjoint_count = false
45
if (damage_disjoint_count == 12)
46
    damage_disjoint_x = -50
47
else if (damage_disjoint_count == 10)
48
    damage_disjoint_x = 50
49
else if (damage_disjoint_count == 8)
50
    damage_disjoint_x = -20
51
else if (damage_disjoint_count == 6)
52
    damage_disjoint_x = 20
53
else if (damage_disjoint_count == 4)
54
    damage_disjoint_x = -10
55
else if (damage_disjoint_count == 2)
56
    damage_disjoint_x = 10
57
else if (damage_disjoint_count == 0)
58
    damage_disjoint_x = 0
59
if (damage_disjoint_count > 0)
60
{
61
    sprite_index = spr_martlet_hit
62
    image_xscale = starting_point_xscale
63
    image_yscale = starting_point_yscale
64
}
65
if (global.current_hp_enemy <= 0)
66
{
67
    time_elapsed = 0
68
    sign_modifier = 1
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
    game_maker_cannot_do_math = power((time_elapsed / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
75
    animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math)
76
    image_yscale = draw_position_yscale + animation_disjoint_yscale
77
    image_xscale = draw_position_xscale - animation_disjoint_yscale * (max_rise_ext / max_rise)
78
    var image_yscale_store = image_yscale
79
    var time_elapsed_head = time_elapsed - time_elapsed_decrease_head
80
    if (time_elapsed_head < 0)
81
    {
82
        time_elapsed_head += time_max
83
        sign_modifier_head = (-sign_modifier)
84
    }
85
    else
86
        sign_modifier_head = sign_modifier
87
    game_maker_cannot_do_math = power((time_elapsed_head / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
88
    animation_disjoint_yscale = sign_modifier_head * (max_rise - game_maker_cannot_do_math)
89
    image_yscale = draw_position_yscale + animation_disjoint_yscale
90
    head_displacement_y = bbox_top + sprite_height * head_displacement_y_multiplier
91
    image_yscale = image_yscale_store
92
    var time_elapsed_hand_left = time_elapsed - time_elapsed_decrease_hand_left
93
    if (time_elapsed_hand_left < 0)
94
    {
95
        time_elapsed_hand_left += time_max
96
        sign_modifier_hand_left = (-sign_modifier)
97
    }
98
    else
99
        sign_modifier_hand_left = sign_modifier
100
    game_maker_cannot_do_math = power((time_elapsed_hand_left / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
101
    animation_disjoint_yscale = sign_modifier_hand_left * (max_rise - game_maker_cannot_do_math)
102
    image_yscale = draw_position_yscale + animation_disjoint_yscale
103
    hand_left_displacement_y = floor(bbox_top + sprite_height * hand_left_displacement_y_multiplier)
104
    image_yscale = image_yscale_store
105
    var time_elapsed_hand_right = time_elapsed - time_elapsed_decrease_hand_right
106
    if (time_elapsed_hand_right < 0)
107
    {
108
        time_elapsed_hand_right += time_max
109
        sign_modifier_hand_right = (-sign_modifier)
110
    }
111
    else
112
        sign_modifier_hand_right = sign_modifier
113
    game_maker_cannot_do_math = power((time_elapsed_hand_right / (time_max / 2 * (1 / sqrt(max_rise))) - sqrt(max_rise)), 2)
114
    animation_disjoint_yscale = sign_modifier_hand_right * (max_rise - game_maker_cannot_do_math)
115
    image_yscale = draw_position_yscale + animation_disjoint_yscale
116
    hand_right_displacement_y = floor(bbox_top + sprite_height * hand_right_displacement_y_multiplier)
117
    image_yscale = image_yscale_store
118
    time_elapsed += time_increase
119
    if (time_elapsed >= time_max)
120
    {
121
        time_elapsed = 0
122
        sign_modifier = (-sign_modifier)
123
    }
124
    animating = true
125
}
126
else
127
    animating = false
128
event_user(1)
129
with (obj_martlet_body_shadow)
130
    event_user(0)