#####################################################################
#                INTERACT ROOM WITH ITEM
#####################################################################
label use_item(target, item):

    if target.ID == "AEEngineTerminal" and item.ID == "ITMControlBand":
        play sound "audio/beep.wav"
        mc "\"I think access control is done centrally at the Bridge...\""

    elif target.ID == "AECargoTerminal" and item.ID == "ITMMultiPod":
        play sound "audio/beep.wav"
        call large_notify("TRANSDIMENSIONAL POD", "WARNING: This device can be used only once. To use it, fill the available slots with subunits from your cargo bay. They will be projected into the Multiverse.", ["Continue", "Abort"], "08_items/ico ITMMultiPod.png", "red") from _call_large_notify_46
        if _return == "Abort":
            mc "\"I better think about this once more...\""
        else:
            call multiverse_manager() from _call_multiverse_manager_1
            return()

    elif target.ID == "AECargoTerminal" and item.ID == "ITMDroneRemote":
        play sound "audio/beep.wav"
        call cargo_drone_manager() from _call_cargo_drone_manager
        return()

    elif target.ID == "AETenarisWarehouseTerminal" and item.ID == "ITMMultiPod":
        play sound "audio/beep.wav"
        call large_notify("TRANSDIMENSIONAL POD", "WARNING: This device can be used only once. Using it now will sublimate all wares, subunits, subsystems and bot stasis pod from this Warehouse into the Multiverse.\nThey will be gone from this instance.", ["Continue", "Abort"], "08_items/ico ITMMultiPod.png", "red") from _call_large_notify_47
        if _return == "Abort":
            mc "\"I better think about this once more...\""
        else:
            call warehouse_multiverse_export() from _call_warehouse_multiverse_export
            return()

    elif target.ID == "AECargoTerminal" and item.ID == "ITMLiquorVortex":
        if not GAME.ship.cargoFree():
            mc "\"I need space in cargo to package a crate...\""
        elif not GAME.mc.hasItem("ITMLiquorVortex",6):
            mc "\"I need six bottles of Vortex for an Exclusive Crate.\""
        else:
            queue sound "audio/potion.wav"
            $ item = GAME.items["ITMCrateExclusive"]
            $ renpy.say (None,"You carefully package six bottles of {} into a crate...".format(GAME.items["ITMLiquorVortex"].getName(["noArt","cap", "col"])))
            queue sound "audio/load.wav"
            $ n = 6

            while n:
                $ n -= 1
                $ GAME.mc.remItem("ITMLiquorVortex")
            queue sound "audio/notify.wav"
            call simple_notify("ITEM LOADED", "(1x) {}".format(item.getName(["noArt", "cap", "col"])), ["Continue"], "08_items/ico ITMCrateExclusive.png", "orange") from _call_simple_notify_66
            $ GAME.ship.loadWare("ITMCrateExclusive")
            call quest_updater() from _call_quest_updater_142

    #####################################################################
    #                MISCELLANEOUS
    #####################################################################
    elif target.ID == "AEEngineTerminal" and item.ID == "ITMPoster001":
        $ GAME.mc.remItem("ITMPoster001")
        queue sound "audio/install.wav"
        "You attach the poster to the engine cover..."
        queue sound "audio/tech_success.wav"
        $GAME.locs["LOCEngine"].tags.append("ITMPoster001")
        mc "\"Nice...\""
        return()

    elif target.ID == "AELabStorage" and item.ID == "ITMCamera":
        if GAME.questSys.isActive("QID_BOT_OBSERVE"):
            mc "\"I already placed a camera here...\""
        elif GAME.questSys.inProgress("QID_BOT_MONITOR"):
            queue sound "audio/install.wav"
            "You install the monitoring camera..." with fade 
            call hour_passes(1) from _call_hour_passes_64
            $ GAME.mc.remItem("ITMCamera")
            $ GAME.mc.hasDone("camera_placed")
            call quest_updater() from _call_quest_updater_143
        else:
            mc "\"I don't know what that would accomplish...\""
        
        return()

    #####################################################################
    #                REPAIR JOBS
    #####################################################################
    elif "AERep" in target.ID and item.ID == "ITMSpanner":
        queue sound "audio/install.wav"
        $ GAME.repQueue.remove(target.ID)
        while target.ID in GAME.repMisses:
            $ GAME.repMisses.remove(target.ID)
        mc "\"There, fixed!\""
        $ GAME.mc.tallyUp("Repair Jobs",1)
        $ GAME.mc.incAttrFrac("TEC", 0.1,5)
        $ GAME.mc.hasDoneToday("repair")
        if tris.getJob().ID == "JOB_Diag" and GAME.repQueue == []:
            queue sound "audio/notify.wav"
            mc "\"The last repair job for today, done!\""
        if GAME.repQueue == []:
            $ GAME.repMisses = []
        call hour_passes() from _call_hour_passes_65
        return()

    elif "repair" in target.ID.lower() and GAME.hour >= 22:
        mc "\"I'm too tired for that...\""
        mc "\"I should have thought of it earlier...\""

    # DEPRECATED
    elif target.ID == "AEEngineRepairDucts" and item.ID == "ITMSpanner":
        play sound "audio/install.wav"
        call hour_passes() from _call_hour_passes_66
        mc "\"That should take care of it...\"" with fade
        $ GAME.mc.tallyUp("Repair Jobs",1)
        $ GAME.mc.hasDoneToday("QID_TSK_DUCTS_ENGINE")
        $ GAME.mc.hasDoneToday("repair_job")

    elif target.ID == "AEH2RepairTerminal" and item.ID == "ITMSpanner":
        play sound "audio/install.wav"
        call hour_passes() from _call_hour_passes_67
        mc "\"That should take care of the terminal...\"" with fade
        $ GAME.mc.tallyUp("Repair Jobs",1)
        $ GAME.mc.hasDoneToday("QID_TSK_TERMINAL_H2")
        $ GAME.mc.hasDoneToday("repair_job")

    elif target.ID == "AEH1RepairPlating" and item.ID == "ITMSpanner":
        play sound "audio/install.wav"
        call hour_passes() from _call_hour_passes_68
        mc "\"That should take care of the floor plating...\"" with fade
        $ GAME.mc.tallyUp("Repair Jobs",1)
        $ GAME.mc.hasDoneToday("QID_TSK_FLOOR_H1")
        $ GAME.mc.hasDoneToday("repair_job")

    elif target.ID == "AEH1RepairPlating_2" and item.ID == "ITMSpanner":
        play sound "audio/install.wav"
        call hour_passes() from _call_hour_passes_69
        mc "\"That should take care of the floor plating...\"" with fade
        $ GAME.mc.tallyUp("Repair Jobs",1)
        $ GAME.mc.hasDoneToday("QID_TSK_FLOOR_H1_2")
        $ GAME.mc.hasDoneToday("repair_job")


    #####################################################################
    #                ENGINE ROOM
    #####################################################################

    elif target.ID == "AEEngineButton" and item.ID == "ITMSpanner" and "reactor activated" not in GAME.mc.done:
        mc "\"This [C_HI_B]Hyper Wrench[C_HI_E] should do the trick...\""
        play sound "audio/switch.wav"
        "Click...!" with vpunch
        play sound "audio/switch.wav"
        "Click...!" with vpunch
        play sound "audio/rumble.wav"
        $ GAME.mc.hasDone("reactor activated")
        play music "audio/ambient_engine2.mp3"
        mc "\"Whoaa...!\"" with blueflash
        call quest_updater() from _call_quest_updater_144
        return()


    #####################################################################
    #                CAPTAINS QUARTERS
    #####################################################################
    elif target.ID == "AECaptainBed" and item.ID in ["ITMFlyboy01", "ITMFlyboy02"]:
        if GAME.hour < 18:
            mc "\"It's a bit early for that...\""
            call sandbox_interior_prepare_scene() from _call_sandbox_interior_prepare_scene_15
        elif not GAME.questSys.isDone('QID_MAIN_GIVEMAP'):
            mc "\"I should get something done around the ship first...\""
            mc "\"For example, give T'Ris her map...\""
            mc "\"Then I can enjoy my magazine...\""
            return()

        elif "used_magazine" not in GAME.mc.doneToday and item.ID == "ITMFlyboy01":
            $ GAME.mc.hasDoneToday("used_magazine")
            call cutscene_tris("flyboy_magazine") from _call_cutscene_tris_12
            $ GAME.hour = 23
            # call night_passes()
            call sandbox_interior_prepare_scene() from _call_sandbox_interior_prepare_scene_16

        elif "used_magazine" not in GAME.mc.doneToday and item.ID == "ITMFlyboy02":
            $ GAME.mc.hasDoneToday("used_magazine")
            call cutscene_tris("flyboy_magazine_special") from _call_cutscene_tris_13
            $ GAME.hour = 23
            # call night_passes()
            call sandbox_interior_prepare_scene() from _call_sandbox_interior_prepare_scene_17        

        else:
            mc "\"I shouldn't overdo it...\""
        return() # CR-0492

    elif target.ID == "AECaptainBox" and item.ID == "ITMControlBand":
        if not GAME.mc.hasDone("package_opened"):
            mc "\"The controller should be able to override the lock...\""
            queue sound "audio/tech_success.wav"
            mc "\"Yes, unlocked!\""
            mc "\"Let's see what is in there...\""
            mc "\"Some data modules...\""
            mc "\"And a magazine!\""
            mc "\"'Flyboy Special Edition'...\""
            mc "\"Looks like Nimhe on the cover...\""
            mc "\"I wonder whether she'd miss it...\""
            queue sound "audio/notify.wav"
            call large_notify("THE COMPROMISING BOX", "Inside the box there are several data modules and a test print of a Flyboy Special Edition. The modules would surely be missed, but the magazine might not.\n\nWhat do you want to do with the magazine?", ["Remove", "Leave"], "05_gui/ico ITMBoxSmall.png", "orange") from _call_large_notify_48
            if _return == "Remove":
                "You take out the magazine for later inspection..."
                queue sound "audio/notify.wav"
                call simple_notify("ITEM FOUND", "Flyboy Special", ["Continue"], "08_items/ico ITMFlyboy02.png") from _call_simple_notify_67
                queue sound "audio/equip.wav"
                $ GAME.mc.addItem("ITMFlyboy02")
            else:
                mc "\"I better leave everything in there...\""
        else:
            mc "\"I already checked inside...\""
            mc "\"I better let Nimhe know that I have the box...\""
        return()

    elif target.ID == "AECaptainCup" and item.ID == "ITMLiquorFairy":
        mc "\"That green glow is weird...\"" 
        mc "\"I'd rather not drink that...\""

    elif target.ID == "AECaptainCup" and item.ID == "ITMLiquorVortex":
        mc "\"That bottle is so expensive, I doubt I would enjoy it...\"" 
        mc "\"I'd rather sell it or collect it...\""

    elif target.ID == "AECaptainCup" and item.ID == "ITMLiquorIltari":
        if GAME.mc.hasDoneToday("liquor_iltari"):
            mc "\"I drank already one of those today...\""
            mc "\"I'd better not get {i}that{/i} hammered.\""
            return()
        mc "\"Let's see...\""
        queue sound "audio/swallow.wav"    
        mc "\"Nice taste!\"" with blueflash
        queue sound "audio/potion.wav"
        $ GAME.mc.remItem("ITMLiquorIltari")

    elif target.ID == "AECaptainCup" and item.ID == "ITMLiquorDrengar":
        if not GAME.questSys.inProgress("QID_TRIS_FOCUS"):
            mc "\"It has a warning on the label...\""
            mc "\"{i}'May impact 'performance' if consumed by non-Drengarians'.{/i}\""
            mc "\"Not sure I should drink that...\""            
        elif GAME.mc.hasDoneToday("liquor"):
            mc "\"I drank already one of those today...\""
            mc "\"I'd better not get {i}that{/i} hammered.\""
        else:
            mc "\"Let's see whether it is worth the money...\""
            queue sound "audio/swallow.wav"
            "You drink the Drengarian Liquor..." with goldflash
            queue sound "audio/swallow.wav"
            mc "\"Tastes awesome, but I'm feeling kind of foggy...\"" with goldflash
            mc "\"Now I should visit T'Ris, before the effect wears off...\""
            $ GAME.mc.remItem("ITMLiquorDrengar")
            $ GAME.mc.hasDoneToday("liquor")
        return()


    #####################################################################
    #                BRIDGE
    #####################################################################
    elif target.ID == "AEBridgeChair" and item.ID == "ITMControlBand":
        if "chair activated" not in GAME.mc.done:
            "You attempt to connect to the Command Console with the device on your wrist..."
            play sound "audio/drone_beep.wav"
            bb2 "\"And?\""
            mc "\"Still at it...\""
            mc "\"...aaannd this button...\""
            play sound "audio/tech_success.wav"
            "Bridge Control" "\"Command Privilege Authorized.\""
            mc "\"Yes!\""
            play sound "audio/success.wav"
            call simple_notify("ACCESS UNLOCKED", "Ship Bridge Controls", ["Continue"], "05_gui/ico_gui_eventspace.png") from _call_simple_notify_68
            $ GAME.mc.hasDone("chair activated")
            call quest_updater() from _call_quest_updater_145
        else:
            mc "\"It is already activated...\""
        return()

    #####################################################################
    #                GUEST CABINS
    #####################################################################

    elif target.ID == "AEGuestCuffs" and item.ID == "ITMControlBand" and "cuffs_checked" in GAME.mc.done:
        mc "\"Let's see...\""
        queue sound "audio/click.wav"
        "With the help of your Control Unit you adjust the logic circuitry just a bit..."
        mc "\"That should do it...\""
        mc "\"Now I should stick around the ship at 20:00 and see what happens...\""
        $ GAME.mc.hasDone("cuffs_manipulated")
        return()    
    
    elif target.ID == "AEGuestCuffs" and item.ID == "ITMControlBand":
        mc "\"I should have a close look at them first...\""
        return()


    #####################################################################
    #					ARELLARTI STATION		
    #####################################################################
    elif target.ID == "AEArellartiPlazaPetshop" and item.ID == "ITMVoucherPet1": # CR-0492
        if GAME.questSys.isDone('QID_TRIS_PET_TRAINER'):
            queue sound "audio/notify.wav"
            mc "\"I better give that voucher to someone of my crew....\""
        else:
            if not GAME.mc.hasDone("intro_voucher"):
                mc "\"I have this item here...\""
                queue sound "audio/notify.wav"
                ptr "\"A Krell Pet Training Voucher...\"" 
                ptr "\"Interesting...\""
                ptr "\"How did you come by that?\""
                mc "\"I did a favour for a Krell Trader once...\""
                ptr "\"I see...\""
                ptr "\"Send your pet over with that voucher in the morning.\""
                if not GAME.mc.hasDone("voucher_talk"):
                    ptr "\"Also, feel free to visit my shop should you need anything...\""
                mc "\"Thanks, I will.\""
                ptr "\"Nice doing business with you...\""
        call quest_updater() from _call_quest_updater_146
        return()

    #####################################################################
    #                CHARACTER USE
    #####################################################################
    elif "ACTTRIS" in target.tags:
        call interact_tris("use", item) from _call_interact_tris_2 

    elif "ACTNIMHE" in target.tags:
        call interact_nimhe("use", item) from _call_interact_nimhe 

    elif "ACTKHELARA" in target.tags:
        call interact_khelara("use", item) from _call_interact_khelara 

    elif "ACTVEE" in target.tags:
        call interact_vee("use", item) from _call_interact_vee 

    elif "ACTSERA" in target.tags:
        call interact_seraphine("use", item) from _call_interact_seraphine 

    elif "ACTTYPEJ" in target.tags:
        call interact_type_j("use", item) from _call_interact_type_j 

    elif "ACTAUDRA" in target.tags:
        call interact_audra("use", item) from _call_interact_audra 

    elif "ACTMOIRA" in target.tags:
        call interact_moira("use", item) from _call_interact_moira 

    elif "ACTVTY" in target.tags:
        call interact_verity("use", item) from _call_interact_verity 
    #####################################################################
    #                CATCH ALL
    #####################################################################

    else:

        $ renpy.say (mc, "\"I don't think the {} can be used in that fashion...\"".format(item.getName(["noArt", "col", "cap"])))


    return()



#####################################################################
#####################################################################
#                INTERACT ROOM
#####################################################################
#####################################################################

label interact_room(interaction, paras=[]):
    if interaction.ID == "AEDummy":
        bb2 "\"Foo...\""
        return()

    #####################################################################
    #					MISC		
    #####################################################################
    elif "AERep" in interaction.ID:
        mc "\"That does not look good.\""
        mc "\"I better fix it...\""
        return()


    #####################################################################
    #
    #               ARELLARTI STATION
    #
    #####################################################################
    #####################################################################
    #               BOARDING
    #####################################################################

    elif interaction.ID == "AEArellartiStationShip":
        # switch back to ship
        call boarding() from _call_boarding
        return()

    elif interaction.ID == "AEArellartiStationGate":
        call sandbox_interior_navigate_to("LOCArellartiStationPL") from _call_sandbox_interior_navigate_to_43
        return()

    elif interaction.ID == "AEArellartiStationAdmin":
        # gate menu
        $ mOptions = [  "Missions/m", "True",
                        "Port Authority/p", "True", 
                        "Exit/x", "True"]


        while True:
                play sound "audio/click.wav"
                call screen menu_interactive_scr(False, mOptions, [])
                play sound "audio/click.wav"
                if _return == "Missions":
                    "Port Authority" "\"You are currently not eligible for missions in Krell Space.\""
                elif _return == "Port Authority":
                    "Port Authority" "\"Please ensure that your female crew wears Krell Crew Attire at all times....\""
                elif _return == "Exit":
                    call sandbox_interior_prepare_scene() from _call_sandbox_interior_prepare_scene_18
                    return()

        return()

    elif interaction.ID == "AEArellartiPlazaPetOwner":
        show screen displayPresentActors("LOCArellartiStationPL")
        call interact_petOwner("interact") from _call_interact_petOwner
        hide screen displayPresentActors
        return()   

    elif interaction.ID == "AEArellartiPlazaPetshop":
        show screen displayPresentActors("LOCArellartiStationPL")
        call shop_arellarti_pets() from _call_shop_arellarti_pets
        hide screen displayPresentActors
        return()   

    #####################################################################
    #
    #               PIRATE HIDEOUT 
    #
    #####################################################################
    #####################################################################
    #               BOARDING
    #####################################################################

    elif interaction.ID == "AEPirateShipOwn":
        # switch back to ship
        call boarding() from _call_boarding_1
        return()

    #####################################################################
    #					MISC ACTIVE ELEMENTS (HIDDEN)		
    #####################################################################
    elif interaction.ID in ["AEPoster003"]:
        mc "\"Nice poster...\""
        if nimhe.isHere():
            if "ITMPonyMag01" in nimhe.doneToday:
                $ poster = "poster3a"
                $ GAME.mc.hasDone("ITMPonyMag01")
            elif "ITMPonyMag02" in nimhe.doneToday:
                $ poster = "poster3b"
                $ GAME.mc.hasDone("ITMPonyMag02")
            elif "ITMPonyMag03" in nimhe.doneToday:
                $ poster = "poster3c"
                $ GAME.mc.hasDone("ITMPonyMag03")
            else:
                return()

            $ img = "06_cutscenes/cutscene_{}.jpg".format(poster) 
            show image img with dissolve 
            window hide  
            pause  
            queue sound "audio/notify.wav"
            if poster == "poster3a":
                nim "\"That's Mizana.\""
                nim "\"She won the races more often than anyone!\""
            elif poster == "poster3b":
                nim "\"That's Xenia.\""
                nim "\"She is quite devious on the track!\""
            elif poster == "poster3c":
                nim "\"That's Se'lar.\""
                nim "\"She's rated best in Endurance!\""
            $ renpy.say(mc, vary("\"<Interesting...|I see...|Really?>\""))
            scene room_guest1_smart with fade
            mc "{i}\"Nimhe is a bit weird...\"{/i}"
            if all([x in GAME.mc.done for x in ["ITMPonyMag01","ITMPonyMag02","ITMPonyMag03"]]) and not GAME.mc.hasAchievement("pony expert"):
                call achievement_notify(GAME.mc, "pony expert") from _call_achievement_notify_10
                $ GAME.galleryAdd(125)
        return()

    elif interaction.ID in ["AEPoster002"]:
        $ img = "06_cutscenes/cutscene_{}.png".format(interaction.ID) 
        queue sound "audio/notify.wav"
        show image img with dissolve 
        window hide  
        pause  
        mc "\"Nice...\"" 
        if nimhe.isAt() == "LOCGuest1":
           
            $ pChat = [
                [["ni"],"any", "DIAPos002a", {}, "True", [],
                [ "ni", "<I like how all of their models are totally shaved!>",
                "mc", "<Indeed.|You don't say.|Really?|Interesting...|Is that so?>"]
                ],
                [["ni"],"any", "DIAPos002b", {}, "True", [],
                [ "ni", "<Those are really popular at Arcades.>",
                "ni", "Only the high end ones have them, though...",
                "mc", "<Indeed.|You don't say.|Really?|Interesting...|Is that so?>"]
                ],
                [["ni"],"any", "DIAPos002c", {}, "True", [],
                [  "ni", "<They are really great for bondage training...>",
                    "ni", "<I had one once, and she used to tie me up {i}real{/i} good...>",
                    "ni", "<She was very strict too...|For hours...|And she shaved me too...>",
                    "mc", "<How unusual.|You don't say.|Really?|Interesting...|Is that so?>"]
                ]
                
            ]
            call npc_talk(nimhe, pChat) from _call_npc_talk_16
        hide image img with dissolve
        return()

    elif interaction.ID in ["AEPoster001"]:
        $ img = "06_cutscenes/cutscene_{}.png".format(interaction.ID) 
        show image img with dissolve 
        window hide  
        pause  
        mc "\"Nice...\"" 
        if khelara.isAt() == "LOCEngine":
           
            $ pChat = [
                [["kh"],"any", "DIAPos001a", {}, "True", [],
                [ "kh", "<That holo movie was boring...>",          
                "kh", "<She defeated her enemies without a single scratch...>",                
                "mc", "<Except for losing most of her clothes...|Except when she fell in the pit with that Gorlac...>",                
                "kh", "<A flimsy attempt to rescue the movie...|Exploitative and unoriginal...|Indeed...>"]
                ]]                
            
            call npc_talk(khelara, pChat) from _call_npc_talk_17
        hide image img with dissolve
        return()


    #####################################################################
    #                   XENOS DOCK
    #####################################################################
    elif interaction.ID == "AEXenosMarquee":
        queue sound "audio/notify.wav"
        mc "\"A Dock for Voron Upgrades...\""
        mc "\"That could be interesting...\""
        mc "\"I wonder what it would take to get my ship ugraded there...\"" # CR-0858
        return()
    
    elif interaction.ID == "AEXenosShipOwn":
        # switch back to ship
        call boarding() from _call_boarding_2
        return()

    #####################################################################
    #					PIRATE DOCK		
    #####################################################################
    elif interaction.ID == "AEPirateShipArms":
        if GAME.mc.attr["NOT"]< 5:
            queue sound "audio/notify.wav"
            "Two guards are scanning you with a dangerously looking device..."
            kguard "\"You're not on Krogneath's list.\""
            mc "\"Nice outfit...\""
            kguard "\"Careful.\""
            kguard "\"Move along.\""
            mc "{i}\"I guess I need at least a bit of notoriety to get in here...\"{/i}"
        elif GAME.hour >= 18:
            queue sound "audio/notify.wav"
            kguard "\"Kroneath is not in.\""
            kguard "\"He's taking his new pet out for a walk.\""
            kguard "\"You might find him in the bar.\""
            mc "\"I see...\""
        else: 
            kguard "\"Welcome.\""
            kguard "\"Krogneath is open for business...\""
            if tris.isAt() == "LOCPetwalk":
                kguard  "\"Your pet has to stay outside, though.\""
                mc "\"Fine.\""
                mc "\"Wait by the ship, T'Ris.\""
                tri "\"Hrmmpfff...\""
            call krogneath_trader() from _call_krogneath_trader            
            call hour_passes() from _call_hour_passes_70
            call sandbox_interior_navigate_to("LOCPirateDock") from _call_sandbox_interior_navigate_to_44
            if tris.isAt() == "LOCPetwalk":
                tri "\"You took your time...\""
                mc "\"One shouldn't rush such discussions...\""
                tri "\"Hrmmmpfff...\""
        return()

    elif interaction.ID == "AEPirateScrap":
        queue sound "audio/notify.wav"
        call large_notify ("SCRAP TRADER", "You approach the ship of the Scrap Trader. The Pirate Hideout seems to be his home base.\n\nTwo guards block your way, demanding 500 Cr admission fee.", ["Pay Fee", "Abort"], "05_gui/ico_gui_trader.png", "orange") from _call_large_notify_49

        if _return == "Pay Fee" and GAME.money < 500:
            "You lack the necessary funds."
            return()

        elif _return == "Pay Fee":
            call transaction("Trader Fees", -500, True) from _call_transaction_22
            call scrap_trader() from _call_scrap_trader_1
            $ GAME.ship.status = "docked" # workaround

        elif _return == "Abort":
            mc "\"Some other time...\""
            return()
        return()

    elif interaction.ID == "AEPirateCantina":
        call sandbox_interior_navigate_to("LOCPirateCantina") from _call_sandbox_interior_navigate_to_45
        return()

    #####################################################################
    #					CANTINA		
    #####################################################################

    elif interaction.ID == "AEPirateCantinaKrogneath":
        show screen displayPresentActors("LOCPirateCantina")
        call interact_krogneath("interact") from _call_interact_krogneath
        hide screen displayPresentActors
        return()   


    elif interaction.ID == "AEPirateCantinaVigo":
        show screen displayPresentActors("LOCPirateCantina")
        call interact_vigo("interact") from _call_interact_vigo
        hide screen displayPresentActors
        return()   

    elif interaction.ID == "AEPirateCantinaTeri":
        show screen displayPresentActors("LOCPirateCantina")
        call interact_teri("interact") from _call_interact_teri
        hide screen displayPresentActors
        return()  

    elif interaction.ID == "AEPirateCantinaKhelara":
        show screen displayPresentActors("LOCPirateCantina")
        call interact_khelara("interact") from _call_interact_khelara_1
        hide screen displayPresentActors
        return()  
    #####################################################################
    #
    #               SPACE STATION
    #
    #####################################################################
    #####################################################################
    #               BOARDING
    #####################################################################

    elif interaction.ID == "AEStationShip":
        # switch back to ship
        call boarding() from _call_boarding_3
        return()

    #####################################################################
    #               ADMINISTRATION
    #####################################################################

    elif interaction.ID == "AEStationAdmin":

        if not GAME.mc.hasDone("mining registration"):
            "You make your way to the Spaceport authorities to volunteer."
            play sound "audio/notify.wav"
            "Luckily, you are among the first volunteers and receive free mining gear!"
            "Spaceport General Affairs" "\"Thank you for your support!\""
            "Spaceport General Affairs" "\"Here are the coordinates for your navigation system!\""
            play sound "audio/success.wav"
            $  GAME.getStarSys().locs["LIDRubbleIltari"].found = True
            call simple_notify("New Location", "Iltari Debris Field.", [], "05_gui/ico_gui_asteroids.png") from _call_simple_notify_69
            "Spaceport General Affairs" "\"A mining laser will be delivered to your ship shortly.\""
            "Spaceport General Affairs" "\"We also provide a basic set of subunits to get the mining laser up and running...\""
            mc "\"Awesome!\""

            $ item = GAME.items["ITMMiningMkI"]
            play sound "audio/notify.wav"
            call find_notify(item, "ITEM DELIVERED") from _call_find_notify_15
            $ GAME.ship.loadWare(item.ID)
            play sound "audio/notify.wav"

            $ item = GAME.items["ITMTunneling"]
            call find_notify(item, "ITEM DELIVERED (3x)") from _call_find_notify_16
            $ GAME.ship.loadWare(item.ID)
            $ GAME.ship.loadWare(item.ID)
            $ GAME.ship.loadWare(item.ID)

            $ item = GAME.items["ITMOutput"]
            play sound "audio/notify.wav"
            call find_notify(item, "ITEM DELIVERED") from _call_find_notify_17
            $ GAME.ship.loadWare(item.ID)

            play sound "audio/load.wav"
            mc "\Now I'm all set!\""
            mc "\"Let's have a look at the Cargo Bay next and install that [C_HI_B]Mining Laser[C_HI_E].\""
            if not GAME.mc.hasDone("intro trade cargo"):
                play sound "audio/success.wav"
                call simple_notify("FEATURE UNLOCKED", "Cargo bay trading terminal", ["Continue"], "05_gui/ico_gui_console.png") from _call_simple_notify_70

        elif GAME.questSys.inProgress("QID_UNIFORM_APPLY"):
            "You proceed to Station Control to apply for uniform registration..."
            queue sound "audio/notify.wav"
            mc "\"I'd like to register a uniform for public use.\"" with fade
            "Spaceport General Affairs" "\"The uniform you are submitting for registration is a Class-A uniform.\"" 
            mc "\"Is that a problem?\""
            "Spaceport General Affairs" "\"It can be approved.\""
            mc "\"Excellent.\""
            "Spaceport General Affairs" "\"There is one final formality left.\""
            mc "\"Which is?\""
            "Spaceport General Affairs" "\"The in-person review.\""
            "Spaceport General Affairs" "\"I suggest you put on the uniform for approval now.\""
            mc "\"Me!?\"" with vpunch
            mc "\"Now!?\"" with vpunch
            "Spaceport General Affairs" "\"It is a requirement...\""
            mc "\"Ahem...\""
            mc "\"It is only for my crew...\""
            "Spaceport General Affairs" "\"I see.\""
            "Spaceport General Affairs" "\"This is not uncommon among merchant vessels.\""            
            "Spaceport General Affairs" "\"The registration needs to be extended to category 43-B then.\""
            "Spaceport General Affairs" "\"Send a member of your crew for in person registration.\""
            mc "\"I will.\""
            "Spaceport General Affairs" "\"Do not take too long or the application will expire.\""
            mc "\"Of course.\""
            $ GAME.mc.hasDone("uniform_apply")
            queue sound "audio/notify.wav"            
            mc "{i}\"I better send T'Ris over right away.\"{/i}"
            call quest_updater() from _call_quest_updater_147
   
        elif GAME.questSys.inProgress("QID_PIRATE_WEAPONS"):
            "Spaceport General Affairs" "\"What can we help you with?\""
            mc "\"I would like to apply for a weapons license.\""
            "Spaceport General Affairs" "\"A weapons license, hmmm?\""
            "Spaceport General Affairs" "\"Let me check your credentials first...\""
            if GAME.mc.attr["REP"] < 10:
                queue sound "audio/beep.wav"
                "Spaceport General Affairs" "\"Your rating is insufficient.\""
                "Spaceport General Affairs" "\"We cannot hand out weapons to just anyone.\""
                mc "\"And now?\""
                "Spaceport General Affairs" "\"You need a positive reputation of 10 points or higher in this Sector.\""
                mc "\"How can I get that?\""
                "Spaceport General Affairs" "\"Help space-farers in distress, report slaves in stasis pods for rescue etc.\""
                mc "\"I see.\""
                "Spaceport General Affairs" "\"Return, when you meet the requirements.\""
                mc "\"Fine.\""
                queue sound "audio/notify.wav"
                mc "{i}\"I better do some good deeds...\"{/i}"
                mc "{i}\"Flying around in space should yield the right opportunities...\"{/i}"

            else:
                "Spaceport General Affairs" "\"Your rating is adequate.\""
                queue sound "audio/tech_success.wav"
                "Spaceport General Affairs" "\"The weapons license has been registered.\""
                "Spaceport General Affairs" "\"From tomorrow, the docking system will list weapons for you to purchase.\""
                "Spaceport General Affairs" "\"Use them responsibly.\""
                $ GAME.mc.hasDone("grade_1")
                mc "\"Great!\""
                mc "\"Space scum beware! Captain [GAME.mc.name] is coming for you!\""
            call quest_updater() from _call_quest_updater_148
   
        elif GAME.questSys.isDone("QID_PIRATE_WEAPONS") and GAME.mc.attr["REP"] >=20 and "grade_2" not in GAME.mc.done:
            queue sound "audio/notify.wav"
            mc "\"I would like to upgrade my weapons license to Grade 2.\""
            "Station Control" "\"Your rating is adequate.\""
            "Station Control" "\"The upgrade is 10,000 Cr.\""
            queue sound "audio/notify.wav"
            call simple_notify("WEAPONS LICENSE", "Ugrade to Level 2 for 10,000 Cr", ["Buy", "Abort"], "05_gui/ico Ship.png") from _call_simple_notify_71
            if _return == "Buy" and GAME.money >= 10000:
                call transaction("Weapons Licese Fee", -10000, True) from _call_transaction_23
                $ GAME.mc.hasDone("grade_2")
            elif _return == "Buy":
                "Station Control" "\"You lack the required credits.\""
            else:
                mc "\"Another time maybe.\""

        elif GAME.questSys.isDone("QID_PIRATE_WEAPONS") and GAME.mc.attr["REP"] >=30 and "grade_3" not in GAME.mc.done:
            queue sound "audio/notify.wav"
            mc "\"I would like to upgrade my weapons license to Grade 3.\""
            "Station Control" "\"Your rating is adequate.\""
            "Station Control" "\"The upgrade is 50,000 Cr.\""
            queue sound "audio/notify.wav"
            call simple_notify("WEAPONS LICENSE", "Ugrade to Level 3 for 50,000 Cr", ["Buy", "Abort"], "05_gui/ico Ship.png") from _call_simple_notify_72
            if _return == "Buy" and GAME.money >= 50000:
                call transaction("Weapons Licese Fee", -50000, True) from _call_transaction_24
                $ GAME.mc.hasDone("grade_3")
            elif _return == "Buy":
                "Station Control" "\"You lack the required credits.\""
            else:
                mc "\"Another time maybe.\""
            
        elif GAME.questSys.inProgress('QID_SERAPHINE_LICENSE'):
            mc "\"I would like to acquire a Hyperjump License.\"" with fade
            "Station Control" "\"That is possible.\""
            "Station Control" "\"You need a Navigator on board qualified for Hyperjump Drives.\""
            "Station Control" "\"We can't just have anyone operate in Hyperspace.\""
            "Station Control" "\"Who knows where you'd end up that way?\""
            mc "\"Fine.\""
            mc "\"I would like to register my Navigator for a License then.\""
            "Station Control" "\"Is your Navigator qualified?\""
            mc "\"T'Ris is a very experienced Deepspace Navigator.\""
            "Station Control" "\"Excellent.\""
            "Station Control" "\"Send her here for the mandatory introduction classes.\""
            mc  "\"Introduction classes?\""
            "Station Control" "\"Hyperspace mechanics, introduction to neighbouring races and their customs, ...\""
            mc "\"I will do that.\""
            "Station Control" "\"Hand me your Multipass for registration.\""
            mc "\"I, ahem... don't have one.\""
            "Station Control" "\"You don't have one?\""
            "Station Control" "\"Every Space Traveller is obligated to carry it at all times!\""
            mc "\"I must have, ahem... lost it.\""
            mc "\"Can you issue me a new one?\""
            "Station Control" "\"That requires extensive background checks...\""
            "Station Control" "\"To keep out spies from our System.\""
            "Station Control" "\"Like the Lizard People of Zebulon Three...\""
            mc "\"I'm kind of in a hurry...\""
            mc "\"Can't we settle this another way?\""
            "Station Control" "\"Another way?\""
            mc "\"Say I donate a generous sum to the Iltari Station Officer Retirement Fund?\""
            "Station Control" "\"That would raise flags with the Accounting Department...\""
            "Station Control" "\"They are not known for their flexibility.\""
            mc "\"Accountancy does that to people I guess...\""
            "Station Control" "\"You are a Trader I presume?\""
            mc "\"Yes.\""
            "Station Control"  "\"You {i}could{/i} provide me with a special item instead...\""
            "Station Control" "\"Voronian Vortex...\""
            "Station Control"  "\"I heard you Traders carry large amounts of that liquor.\""
            mc "\"'Large amounts' is a bit exaggerated, but I've come across it.\"" 
            "Station Control"  "\"I'd like to serve a bottle or two at my next party.\""
            "Station Control" "\"One crate with 6 should do it.\""
            "Station Control" "\"And don't worry, Accounting won't be invited...\""
            mc "\"I'll see what I can do.\""
            $ GAME.mc.hasDone("hypergate_license_inquiry")
            call quest_updater() from _call_quest_updater_149

        # ============ CR-0353 START ================
        elif GAME.questSys.inProgress('QID_SERAPHINE_MULTIPASS_B_PICKUP') and GAME.ship.hasCargo(['ITMCrateExclusive']):
            mc "\"I want to pick up my Multipass.\""
            "Station Control" "\"Where is the, ahem... delivery?\""
            mc "\"I have it in my Cargo Hold.\""
            "Station Control" "\"Excellent, forward it to this address...\""
            mc "\"I will.\""
            "Station Control" "\"With that out of the way, here is your Multipass.\""
            $ item = GAME.items["ITMMultipass"]
            queue sound "audio/notify.wav"
            call find_notify(item, "ITEM RECEIVED") from _call_find_notify_18 
            mc "\"Much obliged.\""
            $ GAME.mc.addItem("ITMMultipass")
            $ GAME.ship.unloadWare("ITMCrateExclusive")
            call quest_updater() from _call_quest_updater_150 
            return()

        elif GAME.questSys.inProgress('QID_SERAPHINE_MULTIPASS_B_PICKUP'):
            mc "\"I want to pick up my Multipass.\""
            "Station Control" "\"Where is the, ahem... delivery?\""
            mc "\"I am still working on it...\""
            "Station Control" "\"Come back when you have it then.\""
            mc "\"I will.\""
            return()

        # ============ CR-0353 END ================


        else:
            mc "\"I wouldn't know what to do there.\""

        return()

    #####################################################################
    #               ENTERTAINMENT
    #####################################################################

    elif interaction.ID == "AEStationEntertainment":
        call sandbox_interior_navigate_to("LOCIltariStationED") from _call_sandbox_interior_navigate_to_46
        return()

    #####################################################################
    #               SPACEBAR
    #####################################################################

    elif interaction.ID == "AEStationSpacebar":
        call sandbox_interior_navigate_to("LOCIltariStationSB") from _call_sandbox_interior_navigate_to_47
        return()

    elif interaction.ID == "AEStationGambling":

        # ===== CR-0682 START
        if not GAME.questSys.isDone("QID_INTRO_GEAR"):
            queue sound "audio/drone_beep.wav"
            bb2 "\"I think there are better ways to earn money, Captain [GAME.mc.name].\""
            bb2 "\"I recommend you go back to the Spacedock.\""
            bb2 "\"Maybe an opportunity will present itself there...\""
            bb2 "\"I heard Station Traffic Control has problems with Asteroid Debris...\""
            bb2 "\"They might look for someone to help out with that...\""
            return()
        
        elif GAME.money < 5000: 
            mc "\"I better earn some money before gambling it away...\""
            mc "\"Maybe they offer some work around the Space Dock...\""
        # ===== CR-0682 END
            "You watch the spinning lights, wishing you had more money..."
            if GAME.hour < 18:
                call hour_passes(18-GAME.hour) from _call_hour_passes_71
            else:
                call hour_passes(22-GAME.hour) from _call_hour_passes_72
            "Some time has passed..." with fade
            return()

        if GAME.hour == 22:
            mc "\"Its late.\""
            mc "\"I should return to the ship.\""
            return()
            
        if not GAME.mc.hasDone("intro_slot"):
            mc "\"A slot machine...\""
            mc "\"I am feeling lucky...\""
        "You place a 1,000 Cr bet..."
        $ bet = 1000
        play sound "audio/coin.wav"
        $ returns = max (0, bet + int(random.gauss(0.0+bet/5.0,bet/5.0)))

        if GAME.hour < 18:
            call hour_passes(18-GAME.hour) from _call_hour_passes_73
        else:
            call hour_passes(22-GAME.hour) from _call_hour_passes_74

        if returns > bet:
            queue sound "audio/success.wav"
            call find_notify(returns, "Your returns are") from _call_find_notify_19
            call transaction("Gambling Wins", returns-bet) from _call_transaction_25
            mc "\"Nice!\"" 
        else:
            queue sound "audio/notify.wav"
            call find_notify(returns, "Your returns are") from _call_find_notify_20
            call transaction("Gambling Losses", returns-bet) from _call_transaction_26
            mc "\"Aarrgg...!\"" 

        return()

    elif interaction.ID == "AEStationDancing":
        # dancer lineup 
        $ GAME.locs["LOCIltariStationSB"].attr["dancers"] = {20: "leila"}

        # if quest ylyee not done and mc has progressed a bit
        if not GAME.questSys.isDone("QID_MULT_TRANSPORT") and GAME.day >= 10:
            $ GAME.locs["LOCIltariStationSB"].attr["dancers"][15] = "ylyee"
        if GAME.hour not in GAME.locs["LOCIltariStationSB"].attr["dancers"].keys():
            "You hang around in the back for a while, but there seems to be no dancer on duty..." with fade 
            call hour_passes() from _call_hour_passes_75
            return()
        if "dancers" in GAME.locs["LOCIltariStationSB"].attr.keys():            
            if GAME.money < 100:
                mc "\"I should carry some spare change to watch the dancers, I guess.\""
                return()
        $ dancer = GAME.locs["LOCIltariStationSB"].attr["dancers"][GAME.hour].title()
        scene expression("10_anims/fullscreen_{}.png".format(dancer.lower())) with Fade(0.5,0.5,2.0)
        window hide
        pause
        mc "\"Nice...\""
        "[dancer]" "\"How about a tip?\""
        $ tip = renpy.input("5 to [GAME.money:,] Cr", 100)
        $ tip = abs(int(force_number(tip)))
        if tip > 500 and not GAME.questSys.isActive("QID_TRIS_ELSEWHERE"):
            mc "{i}\"I think that's a bit much...\"{/i}"
            mc "{i}\"Let's keep it under 500...\"{/i}"
            $ tip = 500
        elif tip < 5:
            mc "{i}\"I don't want to look cheap...\"{/i}"
            mc "{i}\"Let's make it 5...\"{/i}"
            $ tip = 5

        $ GAME.mc.tallyUp("Paid For Dancers", tip)
        call transaction("Dancers", -tip) from _call_transaction_27        
        if tip > 0:
            # Normal tipping dialogue
            play sound "audio/coin.wav"
            $ tipScale = int(round(capValue(math.log(tip,10),0,4)))
            $ renpy.say("[dancer]", "\"{} Credits.\"".format(tip))            
            $ renpy.say("[dancer]", "\"{}\"".format({0: "Well, better than nothing...", 1:"Thanks...", 2: "Much appreciated.", 3: "Thank you {i}very{/i} much.", 4: "{i}That{/i} deserves a private 'Thank You'..."}[tipScale]))
    
            # ylyee quest trigger
            if tip >= 500 and dancer == "Ylyee":
                $ ylyee.tallyUp("Tips (Cr)", 500) 
                if ylyee.getTally("Tips (Cr)") >= 500: #500:
                    $ renpy.say("[dancer]", "\"Let's have a talk in the back room...\"")
                    $ GAME.galleryAdd(27)  
                    call cutscene("ylyee_backroom") from _call_cutscene_46

            # Backroom reward normal dancers
            elif tipScale >= 4:
                "[dancer]" "\"Why don't you follow me into the backroom for a moment...\""
                scene expression("10_anims/dancer_{}_05.jpeg".format(dancer.lower())) with fade
                window hide
                pause
                mc "\"Ready?\""
                "[dancer]" "\"Mmm..hhhh.\""
                scene expression("ani_dancer_{}".format(dancer.lower())) with dissolve
                window hide
                pause
                $ GAME.galleryAdd({"leila":14}[dancer.lower()])  
                scene expression("10_anims/dancer_{}_00.jpeg".format(dancer.lower())) with fade                 
                queue sound "audio/squish.wav"
                mc "\"Aaaarrghhh...\"" with whiteflash
                queue sound "audio/squish.wav"
                mc "\"Aaaarrghhh...\"" with whiteflash
                $ GAME.mc.tallyUp("Dancer Rewards",1)
                $ GAME.mc.hasDone("dancer_tip_{}".format(dancer.lower()))

                # dancer moneyshot
                $ GAME.mc.done.append("dancer_{}".format(dancer.lower()))
                if GAME.mc.done.count("dancer_{}".format(dancer.lower())) == 3:
                    scene expression("06_cutscenes/cutscene_{}_moneyshot.png".format(dancer.lower())) with dissolve
                    $ GAME.galleryAdd({"leila":15}[dancer.lower()]) # special moneyshot still bonus
                else:
                    scene expression("10_anims/dancer_{}_03.jpeg".format(dancer.lower())) with dissolve                    
                    $ GAME.galleryAdd({"leila":10}[dancer.lower()]) # normal anim
                window hide
                pause
                mc "\"Nice...\""
                $ GAME.mc.tallyUp("Dancer Rewards",1)

        scene intermission with dissolve
        $ GAME.mc.hasDone(dancer)
        $ GAME.mc.hasDoneToday(dancer)

        call hour_passes() from _call_hour_passes_76
        scene room_iltari_tavern_smart with fade
        return()

    elif interaction.ID == "AEStationSpriteShady":
        show screen displayPresentActors("LOCIltariStationSB")
        call shady_trader() from _call_shady_trader
        hide screen displayPresentActors
        return()

    elif interaction.ID == "AEStationSpriteAudra":
        show screen displayPresentActors("LOCIltariStationSB")
        call interact_audra("interact") from _call_interact_audra_1
        hide screen displayPresentActors
        return()  

    elif interaction.ID == "AEStationSpriteBarkeeper":
        show screen displayPresentActors("LOCIltariStationSB")
        call veronica() from _call_veronica
        hide screen displayPresentActors
        return()

    #####################################################################
    #               ENTERTAINMENT DISTRICT AND BROTHEL
    #####################################################################

    elif interaction.ID == "AEStationSpriteNimheStreet":
        show screen displayPresentActors("LOCIltariStationED")
        call interact_nimhe("interact") from _call_interact_nimhe_1
        hide screen displayPresentActors
        return()

    elif interaction.ID == "AEStationBrothel":
        play sound "audio/notify.wav"
        "'Closed Until Further Notice for Violation of the Sexbot AI Act, Para 3, Section I.'\n{i}signed: [C_HI_B]Spaceport General Affairs[C_HI_E]{/i}"
        mc "\"Too bad...\""
        return()

    #####################################################################
    #
    #                ENGINE ROOM
    #
    #####################################################################
    #####################################################################
    #                ACCESS CONTROLS
    #####################################################################

    elif interaction.ID == "AEEngineTerminal":
        play sound "audio/beep.wav"

        if "met bb2" not in GAME.mc.done:
            play sound "audio/tech_fail.wav"
            "Engine Control" "\"Access Denied.\""
            return()

        if "access refused" not in GAME.mc.done:
            $ GAME.mc.hasDone("access refused")
            play sound "audio/tech_fail.wav"
            "Terminal Voice" "\"Access Denied.\""
            bb2 "\"It wont work like that.\""
            bb2 "\"You need a [C_YE_B]Wrist Control Unit[C_YE_E] to access the engine configuration.\""
            mc "\"Where can I get one?\""
            bb2 "\"The units are awarded by the Guild with the Captain's Patent.\""
            bb2 "\"They cannot be removed as long as their wearers live.\""
            mc "\"That information is not very helpful...\""
            bb2 "\"Are you a qualified Captain?\""
            mc "\"My cousin lets me pilot his shuttle craft sometimes...\""
            play sound "audio/drone_beep.wav"
            bb2 "\"In an emergency that counts as yes!\"" with vpunch
            bb2 "\"I hereby nominate you Captain of the Bumbling Bee!\""
            mc "\"Are you authorized to make such important decisions?\""
            bb2 "\"I am the highest ranking crew member onboard!\""
            bb2 "\"As such I have full command.\""
            mc "\"How many crew members are on board?\""
            bb2 "\"Only me.\""
            mc "\"Where is the crew?\""
            bb2 "\"The crew is not here.\""
            bb2 "\"The Captain's control unit must be in the ship, though...\""
            mc "\"I thought it couldn't be removed?\""
            mc "\"What happened to the Captain?\"" with vpunch
            mc "\"Is he DEAD!?\"" with vpunch 
            bb2 "\"She.\""
            bb2 "\"Our Captain was female.\""
            bb2 "\"Captain Jennings, a very competent navigator.\""
            mc "\"Don't evade my question!\""
            bb2 "\"As I said, there was an incident...\""
            bb2 "\"But all is safe now!\""

        elif not GAME.questSys.isDone('QID_INTRO_COMMAND'):
            play sound "audio/tech_fail.wav"
            "Engine Control" "\"Access Denied.\""
            play sound "audio/drone_beep.wav"
            bb2 "\"You need to unlock command functions at the Bridge first.\""

        elif not GAME.questSys.isActive('QID_INTRO_ENGINE'):
            mc "\"I should learn more about the ship's controls first...\""
            return()

        elif GAME.questSys.isDone('QID_INTRO_COMMAND'):
            if not GAME.mc.hasDone("maintenance"):
                mc "\"These controls look complicated...\""
                play sound "audio/drone_beep.wav"
                bb2 "\"It is rather easy.\""
                bb2 "\"Complete control paths with the correct modules.\""
                bb2 "\"They should be replaced with proper parts when possible.\""
                bb2 "\"You need to connect all four units in one path to the output...\""
                mc "\"Well, lets see...\""
                call mg_maintenance() from _call_mg_maintenance
                bb2 "\"And?\""
                mc "\"There is only an AI-Core and an Output Controller equipped.\""
                mc "\"Something called Positron Stabilizer and Flux Modulator are missing.\""
                bb2 "\"Look around, there must be Tunneling Modules somewhere...\""
                mc "\"Tunneling Modules?\""
                bb2 "\"Those are spare parts commonly used in this kind of emergency.\""
                bb2 "\"Find them and use them to bridge the circuit.\""
                mc "\"How about the proper modules, like the Positron Stabilizer and the Flux Thingy?\""
                bb2 "\"Those would be preferable, but there are none on board currently\""
                bb2 "\"For a price, they can be obtained at most Space Station wharfs.\""
                bb2 "\"The AI-Core is an exception.\""
                mc "\"Why is that?\""
                bb2 "\"AI-Cores are artifacts from a civilization long gone.\""
                bb2 "\"We do not exactly know how they work.\""
                bb2 "\"But they do.\""
                bb2 "\"AI-Cores are useful for space travel and indispensable for hyperjump navigation.\""
                bb2 "\"All Cores we have today were scavenged from ancient space junk.\""
                bb2 "\"To find them, you need to penetrate ancient space wrecks...\""
                bb2 "\"An activity not without danger...\""
                bb2 "\"Many of my kind have been destroyed in these explorations...\""
                bb2 "\"In rare cases space pirates or random wrecks also might yield such Cores...\""
                mc "\"I see...\""
                mc "\"Well, let's make do with the parts we have here...\""
                mc "\"I'll have a look for those Tunneling Modules...\""
                $ GAME.mc.hasDone("engine checked")
                call quest_updater() from _call_quest_updater_151
            else:
                call mg_maintenance() from _call_mg_maintenance_1
                call quest_updater() from _call_quest_updater_152
            if GAME.ship.getSubSysStatus("mining") > 0:
                if not GAME.mc.hasDone("mining setup"):
                    play sound "audio/drone_beep.wav"
                    bb2 "\"Excellent, you have an operational mining laser now!\""
                    bb2 "\"I suggest you fly out to the debris field and test it.\""
        else:
            "Shouldn't be here /600/"

        return()

    #####################################################################
    #                ACTIVATE ENGINES
    #####################################################################

    elif interaction.ID == "AEEngineButton":
        if "reactor activated" in GAME.mc.done:
            if not GAME.mc.hasDone("met bb2"):
                play sound "audio/load.wav"
                "As you are about to touch the button again, you hear a sound..."
                scene expression("06_cutscenes/cutscene_bb2_engine_encounter_one.png") with fade
                play sound "audio/notify.wav"
                "A small drone wobbles into sight from behind a crate..."
                play sound "audio/drone_beep.wav"
                bb2 "\"Hello...\""
                mc "\"Ahem,... hello.\""
                scene room_engine_smart with fade
                bb2 "\"I wouldn't press that button again, if I were you...\""
                bb2 "\"A Quantum Reactor can only be activated so many times...\""
                bb2 "\"Besides, I haven't finished charging...\""
                mc "\"Who are you?\""
                $ bb_2.name = "BB-2"
                bb2 "\"I am BB-2, technical support drone third grade.\""
                mc "\"What is this place?\""
                bb2 "\"You are aboard the [C_HI_B][GAME.ship.name][C_HI_E], a multi-purpose trade vessel...\""
                bb2 "\"We were operating on the shipping lanes in the Outer Spur.\""
                bb2 "\"To great success I might say...\""
                mc "\"Where is the crew?\""
                bb2 "\"There has been an, ahem.. accident...\""
                bb2 "\"But all is safe now!\""
                mc "\"Why don't I find that reassuring...?\""
                bb2 "\"I do not know.\""
                mc "\"Let's have a look at the controls then...\""
                mc "\"Maybe there is a log or something...\""
            else:
                play sound "audio/drone_beep.wav"
                bb2 "\"You better not touch that again.\""
                bb2 "\"A Quantum Reactor can only be activated so many times...\""
                mc "\"Why was it deactivated?\""
                bb2 "\"That's a long story...\""
            return()
        else:
            mc "\"Let's see...\""
            play sound "audio/switch.wav"
            "Click...!" with vpunch
            play sound "audio/switch.wav"
            "Click...!" with vpunch
            play sound "audio/switch.wav"
            "Click...!" with vpunch
            mc "\"That button seems stuck...\""
            mc "\"Maybe if I hit it with a wrench or something...\""
            mc "\"I might have one in my inventory somewhere...\""
            return()

    #####################################################################
    #                ACTIVATE ENGINES
    #####################################################################
    elif interaction.ID == "AEEngineDoor":
        call sandbox_interior_navigate_to("LOCCargo") from _call_sandbox_interior_navigate_to_48
        #play sound "audio/beep.wav"
        #"Door Control" "\"Denied.\""
        return()

    elif interaction.ID == "AEEngineSpriteKhelaraStand":
        show screen displayPresentActors("LOCEngine")
        call interact_khelara("interact") from _call_interact_khelara_2
        hide screen displayPresentActors
        return()   

    #####################################################################
    #
    #                CARGO BAY
    #
    #####################################################################

    elif interaction.ID == "AEEngineCrate":

        if GAME.mc.hasDoneToday("engine room searched"):
            mc "\"I've already looked there today...\""
            return()

        #call simple_notify("SEARCHING", "You search the crates...")
        "You search the crates..."

        if GAME.questSys.inProgress("QID_INTRO_FINDMODULE") and "found module" not in GAME.mc.done:
            $ item = GAME.items["ITMTunneling"]
            play sound "audio/success.wav"
            call find_notify(item,"ITEM FOUND (2x)") from _call_find_notify_21
            $ GAME.ship.loadWare("ITMTunneling")
            $ GAME.ship.loadWare("ITMTunneling")
            $ GAME.mc.hasDone("found module")

        elif GAME.questSys.inProgress("QID_UNIFORM_FIND"):
            queue sound "audio/success.wav"
            $ item = GAME.items["ITMUniformRacy"]
            call find_notify(item,"ITEM FOUND (2x)") from _call_find_notify_22 
            mc "\"Ah, the uniforms BB-2 mentioned.\""
            mc "\"There's two of them...\""   
            queue sound "audio/equip.wav"
            $ GAME.mc.addItem("ITMUniformRacy")       
            $ GAME.mc.addItem("ITMUniformRacy")       
            mc "\"I better have a chat with T'Ris this evening about it.\"" 
            call quest_updater() from _call_quest_updater_153

        elif GAME.questSys.isDone('QID_BOT_FINDINGS') and random.randint(1,100) > 50 and not GAME.mc.hasItem("ITMMemoryCube"):                
            queue sound "audio/success.wav"
            $ item = GAME.items["ITMMemoryCube"]
            call find_notify(item,"ITEM FOUND") from _call_find_notify_23 
            if not GAME.mc.hasDone("memory_found"):
                mc "\"A fragment of holographic memory...\""
                mc "\"Maybe that can help me find out what happened here...\""  
            else:
                mc "\"Another memory fragment!\""
            $ GAME.mc.tallyUp("Memory Fragments",1)
            $ GAME.mc.addItem(item.ID) 

        else:
            $ result = random.randint(1,100)
        
            #####################################################################
            #                OVERRIDES / SPECIAL FINDS
            #####################################################################
            if GAME.day >= 5:
                if not GAME.mc.hasDone("found_poster001"):
                    $ item = GAME.items["ITMPoster001"]
                    call find_notify(item, "ITEM FOUND") from _call_find_notify_24
                    $ GAME.mc.addItem("ITMPoster001")
                    mc "\"Nice...\""
                    mc "\"That must have slipped between the crates...\""
                    mc "\"Maybe I can pin that somewhere...\""

            #####################################################################
            #                RANDOM FINDS
            #####################################################################
            elif result > 80 and GAME.ship.cargoFree():
                $ item = GAME.items[random.choice(["ITMCandle"])]
                call find_notify(item, "ITEM FOUND") from _call_find_notify_25
                $ GAME.mc.addItem(item.ID)

            elif result > 50 and GAME.ship.cargoFree():
                $ item = GAME.items[random.choice(["ITMPodEnergy"])]
                call find_notify(item, "ITEM FOUND") from _call_find_notify_26
                $ GAME.ship.loadWare(item.ID)

            else:
                call simple_notify(False, "You do not find anything") from _call_simple_notify_73
        return()

    elif interaction.ID == "AECargoHatch":
        if not GAME.questSys.isActive('QID_INTRO_LOWER1'):
            queue sound "audio/notify.wav"
            mc "\"Access to the Maintenance Tubes...\""
            mc "\"That could come handy later on...\""
        elif GAME.questSys.inProgress('QID_INTRO_LOWER1'):
            mc "\"It's about time we do some serious maintenance.\"" 
            mc "\"BB-2, can you access the Lower Decks via this hatch?\"" 
            queue sound "audio/drone_beep.wav"
            bb2 "\"Yes.\"" 
            mc "\"I suggest you go down there and re-establish environmental control.\""
            queue sound "audio/drone_beep.wav"
            bb2 "\"The damage is significant.\""
            bb2 "\"I need 10 Nanite, 5 Energy and 5 Bio Pods to repair the systems and seal the deck.\"" 
            bb2 "\"I suggest you confirm the cargo status and ask me again once we are good to go.\""
            mc "\"Understood.\"" 
            $ GAME.mc.hasDone("lower_deck_talk")
            call quest_updater() from _call_quest_updater_154
        elif GAME.questSys.inProgress('QID_INTRO_LOWER2') and not "repair_mission" in bb_2.status:
            mc "\"BB-2, can you fix the Lower Deck life support systems?\""
            if GAME.ship.hasCargo(["ITMPodNano"]*10+["ITMPodBio"]*5+["ITMPodEnergy"]*5):
                queue sound "audio/drone_beep.wav"
                bb2 "\"I will get right to it.\""
                bb2 "\"Maintenance should be complete by tomorrow.\"" 
                $ bb_2.status.append("repair_mission") 
                python:
                    for i in ["ITMPodNano"]*10+["ITMPodBio"]*5+["ITMPodEnergy"]*5:
                        GAME.ship.unloadWare(i)
            else:
                queue sound "audio/drone_beep.wav"
                bb2 "\"You still need to procure the required repair pods.\""
        elif "repair_mission" in bb_2.status: 
            mc "\"I should wait until BB-2 has completed his mission.\""
        else:
            mc "\"I don't need to go there at the moment.\""

    #####################################################################
    #                MANIFEST
    #####################################################################
    elif interaction.ID == "AECargoTerminal":
        if not GAME.mc.hasDone("seen manifest"):
            mc "\"There's all kinds of boxes in here...\""
            mc "\"Let's have a look at the manifest...\""
        call cargo_manager() from _call_cargo_manager_3
        return()

    #####################################################################
    #                CONTAINER
    #####################################################################
    elif interaction.ID == "AECargoSign" and GAME.questSys.isDone("QID_VEE_CHARGE"):
        if 'awake' not in vee.status:
            $ vee.status.append('awake')
            scene room_cargo_b_smart with fade 
            queue sound "audio/notify.wav"
            mc "\"Wow...\""
            mc "\"The case is empty!\""
            mc "\"I better notify T'Ris...\""
            $ tris.getDressed()
            "A short while later..." with fade
            queue sound "audio/notify.wav"
            tri "\"What has happened?\""
            mc "\"Our passenger is gone...\""
            tri "\"Remarkable.\""
            tri "\"Sensors have not picked up anything unusual tonight...\""
            tri "\"I assume that 'V' has not left the ship.\""
            tri "\"I suggest you find her.\""
            queue sound "audio/drone_beep.wav"
            bb2 "\"Maybe she is in the Lower Deck.\""
            bb2 "\"Lack of life support down there would not pose a problem for her.\""
            mc "\"A valid point.\""
            mc "\"I need to have a look.\""
            mc "\"It's about time we make the Lower Deck accessible anyway...\""
            tri "\"You do that.\""
            call quest_updater() from _call_quest_updater_155
            window hide 
            pause
            scene intermission with fade
            call sandbox_interior_prepare_scene() from _call_sandbox_interior_prepare_scene_19

        else:
            scene room_cargo_b_smart 
            mc "\"No one here...\""
            scene intermission with fade
            call sandbox_interior_prepare_scene() from _call_sandbox_interior_prepare_scene_20
            return()

    elif interaction.ID == "AECargoSign":
        scene expression("room_cargo_b_smart") with fade

        $ mOptions = [  "Stats/s", "True",
                        "Investigate/i", "True",
                        "Leave Energy/e", "'dream_one' in vee.done and 'awake' not in vee.status", 
                        "Exit/x", "True"]
        stop music fadeout 2.0

        if vee.getTally("Energy Consumed") > 0:
            if not GAME.mc.hasDone("notice_energy") and "energy_left" in GAME.mc.done: # CR-0664
                queue sound "audio/notify.wav"
                mc "{i}\"Hmmm, the energy pods have been drained...\"{/i}"
                mc "{i}\"If I keep this up, I may be able to wake her up eventually...\"{/i}"
                call quest_updater() from _call_quest_updater_156

        while True:
            call screen menu_interactive_scr(False, mOptions, [])
            play sound "audio/click.wav"
            if _return == "Investigate":
                if not GAME.mc.hasDoneToday("investigated_v"):
                    $ mOptions = [ "Turn Away/x", "True"]
                    play music "audio/dark.wav"
                    scene expression("06_cutscenes/cutscene_cargobay_container_two.png") with Fade (0.5,0.5,1.0)
                    $ GAME.mc.done.append("investigated_v")
                    "You feel drawn to the mysterious woman..."        
                    window hide
                    pause
                else:
                    mc "\"I feel dizzy...\""
                    mc "\"I should continue that another time...\""

            elif _return == "Stats":
                call show_stats(vee) from _call_show_stats_5

            elif _return == "Turn Away":
                    $ response = {1:"With deep regret, you pull your eyes away from the woman in the glass case...", 2: "You can almost hear the woman in your mind now...", 3: "For an instant, you sense a cold and menacing presence...", 4: "You feel a dull and throbbing pain in your head..."  }[capValue(GAME.mc.done.count("investigated_v"),1,4)]
                    scene expression("room_cargo_b_smart") with Fade (3.0,0.0,1.0)
                    "[response]"
                    if GAME.mc.done.count("investigated_v") == 3:
                        queue sound "audio/notify.wav"
                        mc "{i}\"That was odd...\"{/i}"
                    $ mOptions = [ "Exit/x", "True"]
                    call hour_passes() from _call_hour_passes_77

            elif _return == "Leave Energy":
                if not GAME.mc.hasDone("energy_left"):
                    mc "\"Hmmm, ...'Give me energy'...\""
                    mc "\"Maybe energy pods will do the trick...\""
                    mc "\"That pod rack nearby seems to be a good location.\""
                if vee.hasItem("ITMPodEnergy",6):
                    mc "\"The rack is already filled with energy pods...\""
                elif GAME.ship.cargo.count(GAME.items["ITMPodEnergy"]) < 6:
                    mc "\"I need a complement of six for the rack.\"" 
                    mc "\"I need to get some first...\"" 
                else:
                    mc "\"Let's see, how many pods we have in storage...\""
                    $ amount = GAME.ship.cargo.count(GAME.items["ITMPodEnergy"])
                    call simple_notify("POD TRANSFER", "Transfer 6 of {} units". format(amount), ["Transfer", "Abort"], "08_items/ico ITMPodEnergy.png") from _call_simple_notify_74
                    if _return == "Abort":
                        mc "\"I have to think this over...\""
                    elif _return == "Transfer" and vee.inventory.count(GAME.items["ITMPodEnergy"]) >= 6:
                        mc "\"Hmm, that rack is already full...\""
                    elif _return == "Transfer":
                        queue sound "audio/load.wav"
                        $ i = 6
                        while i:
                            $ vee.addItem("ITMPodEnergy")
                            $ GAME.ship.unloadWare("ITMPodEnergy")
                            $ i -= 1
                        $ vee.hasDoneToday("energy_received")
                        mc "\"There, all done...\""  
                        mc "\"Let's give it some time and see what happens...\""                    

            elif _return == "Exit":
                stop music fadeout 2.0
                call sandbox_interior_prepare_scene() from _call_sandbox_interior_prepare_scene_21
                return()
        return()


    #####################################################################
    #                DOOR
    #####################################################################
    elif interaction.ID == "AECargoDoor":
        call sandbox_interior_navigate_to("LOCHallway2") from _call_sandbox_interior_navigate_to_49
        #play sound "audio/beep.wav"
        #"Door Control" "\"Denied.\""
        return()


    #####################################################################
    #
    #                HALLWAY2
    #
    #####################################################################

    elif interaction.ID == "AEH2DoorLarge":
        call sandbox_interior_navigate_to("LOCHallway1") from _call_sandbox_interior_navigate_to_50
        return()

    elif interaction.ID == "AEH2Guest1":
        if GAME.questSys.isDone("QID_NIMHE_HIRE"):
            call sandbox_interior_navigate_to("LOCGuest1") from _call_sandbox_interior_navigate_to_51
        else: 
            mc "\"That door seems blocked...\""
        return()

    elif interaction.ID == "AEH2Guest2":
        if GAME.questSys.isDone("QID_SERAPHINE_ARELLARTI_FIND"):
            call sandbox_interior_navigate_to("LOCGuest2") from _call_sandbox_interior_navigate_to_52
        else:        
            mc "\"That door seems blocked...\""
        return()


    #####################################################################
    #
    #                LAB
    #
    #####################################################################
    elif interaction.ID == "AELabBot": 
        if "bot_intro" not in GAME.mc.done: 
            mc "\"This bot configurator looks complicated...\""
            mc "\"I better get an introduction by someone first...\"" 
            
        else:
            call mg_sexbot_lab() from _call_mg_sexbot_lab
            if GAME.hour == 15 and GAME.questSys.isActive('QID_NIMHE_LABOVERHEAR') and not GAME.questSys.isDone('QID_NIMHE_LABCHECK1'):
                queue sound "audio/notify.wav"
                "You decide to take a short break..."
                call sandbox_interior_navigate_to("LOCHallwayLower1") from _call_sandbox_interior_navigate_to_53
            elif GAME.hour == 20 and GAME.questSys.isActive("QID_TRIS_AUTOASSIST") and not GAME.questSys.isDone('QID_TRIS_SEXTRAIN_PEEK'):
                queue sound "audio/notify.wav"
                "You decide to take a short break..."
                call sandbox_interior_navigate_to("LOCHallwayLower1") from _call_sandbox_interior_navigate_to_54

        return()

    elif interaction.ID == "AELabTerminal": 
        queue sound "audio/beep.wav"
        call mg_lab_manager() from _call_mg_lab_manager
        return()

    elif interaction.ID == "AELabStorage": 
        # if GAME.questSys.inProgress("QID_BOT_MYSTERY"): # CR-0551
        # if GAME.questSys.isDone("QID_BOT_MYSTERY") and not GAME.questSys.isActive("QID_BOT_MONITOR"):  # CR-0551
        if GAME.questSys.inProgress("QID_BOT_MYSTERY"): # CR-0560
            queue sound "audio/notify.wav" # CR-0551
            mc "\"Let's see...\""
            mc "\"Nothing out of the ordinary...\""
            mc "\"All access control log entries OK...\""
            mc "\"Puzzling...\""
            mc "\"I should monitor access to Lab Storage somehow...\""
            mc "\"Maybe if I got a camera from somewhere...\""
            # $ GAME.mc.hasDone("storage_investigated") # CR-0560
            call quest_updater() from _call_quest_updater_157

        elif GAME.questSys.inProgress("QID_BOT_MONITOR"):
            mc "\"I better place that camera soon...\""
            return()

        elif GAME.questSys.inProgress("QID_BOT_OBSERVE"):
            mc "\"Camera is up and working...\""
            mc "\"I should leave the lab and watch from my computer...\""
            mc "\"Maybe I'll catch the thief...\""
            return()

        else: 
            mc "\"A stasis field...\""
            mc "\"I better not mess with what's in there...\"" 
            mc "\"Could be scary bio-stuff...\""
        return()

    elif interaction.ID == "AELabSpriteNimheStand":
        show screen displayPresentActors("LOCLab")
        call interact_nimhe("interact") from _call_interact_nimhe_2
        hide screen displayPresentActors
        return()    

    elif interaction.ID == "AELabSpriteV":
        show screen displayPresentActors("LOCLab")
        call interact_vee("interact") from _call_interact_vee_1
        hide screen displayPresentActors
        return()   

    #####################################################################
    #
    #              DECK 3
    #
    #####################################################################
    #####################################################################
    #              MED BAY
    #####################################################################
    elif interaction.ID == "AEL2DoorMed":
        call sandbox_interior_navigate_to("LOCMedBay") from _call_sandbox_interior_navigate_to_55
        return()

    #####################################################################
    #              MESS ROOM
    #####################################################################
    elif interaction.ID == "AEL2DoorMessRoom":
        call sandbox_interior_navigate_to("LOCMessRoom") from _call_sandbox_interior_navigate_to_56
        return()

    elif interaction.ID == "AEMessReplicator":
        $ items = [x for x in GAME.items.values() if x.kind in ["drink"]]
        call item_show(items, False, "MESS ROOM REPLICATOR") from _call_item_show_1
        if _return == False:
            mc "\"Maybe some other time...\""
        elif GAME.locs["LOCMessRoom"].status == 0 and not GAME.ship.hasCargo(["ITMPodEnergy"]): # replicator empty
            queue sound "audio/tech_fail.wav"
            "Replicator Control" "\"No Energy Pods available to recharge...\""
            mc "\"I need to get some of those...\""
        else:
            if GAME.locs["LOCMessRoom"].status == 0:
                queue sound "audio/tech_success.wav"
                "You recharge the Replicator with an [C_BL_B]Energy Pod[C_BL_E]..."
                $ GAME.locs["LOCMessRoom"].status = 10 
                $ GAME.ship.unloadWare("ITMPodEnergy")            
            if not GAME.mc.hasDone("used_replicator"):
                queue sound "audio/teleport.wav"
                "You activate the Replicator..."
            $ item = _return
            #queue sound "audio/notify.wav"
            call find_notify(item, "ITEM RECEIVED") from _call_find_notify_27 
            queue sound "audio/potion.wav"
            $ GAME.mc.addItem(item.ID)
        return()

    elif interaction.ID == "AEMessPole":
        if tris.isHere():
            mc "\"T'Ris, would you care to exercise on this Dance Platform?\""
            tri "\"No thank you.\""
            tri "\"My exercise needs are met by Valkoran Advanced Calisthenics...\""
            mc "\"I see..\""
            mc "{i}\"Hmmm... I would like to see T'Ris dance here one day...\"{/i}"
        else:
            mc "\"Nice stage...\""
        return()

    #####################################################################
    #
    #                HOLODECK
    #
    #####################################################################
    elif interaction.ID == "AEHoloTerminal": 
        if not GAME.mc.hasDone("holo_reject"):
            queue sound "audio/beep.wav"
            "Systems Control" "\"Holodeck Inactive.\""
            queue sound "audio/drone_beep.wav"
            bb2 "\"The Isomorphic Projector was damaged during the Incident...\""
            mc "\"Too bad...\"" 
            mc "\"We need to get that fixed...\"" 
            bb2 "\"I can't fix the unit.\""
            if khelara not in GAME.crew:
                bb2 "\"We better hire an expert engineer for that.\""
            else:
                "\"Maybe Khelara can fix it.\""
        else:
            mc "\"It's still not working...\""
        return()

    elif interaction.ID in ["AEHoloRoomPillar", "AEHoloBlankPillar", "AEHoloCastlePillar"]:
        queue sound "audio/beep.wav"
        $ mCondOptions = [
            "Castle Program/3", "True",
            "Blank Program/2", "True",           
            "Deactivate Holodeck/1", "True",           
            "Done/x", "True"
        ]

        # Compile options

        while True:
            call screen menu_interactive_scr(" ", mCondOptions, [])
            play sound "audio/click.wav"
            if _return == "Done":
                return()  
            elif _return == "Castle Program":
                $ GAME.miniMapActive = GAME.miniMaps["MMIDHoloCastle"]
                $ GAME.locs["LOCHolo"].status = "castle" 
                call sandbox_interior_navigate_to("LOCHoloCastle", "fade") from _call_sandbox_interior_navigate_to_57
            elif _return == "Blank Program":
                $ GAME.miniMapActive = GAME.miniMaps["MMIDHoloBlank"]
                $ GAME.locs["LOCHolo"].status = "blank" 
                call sandbox_interior_navigate_to("LOCHoloBlank", "fade") from _call_sandbox_interior_navigate_to_58 
            elif _return == "Deactivate Holodeck":
                play sound "audio/switch.wav"
                $ GAME.miniMapActive = GAME.miniMaps["MMIDShipLower"]
                $ GAME.locs["LOCHolo"].status = 0 
                call sandbox_interior_navigate_to("LOCHolo", "fade") from _call_sandbox_interior_navigate_to_59 

            return()       


    elif interaction.ID == "AEHoloProjector": 
        mc "\"An interesting device...\""  
        queue sound "audio/drone_beep.wav"      
        bb2 "\"That is the Isomorphic Projector...\""
        mc "\"How does it work?\"" 
        bb2"\"It is Voronian technology...\""
        bb2 "\"They do not disclose their specs.\"" 
        mc "\"I see...\""
        return()

    elif interaction.ID == "AEHoloCastleSeraphineSit":
        show screen displayPresentActors("LOCHoloCastle")
        call interact_seraphine("interact") from _call_interact_seraphine_1
        hide screen displayPresentActors
        return()        

    elif interaction.ID == "AEHoloCastleVeeStand":
        show screen displayPresentActors("LOCHoloCastle")
        call interact_vee("interact") from _call_interact_vee_2
        hide screen displayPresentActors
        return()        

    #####################################################################
    #
    #                LOWER HALLWAY1
    #
    #####################################################################
    elif interaction.ID == "AEL1Cam": 
        if not GAME.mc.hasDone("vee_camera"):
            mc "\"A security camera...\"" 
            mc "\"What an ominous glow...\""  
            mc "\"It reminds me of something...\""
            call quest_updater() from _call_quest_updater_158
        else:
            mc "\"How odd, it's active...\""
        return()

    elif interaction.ID == "AEL1DoorCrew1": 
        if khelara not in GAME.crew:
            mc "\"That room could accommodate another crew member...\""
        else:
            call sandbox_interior_navigate_to("LOCCrew1") from _call_sandbox_interior_navigate_to_60
        return() 

    elif interaction.ID == "AEL1DoorCrew2": 
        if not GAME.questSys.isActive('QID_QUTHOR_MOIRA_CURE'):
            mc "\"That room could accommodate another crew member...\""
        else:
            call sandbox_interior_navigate_to("LOCCrew2") from _call_sandbox_interior_navigate_to_61
        return() 

    elif interaction.ID == "AEL1DoorHolo": 
        #$ GAME.setLocID("LOCHolo") 
        call sandbox_interior_navigate_to("LOCHolo") from _call_sandbox_interior_navigate_to_62
        return() 

    elif interaction.ID == "AEL1DoorLab": 
        call sandbox_interior_navigate_to("LOCLab") from _call_sandbox_interior_navigate_to_63        
        return() 

    elif interaction.ID == "AECorridorNanites":
        pass

    elif interaction.ID == "AECorridorDoor":
        if "term_unlocked" in GAME.mc.done:
            call sandbox_interior_navigate_to("LOCMaintenance") from _call_sandbox_interior_navigate_to_64
        else: 
            queue sound "audio/tech_fail.wav"
            mc "\"That door seems blocked...\""
        return()

    elif interaction.ID == "AECorridorTerminal":
        if "term_unlocked" in GAME.mc.done:
            queue sound "audio/switch.wav"
            mc "\"It's already activated...\""
            queue sound "audio/switch.wav"
        else: 
            queue sound "audio/beep.wav"
            "Access Control" "\"Access Denied.\""
            "Access Control" "\"Environmental Systems Unstable.\""
            if not GAME.mc.hasDone("intro_corridor"):
                queue sound "audio/drone_beep.wav"
                bb2 "\"It's probably best to not go in there yet.\""
                bb2 "\"For some reasons this area didn't respond to my repair efforts...\""
                bb2 "\"It is very unusual.\""
                bb2 "\"The control circuits appear to be all scrambled.\""
                mc "\"What's in there?\""
                bb2 "\"Auxiliary systems.\""
                bb2 "\"They can all be controlled remotely and values are nominal.\""
                mc "\"Can it be fixed?\""
                bb2 "\"If our Argus Uplink has 50 percent or more power I'll run an analysis.\"" 
                if khelara not in GAME.crew:
                    bb2 "\"We also need more technical expertise onboard.\""
                    bb2 "\"I suggest you look for an engineer to complement the crew...\""
                    bb2 "\"The Pirate Outpost might have people looking for work...\""
                    mc "\"I'll see to it.\""
                mc "\"Report as soon as you have results...\""
                call quest_updater() from _call_quest_updater_159
        return()

    elif interaction.ID == "AEMaintSpriteVSit":
        show screen displayPresentActors("LOCMaintenance")
        call interact_vee("interact") from _call_interact_vee_3
        hide screen displayPresentActors
        return()  

    #####################################################################
    #
    #                HALLWAY1
    #
    #####################################################################

    elif interaction.ID == "AEH1Bridge":
        if not GAME.questSys.isDone('QID_INTRO_WRISTBAND'):
            play sound "audio/tech_fail.wav"
            "Access Control" "\"Access Denied.\""
        else:
            call sandbox_interior_navigate_to("LOCBridge") from _call_sandbox_interior_navigate_to_65
        return()

    elif interaction.ID == "AEH1Turbo" and  not GAME.questSys.isDone("QID_INTRO_LOWER3"):
        play sound "audio/tech_fail.wav"
        "Access Control" "\"Safety Warning.\""
        "Access Control" "\"Access Denied.\""
        if not GAME.mc.hasDone("intro_turbo"):
            queue sound "audio/drone_beep.wav"
            bb2 "\"I wouldn't go to the Lower Decks.\""
            mc "\"What's the matter?\""
            bb2 "\"Life support failure.\""
            bb2 "\"Major environmental adjustments are required before it is safe.\""
            mc "\"I see...\""
            mc "\"Is it a danger for the ship?\""
            bb2 "\"No. Containment is in place.\""
            bb2 "\"The ship is perfectly able to operate as it is.\""
            mc "\"Fine. Let's deal with that later then.\""
        return()

    elif interaction.ID == "AEH1Turbo":
        # determine level
        $ liftOptions = [
            "Deck 1 Blue/1", "True",
            "Deck 2 Red/2", "True",
            "Deck 3 Green/3", "True",
            "Exit/x", "True"
            ]

        queue sound "audio/beep.wav"
        call screen menu_interactive_scr(" ", liftOptions, [])
        play sound "audio/click.wav"

        # swap to new loc minimap
        if _return == "Deck 1 Blue":
            play sound "audio/tech_fail.wav"
        elif _return == "Deck 2 Red":
            play sound "audio/door_scifi.wav"
            $ GAME.miniMapActive = GAME.miniMaps["MMIDShipLower"]
            call sandbox_interior_navigate_to("LOCHallwayLower1") from _call_sandbox_interior_navigate_to_66 
        elif _return == "Deck 3 Green":
            play sound "audio/door_scifi.wav"
            $ GAME.miniMapActive = GAME.miniMaps["MMIDShipLower2"]
            call sandbox_interior_navigate_to("LOCHallwayLower2") from _call_sandbox_interior_navigate_to_67 
        return()

    elif interaction.ID == "AEH1Captain":
        call sandbox_interior_navigate_to("LOCCaptain") from _call_sandbox_interior_navigate_to_68
        return()

    elif interaction.ID == "AEH1Nav":
        call sandbox_interior_navigate_to("LOCNav") from _call_sandbox_interior_navigate_to_69
        return()

    #####################################################################
    #
    #                CAPTAINS CABIN
    #
    #####################################################################

    elif interaction.ID == "AECaptainBed":
        if GAME.hour < 18:
            $ renpy.say(mc, vary("\"<I can take a short nap, I guess...|Let's rest for a while...|I need a power nap...>\""))         
            scene room_captain_smart with fade
            call hour_passes(18-GAME.hour) from _call_hour_passes_78  
        else:  
            if "night_visit" in tris.doneToday:
                call cutscene_tris("night_visit") from _call_cutscene_tris_14
            #"You sleep into the night..."
            $ GAME.hour = 23
            # call night_passes()
        return()

    elif interaction.ID == "AECaptainComputer":
        call mg_computer_captain() from _call_mg_computer_captain
        hide screen arcadebabes
        scene room_captain_smart with fade
        return()

    elif interaction.ID == "AECaptainCabinet":
        "Searching..."
        if GAME.questSys.getState("QID_INTRO_WRISTBAND") == "in progress":
            play sound "audio/success.wav"
            $ item = GAME.items["ITMControlBand"]
            call find_notify(item, "ITEM FOUND") from _call_find_notify_28
            $ GAME.mc.inventory.append(item)
            play sound "audio/drone_beep.wav"
            bb2 "\"Excellent, you found the control unit!\""
            bb2 "\"Go ahead, put it on!\""
            mc "\"Fine...\""
            play sound "audio/click.wav"
            "The Control Unit closes around your wrist..."
            "You feel a tingling, as the neural connection is established..."
            mc "\"I hope that is safe...\""
            bb2 "\"Welcome aboard, Captain!\""
            bb2 "\"You can access most terminals now...\""
            bb2 "\"Some might still be locked, but you should have access to the bridge!\""
            mc "\"Well then...\""
            mc "\"Captain [GAME.mc.name], Scourge of The Galaxy, to the rescue!\""
            bb2 "\"Excellent attitude!\""
            call hour_passes() from _call_hour_passes_79
            call quest_updater() from _call_quest_updater_160

        elif not GAME.mc.hasItem("ITMFlyboy01") and "intro_favour" in GAME.mc.done:
            play sound "audio/success.wav"
            $ item = GAME.items["ITMFlyboy01"]
            call find_notify(item, "ITEM FOUND") from _call_find_notify_29
            $ GAME.mc.addItem("ITMFlyboy01")
            play sound "audio/equip.wav"
            mc "\"Nice.\""
            mc "\"With T'Ris acting like an Ice Queen, I can always trust my right hand...\""
            call hour_passes() from _call_hour_passes_80
        else:
            mc "\"There is nothing of interest here...\""
            call hour_passes() from _call_hour_passes_81
        return()

    elif interaction.ID == "AECaptainCup":
        queue sound "audio/swallow.wav"
        "You drink a cup of water and relax for a while..."
        call hour_passes() from _call_hour_passes_82
        return()

    elif interaction.ID == "AECaptainBox" and GAME.questSys.inProgress("QID_NIMHE_RETRIEVE_PACKAGE"):
        mc "\"Nimhe's package...\""
        if not GAME.mc.hasDone("package_check"):
            queue sound "audio/switch.wav"
            mc "\"It's locked...\""
            mc "\"Some kind of electronic mechanism...\""
            mc "\"Maybe I can open it somehow...\""
        mc "\"I better let her know, that I have it...\""
        return()

    elif interaction.ID == "AECaptainSpriteTypeJ":
        show screen displayPresentActors("LOCCaptain")
        call interact_type_j("interact") from _call_interact_type_j_1
        hide screen displayPresentActors
        return()    


    #####################################################################
    #                BRIDGE
    #####################################################################

    elif interaction.ID == "AEBridgeChair":
        if not GAME.questSys.isDone('QID_INTRO_COMMAND'):
            play sound "audio/tech_fail.wav"
            "Ship Control" "\"Access denied.\""
            mc "\"The command functions are locked...\""
            mc "\"Maybe I can use my [C_HI_B]Wrist Control Unit[C_HI_E] somehow...\""
        else:
            if GAME.money < 200 and GAME.ship.status == "docked":
                play sound "audio/drone_beep.wav"
                bb2 "\"If I may offer some advice, Captain [GAME.mc.name].\""
                mc "\"Yes?\""
                bb2 "\"Make sure you have 200 Cr for docking fees before you leave...\""
                bb2 "\"You can sell some cargo via the terminal in the cargobay.\""
                mc "\"Right, forgot about that...\""
                if not GAME.mc.hasDone("intro trade cargo"):
                    play sound "audio/success.wav"
                    call simple_notify("FEATURE UNLOCKED", "Cargo Bay terminal.") from _call_simple_notify_75
                return()

            elif GAME.ship.status == "docked" and GAME.money < -200:
                "Station Control bars you from leaving until your account is balanced..."
                return()

            elif tris.getLocOverride() == "LOCPetClass":
                queue sound "audio/notify.wav"
                mc "\"I should wait until T'Ris is back from Pet Class.\""
                mc "\"I wouldn't want to leave her alone in this place...\""
                mc "\"She might be taken by an unscrupulous Krell otherwise...\""
                return()

            elif GAME.ship.status in ["docked", "landed"]:
                if GAME.questSys.inProgress('QID_QUTHOR_WAIT'):
                    queue sound "audio/drone_beep.wav"
                    bb2 "\"We should not leave the Station, Captain [GAME.mc.name].\""
                    bb2 "\"We will be notified by Station Control soon...\""
                    mc "\"Ah, right.\""
                    return()

                if not GAME.mc.hasDone("out space docked"):
                    mc "\"Out into Space!\""
                stop music fadeout 0.1
                if GAME.getSpaceLoc().ID == "LIDPirate":
                    scene expression ("06_cutscenes/cutscene_pirate_station_exit.jpg") with fade
                    window hide
                    pause
                elif GAME.getSpaceLoc().ID == "LIDStationArellarti":
                    scene expression ("06_cutscenes/cutscene_arellarti_station_exit.jpg") with fade
                    window hide
                    pause
                elif GAME.getSpaceLoc().ID == "LIDStationXenos":
                    scene expression ("06_cutscenes/cutscene_xenos_station_exit.jpg") with fade
                    window hide
                    pause
                elif GAME.getSpaceLoc().ID == "LIDStationQuthor":
                    scene expression ("06_cutscenes/cutscene_quthor_station_exit.jpg") with fade
                    window hide
                    pause
                elif GAME.getSpaceLoc().ID == "LIDTenaris":
                    scene expression ("02_locations/SUIDTenaris_ascent.jpg") with fade
                    "You launch the ship into orbit..."
                    $ GAME.ship.launch()
                else:
                    scene expression ("06_cutscenes/cutscene_iltari_station_exit.jpg") with fade
                    window hide
                    pause
            else:
                if not GAME.mc.hasDone("out_space"):
                    mc "\"Off to strange new worlds!\""
            #play music "audio/ambient_space.wav" fadein 1.0
            #call navigate_space()
            return(["transition", GAME.getSpaceLoc()])
        return()

    elif interaction.ID == "AEBridgeSpriteTrisStand":
        #show image "AEBridgeSpriteTrisStand_smart_idle"
        show screen displayPresentActors("LOCBridge")
        call interact_tris("interact") from _call_interact_tris_3
        #hide image "AEBridgeSpriteTrisStand_smart_idle"
        hide screen displayPresentActors
        return()

    elif interaction.ID == "AEBridgeSpriteVStand":
        show screen displayPresentActors("LOCBridge")
        call interact_vee("interact") from _call_interact_vee_4
        hide screen displayPresentActors
        return()    

    #####################################################################
    #					CABIN GUEST 2								    #
    #####################################################################

    elif interaction.ID == "AEGuestSpriteSeraphine":
        show screen displayPresentActors("LOCGuest2")
        call interact_seraphine("interact") from _call_interact_seraphine_2
        hide screen displayPresentActors
        return()

    #####################################################################
    #					CABIN GUEST 1								    #
    #####################################################################

    elif interaction.ID == "AEGuestSpriteNimheSit":
        show screen displayPresentActors("LOCGuest1")
        call interact_nimhe("interact") from _call_interact_nimhe_3
        hide screen displayPresentActors
        return()

    elif interaction.ID == "AEGuestCuffs":
        if nimhe.isHere():            
            show screen displayPresentActors("LOCGuest1")
            mc "\"What are these?\""
            nim "\"None of your concern.\""
            hide screen displayPresentActors
 
        else:    
            scene expression("06_cutscenes/cutscene_nimhe_cuffs_closeup.png") with fade
            mc "{i}\"Nice...\"{/i}"
            mc "{i}\"Kinky handcuffs...\"{/i}"
            mc "{i}\"With electronic release coding...\"{/i}"            
            mc "{i}\"I wonder what Nimhe's doing with them...\"{/i}"
            $ GAME.mc.hasDone("cuffs_checked")      
            scene room_guest1_smart with fade      
        return()

    elif interaction.ID == "AEGuestCabinet":
            if nimhe.isHere():
                mc "{i}\"I shouldn't snoop around, while Nimhe is here...\"{/i}"
            else:    
                mc "{i}\"That's where she keeps her toys...\"{/i}"
                mc "{i}\"Nice...\"{/i}"            
            return()

    #####################################################################
    #              MED BAY
    #####################################################################
    elif interaction.ID == "AEMedSpriteMoira":
        show screen displayPresentActors("LOCMedBay")
        call interact_moira("interact") from _call_interact_moira_1
        hide screen displayPresentActors
        return()


    #####################################################################
    #              MESS ROOM
    #####################################################################
    elif interaction.ID == "AEMessSpriteTris":
        show screen displayPresentActors("LOCMessRoom")
        call interact_tris("interact") from _call_interact_tris_4
        hide screen displayPresentActors
        return()

    elif interaction.ID == "AEMessSpriteVerity":
        show screen displayPresentActors("LOCMessRoom")
        call interact_verity("interact") from _call_interact_verity_1
        hide screen displayPresentActors
        return()

    #####################################################################
    #                CABIN NAV
    #####################################################################

    elif interaction.ID == "AENavSpriteTrisStand":
        show screen displayPresentActors("LOCNav")
        call interact_tris("interact") from _call_interact_tris_5
        hide screen displayPresentActors
        return()

    #####################################################################
    #					CABIN CREW1		
    #####################################################################

    elif interaction.ID == "AECrew1SpriteKhelaraStand":
        show screen displayPresentActors("LOCCrew1")
        call interact_khelara("interact") from _call_interact_khelara_3
        hide screen displayPresentActors
        return()   

    #####################################################################
    #					CABIN CREW2		
    #####################################################################

    elif interaction.ID == "AECrew2SpriteMoira":
        show screen displayPresentActors("LOCCrew2")
        call interact_moira("interact") from _call_interact_moira_2
        hide screen displayPresentActors
        return()   

    #####################################################################
    #					TENARIS INTERIORS		
    #####################################################################

    elif interaction.ID == "AETenarisWarehouseTerminal":
        queue sound "audio/beep.wav"
        call warehouse_manager() from _call_warehouse_manager
        return()   

    elif interaction.ID == "AETenarisHangarDrone":
        if not bb_2.hasDone("drone_expo"):
            queue sound "audio/notify.wav"
            mc "\"Impressive Drone...\""
            queue sound "audio/drone_beep.wav"
            bb2 "\"That's a Logistics Drone.\""
            bb2 "\"Fully Hyperspace capable.\""
            bb2 "\"The Hangar comes with 5 of them.\""
            mc "\"What are they for?\""
            bb2 "\"Each can transport up to 10t of goods to and from your Ship.\""
            mc "\"Nice!\""
            mc "\"How do they work?\""
            bb2 "\"You can contol them from your ship.\""
            bb2 "\"Use this Remote Control Unit in the Cargo Bay to send or summon them.\""
            $ item = GAME.items["ITMDroneRemote"]
            queue sound "audio/notify.wav"
            call find_notify(item, "ITEM RECEIVED") from _call_find_notify_30
            $ GAME.mc.addItem("ITMDroneRemote")  
        else:
            queue sound "audio/drone_beep.wav"
            bb2 "\"Remember, those are controlled from the Cargo Bay with the Remote.\""
            mc "\"Ah right, I forgot.\""
        return()   

    elif "AETrophy" in interaction.ID:
        $ kind = interaction.ID[8:].lower() 
        if GAME.trophies[kind] and not GAME.trophyActive[kind]:
            queue sound "audio/success.wav"
        else:
            queue sound "audio/switch.wav"
        $ GAME.trophyActive[kind] = not GAME.trophyActive[kind]
        return()

    elif interaction.ID == "AEEntranceDoor":
        queue sound "audio/drone_beep.wav"
        bb2 "\"The Interior of the Base has not yet been refurbished, Captain [GAME.mc.name].\""
        bb2 "\"I am still looking for a suitable contractor...\""
        bb2 "\"Some expansions are available, though.\""        
        bb2 "\"The Warehouse and Hangar Modules can be added if you have the credits...\""
        mc "\"Thanks for the info...\""
        return()   

    




    #####################################################################
    #                CATCH PARA REPAIR
    #####################################################################
    elif "repair" in interaction.ID.lower():
        mc "\"I think I need a tool for that...\""
        return()

    #####################################################################
    #                CATCH PARA
    #####################################################################
    else:
        "INTERACT ROOM" "Shouldn't be here [interaction.ID]"

    return()
