Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_heart_battle_fighting_axis_Step_0

(view raw script w/o annotations or w/e)
1
script_execute(scr_controls_battle_heart_red);
2
x_previous = x;
3
y_previous = y;
4
move_x = key_left + key_right;
5
move_y = key_down + key_up;
6
hsp = move_x * walk_speed;
7
vsp = move_y * walk_speed;
8
if (key_revert)
9
{
10
    hsp = round(hsp / 2);
11
    vsp = round(vsp / 2);
12
}
13
hsp += hsp_factor;
14
if (movement_mode == 1)
15
{
16
    y = obj_dialogue_box_battle_transformation_any.bbox_bottom - 16;
17
    soul_direction = 90;
18
    if (sign(hsp) == -1 && (bbox_left + hsp) <= (obj_dialogue_box_battle_transformation_any.bbox_left + 4))
19
    {
20
        while ((bbox_left + sign(hsp)) > (obj_dialogue_box_battle_transformation_any.bbox_left + 4))
21
            x += sign(hsp);
22
        hsp = 0;
23
    }
24
    else if (sign(hsp) == 1 && (bbox_right + hsp) >= (obj_dialogue_box_battle_transformation_any.bbox_right - 4))
25
    {
26
        while ((bbox_right + sign(hsp)) < (obj_dialogue_box_battle_transformation_any.bbox_right - 4))
27
            x += sign(hsp);
28
        hsp = 0;
29
    }
30
    x += hsp;
31
}
32
else if (movement_mode == 2)
33
{
34
    if (circle_alpha < 0.99)
35
        circle_alpha = lerp(circle_alpha, 1, 0.15);
36
    else
37
        circle_alpha = 1;
38
    x = obj_dialogue_box_battle_transformation_any.x + lengthdir_x(base_distance, soul_direction);
39
    y = obj_dialogue_box_battle_transformation_any.y + lengthdir_y(base_distance, soul_direction);
40
    soul_direction -= (hsp * 3);
41
}
42
obj_heart_red_hitbox.x = x;
43
obj_heart_red_hitbox.y = y;
44
if (instance_exists(obj_heart_battle_effect_glow))
45
{
46
    obj_heart_battle_effect_glow.x = x;
47
    obj_heart_battle_effect_glow.y = y;
48
}
49
if (moveable == true && global.current_sp_self > 0)
50
{
51
    var can_trail = false;
52
    trail_cc_current += 1;
53
    if (trail_cc_current >= trail_cc_max)
54
    {
55
        can_trail = true;
56
        trail_cc_current = 0;
57
    }
58
    if (can_trail == true)
59
    {
60
        ds_list_add(x_list, x);
61
        ds_list_add(y_list, y);
62
        while (ds_list_size(x_list) > max_points_trail)
63
        {
64
            ds_list_delete(x_list, 0);
65
            ds_list_delete(y_list, 0);
66
        }
67
    }
68
}
69
event_user(15);
70
image_angle = soul_direction;