#####################################################################
#              CUTSCENES NIMHE
#####################################################################

default nimhe_facialset = ["krell", "free", "racy", "revealing"]
default nimhe_facial_hint_text = ""

label cutscene_nimhe(ID, tags = []):


    #####################################################################
    #                SPY ON NIMHE
    #####################################################################
    if ID == "nimhe_shower":
        play music "audio/shower.wav"
        mc "\"Hmmm, it seems Nimhe is taking a shower...\""
        $ mCondOptions = ["Spy on Nimhe/b", "True", "Leave/x", "True" ]
        while True:
            call screen menu_interactive_scr(" ", mCondOptions, [])
            if _return == "Leave":
                pass
            elif _return == "Spy on Nimhe":
                $ GAME.mc.hasDone("spy_nimhe")
                scene ani_nimhe_shower with fade
                window hide
                pause
                mc "{i}\"Nice...\"{/i}"
                mc "{i}\"I better leave now...\"{/i}"
                stop music fadeout 1.0
                $ GAME.galleryAdd(20)
            scene intermission with fade
            $ GAME.setLocID("LOCHallway1")
            return(False)

    #####################################################################
    #					NIMHE CUFFS												  #
    #####################################################################
    elif ID == "nimhe_cuffs":
        #scene room_captain_smart
        queue sound "audio/notify.wav"
        "You are suddenly called on by BB-2..."
        queue sound "audio/drone_beep.wav"
        bb2 "\"Captain [GAME.mc.name], there is an incident!\""
        mc "\"What's the matter?\""
        bb2 "\"Nimhe has a problem I cannot solve...\""
        mc "\"What kind of incident?\""
        bb2 "\"It is difficult to describe...\""
        mc "\"Let's have a look...\""
        scene room_hallway2 with fade 
        "As you are about to enter Nimhe's cabin..."
        queue sound "audio/tech_fail.wav"
        "Access Control" "\"Doorlock is engaged.\""
        mc "\"Locked!\""
        mc "\"Are you in there?\""
        "Nimhe" "\"I might...\""
        mc "\"Won't you let me in?\""
        "Nimhe" "\"No.\""
        bb2 "\"I suggest you be reasonable.\""
        bb2 "\"Captain [GAME.mc.name] can help you with your predicament.\""
        "Nimhe" "\"Fine...\""
        "Nimhe" "\"But if you ever tell anyone, I'll zap you!\""
        "You hear Nimhe issuing a voice command to Access Control..."
        queue sound "audio/beep.wav"
        "Access Control" "\"Doorlock disengaged.\""
        mc "\"Coming in now...\""
        scene expression("06_cutscenes/cutscene_nimhe_cuffs.png") with fade 
        mc "\"What's going on here?\""
        "Nimhe" "\"The cuffs are not responding...\""
        mc "\"Why do you wear them in the first place?\""
        "Nimhe" "\"I was doing...gymnastics.\""
        "Nimhe" "\"And besides, that's none of your concern.\""
        "Nimhe" "\"Get them off.\""
        queue sound "audio/drone_beep.wav"
        bb2 "\"Let me have another look.\""
        bb2 "\"Maybe I should record the situation for future reference.\""
        "Nimhe" "\"If you do, I'll memory-wipe you!\""
        mc "\"Everybody keep calm...\""
        mc "\"Opening the electronic locks should be possible with my Control Unit...\""
        "You interface with the lock mechanism..."
        queue sound "audio/notify.wav"
        mc "\"There, done...\""
        mc "\"The locks should respond to voice commands again.\""
        "Nimhe" "\"About time...\""
        mc "\"Won't you get out of them now?\""
        "Nimhe" "\"Don't need an audience for that.\""
        "Nimhe" "\"Get out.\""
        mc "\"I'll leave you to it then...\""
        scene room_hallway2_smart with fade 
        queue sound "audio/notify.wav"
        mc "{i}\"That was an unusual incident...\"{/i}"
        mc "{i}\"Nimhe has a peculiar taste in toys it seems...\"{/i}"
        mc "{i}\"Some gratitude would have been nice though...\"{/i}"
        mc "{i}\"Maybe I should talk to her after she has calmed down...\"{/i}"
        $ GAME.mc.done.remove("cuffs_manipulated")
        $ GAME.mc.hasDone("nimhe_cuff_rescue")
        call quest_updater() from _call_quest_updater_15 
        $ GAME.galleryAdd(16)
        mc "{i}\"I think I'll go to bed now...\"{/i}"
        $ GAME.setLocID("LOCCaptain")
        $ GAME.hour = 23
        # call night_passes()
        return()

    #####################################################################
    #					NIMHE HANDJOB	
    #####################################################################
    elif ID == "nimhe_handjob":
        scene expression("10_anims/ani_nimhe_hj_00.jpg") with fade
        $ nimhe.getNaked() 
        "Nimhe" "\"Can I start?\"" # CR-0317
        GAME.mc.name "\"Go right ahead...\"" # CR-0317
        scene ani_nimhe_hj # CR-0317
        window hide  # CR-0317
        pause# CR-0317
        GAME.mc.name "\"I'm coming....!\"" # CR-0317
        "Nimhe" "\"Wait!\"" # CR-0317
        scene expression("10_anims/ani_nimhe_hj_catch.jpg") with vpunch # CR-0317
        "Nimhe" "\"(Sluuurp...)\"" # CR-0317
        queue sound "audio/squish.wav" # CR-0317
        GAME.mc.name "\"Aaarghhh....\"" with whiteflash # CR-0317
        queue sound "audio/squish.wav" # CR-0317
        GAME.mc.name "\"Aaaaaarghhh....\"" with whiteflash # CR-0317
        queue sound "audio/squish.wav" # CR-0317
        GAME.mc.name "\"Aaaaaaaaarghhh...!\"" with whiteflash # CR-0317
        scene expression("06_cutscenes/cutscene_nimhe_hj_moneyshot_1.png") with fade # CR-0317
        window hide  
        pause
        scene intermission with fade
        $ GAME.mc.tally["Last Done (Day)"] = GAME.day
        $ nimhe.tallyUp("Handjobs",1)
        return()

    #####################################################################
    #              NIMHE BLOWJOB
    #####################################################################
    elif ID == "nimhe_blowjob":
        scene expression("10_anims/ani_nimhe_bj_00.jpg") with fade
        $ nimhe.getNaked() 
        window hide  
        pause  
        mc "\"Ready?\""
        nim "\"Mmmhhhh...\""
        queue sound "audio/gag_short.wav"
        scene ani_nimhe_bj
        window hide  
        pause
        if not nimhe.hasDone("blowjob"):
            scene expression("10_anims/ani_nimhe_bj_00.jpg") with Fade(0,0,0.5) 
            nim "\"And?\""
            mc "\"I can see you had some practice...\""
            mc "\"Now back to work...\""
            queue sound "audio/gag_short.wav"
            scene ani_nimhe_bj
            window hide  
            pause

        $ mCondOptions = [         
            "Finish In Mouth/1", "True",
            "Finish In Throat/2", "nimhe.getTally('Blowjobs')>0",
            "Finish On Face/3", "nimhe.getTally('Blowjobs')>1",
            "Chat/c", "True"
        ]
        scene intermission with fade 
        "Quite a while later..."
        scene ani_nimhe_bj with fade
        $ bj_loop = True
        while bj_loop:
            call screen menu_interactive_scr(" ", mCondOptions, []) with dissolve
            play sound "audio/click.wav"
            if _return == "Finish In Throat":

                #scene expression("10_anims/ani_nimhe_bj_05.jpg") with Fade(0,0,0.5)
                queue sound "audio/squish.wav" 
                GAME.mc.name "\"Aaarghhh....\"" with whiteflash 
                queue sound "audio/squish.wav" 
                GAME.mc.name "\"Aaaaaarghhh....\"" with whiteflash 
                queue sound "audio/squish.wav" 
                scene expression("10_anims/ani_nimhe_bj_moneyshot1.jpg") with whiteflash
                GAME.mc.name "\"Aaaaaaaaarghhh...!\"" 
                nim "\"Nnngg...?\"" with vpunch
                GAME.mc.name "\"What did you say?\""
                nim "\"Nnnggg...nngg..nnngghhh??\"" with vpunch
                GAME.mc.name "\"Ah, yes!\""
                GAME.mc.name "\"Quite proficient...\""
                nim "\"Mmmhhh!\""
                $ GAME.galleryAdd(101)
                $ nimhe.tallyUp("Semen Swallowed (ml)",random.randint(7,20))   
                $ bj_loop = False

            elif _return == "Finish In Mouth":
                queue sound "audio/squish.wav" 
                GAME.mc.name "\"Aaarghhh....\"" with whiteflash 
                queue sound "audio/squish.wav" 
                GAME.mc.name "\"Aaaaaarghhh....\"" with whiteflash 
                queue sound "audio/squish.wav" 
                scene expression("10_anims/ani_nimhe_bj_moneyshot2.jpg") with whiteflash   
                GAME.mc.name "\"Aaaaaaaaarghhh...!\"" 
                GAME.mc.name "\"Nice...\""
                nim "\"Sluurp...\""    
                $ GAME.galleryAdd(53)
                $ nimhe.tallyUp("Semen Swallowed (ml)",random.randint(7,20))                        
                $ bj_loop = False                

            elif _return == "Finish On Face":
                #scene expression("10_anims/ani_nimhe_bj_00.jpg") with Fade(0,0,0.5)
                queue sound "audio/squish.wav" 
                GAME.mc.name "\"Aaarghhh....\"" with whiteflash 
                queue sound "audio/squish.wav" 
                GAME.mc.name "\"Aaaaaarghhh....\"" with whiteflash 
                queue sound "audio/squish.wav" 
                scene expression("10_anims/ani_nimhe_bj_moneyshot3.jpg") with whiteflash
                GAME.mc.name "\"Aaaaaaaaarghhh...!\""                    
                nim "\"Can't you aim any better?\""
                nim "\"I got some into my eyes...\"" 
                GAME.mc.name "\"That happens...\""
                nim "\"Hrrmmmpff...\""           
                $ GAME.galleryAdd(102)               
                $ bj_loop = False

            elif _return == "Chat":
                queue sound "audio/gag_short.wav"
                scene expression("10_anims/ani_nimhe_bj_00.jpg") with Fade(0,0,0.5)
                $ renpy.say (nim, vary("\"<Are we done yet?|You're ready...?|Coming...?>\""))
                $ renpy.say (mc, vary("\"<Some more practice is in order...|Keep practicing...|Just continue...>\""))
                queue sound "audio/gag_short.wav"
                scene ani_nimhe_bj with dissolve

        $ nimhe.tallyUp("Blowjobs",1)
        $ GAME.mc.tally["Last Done (Day)"] = GAME.day
        scene intermission with fade
        return()

    #####################################################################
    #              NIMHE LAB HANDJOBS
    #####################################################################
    elif ID == "nimhe_lab_handjob":
        # select scene
        if nimhe.wears("ITMUniformKrell"):
            $ uKey = "krell"
        elif nimhe.wears("ITMUniformRacy"):
            $ uKey = "racy"
        elif nimhe.wears("ITMUniformRevealing"):
            $ uKey = "revealing"
        else:
            $ uKey = "free"
            
        # nimhe facialset = ["krell", "free", "racy", "revealing"]

        # show scene
        hide screen displayPresentActors
        scene expression("06_cutscenes/cutscene_lab_facial_{}.png".format(uKey)) with fade
        nim "\"Go on with it then... \"" 
        scene intermission with fade
        "A short while later..."
        scene expression("06_cutscenes/cutscene_lab_facial_{}.png".format(uKey)) 
        "Nimhe" "\"And?\""
        mc "\"I am coming...\"" 

        queue sound "audio/squish.wav"
        scene expression("06_cutscenes/cutscene_lab_facial_{}.png".format(uKey)) with whiteflash
        mc "\"Aaaarrghhh...\"" 

        queue sound "audio/squish.wav"
        scene expression("06_cutscenes/cutscene_lab_facial_{}.png".format(uKey)) with whiteflash
        mc "\"Aaaarrghhh...\"" 

        queue sound "audio/squish.wav"
        show image "06_cutscenes/cutscene_lab_facial_overlay_one.png" with whiteflash
        mc "\"Aaaaaaaahh...\""
        window hide   
        pause
        "Nimhe" "\"Nice...\""
        mc "\"Why don't you leave it on for a while....\""
        $ nimhe.tags.append("facial")
        scene room_lab_smart with fade 
        nim "\"Now that is kinky... (giggle)\""
        
        $ questData["QID_NIMHE_TRAINING_PUBLIC"][4][1] = str(nimhe_facial_hint_text)
        
        # reward
        if "lab_facial_{}".format(uKey) not in nimhe.done:
            $ nimhe.hasDone("lab_facial_{}".format(uKey))
            call attr_mod(nimhe, "SLU", 1, 13, 100, True) from _call_attr_mod_12 
            
            #OhWee mod code
            
            $ nimhe_facialset.remove(uKey)
            
            $ nimhe_facial_hint_text = "Collect facial scenes in her "
            #$ nimhe_facial_hint_text += ", ".join.nimhe_facialset.capitalize()
                   
            $ facial_outfitcount = len(nimhe_facialset)
            $ foc = 0
            while foc < facial_outfitcount:
            
                if foc == facial_outfitcount - 1 and facial_outfitcount > 1:
                    $ nimhe_facial_hint_text += " and "
                    
                $ listtext = nimhe_facialset[foc]
                #$ listtext = listtext!c
                $ nimhe_facial_hint_text += "{}".format(listtext.capitalize())
                $ foc += 1
                if foc < facial_outfitcount - 1:
                    $ nimhe_facial_hint_text += ", "
                
            if len(nimhe_facialset) > 1:
                $ nimhe_facial_hint_text += " uniforms to increase Nimhe's Sluttiness to 13, which will unlock additional public favours."
            else:
                $ nimhe_facial_hint_text += " uniform to increase Nimhe's Sluttiness to 13, which will unlock additional public favours."
            $ questData["QID_NIMHE_TRAINING_PUBLIC"][4][1] = str(nimhe_facial_hint_text)
            $ GAME.questSys.getQuest("QID_NIMHE_TRAINING_PUBLIC").tags[1] = str(nimhe_facial_hint_text)
            
            #end OhWee mod code
            
        if all(["lab_facial_"+x in nimhe.done for x in ["krell", "free", "racy", "revealing"]]) and not GAME.mc.hasAchievement("facial collector"):
            call achievement_notify(nimhe, "facial queen") from _call_achievement_notify 
            $ GAME.galleryAdd(70) # messy facial  
            $ nimhe.hasDone("lab_facial")    # CR-0472       
        call sandbox_interior_navigate_to("LOCHallwayLower1") from _call_sandbox_interior_navigate_to_2 
        $ GAME.mc.tally["Last Done (Day)"] = GAME.day
        $ nimhe.hasDoneToday("favour")
        mc "{i}\"Nice...\"{/i}"


        return()

    #####################################################################
    #              NIMHE PONY OUTFIT
    #####################################################################
    elif ID == "nimhe_outfit_pony":
        queue sound "audio/notify.wav"
        nim "\"A real ponygirl outfit!\""
        mc "\"I got it off some Krell Trader...\""
        nim "\"Help me put it on!\""
        mc "\"Now?\""
        nim "\"I can't put that one on myself, can I?\""
        mc "\"Fine.\""
        hide screen displayPresentActors
        scene intermission with fade 
        "Quite a while later..."
        scene expression("06_cutscenes/cutscene_nimhe_pony_try.png") with fade 
        window hide  
        pause  
        mc "\"Nice.\""
        "Nimhe" "\"Nnnngggg...\""
        mc "\"Does it fit?\""
        "Nimhe" "\"Nnngg...\""
        mc "\"How about I take your for a walk around the ship?\""
        "Nimhe" "\"Nnnngg...nnngg...nngg!?\"" with vpunch 
        mc "\"Just kidding...\""
        mc "\"Let me help you out of that again...\""
        scene intermission with fade
        "Shortly thereafter..."
        scene room_guest1_smart with fade 
        nim "\"I like that costume!\""
        mc "\"It looks quite uncomfortable...\""
        nim "\"That's how it needs to be.\""
        nim "\"There are {i}much{/i} tougher ones, too.\""
        nim "\"You should see what some of the ponygirls at the Pageant wear!\""
        mc "\"Interesting...\""
        mc "\"We should continue this discussion sometime...\""
        $ GAME.galleryAdd(74)
        $ nimhe.attrMax["SUB"] = 4 # upgrade
        call attr_mod(nimhe, "SUB", 1, 4, 100, True) from _call_attr_mod_13 
        call hour_passes() from _call_hour_passes_10 
        call quest_updater() from _call_quest_updater_16 
        call sandbox_interior_navigate_to("LOCHallway2") from _call_sandbox_interior_navigate_to_3 
        queue sound "audio/notify.wav"
        mc "{i}\"That was weird...\"{/i}"
        mc "{i}\"Maybe I can take her to the Holodeck with that outfit one day...\"{/i}"
        return()
 
    elif ID == "nimhe_pony_walk_ship":
        mc "\"How about a pony walk today?\""
        if not nimhe.hasDone("pony_walk_ship"):
            nim "\"I told you I don't want to go outside in my pony costume.\""
            mc "\"Its not actually {i}outside{/i}...\""
            mc "\"Rather inside the ship.\""
            mc "\"So technically, still inside...\""
            nim "\"Very funny...\""
            mc "\"So?\""
        else:
            nim "\"But only on the ship!\""
            mc "\"Of course.\""
        nim "\"Well, fine then.\""
        mc "\"Let me help you into your costume...\""
        hide screen displayPresentActors # CR-0612
        scene intermission with fade 
        "A while later..."
        $ nimhe.putOn("ITMOutfitPony")
        scene room_guest1_smart with fade
        if nimhe.getAttr("SUB") >= 5 and "bells" not in nimhe.doneToday: # CR-0612
            $ nimhe.hasDoneToday("bells")
            $ GAME.galleryAdd(97)
        if "bells" in nimhe.doneToday: # CR-0612
            $ soundEffect = "audio/bell_small.wav"
            mc "\"I think we need a small adjustment here...\""
        else:
            $ soundEffect = "audio/blank.wav"
        queue sound soundEffect
        mc "\"I think with that we're ready...\""
        queue sound soundEffect
        nim "\"Nnnggghh...\""
        queue sound "audio/slap.wav"
        mc "\"Lets go then...\""
        nim "\"Nnnggghh!!\"" with vpunch
        queue sound "audio/door_scifi.wav"
        scene room_hallway2_smart with fade 
        mc "\"See, no one here...\""
        queue sound soundEffect
        nim "\"Nnnggghh...nnngghh...mhhh?\""
        mc "\"No, of course not.\""
        mc "\"Let's have a walk towards the bridge...\""
        queue sound soundEffect
        nim "\"Nnnnggghhh!?\"" with vpunch
        mc "\"Just the next room.\""
        nim "\"Nnnngg..Nggg...Nggg!\""
        mc "\"Yes.\""
        mc "\"Now move along...\""
        queue sound "audio/door_scifi.wav"
        scene room_hallway1_smart with fade 
        mc "\"See, no one here too.\""
        queue sound soundEffect
        nim "\"Nnnnggghhh...\""
        mc "\"Now walk forward a bit and stay there...\""
        nim "\"Nnngghh...\""

        # ===== CR-0612 START
        if "bells" in nimhe.doneToday:
            scene expression("06_cutscenes/cutscene_nimhe_ponywalk_two.jpg") with fade
            window hide 
            pause 
            scene expression("06_cutscenes/cutscene_nimhe_ponywalk_two_closeup.jpg") with fade
            window hide 
            pause 
            mc "\"Very nice...\""
            queue sound soundEffect
            nim "\"Nnnngggg.....\""
            scene expression("06_cutscenes/cutscene_nimhe_ponywalk_two.jpg") with fade
        else:
            scene expression("06_cutscenes/cutscene_nimhe_ponywalk_one.jpg") with fade

        window hide 
        pause 
        # mc "\"Excellent...\""

        # ===== CR-0612 END

        mc "\"Let me take a holograph.\""
        queue sound soundEffect
        nim "\"Ngggghh...!?\""
        mc "\"Yes, you'll get a copy...\""
        queue sound "audio/blank.wav"
        mc "\"Now smile...\""
        queue sound "audio/shutter.wav"
        mc "\"Great!\"" with whiteflash
        queue sound "audio/shutter.wav"
        mc "\"And one more...\"" with whiteflash
        queue sound "audio/shutter.wav"
        mc "\"And another one...\"" with whiteflash
        queue sound "audio/shutter.wav"
        mc "\"Aaannd done!\"" with whiteflash
        nim "\"Nnngghhh....\"" 
        mc "\"Great, lets walk back...\""
        queue sound soundEffect
        scene intermission with fade 
        "A while later..."
        scene room_guest1_smart with fade 
        $ nimhe.getNaked()
        mc "\"See, that wasn't too bad.\""
        nim "\"Still weird...\""
        mc "\"You'll get used to it in no time.\""
        mc "\"We just need to practice...\""
        nim "\"Well, maybe...\""
        # ===== CR-0612 START
        if nimhe.getAttr("SUB") <= 4:
            $ nimhe.attrMax["SUB"] = 5 # 
        elif nimhe.getAttr("SUB") == 5 and nimhe.attrMax["SUB"] < 8: # CR-0631
            $ nimhe.attrMax["SUB"] = 8 # # CR-0631
            queue sound "audio/notify.wav"
            call simple_notify("{} POTENTIAL INCREASE".format(nimhe.name.upper()), "SUB can now reach 8", ["Continue"], "08_items/ico ITMCrop.png") from _call_simple_notify_10 
        # ===== CR-0612 END
        call attr_mod(nimhe, "SUB", 1,6,100, True) from _call_attr_mod_14 
        call sandbox_interior_navigate_to("LOCHallway2") from _call_sandbox_interior_navigate_to_4 
        queue sound "audio/notify.wav"
        mc "{i}\"That was... interesting.\"{/i}"
        $ nimhe.hasDoneToday("favour")
        call hour_passes() from _call_hour_passes_11 
        return()

    elif ID == "nimhe_pony_walk_public":
        hide screen displayPresentActors
        scene room_cargo_smart with fade
        $ nimhe.putOn("ITMOutfitPony")
        queue sound "audio/bell_small.wav"
        mc "\"There you are...\""
        nim "\"Nnnnggg, ...\""
        mc "\"Let's take a step outside...\""
        $ nimhe.setLocOverride("LOCPetwalk")
        scene intermission with fade
        queue sound "audio/door_scifi.wav"
        
        $ nimhe.tallyUp("Pony Walks", 1)
        $ locID = {"LIDStationArellarti": "LOCArellartiStationDA", "LIDDomeArellarti": "LOCArellartiDomeDA"}[GAME.getSpaceLoc().ID]
        call sandbox_interior_navigate_to(locID) from _call_sandbox_interior_navigate_to_5 
        return()

    #####################################################################
    #              MILKING
    #####################################################################
    elif ID == "milking":
        # entry checks 
        if "milked" in nimhe.doneToday:
            "You have milked Nimhe already today..."
            return()
        if GAME.hour >= 21:
            mc "\"It is late already...\""
            mc "\"I better try that tomorrow...\""
            return()

        # milking
        queue sound "audio/beep.wav"
        mc "\"Nimhe, report to Cargobay Section B.\""
        "Nimhe" "\"On my way...\""
        scene intermission with fade
        queue sound "audio/door_scifi.wav"
        scene room_cargo_b_smart with fade

        if not nimhe.hasDone("intro_milking"):
            
            $ nimhe.attrMax["SUB"] = 9 # unlock new SUB max
            
            queue sound "audio/notify.wav"
            nim "\"Reporting as ordered.\""
            mc "\"Here is your chance to try out the Milk Master 3000...\""
            nim "\"About time...\""
            mc "\"Get naked and I'll fit you into the Milk Master...\""
            $ nimhe.getNaked()
            queue sound "audio/equip.wav"
            nim "\"Ready!\"" with fade

        "You install Nimhe in the Milk Master..."
        queue sound "audio/install.wav"
        call mg_milking(nimhe) from _call_mg_milking
        call hour_passes() from _call_hour_passes_12

        # initial post use dialogue moira 
        if nimhe.getTally("Milker Used") <= 1:
            nim "\"It didn't work...\""
            mc "\"You need to consume some Pet Supplement the day before use...\""
            nim "\"Clever...\""
            nim "\"Of course the Krell would use some substance like that...\""
        
        elif nimhe.milkMod.yieldToday == 0:
            nim "\"I think I didn't get enough supplement the day before...\""
            mc "\"Yes, I forgot...\""

        else:
            $ renpy.say(nim, vary("\"<Was quite interesting...|Great device...|Didn't feel too bad...|Could get used to that...>\""))
            call attr_mod(nimhe, "SUB", 1,9, 100, True) from _call_attr_mod_15
        
        nim "\"Need to go now...\""
        nim "\"Expecting some data coming in...\""
        mc "\"Of course...\""
        $ nimhe.getDressed()
        return()

    #####################################################################
    #              NIMHE SEX
    #####################################################################
    elif ID == "nimhe_sex":
        nim "\"Fine.\""
        nim "\"Might be interesting for a change...\""
        hide screen displayPresentActors
        scene intermission with fade 
        "A while later..."
        scene expression("06_cutscenes/cutscene_nimhe_sex_zero.png") with fade
        mc "\"Ready?\""
        window hide 
        pause
        scene expression("06_cutscenes/cutscene_nimhe_sex_one.png") with dissolve
        "Nimhe" "\"Let's go!\""
        # prep interaction data
        $ sexLoop = True 
        $ sexAngle = 1
        $ sexOptions = [
            "Angle Change/a", "nimhe.getAttr('SLU')>=14",
            "Chat/c", "True",
            "Finish/x", "True"
        ]
        $ GAME.galleryAdd(82) # Angle 1

        scene ani_nimhe_sex with fade 
        while sexLoop:
            call screen menu_interactive_scr("", sexOptions, [])
            if _return == "Finish":
                queue sound "audio/squish.wav"
                mc "\"Aaaarrghhh...\"" with whiteflash 
                queue sound "audio/squish.wav"
                mc "\"Aaaarrghhh...\"" with whiteflash 
                scene expression("10_anims/ani_nimhe_sex_05.jpg") with dissolve
                queue sound "audio/squish.wav"
                mc "\"Aaaarrghhh...\"" with whiteflash 
                "Nimhe" "\"We should repeat that sometime...\""
                mc "\"Definitely!\""
                if nimhe.getAttr("SLU") == 13:
                    call simple_notify("NIMHE SEX", "New Cam Angle Unlocked!", ["Continue"], "05_gui/ico_gui_camera.png") from _call_simple_notify_11
                call attr_mod(nimhe, "SLU", 1, 14, 100, True) from _call_attr_mod_16 
                $ sexLoop = False

            elif _return == "Angle Change":
                $ sexAngle = {1:2, 2:1}[sexAngle]
                if sexAngle == 1:
                    scene ani_nimhe_sex with dissolve  
                elif sexAngle == 2:
                    scene ani_nimhe_sex_angle2 with dissolve  
                    $ GAME.galleryAdd(142) # Angle 2      

            elif _return == "Chat":
                $ renpy.say("Nimhe", vary("\"<Very pleasurable...|Nice...|Thats sooo relaxing...>\""))       
                $ renpy.say(mc, vary("<\"Yesss...|Aaahhh...|Indeed...|Oh yeah...>\""))


        $ nimhe.hasDone("sex_normal")
        $ nimhe.tallyUp("Sex",1)
        $ nimhe.fp -= 2
        $ GAME.mc.tally["Last Done (Day)"] = GAME.day
        call hour_passes() from _call_hour_passes_13 
        scene intermission with fade
        call sandbox_interior_navigate_to("LOCHallway2") from _call_sandbox_interior_navigate_to_6 
        queue sound "audio/notify.wav"
        mc "\"Nice!\""
        return()
 
    #####################################################################
    #              NIMHE WALKS ILTARI
    #####################################################################
    elif ID == "nimhe_walk_iltari":
        mc "\"How about a walk around the station...?\""
        if not nimhe.hasDone("first_station_walk"):
            nim "\"I know the station.\""
            mc "\"You could benefit from some, ahem... training in public.\""
            nim "\"Why would I?\""
            mc "\"If you ever want to get on stage with your pony costume...\""
            mc "\"You need to feel comfortable out there...\""
            nim "\"I won't walk around outside in my pony outfit.\""
            nim "\"Forget it!\"" with vpunch
            mc "\"Let's start small.\""
            mc "\"Wear you normal outfit.\""
            mc "\"Just leave your top here.\""
            nim "\"I won't run around topless either!\""
            mc "\"You can wear your jacket...\""
            mc "\"Surely that's not a big deal...\""
        nim "\"Fine.\""    
        hide screen displayPresentActors
        queue sound "audio/equip.wav" # CR-0810
        $ nimhe.tags.append("walk1") # CR-0810
        nim "\"Happy?\"" with fade # CR-0810
        mc "\"Let's go!\"" # CR-0810
        scene intermission with fade 
        "A while later outside..."
        scene expression("06_cutscenes/cutscene_nimhe_walk_prep.png")

        # Branch into different walks from here xxx
        if nimhe.getAttr("EXH") == 6: # CR-0535
            # $ nimhe.tags.append("walk1") CR-0810
            mc "\"Ready?\""
            nim "\"Yes.\""
            mc "\"Now walk down the street and back...\""
            nim "\"Fine...\""
            scene intermission with fade 
            "A few minutes later..."
            scene expression("06_cutscenes/cutscene_nimhe_walk_one_return.png")
            nim "\"Big deal.\""
            mc "\"Let me adjust you jacket a bit...\""
            queue sound "audio/equip.wav"
            scene expression("06_cutscenes/cutscene_nimhe_walk_one_return_show.png") with dissolve # CR-0535
            nim "\"Hey!\""
            mc "\"Well done.\""
            mc "\"Now let's head back to the ship.\""
            nim "\"Fine.\""
            call attr_mod(nimhe, "EXH",1,7,100,True) from _call_attr_mod_17 
            call attr_mod(nimhe, "STS",30,100,100,True) from _call_attr_mod_18 
            $ nimhe.tags.remove("walk1")

        elif nimhe.getAttr("EXH") == 7: # CR-0535
            mc "\"Today, we're trying it topless...\""
            nim "\"What do you mean, 'we'?\""
            mc "\"Hand me your jacket...\""
            queue sound "audio/equip.wav"
            scene expression("06_cutscenes/cutscene_nimhe_walk_two_prep.png") with dissolve
            $ nimhe.tags.remove("walk1") # CR-0810            
            $ nimhe.tags.append("walk2")
            nim "\"Fine.\""
            mc "\"Ready?\""
            nim "\"Yes.\""
            mc "\"Now walk down the street and back...\""
            nim "\"If I must...\""
            scene intermission with fade 
            "A few minutes later..."
            scene expression("06_cutscenes/cutscene_nimhe_walk_two_return.png")
            nim "\"They've seen my boobs...\""
            nim "\"Big deal.\""
            mc "\"Well done.\""
            mc "\"Now let's head back to the ship.\""
            nim "\"Fine.\""
            call attr_mod(nimhe, "EXH",1,8,100,True) from _call_attr_mod_19 
            call attr_mod(nimhe, "STS",30,100,100,True) from _call_attr_mod_20 
            $ GAME.galleryAdd(86)        
            $ nimhe.tags.remove("walk2")
      

        elif nimhe.getAttr("EXH") >= 8 : # CR-0535
            mc "\"Today, we're trying it without bottoms...\""
            nim "\"Big deal.\""
            mc "\"Hand me your pants then...\""
            queue sound "audio/equip.wav"
            scene expression("06_cutscenes/cutscene_nimhe_walk_three_prep.png") with dissolve
            $ nimhe.tags.remove("walk1") # CR-0810
            $ nimhe.tags.append("nobottoms")
            nim "\"Fine.\""
            mc "\"Ready?\""
            nim "\"Yes.\""
            mc "\"Now walk down the street and back...\""
            nim "\"If I must...\""
            scene intermission with fade 
            "A few minutes later..."
            scene expression("06_cutscenes/cutscene_nimhe_walk_three_return.png")
            nim "\"I almost slapped a guy...\""
            nim "\"Made some offers...\""
            nim "\"Way too low too.\""
            mc "\"Well done.\""
            mc "\"Now let's head back to the ship.\""
            nim "\"Fine.\""
            call attr_mod(nimhe, "EXH",1,9,100,True) from _call_attr_mod_21 
            call attr_mod(nimhe, "STS",30,100,100,True) from _call_attr_mod_22 
            $ GAME.galleryAdd(87)
            $ nimhe.tags.remove("nobottoms")        

        # wrap up
        call sandbox_interior_navigate_to("LOCCargo") from _call_sandbox_interior_navigate_to_7 
        mc "{i}\"That went quite well...\"{/i}"
        call hour_passes() from _call_hour_passes_14 
        call quest_updater() from _call_quest_updater_17 
        return()

    #####################################################################
    #					INFILTRATOR		
    #####################################################################
    elif ID == "parts_missing_complaint":
        queue sound "audio/notify.wav"
        "Nimhe pays you a surprise visit..."
        nim "\"Have to talk with you...\""
        mc "\"What's up?\""
        nim "\"You've been taking parts from lab storage and not registering them?\""
        mc "\"No... just using the lab normally.\""
        nim "\"That's odd.\""
        nim "\"There's a bunch of parts I had in storage unaccounted for.\""
        mc "\"I didn't take them.\""
        nim "\"Someone did.\""
        mc "\"Hmmm...\""
        nim "\"If you notice something, let me know.\""
        nim "\"I'll be in my room then.\""
        "Nimhe leaves you with a mystery..." with fade
        $ nimhe.hasDone("parts_missing_complaint")
        call quest_updater() from _call_quest_updater_18 
        return()
 
    elif ID == "retrieve_kickoff": # captains room
        queue sound "audio/notify.wav"
        nim "\"I need to talk to you!\""
        mc "\"What is it?\""
        nim "\"I watched you do a decent job so far...\""
        mc "\"Thank you.\""
        nim "\"...so you probably won't get yourself killed with the kind of request I have...\""
        mc "\"Why don't I like the sound of this?\""
        nim "\"Don't know.\""
        nim "\"There is a certain individual on Iltari Station I need to retrieve an item from...\""
        nim "\"It may involve resorting to a special kind of persuasion...\""
        mc "\"What kind of item?\""
        nim "\"It's rather embarassing...\""
        mc "\"I need to know, what we are looking for...\""
        nim "\"...\""
        nim "\"Fine.\""
        nim "\"Some time ago I got talked into posing for a Flyboy Special...\""
        nim "\"I needed the money...\""
        mc "\"A classic...\""
        nim "\"I was certain I could grab the money and purge the data later on, no one the wiser...\""
        nim "\"Unfortunately that sleazy agent forwarded a copy to someone...\""
        nim "\"...who managed to cleverly conceal it from me.\""
        nim "\"I assume he is using offline storage...\""
        mc "\"And...?\""
        nim "\"He is using the material to ask me for illegal bot jobs.\""
        mc "\"Who is that guy.\""
        nim "\"He is known as 'The Bot Collector'...\""
        mc "\"Why don't just send some hired hands to make him an offer he can't refuse?\""
        nim "\"He is much too clever for that.\""
        nim "\"And besides, he has his own protection...\""
        nim "\"We need to scare him into cooperation...\""
        mc "\"We?\""
        nim "\"There are rumours of this military base...\""
        nim "\"They conducted certain experiments...\""
        nim "\"Dangerous experiments...\""
        mc "\"This is beginning to sound like a really bad idea...\""
        nim "\"One day, they vanished without a trace...\""
        mc "\"Just out of curiosity, what kind of experiments did they conduct?\""
        nim "\"They attempted to create Infiltrator Bots.\""
        nim "\"Quite dangerous units...\""
        nim "\"Fully militarized, highly intelligent and without any safety overrides.\""
        nim "\"They probably lost control of their creations...\""
        mc "\"This is getting worse by the minute...\""
        nim "\"I managed to intercept a weird signal with the Argus the other day...\""
        nim "\"I might have finally found the location of that base...\""
        nim "\"If we could get our hands on one of those Infiltrator Shells...\""
        nim "\"Our very own Infiltrator can pay the Collector a visit.\""
        nim "\"He'll know what he faces and will be scared out of his wits...\""
        mc "\"Can't we just create a fake of such an Infiltrator...?\""
        nim "\"The Infiltrator Bot needs to bypass his security...\""
        nim "\"And...ahem, dispose of his protection...\""
        nim "\"With the Argus unit I am certain I can control it.\""
        mc "\"Well...\""
        mc "\"If it is absolutely necessary...\""
        nim "\"It is.\""
        nim "\"You do that, and I'll own you a favour.\""
        mc "\"I like the sound of that...\""
        nim "\"Figures...\""
        $ GAME.mc.hasDone("nimhe_retrieve_kickoff")
        call quest_updater() from _call_quest_updater_19 
        return()

    elif ID == "shell_find": # on the bridge
        scene room_bridge_smart 
        scene expression("11_backgrounds/backdrop_asteroids.jpg") with fade 
        "Scanning the asteroid field, you close in on the base's location..."
        "You carefully steer a reconnaissance drone inside..."
        scene expression("06_cutscenes/cutscene_type_i_corridor.png") with fade
        mc "\"That does not look good, everything destroyed...\""
        mc "\"I wonder what happened here.\""
        nim "\"Keep on looking...\""
        "In a completely destroyed science lab an item catches your attention..."
        scene expression("06_cutscenes/cutscene_type_i_accident.png") with fade
        nim "\"There is a shell crate in the corner over there...\""
        nim "\"That's like no type I have ever seen...\""
        nim "\"Grab it and let's get out of here...\""
        mc "\"Agreed...\""
        mc "\"This place gives me the creeps...\""
        scene intermission with fade 
        "Later back on the ship..."
        scene room_bridge_smart with fade  
        queue sound "audio/notify.wav"
        nim "\"We got the shell!\""
        nim "\"Meet me later in the lab.\""
        $ GAME.mc.hasDone("shell_find")
        call quest_updater() from _call_quest_updater_20 
        call quest_updater() from _call_quest_updater_21 
        return()

    elif ID == "infiltrator_intro": # in the lab
        queue sound "audio/notify.wav"    
        nim "\"Here you are!\""
        nim "\"I had a look at our salvaged crate...\""
        nim "\"It {i}is{/i} a Type-I military shell!\""
        mc "\"Can we use it?\""
        nim "\"I don't see why not.\""
        nim "\"It requires a fully mil-spec Gen 2 or Gen 3 bot frame to install on.\""
        nim "\"Once equipped it will upgrade that bot's capabilities.\""
        mc "\"Like a custom appearance?\""
        nim "\"{i}Way{/i} more advanced.\""
        nim "\"And with AI overrides for the bot core...\""
        nim "\"No security protocols, camouflage capability, ...\""
        mc "\"Sounds scary...\""
        nim "\"Don't worry.\""
        nim "\"I can control the bot as long as the Argus is at top power...\""
        nim "\"I suggest we get it assembled.\""
        nim "\"Create a suitable bot frame and store it for me.\""
        mc "\"What could possibly happen...\""
        nim "\"You're in or not?\""
        mc "\"Fine, I'll do it.\""
        mc "\"Maybe that shell comes in handy for our mission later...\""
        $ GAME.mc.hasDone("infiltrator_intro")
        call quest_updater() from _call_quest_updater_22 

    elif ID == "infiltrator_assembly": # cut to lab
        scene room_lab_smart with fade 
        nim "\"Let's see, what we've got with that shell crate...\""
        queue sound "audio/install.wav"
        nim "\"There, opened...\"" with fade
        nim "\"The shell is ready to be mounted...\"" 
        nim "\"Where is the bot frame?\""
        mc "\"I put it aside in storage...\""
        nim "\"I'll get to the final install then...\""
        hide screen displayPresentActors
        scene intermission with fade 
        "A while later..."
        "Nimhe calls you over into the storage area..."
        scene expression("06_cutscenes/cutscene_type_j_construct.png") with fade 
        play music("audio/dark.wav")
        window hide
        pause
        nim "\"What do you think?\""
        mc "\"Looks creepy...\""
        mc "\"And no seams...\""
        nim "\"Yeah, she's got awesome camouflage capabilities...\""
        mc "\"Can she hear us?\""
        nim "\"Yes.\""
        nim "\"Couldn't get her to talk so far...\""
        nim "\"But she's ready for the mission.\""
        nim "\"I'll deactivate her for the time being...\""
        nim "\"The mission parameters have already been loaded into her cortex.\""
        nim "\"Next time we spend a night at Iltari Station I'll activate her.\""
        nim "\"Make sure the Argus is at 100 percent then.\""
        nim "\"Would hate to lose her.\""
        $ GAME.mc.hasDone("infiltrator_assembled")
        stop music
        $ GAME.setLocID("LOCHallwayLower1")
        call sandbox_interior_navigate_to("LOCLab") from _call_sandbox_interior_navigate_to_8 
        $ GAME.galleryAdd(46)
        call quest_updater() from _call_quest_updater_23 
        return() 

    elif ID == "infiltrator_mission":
        scene intermission with fade 
        "Somewhere deep inside Iltari Station..."
        scene expression("06_cutscenes/cutscene_type_j_night_mission_zero.png") with fade
        play music ("audio/dark.wav")
        window hide
        pause        
        "The Bot Collector" "\"Who is there?\""
        queue sound "audio/teleport.wav"
        scene expression("06_cutscenes/cutscene_type_j_night_mission_one.png") with dissolve
        
        "The Bot Collector" "\"Waaaa.... Guards!\"" with vpunch
        "Infiltrator" "\"None remain...\""
        "The Bot Collector" "\"Wha... What do you want?\""
        "Infiltrator" "\"...\""
        "The Bot Collector" "\"It is Nimhe, isn't it?\""
        "Infiltrator" "\"...\""
        "The Bot Collector" "\"She must be crazy to have awoken one of your kind...\""
        "Infiltrator" "\"...\""
        "The Bot Collector" "\"She wants the box, right?\""
        "Infiltrator" "\"Yessssssss...\""
        "The Bot Collector" "\"You take it, it is over there...\""
        "Infiltrator" "\"Pray I do not need return...\""
        scene expression("06_cutscenes/cutscene_type_j_night_mission_zero.png") with dissolve
        queue sound "audio/teleport.wav"
        window hide
        pause
        "The Bot Collector" "\"He...hello?\""
        "The Bot Collector" "\"You're still here...?\""
        "The Bot Collector" "\"Nimhe is insane!\"" with vpunch
        "The Bot Collector" "\"I hope one of her crazy bots gets her someday...\""
        scene intermission with fade 
        "Later, back on the ship..."
        scene expression("06_cutscenes/cutscene_type_j_night_report.png") with fade
        window hide  
        pause
        mc "\"Waaaaa...!\"" with vpunch
        mc "\"I almost got a heart attack there...\""
        "Infiltrator" "\"Mission complete...\""
        "Infiltrator" "\"Object recovered.\""
        mc "\"Ahem, excellent.\""
        mc "\"Return to storage and deactivate yourself.\""
        "Infiltrator" "\"Affirmative.\""
        $ GAME.galleryAdd(48)
        scene intermission with fade 
        $ GAME.mc.hasDone("night_report")
        $ GAME.locs["LOCCaptain"].tags.append("delivery")
        #$ shellID = random.choice(["SBPShell2TypeI", "SBPShell3TypeI"])
        #$ part = GAME.sbPartsData[shellID].clone({"pref": "military grade"})
        #$ GAME.lab.parts.append(part)
        stop music
        call quest_updater() from _call_quest_updater_24 
        return()

    elif ID == "package_delivery": # nimhe's room
        mc "\"I have received the package from our night mission.\""
        nim "\"Great, I'll pick it up right away.\""
        $ GAME.locs["LOCCaptain"].tags.remove("delivery")
        nim "\"I hope the Infiltrator Bot gave that creep a heart attack...\""
        nim "\"I've put it into a stasis pod for safety.\""
        nim "\"We better keep it for later.\""
        nim "\"It might come in handy...\""        
        nim "\"I'll add the packaged Infiltrator to Cargo.\""
        nim "\"You can reuse it if you want.\""
        $ shellID = random.choice(["SBPShell2TypeI", "SBPShell3TypeI"])
        $ part = GAME.sbPartsData[shellID].clone({"pref": "military grade"})
        $ bot = GAME.lab.hiddenCells.pop() 
        $ bot.addOns[5] = part # mount shell
        $ GAME.ship.packBot(bot, "Infiltrator Pod") 

        nim "\"Thanks for helping me out with that.\"" 
        mc "\"Ahem...\""
        nim "\"Yeah, the favour.\""
        nim "\"Ask me when you want it.\""
        nim "\"Might even make the stay here more interesting...\""
        $ nimhe.hasDone('package_received')
        call attr_mod(nimhe,"APP", 3, 10, 100) from _call_attr_mod_23 
        call quest_updater() from _call_quest_updater_25 
        return()

    #####################################################################
    #              SIGNAL INHIBITOR
    #####################################################################
    elif ID == "signal_inhibitor_talk":
        queue sound "audio/notify.wav"
        "Nimhe pays you a surprise visit..."
        nim "\"Have to talk with you...\""
        mc "\"What is the matter?\""
        nim "\"It is Vee.\""
        mc "\"What about her?\""
        nim "\"I picked up a signal on a Swarm Subspace Frequency...\""
        mc "\"Is she communicating with The Swarm?\""
        nim "\"It's a tracking signal...\""
        mc "\"So the Swarm can pinpoint our location?\""
        nim "\"Looks like it...\""
        mc "\"That is not good...\""
        mc "\"Did you talk with her?\""
        nim "\"Not yet...\""
        mc "\"Can we suppress the signal somehow?\""
        nim "\"I could construct a device that inhibits Vee's transmission...\""
        mc "\"Great!\""
        nim "\"Vee would have to wear it close by for it to work though...\""
        nim "\"But I can figure something out...\""
        mc "\"Great!\""
        mc "\"What do you need for it?\""
        nim "\"Some Swarm stuff.\""
        mc "\"Such as?\""
        nim "\"A Carbon Fiber Spool and two sets of Carbon Nanotubes...\""
        mc "\"Where can I best get those?\""
        queue sound "audio/beep.wav"
        bb2 "\"They cannot be easily bought...\""
        bb2 "\"Some Pirates in Quthor might have them...\""
        bb2 "\"Also, they are known to have been salvaged from Swarm ships at times...\""
        mc "\"I see...\""
        mc "\"Well, Nimhe, I'll let you know once I have the materials.\""
        nim "\"You do that...\""
        nim "\"I hate the thought of The Swarm creeping up on us...\""
        $ nimhe.hasDone("signal_inhibitor_talk")
        return()
 
    elif ID == "signal_inhibitor_fit":
        queue sound "audio/notify.wav"
        mc "\"Vee, I need to talk to you.\""
        v "\"Explain.\""
        mc "\"There may be a covert carrier signal with which The Swarm is tracking you...\""
        v "\"That is possible.\""
        mc "\"Nimhe has constructed a device inhibiting this signal.\""
        v "\"Is that so?\""
        mc "\"Nimhe, why don't you show Vee the Inhibitor.\""
        nim "\"Fine.\""
        nim "\"Have a look over here at the Replicator Bench.\""
        queue sound "audio/notify.wav"
        hide screen displayPresentActors
        scene expression("06_cutscenes/cutscene_inhibitor_crafting.jpg") with fade
        window hide  
        pause 
        nim "\"The Inhibitor has been constructed with the best Swarm Carbon Nanomaterials.\""
        v "\"It has an unusual shape.\""
        nim "\"We need to make sure that you can keep it on your person at all times.\""
        v "\"I see.\""
        nim "\"Let me explain...\""
        v "\"I can divine the device's application from its shape.\""
        mc "\"Excellent, why don't you let Nimhe assist you to check its fitting...\""
        v "\"If it is necessary.\""
        nim "\"I suggest you undress.\""
        v "\"Fine.\""
        scene intermission with fade 
        "A while later..."
        scene expression("06_cutscenes/cutscene_inhibitor_crafting.jpg") with fade
        queue sound "audio/equip.wav"
        $ vee.getNaked()
        v "\"We can proceed.\""
        nim "\"Excellent.\""
        nim "\"Just bend over here at the table for a fitting...\""
        queue sound "audio/squish.wav"
        scene expression("06_cutscenes/cutscene_inhibitor_fitting.jpg") with fade 
        $ GAME.galleryAdd(134)
        nim "\"Works like a charm...\""
        v "\"It is... acceptable.\""
        nim "\"I could make it bigger...\""
        v "\"That is unnecessary.\""
        mc "\"Fine then!\""
        mc "\"This should prevent the Swarm from tracking us...\""
        mc "\"I suggest you leave it in for today.\""
        mc "\"From tomorrow, we'll decide every morning whether it is to be applied.\""
        mc "\"Based on tactical considerations.\""
        v "\"Of course.\""
        scene intermission with fade 
        $ vee.getDressed()
        $ GAME.mc.addItem("ITMPlugSwarm")
        $ GAME.mc.passItem("ITMPlugSwarm", vee, "wardrobe")
        $ vee.putOn("ITMPlugSwarm") # CR-0941
        scene room_lab_smart with fade 
        show screen displayPresentActors("LOCLab")
        mc "\"So we're all set here?\""
        nim "\"It fits nicely under your suit.\""
        nim "\"As if it wasn't there at all.\""
        v "\"I can assure you, it is.\""
        return()




    return()