Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_robuild_parent_Step_0

(view raw script w/o annotations or w/e)
1
var robot_item_x_player = obj_pl.x
2
var robot_item_y_player = obj_pl.y - 9 - (sprite_height - sprite_yoffset)
3
if (scr_interact
scr_interact

function scr_interact() //gml_Script_scr_interact { if (distance_to_object(obj_pl) < 20 && obj_pl.state == gml_Script_scr_normal_state) { var pl_dir = obj_pl.direction var pl_x = 0 var pl_y = 0 var check_distance_x = 0 var check_distance_y = 0 switch pl_dir { case 0: pl_x = obj_pl.bbox_right pl_y = obj_pl.bbox_top + 1 check_distance_x = 20 break case 180: pl_x = obj_pl.bbox_left pl_y = obj_pl.bbox_top + 1 check_distance_x = -20 break case 90: pl_x = obj_pl.x pl_y = obj_pl.bbox_top check_distance_y = -20 break case 270: pl_x = obj_pl.x pl_y = obj_pl.bbox_bottom check_distance_y = 20 break } if collision_line_first(pl_x, pl_y, (pl_x + check_distance_x), (pl_y + check_distance_y), id, false, false) return true; } }
() && keyboard_multicheck_pressed(0))
4
{
5
    if (global.route == 2)
6
    {
7
        if (robot_item_is_carried == false && robot_item_can_pickup == true)
8
        {
9
            with (obj_robuild_parent)
10
            {
11
                if (robot_item_is_carried == true)
12
                    return;
13
            }
14
            robot_item_is_jumping = true
15
            robot_item_x_target = robot_item_x_player
16
            robot_item_y_target = robot_item_y_player
17
            audio_play_sound(snd_playerjump, 1, 0)
18
            depth = obj_pl.depth - 1
19
            solid = false
20
            visible = true
21
            obj_pl.state = gml_Script_scr_frozen_state
22
            obj_pl.image_index = 0
23
            obj_pl.image_speed = 0
24
        }
25
    }
26
    else
27
    {
28
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
29
        with (msg)
30
            message[0] = "* (Just some useless scrap.)"
31
    }
32
}
33
if (robot_item_is_jumping == true)
34
{
35
    if scr_arc_jump
scr_arc_jump

function scr_arc_jump(argument0, argument1) //gml_Script_scr_arc_jump { var jump_target_x = argument0 var jump_target_y = argument1 var _xd = jump_target_x - x var _yd = jump_target_y - y if (_xd == 0) _xd = 1 gravity = 1.5 var _hsp = sign(_xd) * sqrt(abs(_xd)) / 1.5 var _time = ceil(_xd / _hsp) hspeed = _xd / _time vspeed = _yd / _time - gravity / 2 * (_time + 1) alarm[0]
alarm[0]

hspeed = 0 vspeed = 0 gravity = 0
if (round(x) == jump_target_x && round(y) == jump_target_y) { hspeed = 0 vspeed = 0 x = jump_target_x y = jump_target_y gravity = 0 return true; } return false; }
(robot_item_x_target, robot_item_y_target)
36
    {
37
        if (robot_item_is_carried == false)
38
        {
39
            robot_item_is_carried = true
40
            robot_item_is_jumping = false
41
            if (!global.cutscene)
42
                scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
43
        }
44
        else if (robot_item_is_carried == true)
45
        {
46
            audio_play_sound(snd_mart_impact_2, 1, 0)
47
            robot_item_is_carried = false
48
            robot_item_is_jumping = false
49
            depth = (-y)
50
            solid = true
51
            visible = true
52
            if (!instance_exists(obj_dialogue))
53
            {
54
                if (!global.cutscene)
55
                    scr_cutscene_end
scr_cutscene_end

function scr_cutscene_end() //gml_Script_scr_cutscene_end { global.cutscene = false obj_pl.alarm[0] = 1 }
()
56
            }
57
            if (instance_exists(obj_steamworks_13_controller) && obj_steamworks_13_controller.robot_part_no_loop == true)
58
                obj_steamworks_13_controller.robot_part_no_loop = false
59
        }
60
    }
61
    return;
62
}
63
if (robot_item_is_carried == true)
64
{
65
    x = robot_item_x_player
66
    y = robot_item_y_player
67
    depth = obj_pl.depth - 1
68
    var pl_image_index = floor(obj_pl.image_index)
69
    if (obj_pl.direction == 0 || obj_pl.direction == 180)
70
    {
71
        if (pl_image_index == 1)
72
            y += 1
73
    }
74
    else if (pl_image_index == 1 || pl_image_index == 3)
75
        y -= 1
76
    if (keyboard_multicheck(1) && obj_pl.state == gml_Script_scr_normal_state)
77
    {
78
        robot_item_is_jumping = true
79
        audio_play_sound(snd_playerjump, 1, 0)
80
        robot_item_y_target = obj_pl.y + 16
81
        if place_free((obj_pl.x + 20), (obj_pl.y + 10))
82
            robot_item_x_target = obj_pl.x + 20
83
        else if place_free((obj_pl.x - 20), (obj_pl.y + 10))
84
            robot_item_x_target = obj_pl.x - 20
85
        else if place_free(obj_pl.x, (obj_pl.y + 20))
86
        {
87
            robot_item_x_target = obj_pl.x
88
            robot_item_y_target = obj_pl.y + 20
89
        }
90
        else
91
        {
92
            robot_item_x_target = obj_pl.x
93
            robot_item_y_target = obj_pl.y - 20
94
        }
95
        obj_pl.state = gml_Script_scr_frozen_state
96
        obj_pl.image_index = 0
97
        obj_pl.image_speed = 0
98
    }
99
}