| 1 | if (global.sworks_flag[pedestal_flag] == 0) | 
    
    
        | 2 | { | 
    
    
        | 3 |     if (scr_interactscr_interact() && keyboard_multicheck_pressed(0))function scr_interact ()
{
    if (distance_to_object(obj_pl) < 20 && obj_pl.state == 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;
    }
} | 
    
    
        | 4 |     { | 
    
    
        | 5 |         scr_textscr_text();function 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(); | 
    
    
        | 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 |             default: | 
    
    
        | 33 |                 scr_textscr_text();function scr_text ()
{
    if (!instance_exists(obj_dialogue))
        msg = instance_create(x, y, obj_dialogue);
} | 
    
    
        | 34 |                 with (obj_dialogue) | 
    
    
        | 35 |                     message[0] = "* (Nothing happened.)"; | 
    
    
        | 36 |                 global.cutscene = false; | 
    
    
        | 37 |                 break; | 
    
    
        | 38 |             case "G. Pear": | 
    
    
        | 39 |                 correct_item = true; | 
    
    
        | 40 |                 global.sworks_flag[pedestal_flag] = 1; | 
    
    
        | 41 |                 break; | 
    
    
        | 42 |             case "G. Coffee": | 
    
    
        | 43 |                 correct_item = true; | 
    
    
        | 44 |                 global.sworks_flag[pedestal_flag] = 2; | 
    
    
        | 45 |                 break; | 
    
    
        | 46 |             case "G. Cactus": | 
    
    
        | 47 |                 correct_item = true; | 
    
    
        | 48 |                 global.sworks_flag[pedestal_flag] = 3; | 
    
    
        | 49 |                 break; | 
    
    
        | 50 |         } | 
    
    
        | 51 |         if (correct_item == true) | 
    
    
        | 52 |         { | 
    
    
        | 53 |             scr_screenshakescr_screenshake(6, 2);function scr_screenshake (arg0, arg1)
{
    if (instance_exists(obj_screenshake_player))
        exit;
    with (instance_create(__view_get(e__VW.Object, 0).x, __view_get(e__VW.Object, 0).y, obj_screenshake_player))
    {alarm[0] gml_Object_obj_macro_froggit_pedestal_Alarm_0.gmlswitch (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;
}
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 = arg1;
    }
}
enum e__VW
{
    XView,
    YView,
    WView,
    HView,
    Angle,
    HBorder,
    VBorder,
    HSpeed,
    VSpeed,
    Object,
    Visible,
    XPort,
    YPort,
    WPort,
    HPort,
    Camera,
    SurfaceID
} | 
    
    
        | 54 |             alarm[0] = 1;gml_Object_obj_macro_froggit_pedestal_Alarm_0.gmlswitch (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;
}
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);
} | 
    
    
        | 55 |             alarm[1] = 15; | 
    
    
        | 56 |             audio_play_sound(snd_undertale_swipe, 1, 0); | 
    
    
        | 57 |             scr_item_removescr_item_remove(global.item_used_overworld);function scr_item_remove (arg0)
{
    for (i = 1; i <= 8; i += 1)
    {
        if (global.item_slot[i] == arg0)
        {
            while (i < 8)
            {
                global.item_slot[i] = global.item_slot[i + 1];
                i += 1;
            }
            global.item_slot[8] = "Nothing";
            return true;
            break;
        }
        else if (i == 8)
        {
            return false;
        }
    }
} | 
    
    
        | 58 |         } | 
    
    
        | 59 |     } | 
    
    
        | 60 |     if (pedestal_menu_open == 2 && !instance_exists(obj_item_use_menu)) | 
    
    
        | 61 |     { | 
    
    
        | 62 |         pedestal_menu_open = 0; | 
    
    
        | 63 |         global.item_used_overworld = undefined; | 
    
    
        | 64 |     } | 
    
    
        | 65 | } |