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
    exit;
11
    image_alpha = 0.5;
12
}
13
else if (enemy_spared == true)
14
{
15
    sprite_index = spr_martlet_spared;
16
    x = starting_point_x;
17
    y = starting_point_y;
18
    image_xscale = starting_point_xscale;
19
    image_yscale = starting_point_yscale;
20
    image_alpha = 0.5;
21
    if (no_loop_create_clouds == false)
22
    {
23
        for (i = 0; i <= 11; i += 1)
24
            instance_create(x, y - 112, obj_spare_cloud);
25
    }
26
    no_loop_create_clouds = true;
27
}
28
if (damage_disjoint_count > 0)
29
{
30
    damage_disjoint_count -= 1;
31
}
32
else if (enemy_dead == false && enemy_spared == false)
33
{
34
    if (global.current_hp_enemy <= 0)
35
        sprite_index = spr_martlet_body;
36
    else
37
        sprite_index = spr_martlet_body;
38
}
39
if (instance_exists(obj_text_damage_count) && global.fight_number == 1 && no_loop_damage_disjoint_count == false)
40
{
41
    time_elapsed = 0;
42
    sign_modifier = 1;
43
    damage_disjoint_count = 12;
44
    no_loop_damage_disjoint_count = true;
45
}
46
else if (!instance_exists(obj_text_damage_count))
47
{
48
    no_loop_damage_disjoint_count = false;
49
}
50
if (damage_disjoint_count == 12)
51
    damage_disjoint_x = -50;
52
else if (damage_disjoint_count == 10)
53
    damage_disjoint_x = 50;
54
else if (damage_disjoint_count == 8)
55
    damage_disjoint_x = -20;
56
else if (damage_disjoint_count == 6)
57
    damage_disjoint_x = 20;
58
else if (damage_disjoint_count == 4)
59
    damage_disjoint_x = -10;
60
else if (damage_disjoint_count == 2)
61
    damage_disjoint_x = 10;
62
else if (damage_disjoint_count == 0)
63
    damage_disjoint_x = 0;
64
if (damage_disjoint_count > 0)
65
{
66
    sprite_index = spr_martlet_hit;
67
    image_xscale = starting_point_xscale;
68
    image_yscale = starting_point_yscale;
69
}
70
if (global.current_hp_enemy <= 0)
71
{
72
    time_elapsed = 0;
73
    sign_modifier = 1;
74
}
75
x = draw_position_x + damage_disjoint_x;
76
y = draw_position_y + damage_disjoint_y;
77
if (!(instance_exists(obj_text_damage_count) && global.fight_number == 1) && enemy_dead == false && enemy_spared == false && image_alpha > 0)
78
{
79
    game_maker_cannot_do_math = power((time_elapsed / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
80
    animation_disjoint_yscale = sign_modifier * (max_rise - game_maker_cannot_do_math);
81
    image_yscale = draw_position_yscale + animation_disjoint_yscale;
82
    image_xscale = draw_position_xscale - (animation_disjoint_yscale * (max_rise_ext / max_rise));
83
    var image_yscale_store = image_yscale;
84
    var time_elapsed_head = time_elapsed - time_elapsed_decrease_head;
85
    if (time_elapsed_head < 0)
86
    {
87
        time_elapsed_head += time_max;
88
        sign_modifier_head = -sign_modifier;
89
    }
90
    else
91
    {
92
        sign_modifier_head = sign_modifier;
93
    }
94
    game_maker_cannot_do_math = power((time_elapsed_head / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
95
    animation_disjoint_yscale = sign_modifier_head * (max_rise - game_maker_cannot_do_math);
96
    image_yscale = draw_position_yscale + animation_disjoint_yscale;
97
    head_displacement_y = bbox_top + (sprite_height * head_displacement_y_multiplier);
98
    image_yscale = image_yscale_store;
99
    var time_elapsed_hand_left = time_elapsed - time_elapsed_decrease_hand_left;
100
    if (time_elapsed_hand_left < 0)
101
    {
102
        time_elapsed_hand_left += time_max;
103
        sign_modifier_hand_left = -sign_modifier;
104
    }
105
    else
106
    {
107
        sign_modifier_hand_left = sign_modifier;
108
    }
109
    game_maker_cannot_do_math = power((time_elapsed_hand_left / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
110
    animation_disjoint_yscale = sign_modifier_hand_left * (max_rise - game_maker_cannot_do_math);
111
    image_yscale = draw_position_yscale + animation_disjoint_yscale;
112
    hand_left_displacement_y = floor(bbox_top + (sprite_height * hand_left_displacement_y_multiplier));
113
    image_yscale = image_yscale_store;
114
    var time_elapsed_hand_right = time_elapsed - time_elapsed_decrease_hand_right;
115
    if (time_elapsed_hand_right < 0)
116
    {
117
        time_elapsed_hand_right += time_max;
118
        sign_modifier_hand_right = -sign_modifier;
119
    }
120
    else
121
    {
122
        sign_modifier_hand_right = sign_modifier;
123
    }
124
    game_maker_cannot_do_math = power((time_elapsed_hand_right / ((time_max / 2) * (1 / sqrt(max_rise)))) - sqrt(max_rise), 2);
125
    animation_disjoint_yscale = sign_modifier_hand_right * (max_rise - game_maker_cannot_do_math);
126
    image_yscale = draw_position_yscale + animation_disjoint_yscale;
127
    hand_right_displacement_y = floor(bbox_top + (sprite_height * hand_right_displacement_y_multiplier));
128
    image_yscale = image_yscale_store;
129
    time_elapsed += time_increase;
130
    if (time_elapsed >= time_max)
131
    {
132
        time_elapsed = 0;
133
        sign_modifier = -sign_modifier;
134
    }
135
    animating = true;
136
}
137
else
138
{
139
    animating = false;
140
}
141
event_user(1);
142
with (obj_martlet_body_shadow)
143
    event_user(0);