label tonks_summon_setup:

    #TODO I was thinking this event could trigger after certain events for now: some days after Astoria imperio training and some days after Cho/Tonks strip event (would that mess up with other story stuff happening around that time?)
    #TODO add a variable for which event it has triggered from (for dialog variation in this event)
    #TODO remove friendship check (not really relevant to her lewdness level atm plus it could mess up other checks)
    #TODO Added a choice if she should stay naked or put on clothes, move wardrobe functions to each option
    $ tonks_wardrobe_unlocked = True

    # Reset doll state
    $ tonks.wear("all")
    $ tonks.set_cum(None)
    $ tonks.animation = None

    $ random_number = renpy.random.randint(1, 20)
    if 5 > random_number > 0 and tonks.is_worn("top") and ton_friendship >= 50:

        if not tonks_strip_happened: #First time.
            $ tonks_strip_happened = True

            $ tonks.strip("all")
            call ton_walk(action="enter", xpos="mid", ypos="base")

            call play_sound("scratch")
            with hpunch
            gen "!!!" ("angry", xpos="far_left", ypos="head")

            ton "" ("base", "base", "base", "mid", hair="horny", xpos="mid", ypos="base", trans=d5)
            call ctc

            ton "Hi, [ton_genie_name]." ("horny", "base", "raised", "mid")
            gen "You're naked!" ("grin", xpos="far_left", ypos="head")
            ton "Indeed I am." ("open", "base", "raised", "mid")
            ton "Is that a problem, [ton_genie_name]?" ("horny", "base", "raised", "mid")
            ton "Am I going to get fired for inappropriate behaviour?" ("open", "base", "base", "R")
            ton "Are you going to report me to the ministry?" ("horny", "base", "raised", "mid")
            gen "..." ("base", xpos="far_left", ypos="head")
            gen "Have you been drinking?" ("base", xpos="far_left", ypos="head")
            ton "Maybe..." ("base", "base", "base", "mid")

        else: #Repeated Event.

            $ tonks.strip("all")
            call ton_walk(action="enter", xpos="mid", ypos="base")

            call play_music("chipper_doodle")
            ton "" ("base", "base", "base", "mid", hair="horny", xpos="mid", ypos="base", trans=d5)
            call ctc

            ton "Hi, [ton_genie_name]." ("horny", "base", "raised", "mid")
            gen "You're naked again." ("grin", xpos="far_left", ypos="head")
            ton "Yes... I just felt like it." ("base", "base", "raised", "stare")
            gen "(She's smashed...)" ("base", xpos="far_left", ypos="head")
            gen "Miss Tonks, you should be more careful." ("base", xpos="far_left", ypos="head")

        gen "One of the students could have seen you..." ("base", xpos="far_left", ypos="head")
        ton "Oh, I would love for them to see me like this..." ("horny", "base", "raised", "mid")
        ton "Why don't you invite one to your office?" ("horny", "base", "base", "mid")

        if states.ast.ev.imperio_with_tonks.completed_once:
            gen "You'd like that wouldn't you..." ("base", xpos="far_left", ypos="head")
            ton "Very much!"
            gen "Like that Astoria girl you're so infatuated with?" ("base", xpos="far_left", ypos="head")
            gen "Want me to call her up here to have her shame you on your bad behaviour?" ("base", xpos="far_left", ypos="head")
            ton "Oh, yes please!"

        #TODO if triggered after last Cho strip favour with tonks done (Gryffindor tier)
        # Note: No such event exists in the game yet (?)
            #gen "Would you like me to bring Miss Chang up here so you rub your bodies together?" ("base", xpos="far_left", ypos="head")
            #ton "Yes please!"
            #gen "You sure you're ready to find out just how flexible she is?" ("base", xpos="far_left", ypos="head")
            #ton "Yes!"

        gen "I bet you'd love that..." ("base", xpos="far_left", ypos="head")
        gen "(Although that's probably not the best idea in her current state...)" ("base", xpos="far_left", ypos="head")
        gen "(Doesn't mean I can't tease her a bit though...)" ("grin", xpos="far_left", ypos="head")

        menu:
            "-Play nice-":
                gen "How about a bonus instead?" ("grin", xpos="far_left", ypos="head")
                ton "A bonus? For showing my body to my own boss?" ("open", "base", "raised", "mid")
                ton "How much am I worth to you, [ton_genie_name]?" ("base", "base", "raised", "mid")

                menu:
                    "-Zero gold-" if game.gold <= 0:
                        gen "Zero gold." ("base", xpos="far_left", ypos="head")
                        ton "Seriously?" ("angry", "base", "raised", "mid")
                        gen "Yes, I'm a cheap bastard." ("base", xpos="far_left", ypos="head")
                        ton "I can see that..." ("upset", "base", "base", "mid")

                    "-One gold-" if game.gold > 0:
                        gen "A single gold coin, if anything..." ("base", xpos="far_left", ypos="head")
                        ton "(Bastard... How humiliating.)" ("base", "base", "raised", "ahegao")
                        ton "Thank you so much, [ton_genie_name]." ("base", "base", "base", "mid")
                        gen "Don't mention it, [tonks_name]." ("base", xpos="far_left", ypos="head")
                        $ game.gold -= 1

                    "-Twenty gold-" if game.gold >= 20:
                        gen "How does twenty gold sound?" ("base", xpos="far_left", ypos="head")
                        ton "(*Hmm*... I kind of expected more.)" ("base", "base", "base", "R")
                        ton "Thank you, [ton_genie_name]." ("base", "base", "base", "mid")
                        gen "No, [tonks_name]... Thank you." ("grin", xpos="far_left", ypos="head")
                        $ game.gold -= 20

                    "-A hundred gold-" if game.gold >= 100:
                        gen "Does one hundred gold sound nice to you?" ("base", xpos="far_left", ypos="head")
                        gen "With a body like that, you could earn a fortune at a strip club!" ("grin", xpos="far_left", ypos="head")
                        ton "Really..." ("horny", "base", "raised", "mid")
                        ton "You think a noble teacher like me, an ex-auror, would quit her highly regarded job to become a cheap stripper?" ("open", "base", "base", "mid")
                        gen "Well, no. I still want to keep you as a teacher." ("base", xpos="far_left", ypos="head")
                        gen "I merely suggested that you could." ("base", xpos="far_left", ypos="head")
                        ton "Maybe the duelling stage could find some extra use..." ("base", "base", "base", "R")
                        ton "Perhaps some extra curricular activities for a couple of my favourite students could be arranged..." ("open", "base", "raised", "mid")
                        gen "I'm sure they would all love to watch their perverted teacher strip!" ("grin", xpos="far_left", ypos="head")
                        $ game.gold -= 100

                gen "Now..." ("base", xpos="far_left", ypos="head")

            "-Scold her-":
                gen "You know I have to, Miss [tonks_name]." ("base", xpos="far_left", ypos="head")
                gen "Walking into your boss' office, completely naked?" ("base", xpos="far_left", ypos="head")
                gen "Behaviour like that from a teacher... that's just unspeakable!" ("base", xpos="far_left", ypos="head")
                ton "I'm terribly sorry, [ton_genie_name]..." ("open", "base", "base", "down")
                gen "What will you do next? Climb under my desk and suck my cock?" ("base", xpos="far_left", ypos="head")
                gen "Spread your legs for one of your students?" ("angry", xpos="far_left", ypos="head")
                ton "..." ("base", "base", "raised", "stare")
                gen "How's this befitting for a teacher... strutting into the headmaster's office in your birthday suit." ("angry", xpos="far_left", ypos="head")
                gen "That surely calls for some punishment, don't you think?" ("grin", xpos="far_left", ypos="head")
                ton "You are so right, [ton_genie_name]!" ("base", "base", "worried", "mid")

                #TODO This section will be under some whoring check later
                # gen "I should make you the school's cum-dumpster instead. How would you like that position?" ("base", xpos="far_left", ypos="head")
                # gen "Boys lining up in front of the school toilets, waiting their turn to dump their cum into their teacher's mouth, day after day!" ("base", xpos="far_left", ypos="head")
                # ton "You're making me so wet, [ton_genie_name]!" ("base", "base", "base", "ahegao")
                # ton "Maybe some day I'll get bored of my current position here at Hogwarts... you never know..." ("horny", "base", "raised", "mid")
                # gen "I'm not done with your punishment, Miss [tonks_name]!" ("base", xpos="far_left", ypos="head")
                if not tonks_strip_happened:
                    gen "You went to this school, didn't you? Which house were you in?" ("base", xpos="far_left", ypos="head")
                    ton "Me? I was in Hufflepuff." ("open", "base", "raised", "mid")
                    gen "Very well then." ("base", xpos="far_left", ypos="head")
                    gen "Minus ten points from Hufflepuff!" ("base", xpos="far_left", ypos="head")
                    $ hufflepuff -=10
                    ton "What? But [ton_genie_name]! I'm not even a student--" ("open", "wide", "shocked", "mid", trans=hpunch)
                else:
                    gen "Then that's another minus ten points from Hufflepuff!" ("base", xpos="far_left", ypos="head")
                    ton "Again? But please, sir!"
                    ton "What will they say once I get back to the common room?"
                    gen "What?" ("base", xpos="far_left", ypos="head")
                    ton "Oh... I'm a teacher now aren't I... silly me."

                gen "Also--" ("base", xpos="far_left", ypos="head")

        menu:
            "-Those clothes stay off!-":
                $ tonks.unequip("all")

                ton "*Hmm*?"
                gen "That's right... since they're so bothersome, why bother wearing them at all?" ("base", xpos="far_left", ypos="head")
                gen "When you're in here with me I want you on full display!" ("base", xpos="far_left", ypos="head")
                ton "Of course sir..." #Horny
                ton "If you want me to put my clothes back on at any time, just let me know..." ("base", "base", "base", "mid")

            "-Get dressed!-":
                gen "No teacher of mine will strut around naked...{w} unless I say so!" ("base", xpos="far_left", ypos="head")
                ton "Yes sir..."
                gen "Now, put your clothes back on..." ("base", xpos="far_left", ypos="head")
                ton "*Ehm*... Okay..."

                call play_sound("magic")
                $ tonks.wear("all")
                ton "" (trans=morph)

                if tonks_morph_known:
                    gen "...{w} You used your meta-whatsit ability just then didn't you?" ("base", xpos="far_left", ypos="head")
                    ton "You can tell?"
                    gen "Whatever, just wear your actual clothing next time..." ("base", xpos="far_left", ypos="head")
                else:
                    gen "Much better..." ("base", xpos="far_left", ypos="head")
                    ton "..." #smirks #looking down (She's just morphed so she looks like she has clothes)

        gen "Now, get back to your room and think about what you've done..." ("base", xpos="far_left", ypos="head")
        ton "Of course sir..." #look down, blush
        gen "On second thought, stay here, we're not done yet." ("base", xpos="far_left", ypos="head")

        ton "" (xpos="base", ypos="base", trans=fade)

        return

    if tonks_outfits_schedule:
        $ tonks.equip_random_outfit()

    call play_sound("door")
    call ton_chibi("stand","mid","base")
    with d3

    #Tonks greeting.
    call play_music("tonks")

    if ton_mood > 0:
        if 5 > ton_mood >= 1:
            ton "Yes, [ton_genie_name]?" ("open", "base", "base", "R", xpos="base", ypos="base", trans=d3)
            ton "" ("base", "base", "base", "R")
        elif 10 > ton_mood >= 5:
            ton "I have classes to teach, please be quick." ("upset", "base", "base", "mid", xpos="base", ypos="base", trans=d3)
        elif 20 > ton_mood >= 10:
            ton "Make it quick, [ton_genie_name]..." ("upset", "base", "base", "R", xpos="base", ypos="base", trans=d3)
        elif 30 > ton_mood >= 20:
            ton "What do you want, \"[ton_genie_name]\", I'm busy." ("mad", "base", "angry", "mid", xpos="base", ypos="base", trans=d3)
        elif 40 > ton_mood >= 30:
            ton "..............." ("upset", "base", "angry", "mid", xpos="base", ypos="base", trans=d3)
        elif 50 > ton_mood >= 40:
            ton "Please stop wasting my time." ("upset", "closed", "angry", "mid", xpos="base", ypos="base", trans=d3)
        elif ton_mood >= 50:
            ton "You have the nerve to call me here after what you did." ("upset", "base", "angry", "mid", xpos="base", ypos="base", trans=d3)

        call describe_mood("Tonks", ton_mood)
        call tutorial("moodngifts")
    else:
        ton "You called, [ton_genie_name]?" ("base", "base", "base", "mid", xpos="base", ypos="base", trans=d3)
    return
