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;
gml_Object_obj_factory_02_conveyor_puzzle_Alarm_1.gml

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

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