Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_factory_02_seesaw_puzzle_Step_0

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

seesaw_puzzle_countdown -= 1 if (seesaw_puzzle_countdown > 0) { audio_play_sound(snd_beep, 1, 0) alarm[1] = 30 } else { audio_play_sound(snd_puzzle_start, 1, 0) seesaw_item_number = seesaw_item_number_max seesaw_item_number_wrong = 3 seesaw_puzzle_active = true return; } with (obj_steamworks_factory_02_face) { sprite_index = spr_steamworks_38_face_numbers image_index = other.seesaw_puzzle_countdown - 1 image_speed = 0 }
8
}
9
if (seesaw_puzzle_active == true)
10
{
11
    if (seesaw_item_offset > 0)
12
        seesaw_item_offset--
13
    else
14
    {
15
        seesaw_item_offset = seesaw_item_offset_max / speed_modifier
16
        seesaw_spawn_item = true
17
    }
18
    if global.left_key
19
    {
20
        if (obj_seesaw.phy_rotation > (-seesaw_angle_max))
21
            obj_seesaw.phy_rotation -= 1
22
    }
23
    if global.right_key
24
    {
25
        if (obj_seesaw.phy_rotation < seesaw_angle_max)
26
            obj_seesaw.phy_rotation += 1
27
    }
28
    obj_seesaw_light.image_angle = (-obj_seesaw.phy_rotation)
29
    with (obj_steamworks_factory_02_face)
30
    {
31
        sprite_index = spr_steamworks_38_face_numbers
32
        image_index = other.seesaw_item_number - 1
33
        image_speed = 0
34
    }
35
    if (hint_button_alpha < 1)
36
        hint_button_alpha += 0.1
37
}
38
else if (hint_button_alpha > 0)
39
    hint_button_alpha -= 0.2
40
if (seesaw_spawn_item && (!instance_exists(obj_factory_02_seesaw_item_ready)))
41
{
42
    audio_play_sound(snd_factory_puzzle_spawn_item, 1, 0)
43
    instance_create_depth(360, 90, -1000, obj_factory_02_seesaw_item_ready)
44
    seesaw_spawn_item = false
45
}
46
var strikes = 3 - seesaw_item_number_wrong
47
with (obj_factory_02_conveyor_indicator)
48
{
49
    if (strikes >= indicator_flag && sprite_index != spr_conveyor_indicator_red_x)
50
        sprite_index = spr_conveyor_indicator_red_x
51
}
52
if (strikes == 3)
53
{
54
    if (!alarm[0])
55
        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 }
56
    seesaw_puzzle_active = false
57
    with (obj_conveyor_belt)
58
    {
59
        image_index = 0
60
        image_speed = 0
61
    }
62
    with (obj_factory_02_conveyor_item)
63
        destroy_self = true
64
}
65
if (seesaw_item_number <= 0 || seesaw_item_number_wrong <= 0)
66
{
67
    instance_destroy()
68
    with (obj_steamworks_factory_02_face)
69
    {
70
        sprite_index = spr_steamworks_38_face_hello
71
        image_index = 0
72
        image_speed = 1
73
    }
74
    with (obj_factory_02_seesaw_item_ready)
75
        destroy_self = true
76
    with (obj_factory_02_seesaw_item)
77
        destroy_self = true
78
}