Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_battle_enemy_attack_know_cone_fig_Step_0

(view raw script w/o annotations or w/e)
1
if (jump_speed < grav_limit)
2
    jump_speed += grav
3
if (jump_speed_initial > 0)
4
{
5
    if ((bbox_bottom + jump_speed) >= (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4))
6
    {
7
        while ((bbox_bottom + sign(jump_speed) * grav) < (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4))
8
            y += (sign(jump_speed) * grav)
9
        jump_speed = 0
10
        can_switch_y = true
11
    }
12
    y += jump_speed
13
    if (can_switch_y == true)
14
    {
15
        jump_speed_initial -= jump_speed_initial_decrease
16
        jump_speed = (-jump_speed_initial)
17
        if (abs(jump_speed) < jump_speed_initial_decrease)
18
            jump_speed = 0
19
        can_switch_y = false
20
    }
21
}
22
if (jump_speed_initial <= 0)
23
{
24
    x_speed -= (x_speed_decrease * sign(x_speed))
25
    if (abs(x_speed) < x_speed_decrease)
26
        x_speed = 0
27
}
28
if (x_speed == 0 && no_loop == false)
29
{
30
    alarm[0] = 30
alarm[0]

instance_destroy()
31
    no_loop = true
32
}
33
if (bbox_top > (obj_dialogue_box_battle_transformation_any.bbox_top + 4) && bbox_bottom < (obj_dialogue_box_battle_transformation_any.bbox_bottom - 4) && bbox_left > (obj_dialogue_box_battle_transformation_any.bbox_left + 4) && bbox_right < (obj_dialogue_box_battle_transformation_any.bbox_right - 4) && in_box == false)
34
    in_box = true
35
if (in_box == true)
36
{
37
    if (sign(x_speed) == -1 && (bbox_left + x_speed) <= (obj_dialogue_box_battle_transformation_any.bbox_left + 4))
38
    {
39
        while ((bbox_left + sign(x_speed) * x_speed_decrease) > (obj_dialogue_box_battle_transformation_any.bbox_left + 4))
40
            x += (sign(x_speed) * x_speed_decrease)
41
        x_speed_hold = (-x_speed)
42
        x_speed = 0
43
        can_switch_x = true
44
    }
45
    else if (sign(x_speed) == 1 && (bbox_right + x_speed) >= (obj_dialogue_box_battle_transformation_any.bbox_right - 4))
46
    {
47
        while ((bbox_right + sign(x_speed) * x_speed_decrease) < (obj_dialogue_box_battle_transformation_any.bbox_right - 4))
48
            x += (sign(x_speed) * x_speed_decrease)
49
        x_speed_hold = (-x_speed)
50
        x_speed = 0
51
        can_switch_x = true
52
    }
53
}
54
x += x_speed
55
if (can_switch_x == true)
56
{
57
    x_speed = x_speed_hold
58
    can_switch_x = false
59
}