Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_factory_03_minigame_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var axis_move = false
4
var axis_speed = 2
5
with (obj_factory_03_furnace)
6
{
7
    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) && state == 0)
8
        state = 1
9
}
10
if (axis_move_timer >= 0)
11
    axis_move_timer--
12
else
13
{
14
    axis_move = true
15
    axis_move_timer = axis_move_timer_max
16
}
17
if (axis_move == true)
18
{
19
    switch axis_position_current
20
    {
21
        case 0:
22
            axis_position_new = choose(1, 3)
23
            break
24
        case 1:
25
            axis_position_new = choose(0, 2, 4)
26
            break
27
        case 2:
28
            axis_position_new = choose(1, 5)
29
            break
30
        case 3:
31
            axis_position_new = choose(4, 0, 6)
32
            break
33
        case 4:
34
            axis_position_new = choose(1, 3, 5, 7)
35
            break
36
        case 5:
37
            axis_position_new = choose(2, 4, 8)
38
            break
39
        case 6:
40
            axis_position_new = choose(7, 3)
41
            break
42
        case 7:
43
            axis_position_new = choose(4, 6, 8)
44
            break
45
        case 8:
46
            axis_position_new = choose(7, 5)
47
            break
48
    }
49
50
    axis_position_current = axis_position_new
51
    with (obj_axis_npc)
52
    {
53
        actor_speed = axis_speed
54
        can_walk = true
55
        npc_arrived = false
56
        x_dest[0] = other.axis_positions[other.axis_position_new][0]
57
        y_dest[0] = other.axis_positions[other.axis_position_new][1]
58
        end_direction = "nothing"
59
    }
60
}