Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_martlet_body_Step_0

related scripts: Create_0Destroy_0Other_10Other_11Step_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
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_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 (global.current_hp_enemy <= 0)
37
        sprite_index = spr_martlet_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
    damage_disjoint_count = 12;
46
    no_loop_damage_disjoint_count = true;
47
}
48
else if (!instance_exists(obj_text_damage_count))
49
{
50
    no_loop_damage_disjoint_count = false;
51
}
52
if (damage_disjoint_count == 12)
53
    damage_disjoint_x = -50;
54
else if (damage_disjoint_count == 10)
55
    damage_disjoint_x = 50;
56
else if (damage_disjoint_count == 8)
57
    damage_disjoint_x = -20;
58
else if (damage_disjoint_count == 6)
59
    damage_disjoint_x = 20;
60
else if (damage_disjoint_count == 4)
61
    damage_disjoint_x = -10;
62
else if (damage_disjoint_count == 2)
63
    damage_disjoint_x = 10;
64
else if (damage_disjoint_count == 0)
65
    damage_disjoint_x = 0;
66
if (damage_disjoint_count > 0)
67
{
68
    sprite_index = spr_martlet_hit;
69
    image_xscale = starting_point_xscale;
70
    image_yscale = starting_point_yscale;
71
}
72
if (global.current_hp_enemy <= 0)
73
{
74
    time_elapsed = 0;
75
    sign_modifier = 1;
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
    game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
82
    animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math);
83
    image_yscale = draw_position_yscale + animation_disjoint_yscale;
84
    image_xscale = draw_position_xscale - (animation_disjoint_yscale * (max_rise_ext / max_rise));
85
    var image_yscale_store = image_yscale;
86
    var time_elapsed_head = time_elapsed - time_elapsed_decrease_head;
87
    if (time_elapsed_head < 0)
88
    {
89
        time_elapsed_head += time_max;
90
        sign_modifier_head = -sign_modifier;
91
    }
92
    else
93
    {
94
        sign_modifier_head = sign_modifier;
95
    }
96
    game_maker_cannot_do_math = power((time_elapsed_head / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
97
    animation_disjoint_yscale = sign_modifier_head * (max_rise - game_maker_cannot_do_math);
98
    image_yscale = draw_position_yscale + animation_disjoint_yscale;
99
    head_displacement_y = bbox_top + (sprite_height * head_displacement_y_multiplier);
100
    image_yscale = image_yscale_store;
101
    var time_elapsed_hand_left = time_elapsed - time_elapsed_decrease_hand_left;
102
    if (time_elapsed_hand_left < 0)
103
    {
104
        time_elapsed_hand_left += time_max;
105
        sign_modifier_hand_left = -sign_modifier;
106
    }
107
    else
108
    {
109
        sign_modifier_hand_left = sign_modifier;
110
    }
111
    game_maker_cannot_do_math = power((time_elapsed_hand_left / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
112
    animation_disjoint_yscale = sign_modifier_hand_left * (max_rise - game_maker_cannot_do_math);
113
    image_yscale = draw_position_yscale + animation_disjoint_yscale;
114
    hand_left_displacement_y = floor(bbox_top + (sprite_height * hand_left_displacement_y_multiplier));
115
    image_yscale = image_yscale_store;
116
    var time_elapsed_hand_right = time_elapsed - time_elapsed_decrease_hand_right;
117
    if (time_elapsed_hand_right < 0)
118
    {
119
        time_elapsed_hand_right += time_max;
120
        sign_modifier_hand_right = -sign_modifier;
121
    }
122
    else
123
    {
124
        sign_modifier_hand_right = sign_modifier;
125
    }
126
    game_maker_cannot_do_math = power((time_elapsed_hand_right / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
127
    animation_disjoint_yscale = sign_modifier_hand_right * (max_rise - game_maker_cannot_do_math);
128
    image_yscale = draw_position_yscale + animation_disjoint_yscale;
129
    hand_right_displacement_y = floor(bbox_top + (sprite_height * hand_right_displacement_y_multiplier));
130
    image_yscale = image_yscale_store;
131
    time_elapsed += time_increase;
132
    if (time_elapsed >= time_max)
133
    {
134
        time_elapsed = 0;
135
        sign_modifier = -sign_modifier;
136
    }
137
    animating = true;
138
}
139
else
140
{
141
    animating = false;
142
}
143
event_user(1);
144
with (obj_martlet_body_shadow)
145
    event_user(0);