label hermione_summon_setup:
    $ random_number = renpy.random.randint(1, 10)

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

    #
    # TODO: Remove obsolete variables and fix the code after clothes have been added.
    #
    # if game.weather == "clear":

        # if her_tier >= 3 and game.daytime and not hg_muggle_hot_ITEM.unlocked:
            # $ hg_muggle_hot_ITEM.unlocked = True

            # if not persistent.game_complete:
                # $ hermione_door_event_happened = True #Hermione won't greet you again.

                # $ hermione_wear_neckwear    = False
                # $ hermione_wear_gloves      = False
                # $ hermione_wear_stockings   = True
                # $ h_top = "top_frilled_1"
                # $ h_bottom = "pants_jeans_short"
                # $ h_stockings = "stockings_cute"

                # call update_her_uniform

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

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")
                # call ctc

                # gen "(Wow! Look at her!)" ("angry", xpos="far_left", ypos="head")
                # gen "That's quite a sexy outfit, [hermione_name]!" ("grin", xpos="far_left", ypos="head")
                # if her_whoring < 11:
                    # her "*Ehm*... Thank you, [genie_name]." ("soft", "base", "base", "R")
                    # her "I normally don't wear something like this." ("open", "base", "base", "mid")
                    # her "(Showing so much cleavage...)" ("disgust", "narrow", "worried", "down", cheeks="blush")
                    # her "But the weather is just too hot today." ("base", "base", "base", "R")
                    # gen "You should wear this more often!" ("grin", xpos="far_left", ypos="head")
                # else:
                    # her "Thank you, [genie_name]." ("base", "narrow", "base", "mid_soft")

            # else:
                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")

            # #Unlocks rewards.
            # call unlock_clothing(text = ">New clothing items for Hermione have been unlocked!", item = hg_muggle_hot_ITEM)


    # if game.weather == "overcast":

        # #One time event.
        # if not hg_accs_wool_g_ITEM.unlocked:
            # $ hg_accs_wool_g_ITEM.unlocked = True

            # if not persistent.game_complete:
                # $ hermione_door_event_happened = True #Hermione won't greet you again.

                # $ hermione_wear_neckwear    = True
                # $ hermione_wear_gloves      = True
                # $ hermione_wear_stockings   = True
                # $ h_neckwear = "scarf_striped_g"
                # $ h_gloves = "gloves_wool_1"
                # $ h_stockings = "stockings_striped_1"

                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")
                # call ctc

                # gen "..." ("base", xpos="far_left", ypos="head")
                # gen "[hermione_name]..." ("base", xpos="far_left", ypos="head")
                # gen "What's with all these clothes you are wearing?" ("base", xpos="far_left", ypos="head")
                # her "It's a bit cold outside, [genie_name]... and my..." ("soft", "base", "base", "R", cheeks="blush")

                # if her_whoring < 11:
                    # her "I better not mention it..." ("disgust", "narrow", "worried", "down", cheeks="blush")
                # elif her_whoring < 18:
                    # her "{size=-5}People can see my... my nipples...{/size}" ("disgust", "narrow", "worried", "down", cheeks="blush")
                # else:
                    # her "I can't have my nipples poking out all the time, [genie_name]! It's distracting!" ("annoyed", "narrow", "angry", "R")

                # her "" ("soft", "base", "base", "mid")
                # pause.2
                # gen "Alright... It looks cute on you." ("base", xpos="far_left", ypos="head")
                # gen "You can keep it on for now." ("base", xpos="far_left", ypos="head")
                # her "Thank you, [genie_name]." ("base", "base", "base", "mid")

                # $ h_request_wear_top = True
                # $ h_request_wear_bottom = True
                # $ h_request_wear_neckwear = True
                # $ h_request_wear_gloves = True
                # $ h_request_wear_stockings = True

            # else:
                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")

            # #Unlocks rewards.
            # call unlock_clothing(text = ">New clothing items for Hermione have been unlocked!", item = hg_accs_wool_g_ITEM)


    # # Raining
    # if game.weather == "rain":

        # if her_tier >= 2 and not hg_muggle_rainy_ITEM.unlocked:
            # $ hg_muggle_rainy_ITEM.unlocked = True

            # if not persistent.game_complete:
                # $ hermione_door_event_happened = True #Hermione won't greet you again.

                # $ hermione_wet_clothes = True
                # $ hermione_wear_neckwear    = False
                # $ hermione_wear_gloves      = False
                # $ h_top = "top_sweater_1"
                # $ h_bottom = "pants_jeans_long"

                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("disgust", "narrow", "worried", "down", xpos="base", ypos="base")
                # call ctc

                # gen "Damn girl. You look drenched..." ("base", xpos="far_left", ypos="head")
                # her "I'm sorry, [genie_name], but... It's raining cats and dogs out there!" ("open", "base", "base", "mid")
                # her "I couldn't find my robe so I just put on a sweater and some jeans..." ("open", "base", "base", "R")
                # her "I hope you don't mind my uniform not being up for standards. I didn't want it to get wet." ("disgust", "narrow", "worried", "down")
                # gen "It's fine, [hermione_name]." ("base", xpos="far_left", ypos="head")
                # gen "Besides, I wouldn't mind seeing you in jeans more often!" ("grin", xpos="far_left", ypos="head")
                # her "Thank you, [genie_name]." ("normal", "base", "base", "R")
                # $ her_mood -= 10
                # if her_mood < 0:
                    # $ her_mood = 0

            # else:
                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")

            # #Unlocks rewards.
            # call unlock_clothing(text = ">New clothing items for Hermione have been unlocked!", item = hg_muggle_rainy_ITEM)

        # # Robe
        # else:

            # $ hermione_wear_robe = True
            # call update_her_uniform
            # call play_sound("door")
            # call her_chibi("stand","mid","base")
            # with d3

            # call play_music("hermione")
            # if her_mood > 1:
                # her "" ("annoyed", "base", "base", "R", xpos="base", ypos="base")
            # else:
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")

            # if not h_request_wear_robe:
                # pause.5 #Shows Hermione with robe for a bit.

    # # Snow
    # if game.weather in ("snow", "blizzard"):

        # if her_tier >= 2 and not hg_muggle_cold_ITEM.unlocked:
            # $ hg_muggle_cold_ITEM.unlocked = True

            # if not persistent.game_complete:
                # $ hermione_door_event_happened = True #Hermione won't greet you again.

                # $ h_request_wear_stockings = True
                # $ hermione_wear_neckwear    = False
                # $ hermione_wear_gloves      = False
                # $ hermione_wear_stockings = True
                # $ h_top = "top_pullover_1"
                # $ h_stockings = "stockings_pantyhose"

                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")
                # call ctc

                # gen "New outfit?" ("base", xpos="far_left", ypos="head")
                # her "Yes, [genie_name]. I brought it with me from home. It's a bit too cold for just my normal uniform..." ("open", "base", "base", "R")
                # her "Do you like it?" ("soft", "base", "base", "mid")
                # gen "I do, [hermione_name]. It's cute." ("grin", xpos="far_left", ypos="head")
                # $ her_mood -= 10
                # if her_mood < 0:
                    # $ her_mood = 0

            # else:
                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")

            # #Unlocks rewards.
            # call unlock_clothing(text = ">New clothing items for Hermione have been unlocked!", item = hg_muggle_cold_ITEM)

        # elif her_tier >= 3 and not hg_muggle_cold_sexy_ITEM.unlocked:
            # $ hg_muggle_cold_sexy_ITEM.unlocked = True

            # if not persistent.game_complete:
                # $ hermione_door_event_happened = True #Hermione won't greet you again.

                # $ h_request_wear_stockings = True

                # $ hermione_wear_neckwear    = False
                # $ hermione_wear_gloves      = False
                # $ hermione_wear_stockings   = True
                # $ h_top = "top_pullover_2"
                # $ h_stockings = "stockings_pantyhose"

                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")
                # call ctc

                # gen "That's quite the cute outfit, [hermione_name]." ("base", xpos="far_left", ypos="head")
                # her "Thank you, [genie_name]. I made some changes to the old one..." ("open", "base", "base", "R")
                # her "Do you like it?" ("soft", "base", "base", "mid")
                # gen "Very much so, [hermione_name]. I love the breast window." ("grin", xpos="far_left", ypos="head")
                # $ her_mood -= 10
                # if her_mood < 0:
                    # $ her_mood = 0

            # else:
                # call update_her_uniform
                # call play_sound("door")
                # call her_chibi("stand","mid","base")
                # with d3

                # call play_music("hermione")
                # her "" ("base", "base", "base", "mid", xpos="base", ypos="base")

            # #Unlocks rewards.
            # call unlock_clothing(text = ">New clothing items for Hermione have been unlocked!", item = hg_muggle_cold_sexy_ITEM)

    if hermione_outfits_schedule:
        $ hermione.equip_random_outfit()

        if not config.developer and not tutorial_is_done("schedule") and hermione_wardrobe_unlocked:
            call play_sound("door")
            call her_chibi("stand","mid","base")
            with d3

            call play_music("hermione")

            her "Hello, [genie_name]." ("open", "base", "base", "R", xpos="base", ypos="base", trans=d3)
            her "" ("base", "base", "base", "mid", xpos="base", ypos="base")
            pause 1.0
            gen "You changed your clothes again..." ("base", xpos="far_left", ypos="head")

            call tutorial("schedule")

            menu:
                "Leave Outfits Scheduling turned {b}ON{/b}?"

                "-Yes-":
                    "Outfits scheduling remains turned {b}ON{/b}."
                "-No-":
                    $ hermione_outfits_schedule = False
                    $ tonks_outfits_schedule = False
                    $ cho_outfits_schedule = False
                    $ astoria_outfits_schedule = False
                    $ luna_outfits_schedule = False
                    # Susan

                    "Outfit scheduling turned {b}Off{/b}."

                    $ hermione.equip(her_outfit_default)
                    with fade

            return

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

    #Hermione greeting.
    call play_music("hermione")

    if her_mood > 0:
        if 5 > her_mood >= 1:
            her "Yes, [genie_name]?" ("soft", "base", "worried", "mid", xpos="base", ypos="base", trans=d3)
        elif 10 > her_mood >= 5:
            her "*sigh*... Yes, [genie_name]?" ("annoyed", "base", "base", "mid", xpos="base", ypos="base", trans=d3)
        elif 20 > her_mood >= 10:
            her "What is it, [genie_name]?" ("open", "closed", "annoyed", "mid", xpos="base", ypos="base", trans=d3)
            her "" ("upset", "base", "annoyed", "mid")
        elif 30 > her_mood >= 20:
            her "What do you want, \"[genie_name]\"?" ("upset", "squint", "angry", "R", xpos="base", ypos="base", trans=d3)
        elif 40 > her_mood >= 30:
            her "*Hmph*..." ("normal", "squint", "angry", "R", xpos="base", ypos="base", trans=d3)
        elif 50 > her_mood >= 40:
            her "*Tsk*" ("angry", "base", "angry", "R", xpos="base", ypos="base", trans=d3)
        elif her_mood >= 50:
            her "I have nothing to tell you, sir!" ("mad", "narrow", "angry", "L", xpos="base", ypos="base", trans=d3)

        call describe_mood("Hermione", her_mood)
        call tutorial("moodngifts")
    else:
        if game.daytime:
            her "Good morning, [genie_name]." ("base", "base", "base", "mid", xpos="base", ypos="base", trans=d3)
        else:
            her "Good evening, [genie_name]." ("base", "base", "base", "mid", xpos="base", ypos="base", trans=d3)
    return
