Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_factory_02_conveyor_puzzle_Step_0

(view raw script w/o annotations or w/e)
1
if live_call()
2
    return global.live_result;
3
var spawn_modifier = 1 + (1 - conveyor_item_number / conveyor_item_number_max) * 1.5
4
if (conveyor_puzzle_activate == true)
5
{
6
    conveyor_puzzle_activate = false
7
    alarm[1] = 30
alarm[1]

conveyor_puzzle_countdown -= 1 if (conveyor_puzzle_countdown > 0) { audio_play_sound(snd_beep, 1, 0) alarm[1] = 30 } else { audio_play_sound(snd_puzzle_start, 1, 0) with (obj_conveyor_belt) image_speed = 1 conveyor_item_number = conveyor_item_number_max conveyor_item_number_wrong = 3 conveyor_puzzle_active = true return; } with (obj_steamworks_factory_02_face) { sprite_index = spr_steamworks_38_face_numbers image_index = other.conveyor_puzzle_countdown - 1 image_speed = 0 }
8
}
9
if (conveyor_puzzle_active == true)
10
{
11
    if (conveyor_item_offset > 0)
12
        conveyor_item_offset--
13
    else
14
    {
15
        conveyor_item_offset = conveyor_item_offset_max / spawn_modifier
16
        conveyor_spawn_item = true
17
    }
18
    if keyboard_multicheck_pressed(0)
19
    {
20
        with (obj_conveyor_stamp_blue)
21
        {
22
            if (object_index != obj_conveyor_stamp_red)
23
                activate = true
24
        }
25
    }
26
    if keyboard_multicheck_pressed(1)
27
        obj_conveyor_stamp_red.activate = true
28
    with (obj_steamworks_factory_02_face)
29
    {
30
        sprite_index = spr_steamworks_38_face_numbers
31
        image_index = other.conveyor_item_number - 1
32
        image_speed = 0
33
    }
34
    if (hint_button_alpha < 1)
35
        hint_button_alpha += 0.1
36
}
37
else if (hint_button_alpha > 0)
38
    hint_button_alpha -= 0.2
39
if conveyor_spawn_item
40
{
41
    if (global.fun_value >= 11 && global.fun_value <= 15 && global.sworks_flag[56] == 0)
42
        conveyor_item_secret--
43
    if (conveyor_item_secret == 0)
44
    {
45
        conveyor_item_secret = -1
46
        audio_play_sound(snd_factory_puzzle_spawn_item, 1, 0)
47
        instance_create_depth(420, 590, 950, obj_factory_02_conveyor_item_dog)
48
        conveyor_spawn_item = false
49
        global.sworks_flag[56] = 1
50
    }
51
    else
52
    {
53
        audio_play_sound(snd_factory_puzzle_spawn_item, 1, 0)
54
        instance_create_depth(420, 590, 950, obj_factory_02_conveyor_item)
55
        conveyor_spawn_item = false
56
    }
57
}
58
var strikes = 3 - conveyor_item_number_wrong
59
with (obj_factory_02_conveyor_indicator)
60
{
61
    if (strikes >= indicator_flag && sprite_index != spr_conveyor_indicator_red_x)
62
        sprite_index = spr_conveyor_indicator_red_x
63
}
64
if (strikes == 3)
65
{
66
    if (!alarm[0])
67
        alarm[0] = 30
alarm[0]

instance_destroy() with (obj_steamworks_factory_02_face) { sprite_index = spr_steamworks_38_face_hello image_index = 0 image_speed = 1 }
68
    conveyor_puzzle_active = false
69
    with (obj_conveyor_belt)
70
    {
71
        image_index = 0
72
        image_speed = 0
73
    }
74
    with (obj_factory_02_conveyor_item)
75
        destroy_self = true
76
}
77
if (conveyor_item_number <= 0 || conveyor_item_number_wrong <= 0)
78
{
79
    with (obj_conveyor_belt)
80
    {
81
        image_index = 0
82
        image_speed = 0
83
    }
84
    instance_destroy()
85
    with (obj_factory_02_conveyor_item)
86
        destroy_self = true
87
    with (obj_steamworks_factory_02_face)
88
    {
89
        sprite_index = spr_steamworks_38_face_hello
90
        image_index = 0
91
        image_speed = 1
92
    }
93
}