Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_macro_froggit_pedestal_Step_0

(view raw script w/o annotations or w/e)
1
if (global.sworks_flag[pedestal_flag] == 0)
2
{
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
        scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
6
        if (!pedestal_is_active)
7
        {
8
            with (msg)
9
                message[0] = "* (Something seems to have once#  rested here...)"
10
            pedestal_menu_open = true
11
        }
12
        else
13
        {
14
            with (msg)
15
            {
16
                message[0] = "* (A beautiful flower made of#  solid gold.)"
17
                message[1] = "* (Unfortunately, it's stuck to#  the pedestal.)"
18
            }
19
        }
20
    }
21
    if ((!instance_exists(obj_dialogue)) && pedestal_menu_open == 1)
22
    {
23
        instance_create(x, y, obj_item_use_menu)
24
        scr_cutscene_start
scr_cutscene_start

function scr_cutscene_start() //gml_Script_scr_cutscene_start { global.cutscene = true obj_pl.state = gml_Script_scr_frozen_state obj_pl.image_index = 0 obj_pl.image_speed = 0 }
()
25
        pedestal_menu_open = 2
26
    }
27
    var correct_item = false
28
    if (global.item_used_overworld != undefined && pedestal_menu_open == 2)
29
    {
30
        switch global.item_used_overworld
31
        {
32
            case "G. Pear":
33
                correct_item = true
34
                global.sworks_flag[pedestal_flag] = 1
35
                break
36
            case "G. Coffee":
37
                correct_item = true
38
                global.sworks_flag[pedestal_flag] = 2
39
                break
40
            case "G. Cactus":
41
                correct_item = true
42
                global.sworks_flag[pedestal_flag] = 3
43
                break
44
            default:
45
                scr_text
scr_text

function scr_text() //gml_Script_scr_text { if (!instance_exists(obj_dialogue)) msg = instance_create(x, y, obj_dialogue) }
()
46
                with (obj_dialogue)
47
                    message[0] = "* (Nothing happened.)"
48
                global.cutscene = false
49
                break
50
        }
51
52
        if (correct_item == true)
53
        {
54
            scr_screenshake
scr_screenshake

function scr_screenshake(argument0, argument1) //gml_Script_scr_screenshake { if instance_exists(obj_screenshake_player) return; with (instance_create(__view_get((9 << 0), 0).x, __view_get((9 << 0), 0).y, obj_screenshake_player)) { alarm[0]
alarm[0]

switch global.sworks_flag[pedestal_flag] { case 0: break case 1: pedestal_item = "pear" break case 2: pedestal_item = "coffee" break case 3: pedestal_item = "cactus" break default: } if (global.sworks_flag[pedestal_flag] != 0 || pedestal_is_active) { instance_create_depth(x, y, 500, obj_macro_froggit_light) sprite_index = spr_macro_froggit_pedestal_activated layer_set_visible((string(pedestal_placement) + "_" + string(pedestal_item)), true) layer_set_visible(("floorlights_" + string(pedestal_placement)), true) }
intensity = argument1 } }
(6, 2)
55
            alarm[0] = 1
alarm[0]

switch global.sworks_flag[pedestal_flag] { case 0: break case 1: pedestal_item = "pear" break case 2: pedestal_item = "coffee" break case 3: pedestal_item = "cactus" break default: } if (global.sworks_flag[pedestal_flag] != 0 || pedestal_is_active) { instance_create_depth(x, y, 500, obj_macro_froggit_light) sprite_index = spr_macro_froggit_pedestal_activated layer_set_visible((string(pedestal_placement) + "_" + string(pedestal_item)), true) layer_set_visible(("floorlights_" + string(pedestal_placement)), true) }
56
            alarm[1] = 15
alarm[1]

if (global.sworks_flag[47] != 0 && global.sworks_flag[48] != 0 && global.sworks_flag[49] != 0) return; scr_cutscene_end()
57
            audio_play_sound(snd_undertale_swipe, 1, 0)
58
            scr_item_remove
scr_item_remove

function scr_item_remove(argument0) //gml_Script_scr_item_remove { i = 1 while (i <= 8) { if (global.item_slot[i] == argument0) { while (i < 8) { global.item_slot[i] = global.item_slot[(i + 1)] i += 1 } global.item_slot[8] = "Nothing" return true; } else { if (i == 8) return false; i += 1 continue } } }
(global.item_used_overworld)
59
        }
60
    }
61
    if (pedestal_menu_open == 2 && (!instance_exists(obj_item_use_menu)))
62
    {
63
        pedestal_menu_open = 0
64
        global.item_used_overworld = undefined
65
    }
66
}