init:
    label create_quests(called = False):


        $ quests = []

        python:

            """
                █████████████████████████████████████████████████████████████████████████████
                ██                                                                         ██
                ██  ███████╗ ██╗   ██╗ ███╗   ███╗ ███╗   ███╗  █████╗  ██████╗  ██╗   ██╗ ██
                ██  ██╔════╝ ██║   ██║ ████╗ ████║ ████╗ ████║ ██╔══██╗ ██╔══██╗ ╚██╗ ██╔╝ ██
                ██  ███████╗ ██║   ██║ ██╔████╔██║ ██╔████╔██║ ███████║ ██████╔╝  ╚████╔╝  ██
                ██  ╚════██║ ██║   ██║ ██║╚██╔╝██║ ██║╚██╔╝██║ ██╔══██║ ██╔══██╗   ╚██╔╝   ██
                ██  ███████║ ╚██████╔╝ ██║ ╚═╝ ██║ ██║ ╚═╝ ██║ ██║  ██║ ██║  ██║    ██║    ██
                ██  ╚══════╝  ╚═════╝  ╚═╝     ╚═╝ ╚═╝     ╚═╝ ╚═╝  ╚═╝ ╚═╝  ╚═╝    ╚═╝    ██
                ██                                                                         ██
                █████████████████████████████████████████████████████████████████████████████

            ###########################

            Quests declaration:

                MAIN QUESTS :

                    - First Day at School
                    - Order to the Chaos
                    - Leave No Girl's Behind
                    - A Man's Work
                    - Who's Tugging Mykock?
                    - If a Headmaster Falls In the Woods

                STAFF QUESTS :

                    - Experiments gone wild
                    - Teaching Miss Potts
                    - Sally Learns the Ropes
                    - Priti as a Picture
                    - A Troublesome Inspector

                STUDENTS QUESTS :

                    - The Headmaster's Pet
                    - The Headmaster's Pet Part 2
                    - Taming a Prefect
                    - The Spanking Connoisseur
                    - Maid for Punishment
                    - The Accidental Nudist
                    - The Hostess with Mostess
                    - The Reluctant Rebel
                    - Pride and President


            Screens:

                - quest_screen_main(category,quest_to_show)
                - quest_text(quest,page,quest_part)
                - notespage_screen2(pages,page)
                - q_case(quest,brand_new)

            Labels:

                - q_log(l_quest,is_new)

            Functions:

                - no_quest()
                - quests_to_show(category)
                - quest_pages(quest,notestyle,q_spacing,quest_part)
                - get_quest_category(quest_name)

            Classes:

                - quests_in_category(category)   Function
                - search_quest(name)             Function
                - Quest_()                       Class
                - Quest()                        Class
                - Quest_step()                   Class

            """


    ####################################################################################################################################################
    #                                                                                                                                                  #
    #   ██████╗ ██╗   ██╗███████╗███████╗████████╗    ██████╗ ███████╗ ██████╗██╗      █████╗ ██████╗  █████╗ ████████╗██╗ ██████╗ ███╗   ██╗███████╗  #
    #  ██╔═══██╗██║   ██║██╔════╝██╔════╝╚══██╔══╝    ██╔══██╗██╔════╝██╔════╝██║     ██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗  ██║██╔════╝  #
    #  ██║   ██║██║   ██║█████╗  ███████╗   ██║       ██║  ██║█████╗  ██║     ██║     ███████║██████╔╝███████║   ██║   ██║██║   ██║██╔██╗ ██║███████╗  #
    #  ██║▄▄ ██║██║   ██║██╔══╝  ╚════██║   ██║       ██║  ██║██╔══╝  ██║     ██║     ██╔══██║██╔══██╗██╔══██║   ██║   ██║██║   ██║██║╚██╗██║╚════██║  #
    #  ╚██████╔╝╚██████╔╝███████╗███████║   ██║       ██████╔╝███████╗╚██████╗███████╗██║  ██║██║  ██║██║  ██║   ██║   ██║╚██████╔╝██║ ╚████║███████║  #
    #   ╚══▀▀═╝  ╚═════╝ ╚══════╝╚══════╝   ╚═╝       ╚═════╝ ╚══════╝ ╚═════╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝   ╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚══════╝  #
    ####################################################################################################################################################



    #########################################
    #                 MAIN                  #
    #########################################

        quest:
            name "First Day at School"
            description "It's your first day as the headmaster at an all girls college for troubled teens. Your PA Samantha has kindly prepared a schedule for you to help you get settled in."
            pic "first_day.png"
            keyword "first_day"

            category "Main"

            step 1:
                text "Familiarise yourself with your office then head to the classrooms."

            step 2:
                text "Make your way to the sports centre where another class is expecting you."
                show if gold

            step 3:
                text "Head to the science classroom to meet with Miss Chang."
                show if first_day_step2

            step 4:
                text "Head to the dorms to make sure the girls are behaving."
                show if chang_met

            step 5:
                text "Head back to your apartment and get some sleep."
                show if first_day_step4

            stop_show day>1

    ########################################

        quest:
            name "Order to the Chaos"
            category "Main"
            pic "ottc.png"
            keyword "ottc"

            description "Discipline is low and the girls are not studying in their free time. You must assert your authority and bring order to the school."

            show_cond otc_start and not v4_intro

            step 1:
                text "Increase Discipline to 20 to prevent Grades from declining."
                complete if discipline >= 20

            step 2:
                text "Help Miss Potts control her class."
                complete if dc2

            step 3:
                text "Improve the science facilities for Miss Chang. Advance the quest {i}[egw.name]{/i} to make sure she has everything she needs."
                complete if dc3

            step 4:
                text "Win Mr Wilson to your side."
                complete if dc4

            step 5:
                text "Implement a new rule at a weekly meeting of the school board."
                complete if dc5

    ########################################

        quest:
            name "Leave No Girl's Behind"
            description "You are finally able to punish the girls yourself and grades and discipline are bound to increase rapidly as a result. Ruth will be giving the girls a test soon and every single girl needs to pass with flying colours. You will need to improve overall grades by teaching lesson and you will need to focus on any individual girls who may be falling behind."
            pic "lngb.png"
            keyword "lngb"

            category "Main"

            show_cond lngb_unlocked

            step 1:
                text "Achieve 100 Grades."
                complete if grades >= 100

            step:
                text "PLEASE NOTE: This quest is still a work in progress. It can be complete this update but there is currently only a placeholder ending."

    ########################################

        quest:
            name "A Man's Work"
            category "Main"
            pic "amw.png"
            keyword "amw"

            description "Some jobs are best left to a man. Spanking naughty schoolgirls is a prime example."

            show_cond v4_intro

            step 1:
                text "Find out your colleagues opinions on changing the rules at the next meeting of the school board."

            step 2:
                text "Earn three influence points from Miss Newman."
                complete if sally_feels
                show if mens_proposed

            step 3:
                text "Find a way to convince Ruth to let you spank the girls."
                show if mens_proposed
                complete if ruth_ba2

            step 4:
                text "Have at least one student enforcer (Prefect)."
                show if ruth_ba2 and sally_feels

            step 5:
                text "Hold another vote at the school board to allow you to spank the girls."
                show if debbie_prefect
                complete if men_cp

            stop_show chapter2


    ########################################

        quest:

            name "If a Headmaster Falls In the Woods"
            description "The old headmaster was worried he was being followed in the woods. Could he have been murdered? You decide to investigate in case you yourself are in danger." # <-- no mandatory
            pic "iahfitw.png"
            keyword "iahfitw"

            category "Main"

            show_cond iahfitw_unlocked

            step 1:
                text "Ask the staff about the old headmaster and find out if anyone knows anything about his death."

            step 2:
                show if charles_chat_oh or jimmy_oh_asked
                text "Visit the lake in the morning and speak to the groundskeeper about finding the old headmaster's body."

            step 3:
                show if jimmy_oh_asked
                text "Ask Jimmy to show you the spot where the old headmaster died."

            step 4:
                show if jimmy_body_asked
                text "Wait for Jimmy to clear the path into the woods to show you where he found the old headmaster's body."

            step 5:
                show if oh_code_have
                text "Try using the numbers you found with the safe in your office."

            step 6:
                show if safe_opened
                text "Ask Miss Chang what she knows about British Defence System Manufacturers."

            step 7:
                text "Miss Chang warned you about a spy on campus. Could there be a connection between the spy and the old headmaster's death? You will need to investigate. COMING SOON."
                show if printer

    ########################################

        quest:

            name "Who's Pulling Mykock?"
            category "Main"
            pic "wpm.png"
            keyword "mykock"

            description "As Ada pointed out, the school is behind a restrictive firewall. All digital communications on campus are being monitored and controlled. Who are the people behind the scenes pulling all the strings? With no way of contacting them directly, Mr Mykock warned you not to ask about them. However, perhaps you can learn more about their intentions by listening to their requests."

            show_cond chapter2

            step 1:
                text "Give Ada's phone to Miss Chang after school"

            step 2:
                text "Find Ada in the hallway (on Monday afternoon) and return her phone."
                show if chang_ada

            step 3:
                text "Check for an email from Mr Mykock."
                show if ada_phone_given

            step 4:
                text "Wait for a day and read the response."
                show if email_ada_read

            step 5:
                text "Watch Ada's Video diary for clues on her secret photographs"
                show if email2_ada_read

            step 6:
                text "View Ada's photos and look through the hidden folders"
                show if ada_secret_folders_unlocked

            step 7:
                text "Find another way to engage with the school's owners - speak with Maxine."
                show if ada_voyeur

            step 8:
                text "Complete Maxine's quest."
                show if maxines_charity_request and ada_voyeur
                complete if maxines_fundraiser_day7

            step 9:
                text "You didn't learn much from this set of requests. However, Mr Mykock is sending his secretary to campus to discuss Ada's punishment. Perhaps she will be a fertile source of inside information."
                show if maxines_fundraiser_day7
                complete if pp_minimal

            step 10:
                text "Reilly has said she will return, with more requests and guidance. She's been tight-lipped so far, but there must be something that can loosen her resolve. COMING SOON."
                show if pp_minimal

    #########################################
    #                 STAFF                 #
    #########################################


        quest:

            name "Experiments gone wild"
            description "Miss Chang has complained about the lack of science facilities at the school."
            pic "egw.png"
            keyword "egw"

            category "Staff"

            show_cond chang1_done

            step 1:
                text "Upgrade your science classroom by using the construction menu on your computer."

            step 2:
                text "Tell Miss Chang you have ordered new equipment for her."
                show if science_upgrade1

            step 3:
                text "Check in on Miss Chang's classroom during school hours."
                show if chang2_done

            step 4:
                text "Check back with Miss Chang in the evening to see if there is anything else she needs."
                show if chang_event1done

            step 5:
                text "Summon Samantha to your office during school hours and ask about hiring a lab technician."
                show if chang_event2

            step 6:
                text "Wait a few days for Sam to ask around town and see if there is anyone looking for work."
                show if looking_tech or interview_seen

            step 7:
                text "Visit Miss Chang in the evening and see how she's getting on with her new assistant."
                show if interview_seen
                complete if dc3 or trixie_fire or egw_step7

            step 8:
                text "Summon Trixie to your office and figure out what to do with her."
                show if egw_step7

            step 9:
                text "Visit Miss Chang again in the evening and see how she's getting on with her new new assistant."
                show if egw_step7 and anna_assist

            step 8 + 2*egw_step7:
                text "Wait for Miss Chang to ask for further assistance."
                show if dc3

            step 9 + 2*egw_step7:
                text "Purchase a 3D printer for Miss Chang. COMING SOON."
                show if printer

    ########################################

        quest:
            name "Teaching Miss Potts"
            description "Miss Potts can't control her class. Fortunately you are an expert in disciplining young women and have offered to pass on some of your skills."
            pic "tmp.png"
            keyword "tmp"

            category "Staff"

            show_cond gold

            step 1:
                text "Visit Miss Potts' apartment in the evenings to provide her with basic training."

            step 2:
                text "Visit Miss Potts' classroom during school hours to check up on her progress."
                show if potts_level > 5

            step 3:
                text "Visit Miss Potts's apartment and discuss the next phase of her training."
                show if potts_stand

            step 4:
                text "You have convinced the English teacher to dress up like a schoolgirl so you can spank her. Visit her at her apartment in the evening."
                show if potts_level > 6

            step 5:
                text "Visit Miss Potts again for more advanced training."
                show if dc2

            step 6:
                text "Visit Miss Potts' Classroom to see her punish one of the girls (you may need to unlock new rules at the school board to proceed)."
                show if claire_emb_train1

            step 7:
                text "Visit Miss Potts' apartment again to continue her training."
                show if claire_faye_seen

            step 8:
                text "Visit Miss Potts' classroom to supervise her spanking one of the girls."
                show if tmp_step8

            step 9:
                text "Visit Miss Potts' apartment to discuss Mary's punishment."
                show if claire_mary

            step 10:
                text "Wait until Claire visits you in your office and show her the wrong way to give a punishment."
                show if claire_mary_discussed

            step:
                text "You've reached the end of Claire's story line for this update."
                show if claire_bda

    ########################################

        quest:
            name "Sally Learns the Ropes"
            category "Staff"
            pic "sltr.png"
            keyword "sltr"

            show_cond sally_quest_started

            description "Sally is already an accoplished disciplinarian and you think she might be ready to learn some of your advanced teaching methods."

            step 1:
                text "Purchase a paddle from the online store."
                complete if have_paddle

            step 2:
                text "Convince the school board that skirts must be removed for corporal punishments."
                complete if undress_rule

            step 3:
                text "Catch Debbie misbehaving and sentence her to a private punishment."
                show if undress_rule and have_paddle

            step 4:
                text "Convince the school board to allow you to confiscate clothing that does not fit with the school's uniform policy."
                show if uniform2_unlocked

            step 5:
                text "Catch Debbie misbehaving in class and then sentence her to another private punishment."
                show if uniform2

            step:
                text "You've reached the end of Sally's story line for this update."
                show if debbie_fingered

    ########################################

        quest:
            name "Priti as a Picture"
            category "Staff"
            pic "paap.png"
            keyword "paap"

            description "Mr Wilson the maths teacher appears to have an unhealthy fixation on one of the students. A sweet and innocent girl by the name of Priti. He has asked for you to steal her email password."

            show_cond charles_help1 or priti_q1

            step 1:
                text "Ask Miss Chang if she knows how to steal someone's email password without them knowing."

            step 2:
                text "Use the phone in your office to summon Priti."
                show if keylog2

            step 3:
                text "Deliver Priti's password to Mr Wilson."
                show if priti_password

            step 4:
                text "Check back with Mr Wilson another night to see if there is anything else he needs."
                show if dc4
                complete if charles_help2

            # Accept Charles' Proposition

            step 5:
                text "Purchase a digital camera and then decide how to obtain high quality naked photos of Priti."
                show if charles_help2 and (not charles_refused or priti_good_photos or priti_bad_photos)

            step 6:
                text "Summon Priti to your office then decide how to obtain naked photos of her."
                show if have_camera and charles_help2 and (not charles_refused or priti_good_photos or priti_bad_photos)
                complete if priti_bad_photos or priti_summon3 or priti_good_photos

            # BAD PHOTOS
            step 7:
                text "Speak to Mr Wilson and decide whether to hand over the pictures."
                show if priti_bad_photos
                complete if priti_q2_done

            # GOOD PHOTOS
            step 7:
                text "Order swimsuit and uniform samples for Priti to try on. Then summon her to your office."
                show if priti_summon3 or priti_good_photos

            step 8:
                text "Visit Mr Wilson and decide whether to hand over the pictures."
                show if priti_good_photos
                complete if priti_q2_done or paap_refuse_hand or charles_refused

            # Refuse Charles' Proposition

            step 5 + 3*priti_bad_photos + 4*priti_good_photos:
                text:
                    "Figure out a way to get a prostitute for the Maths teacher." if not trixie_assist and not trixie_dance
                    "Ask Trixie if she knows any local prostitutes." if trixie_assist or trixie_dance
                show if charles_refused

            step 6 + 3*priti_bad_photos + 4*priti_good_photos:
                text "Wait a day and check for a reply from the escort agency."
                show if date_requested

            step 7 + 3*priti_bad_photos + 4*priti_good_photos:
                text "Email back the escort agency."
                show if show_candy

            step 8 + 3*priti_bad_photos + 4*priti_good_photos:
                text "Purchase some Viagra from the online store."
                show if date_responded

            step 9 + 3*priti_bad_photos + 4*priti_good_photos:
                text "Wait for the Viagra to arrive from the online store."
                show if (viagra_ordered or have_viagra) and date_responded

            step 10 + 3*priti_bad_photos + 4*priti_good_photos:
                text "Deliver the pills to Mr Wilson and inform him that the prostitute has been ordered."
                show if have_viagra and date_responded

            step 11 + 3*priti_bad_photos + 4*priti_good_photos:
                text "Wait a couple of nights and visit Mr Wilson again."
                show if bad_pills_given or good_pills_given
                complete if candy_discussed

            step:
                text "You gave Priti's pictures to Mr Wilson."
                show if priti_q2_done

            step:
                text "You've completed Mr Wilson's story line."
                show if candy_discussed or priti_q2_done


    ########################################

        quest:
            name "A Troublesome Inspector"
            category "Staff"
            pic "ati.png"
            keyword "ati"

            description "In order to ensure the girls are not being mistreated the government sent an inspector to your school by the name Ruth Thomas. Ruth is determined to prevent you from being able to punish the girls yourself. She is immune to your charms and you will need to find some other way to convince her."

            show_cond mens_proposed

            step 1:
                text "Go and visit Ruth in the teachers lounge located in the office building."

            step 2:
                text "Speak to Miss Chang about getting the password to the old headmaster's computer."
                show if ohp_needed

            step 3:
                text "Spike Sally's drink with the shrinking potion formula while she's in the shower (Monday afternoon in the men's changing rooms)."
                show if ohp_request

            step 4:
                text "Wait until the evening."
                show if sally_sf_given

            step 5:
                text "Open the locked journal entry in the recycle bin of the old headmaster's computer."
                show if ohp_have

            step 6:
                text "Ruth and the old headmaster were having an affair. Use the information to blackmail her."
                show if oh_journal_have

            step 7:
                text "Hope for a miracle."
                show if ruth_ba1

            step 8:
                text "Confront Ruth again in the teachers' lounge."
                show if safe_opened

            step:
                text "You've reached the end of Ruth's story line for this update."
                show if ruth_ba2


    #########################################
    #               STUDENTS                #
    #########################################


        quest:                                  # VEIGHT 4514 CHECK THAT...
            name "The Headmaster's Pet"
            category "Students"
            pic "thp.png"
            keyword "thp"

            description "A cute young woman named Rachel keeps falling asleep in lessons. She appears to be addicted to computer games, although you suspect this is merely a symptom of some deeper problem. You will need to learn more about her if you are to help her overcome her addiction. Perhaps you can also find a role for her to help you in the running of the school."

            show_cond rachel_qstart and not rachel_thp2_intro

            step 1:
                text "Purchase the ointment from the online store to provide extra pleasure during punishment."
                complete if have_ointment

            step 2:
                text "Convince the school board to allow skirts to be removed to provide extra humiliation."

            step 3:
                text "Catch Rachel falling asleep in class again and then convince her to talk to you about her night-time habits."
                show if have_ointment and undress_rule > 0

            step 4:
                text "Spy on Rachel's room to make sure she does her homework."
                show if rachel_sha

            step 5:
                text "Catch Rachel falling asleep in class again then assign her the role of your trainee. You may need to unlock new punishments actions first by following Miss Newman's questline."
                show if rachel_sha_seen

            step 6:
                text "Meet with Rachel at lunchtime in your office the next school day."
                show if rachel_trainee

            step 7:
                text "Explore the school with Rachel and try to work out what is causing her body confidence issues."
                show if rachel_follower

            step 8:
                text "Find a reason to make Rachel take her shirt off in front of the other girls during a sports lesson."
                show if rachel_sally

            step 9:
                text "Find a reason to make Rachel take her shirt off in front of you in your office. Perhaps by making her change clothes for a public punishment."
                show if match2_done and rachel_sally

            step 10:
                text "Purchase some cat ears online."
                show if rachel_weakness

            step 11:
                text "Punish Rachel again and teach her to be less anxious about her body."
                show if have_cat_ears

            step 12:
                text "Spy on Rachel's room again."
                show if rachel_pet_play1

            step 13:
                text:
                    "Convince the school board to let you make the girls strip down to their underwear for punishments and then punish Rachel again. You will need to be able to punish the girls yourself before you can unlock this rule." if thp_step13_3 or thp_step13_4 or undress_rule3_available
                    "Punish Rachel again after school." if thp_step13_1
                    "Catch Rachel misbehaving in class and punish her again." if thp_step13_2
                show if thp_step13_1 or thp_step13_2 or thp_step13_3 or thp_step13_4 or undress_rule3_available

            step 14:
                text "Watch Rachel showering with the other girls."
                show if rachel_atoc

            step 15:
                text "Click on the headmaster's locker on a Thursday afternoon."
                show if rachel_atoc_seen

            step 16:
                text "Catch Rachel falling asleep again and give her a private punishment."
                show if thp_step16

            step 17:
                text "Visit Rachel's dorm room at night and climb in through the window."
                show if rachel_shas1

            step 18:
                text "Teach a class and make sure that Rachel doesn't fall asleep."
                show if rachel_shas2

            step 19:
                text "Spy on Rachel's room and make sure she is cured of her gaming addiction."
                show if rachel_shas3

            step 20:
                text:
                    "Give Rachel a private punishment in your office." if thp_step20
                    "Teach a class and make sure Rachel stays awake."
                show if rachel_butt_plug or thp_step20

            step 21:
                text "Wait to speak with Rachel on the next weekday morning."
                show if rachel_pet

    ########################################

        quest:
            name "The Headmaster's Pet Part 2"
            category "Students"
            pic "thp.png"
            keyword "thp2"

            description "Rachel wasn't sleeping well and was falling asleep in class. It turned out she suffered from body dysmorphia due to her small breasts and had intense jealousy of curvier women. By teaching Rachel to be more carefree, like her favourite animal, the cat, you were able to help Rachel feel better about herself and to finally get a good night's rest. Over the course of her therapy, the two of you had grown close and you offered her the role of Personal Executive Trainee (PET) to take care of all your personal needs. Things are going well but is Rachel truly cured of her jealousy toward other women?"

            show_cond rachel_thp2_intro

            step 1:
                text:
                    "{b}Learning to Share{/b} - Rachel locked Miss Newman in a cupboard rather than share you with her. Such willful insubordination cannot be tollerated. The time for fun and games is over. Only your most advanced disciplinary techniques can help now." if rachel_revenge
                    "{b}Learning to Share{/b} - Rachel sat and watched as you roughly fucked her teacher's ass. Hopefully, Rachel now understands how important your penis is in maintaining discipline and that she cannot have it all to herself. Perhaps now she will be more willing to share. {b}Teach a football class{/b} and join Rachel and Sally in the shower again." if sallys_anal_punishment
                    "{b}Learning to Share{/b} - Rachel still doesn't understand that your penis is not her toy, it's an important tool for maintaining discipline for both staff and students alike. It might be best if Rachel watches it in action. {b}Teach a football class.{/b} and then have sex with Sally in front of Rachel." if rachel_ps_anal_dildo_discussed and pool_unlocked
                    "{b}Learning to Share{/b} - Rachel still doesn't understand that your penis is not her toy, it's an important tool for maintaining discipline for both staff and students alike. It might be best if Rachel watches it in action. However, first, she needs to be punished." if rachel_sally_shower1 and pool_unlocked
                    "{b}Learning to Share{/b} - Rachel still doesn't understand that your penis is not her toy, it's an important tool for maintaining discipline for both staff and students alike. It might be best if Rachel watches it in action. You will be more likely to run into Miss Newman in the locker room if you {b}open the pool{/b}." if rachel_sally_shower1
                    "{b}Learning to Share{/b} - You decided a threesome would be a good way to help Rachel get used to sharing you with other women. Debbie made an excellent partner as she has little interest in men and didn't make Rachel overly jealous. For a real test, Rachel would need to see you with a woman she was truly envious of, someone like her teacher Miss Newman. {b}Teach football class{/b}, make Rachel play naked and then join you afterwards in the shower." if rachel_post_punish_new1 and match5_done
                    "{b}Learning to Share{/b} - You decided a threesome would be a good way to help Rachel get used to sharing you with other women. Debbie made an excellent partner as she has little interest in men and didn't make Rachel overly jealous. For a real test, Rachel would need to see you with a woman she was truly envious of, someone like her teacher Miss Newman. {b}Teach football class several times{/b} until you have the opportunity to make Rachel play naked, then have her join you afterwards in the shower." if rachel_post_punish_new1
                    "{b}Learning to Share{/b} - You decided a threesome would be a good way to help Rachel get used to sharing you with other women. Debbie made an excellent partner as she has little interest in men and didn't make Rachel overly jealous. For a real test, Rachel would need to see you with a woman she was truly envious of, someone like her teacher Miss Newman. Rachel isn't ready for this yet though, you need more advanced disciplinary techniques." if debbie_rachel2
                    "{b}Learning to Share{/b} - Rachel has a jealous nature and she wants you all to herself. As headmaster, it's your job to discipline all the girls at school and Rachel is going to have to learn to share. You've decided a threesome would be the best way for her to get used to the idea and Debbie would be the ideal third partner. {b}Summon Rachel and Debbie using the phone in your office{/b}." if debbie_rachel1
                    "{b}Learning to Share{/b} - Rachel has a jealous nature and she wants you all to herself. As headmaster, it's your job to discipline all the girls at school and Rachel is going to have to learn to share. You've decided a threesome might help Rachel get used to the idea of sharing. {b}Patrol the halls and decide on a suitable student for a threesome{/b}." if debbie_rachel3
                    "{b}Learning to Share{/b} - Rachel has a jealous nature and she wants you all to herself. As headmaster, it's your job to discipline all the girls at school and Rachel was going to have to learn to share. In the process, you hoped to cure Rachel of her jealousy toward other women. First, you decided to observe her reaction as you {b}perform body searches on all the girls around school {/b}(you will need to pass the body search rule). A particular busty blonde would be an ideal target, you've seen her hanging out in the hallway on a Wednesday afternoon."
                show if not rachel_sex
                complete if False

            step 2:
                text:
                    "{b}Advanced Disciplinary Techniques{/b} - The time has finally come. {b}Punish Rachel in your office{/b} and have sex with her." if rachel_revenge
                    "{b}Advanced Disciplinary Techniques{/b} - Rachel has taken the medium sized dildo in both her ass and pussy now. It won't be long until she is ready for your cock. Miss Newman has been taught the benefits of disciplinary sex. All you need to do wait for Rachel to misbehave sufficiently." if sallys_anal_punishment
                    "{b}Advanced Disciplinary Techniques{/b} - Rachel has taken the medium sized dildo in both her ass and pussy now. It won't be long until she is ready for your cock. Miss Newman will need to be present though, so first she needs to learn the benefits of a disciplinary fucking first hand." if rachel_ps_anal_dildo_discussed
                    "{b}Advanced Disciplinary Techniques{/b} - Rachel's naughty behaviour in the shower requires further punishment. This gives you the opportunity to continue stretching out her little holes with the dildo. {b}Summon Rachel to your office after school for punishment and fuck her ass with a dildo.{/b}" if rachel_sally_shower1
                    "{b}Advanced Disciplinary Techniques{/b} - To permanently cure Rachel of her body envy you will need your most advanced disciplinary techniques and that means fucking the girl. You came a step closer to this goal by penetrating her with moderately sized dildo, soon she will be ready for your sizable cock. While you wait for the inevitable, you should continue helping her learn to share." if rachel_post_punish_new1
                    "{b}Advanced Disciplinary Techniques{/b} - Unfortunately, Rachel's little holes are still much too tight. She couldn't even manage to take a medium sized dildo, let alone your large cock. Believing Rachel's problem to be mostly psychological you realised that your punishment method could help her overcome this challenge. {b}Order Rachel to your office after school for punishment{/b} and try again with the dildo." if rachel_m_dildo1
                    "{b}Advanced Disciplinary Techniques{/b} - To permanently cure Rachel of her body envy you will need your most advanced disciplinary techniques and that means fucking the girl. Rachel is desperate to please her Master and has already offered her virginity. There's a problem though, her little holes are much too tight and will need stretching out before you'll be able to penetrate her with your large cock. {b}Spend time with Rachel in your office (by clicking her icon in the afternoon) and let her practice using a dildo{/b}" if have_dildos and have_tail
                    "{b}Advanced Disciplinary Techniques{/b} - To permanently cure Rachel of her body envy you will need your most advanced disciplinary techniques and that means fucking the girl. Rachel is desperate to please her Master and has already offered her virginity. There's a problem though, her little holes are much too tight and will need stretching out before you'll be able to penetrate her with your large cock. {b}Purchase a selection of different sized dildos and a new butt plug from the online store.{/b}"
                show if not rachel_sex
                complete if False

            step:
                text "Rachel has been cured of her jealousy issues and is now a perfect student. Now it's time for her to teach the other girls the joys of sharing."
                show if rachel_sex
                complete if False

            step:
                text "You have completed Rachel's storyline."
                show if rachel_sex


    ########################################

        quest:
            name "Taming a Prefect"
            category "Students"
            pic "tap.png"
            keyword "tap"

            description "You need a strong girl on your side to keep the others in line. Debbie would be ideal if she wasn't so wild. Use Miss Newman to tame the savage girl in your office."

            show_cond maxine_fs

            step 1:
                text "Raise Debbie to level 5 and assign her the role of Prefect. Follow the questlog for Miss Newman."

            step 2:
                text "Wait until Sunday and have Debbie put an end to Maxine's protests."
                show if debbie_prefect

            step:
                text "You've reached the end of Debbie's storyline for this update."
                show if maxine_pantsed

    ########################################

        quest:
            name "The Spanking Connoisseur"
            category "Students"
            pic "tsc.png"
            keyword "tsc"

            description:
                "A young athlete named Amy is constantly late and always runs around at dangerous speeds as a result. It's a bad habit that is disruptive to your lessons and you fear that she might one day injure someone. From observation of the girl during her punishments you have determined that she is a masochist, deriving sexual pleasure from pain. A girl like her could prove useful to you as a practice subject to help train your staff and Prefects in the art of discipline. You believe that Amy is proving resistant to your punishment methods because she is receiving large amounts of pleasure, pain and humiliation from outside sources. You decide that you will need to temporarily cut off her source of pleasure in order to make your punishment methods effective." if amy_tia2
                "A young athlete named Amy is constantly late and always runs around at dangerous speeds as a result. It's a bad habit that is disruptive to your lessons and you fear that she might one day injure someone. From observing the girl during her punishments, you have determined that she is a masochist; deriving sexual pleasure from pain. A girl like her could prove useful to you as a practice subject to help train your staff and Prefects in the art of discipline. You believe that Amy is proving resistant to your punishment methods because she is receiving large amounts of pleasure, pain, and humiliation from outside sources." if amy_spy3
                "A young athlete named Amy is constantly late and always runs around at dangerous speeds as a result. It's a bad habit that is disruptive to your lessons and you fear that she might one day injure someone. From observation of the girl during her punishments you have determined that she is a masochist, deriving sexual pleasure from pain. A girl like her could prove useful to you as a practice subject to help train your staff and Prefects in the art of discipline."

            show_cond amy_max

            step 1:
                text "Spank Amy in front of her classmates to see how she reacts."
                complete if amy_second_punish

            step 2:
                text "Convince the school board to allow skirts to be removed as part of a punishment."
                complete if undress_rule > 0

            step 3:
                text "Sentence Amy to a Private Punishment."
                show if undress_rule > 0 and amy_second_punish

            step 4:
                text "Spy on Amy's room again."
                show if amy_sex_chat

            step 5:
                text "Find out Amy's source of regular pain - Speak with her in the sports centre on Tuesday morning."
                show if amy_spy3
                complete if amy_abs_seen

            step 6:
                text:
                    "Find out Amy's source of constant humiliation - Speak with her in the sports centre on Tuesday morning." if not amy_met
                    "Find out Amy's source of constant humiliation - Track down the magazine she posed topless for." if amy_met and not amys_pictures_seen
                    "Find out Amy's source of constant humiliation - Spy on her room again another night." if amys_pictures_seen
                show if amy_spy3
                complete if amy_spy6

            step 7:
                text "Punish Amy in class without her skirt to see how she reacts."
                show if amy_spy3
                complete if amy_tickled

            step 8:
                text "Find out Amy's source of regular pleasure - Patrol the halls and find out what Amy gets up to between lessons."
                show if amy_spy3
                complete if amy_tia1

            step 9:
                text "Catch Amy misbehaving and sentence her to a private punishment."
                show if amy_tia1 and amy_tickled and amy_spy6 and amy_abs_seen

            step 10:
                text "Spy on Amy's room again."
                show if amy_spy5

            step 11:
                text "Purchase chastity panties online."
                show if amy_tia2
                complete if have_chastity

            step 12:
                text "Purchase a cane (optional)."
                show if amy_tia2
                complete if have_cane

            step 13:
                text "Convince the school board to allow you to punish the girls yourself."
                show if amy_tia2
                complete if men_cp

            step 14:
                text "Patrol the halls and look out for Amy misbehaving."
                show if men_cp and have_chastity and amy_tia2

            step 15:
                text "Punish Amy and make her wear chastity panties."
                show if amy_faye

            step 16:
                text "Spy on Amy and Debbie in the dorm room shower."
                show if amy_chastity1

            step 17:
                text "Resist Amy's attempts to get you to remove her underwear for one whole week. [amy_chastity_count] days resisted."
                show if amy_spy8

            step:
                text "You've reached the end of Amy's story line for this update."
                show if amy_ass_fucked

    ########################################

        quest:
            name "Maid for Punishment"
            category "Students"
            pic "mfp.png"
            keyword "mfp"

            description "Harriet Rose is a smart and savvy young woman, who claimed to have run a successful company before being forced back to school. Whilst spying on the girl's dorms you observed Harriet pressuring another student into giving her homework answers in exchange for chocolate. Harriet, it seems, was then selling these answers to other girls in exchange for cash. You had noticed the girl's average grades have been falling recently. Could this be one of the causes? You will need to deal with Harriet's criminal enterprise as soon as possible. You will also need to devise a suitably harsh punishment to make sure the girls understand just how important their grades are."

            show_cond mfp_start_quest

            step 1:
                text "Knowing Harriet's guilt won't be enough to stop her, you'll need to catch her red handed with sufficient evidence to prove her crimes to the school board so she can be suitably punished. {b}Patrol the halls during the week{/b} and keep an eye out for Harriet."

            step 2:
                text:
                    "You spotted Harriet selling cigarettes to Charlotte. Clearly, she is getting supplies from someone off-campus. You can't bust Harriet until you find her source. {b}Patrol the halls during the week{/b} and follow Harriet to find her source." if priti_cafe_cake_01
                    "You spotted Harriet selling cigarettes to Charlotte. Clearly, she is getting supplies from someone off-campus. If you knew where Harriet was meeting her source you could follow her. Perhaps you might overhear something while the girls are eating lunch. {b}Visit the cafeteria at lunchtime{/b}."
                show if charlotte_smoking4

            step 3:
                text "It turns out that Harriet is buying cigarettes, alcohol and underwear from Samantha's sister, Lily. Now you know her source, it's time to make your move and bust the whole affair wide open. You've seen her hanging around the sports centre lockers on Monday and Friday afternoons and suspect she stashes all her contraband there. A thorough search of her person is in order. {b}Perform a body search on Harriet{/b}."
                show if harriet_lily

            step 4:
                text "When searching Harriet's bag you found all the evidence you need to prove to the school board the seriousness of her crimes. Now you'll be able to convince the school board of the need for serious punishment. {b}Wait for the next school board meeting.{/b}."
                show if harriet_body_search2

            step 5:
                text "The school board agreed to a new form of punishment, one reserved for the most serious offenders. Harriet will be made to act as a maid for the other girls in the evenings and weekends. The other girls will be given permission to punish her if she does not comply. {b}Teach a class and announce Harriet's new punishment.{/b}."
                show if harriet_board_discussed

            step 6:
                text "You made a big announcement to let the other girls know about Harriet's new punishment. You should spy on the dorms to see how she is reacting to her new punishment. She normally hangs around in Liz's room. {b}Spy on Liz's room.{/b}."
                show if harriet_maid

            step 7:
                text:
                    "Harriet is slacking off from her punishment by taking advantage of Priti's timid nature. You need to help Priti become more confident and assertive so she can stand up to Harriet. {b}Advance Priti's storyline{/b}" if priti_harriet_maid_01
                    "Harriet is clearly unhappy about her new punishment, but you won't know if it's effective until you see another student punish her. Perhaps if you are able to improve Priti's confidence enough she might be able to finally stand up to Harriet. {b}Advance Priti's storyline.{/b}."
                show if harriet_maid_liz_room
                complete if priti_h_tempt2

            step:
                text "You have given permission for the other girls to spank Harriet if she does not comply with her punishment. You will need to examine Harriet's body regularly for bruising to make sure the other girls are not abusing their power over her. {b}Examine Harriet's naked body at the next school board meeting.{/b}."
                show if harriet_maid
                complete if harriets_body_inspection

            step:
                text "You've reached the end of Harriet's story line for this update."
                show if harriets_body_inspection and priti_h_tempt2

    ########################################

        quest:
            name "The Accidental Nudist"
            category "Students"
            pic "tan.png"
            keyword "tan"

            description "Emily lost her towel at the beach and had to pretend to be a nudist to avoid a punishment for streaking. You decided that it would be a good idea to open an official school nudist area. First though you wanted to run the idea past Sally."

            show_cond liz_emily_nudist

            step 1:
                text "Speak with Sally in the men's changing rooms on a weekday afternoon."

            step 2:
                text "Summon Emily and Sally using the phone in your office."
                show if sally_emily1

            step 3:
                text "Spy on Liz's room to see what Emily tells her friends."
                show if sally_emily2

            step:
                text "You've reached the end of Emily's story line for this update."
                show if emily_sally_spy

    ########################################

        quest:
            name "The Hostess with Mostess"
            category "Students"
            pic "thwtm.png"
            keyword "thwtm"

            description "Cassandra is constantly getting in trouble. Whether it's by using her phone in class or simply by being disrespectful to her teachers. When questioned about her bad attitude Cassandra explained that she has no intention in working hard at school expecting that her good looks will win her a wealthy husband to provide for her. Realising that you may have found a way to manipulate her into behaving, you offered to help her in her goal of meeting her prince charming in exchange for her good behaviour in class. Meanwhile, Mr Mykock emailed, informing you that some of the school's wealthy financial backers wanted a tour of the school and wished to be shown around by a student. You realised that with the right training Cassandra would perfect for the role."

            show_cond cass_smile2

            step 1:
                text "Catch Cassandra misbehaving in class and give her a private punishment in your office (you may need to unlock additional punishment methods by following other girls storylines or through changing rules at the school board)."

            step 2:
                text "Spy on Cassandra in Debbie's Room."
                show if cass_flirt

            step 3:
                text "Observe Cassandra's behaviour in Class."
                show if cass_flirt2
                complete if cass_boast

            step 3:
                text "Observe Cassandra's behaviour while patrolling the halls."
                show if cass_flirt2
                complete if cass_attention

            step 3:
                text "Observe Cassandra's behaviour in the shower room."
                show if cass_flirt2
                complete if cass_shower_seen

            step 6:
                text "Convince the school board to allow you to punish the girls yourself (follow the main quest A Man's Work)."
                show if cass_weakness_discovered

            step 7:
                text "Visit the sport centre in the afternoon and give Cassandra a public punishment."
                show if men_cp and cass_weakness_discovered

            step 8:
                text "Spy on Cassandra's room and see how she is recovering from her punishment."
                show if cass_gym_paddled

            step 9:
                text "Teach a class and see if Cassandra's behaviour has improved."
                show if cass_comfort_seen

            step 10:
                text "Punish Cassandra in your office and take humiliating photographs of her."
                show if cassandra_camera_effect2

            step 11:
                text "Spy on Cassandra in the dorms."
                show if cass_flirt3

            step 12:
                text "Teach a class and speak with Cassandra."
                show if cass_flirt4

            step 13:
                text:
                    "Punish Cassandra in your office and use the vibrator on her (requires board approval for punishing girls in their underwear)" if undress_rule < 2
                    "Punish Cassandra in your office and use the vibrator on her"
                show if cass_bma

            step 14:
                text "Purchase a new dress for Cassandra to wear on your date."
                show if cass_date1

            step 15:
                text:
                    "Speak with Cassandra before class and rearrange your date." if cass_date_fail
                    "Wait until Saturday evening for your date wih Cassandra."
                show if have_red_dress and cass_date1

            step 16:
                text "Spy on Debbie's room."
                show if cass_date_success

            step 17:
                text "Summon Cassandra to your office for punishment after school."
                show if cass_debbie_sex

            step:
                text "You've reached the end of Cassandra's story line for this update."
                show if cass_office_bj1

    ########################################

        quest:

            name "The Reluctant Rebel"
            category "Students"
            pic "trr.png"
            keyword "trr"

            description:
                "{k=-.5}You witnessed Priti giving her completed homework to another girl, Harriet, in exchange for chocolate. When confronted, Priti claimed to have a weakness for chocolate. You learned that she had been denied it by her overbearing mother, and that was why she could not control her cravings. However, you realised that this was the tip of the iceberg and there were much stronger desires than chocolate that Priti's mother had her repress. Priti's inability to act on her desires had left her weak-willed, timid and unable to stand up for herself. You resolved to help Priti by encouraging her to: a) rebel against the school and gain experience standing up to authority, and b) do things her mother wouldn't approve of to learn the nature of her repressed desires." if priti_bad
                "{k=-.5}You witnessed Priti giving her completed homework to another girl, Harriet, in exchange for chocolate. When confronted, Priti claimed to have a weakness for chocolate. You learned that she had been denied it by her overbearing mother, and that was why she could not control her cravings. However, you realised that this was the tip of the iceberg and there were much stronger desires than chocolate that Priti's mother had her repress. Priti's inability to act on her desires had left her weak-willed, timid and unable to stand up for herself. You resolved to help Priti by encouraging her to do things her mother wouldn't approve of and learn the nature of her repressed desires." if not priti_bad and priti_desires
                "{k=-.5}Mr Mykock told you that the school's owners had taken a particular interest in one of the students, Priti, and have offered you additional incentive to watch her being punished in our office. However, Priti is doing well at school and is top of you class, you have no real reason to punish her. Perhaps though she has some other character flaws that can be solved using your punishment methods."

            show_cond mykock_chapter2

            step 1:
                text "Observe Priti in class and watch for any misbehaviour."
                show if not priti_desires

            step 2:
                text "Observe Priti in a group activity. Check out the school play rehearsal on Wednesday evening in the gymnasium."
                show if priti_class1 and not priti_desires

            step 3:
                text "Observe Priti whilst patrolling the halls."
                show if priti_class1 and drama_new3 and not priti_desires

            step 4:
                text "Spy on Priti's room and find out what she was planning with Harriet."
                show if priti_harriet1 and not priti_desires

            step 5:
                text "Summon Priti to your office."
                show if priti_harriet2 and not priti_desires
                complete if priti_desires

            step 1:
                text:
                    "{b}Learning to Rebel{/b} - Priti's ability to rebel is improving and she's becoming a little more naughty. However, she still has a long way to go. {b}Catch Priti misbehaving in class and then punish her in your office.{/b}" if priti_desire_test3
                    "{b}Learning to Rebel{/b} - Priti is becoming a little more rebellious but she still needs more experience at being naughty. {b}Catch Priti misbehaving in class and then punish her in your office.{/b}" if priti_desire_test2 and priti_bad
                    "{b}Learning to rebel{/b} - If Priti can't rebel against you, how can she hope to do so against her mother? You, therefore, convinced Priti of the need to be naughty. {b}Catch Priti Misbehaving in class and punish her in your office.{/b}"
                complete if (priti_level_up1 and not (priti_desire_test2 and priti_bad)) or (priti_level_up2 and not priti_desire_test3) or priti_level_up3
                show if priti_bad and not trr_confident


            step 1 + priti_bad:
                text:
                    "{b}Understanding her Desires{/b} - Priti confessed to masturbating occasionally but says she always feel deep shame afterwards. You strongly believe that young women should never be ashamed of their sexual desires. You, therefore, decided to help rid her of that shame by having her masturbate in front of you. First, she will need to build up her confidence, you suggested she perform nude in the next play rehearsal as a way to improve her confidence {b}Go to the gymnasium on a Wednesday evening.{/b}." if priti_nude_play_request
                    "{b}Understanding her Desires{/b} - Priti confessed to masturbating occasionally but says she always feel deep shame afterwards. You strongly believe that young women should never be ashamed of their sexual desires. You, therefore, decided to help rid her of that shame by having her masturbate in front of you. Unfortunately, she lacks the confidence for that yet. {b}Wait until the next weekday morning to speak with Priti again.{/b}." if priti_desire_test3

                    "{b}Understanding her Desires{/b} - As you suspected, Priti has a repressed desire to feel sexy. She confessed that she's always wanted to wear a bikini on the beach but her mother wouldn't let her. You should buy her a new bikini and encourage her to wear it in public. {b}Purchase a string bikini and meet Priti on the beach on a Saturday afternoon.{/b}." if priti_desire_test2
                    "{b}Understanding her Desires{/b} - Priti is repressing her desires and they are bubbling up inside her waiting to explode. You urgently need to help her understand her needs and how to satisfy them. She says that she enjoyed your photoshoot together and that her mother certainly wouldn't have approved. Perhaps it's time for another photo shoot. {b}Meet Priti after the school play rehearsal on Wednesday evening in the gymnasium.{/b}." if (priti_good_photos or priti_ps_redo_done) and v12_intro
                    "{b}Understanding her Desires{/b} - Priti is repressing her desires and they are bubbling up inside her waiting to explode. You urgently need to help her understand her needs and how to satisfy them. You suspect that Priti is secretly proud of her body and has a repressed desire to show it off. You, therefore, concocted a ruse to have her pose for photos in your office to test your theory. {b}Purchase the new uniform samples online, then summon Priti to your office during school hours.{/b}" if v12_intro
                    "{b}Understanding her Desires{/b} - Priti needs help exploring her repressed desires. Wait for Priti to speak with you again."
                show if priti_desires and not trr_confident
                complete if (priti_desires1 and not priti_desire_test2) or (priti_itsy_bitsie and not priti_desire_test3) or priti_nude_play_seen


            step 2:
                text:
                    "With your help Priti is blossoming into the brave and confident woman you always knew she could be. For her final test, you asked her what she desired most. She asked to do another photoshoot together and to eat more cake. You suggested meeting at the cafeteria at the weekend when it will be empty. {b}Meet Priti at the cafeteria on Saturday afternoon.{/b}" if priti_desire_test6
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. She accepted responsibility and offered herself up for punishment. However, you saw no need to spank her. Her training has been successful and there is no need to correct her behaviour further. She is ready for your next test. {b}Test Priti's ability to act on her desire for the opposite sex.{/b}" if trr_refuse_punish
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. Although you didn't blame her for her actions you decided she needed to be punished. {b}Punish Priti and raise her level using the punishment system.{/b}" if priti_punish1 or priti_punish_anyway
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. {b}Wait until after school and decide on Priti's fate.{/b}" if trr_food_fight
                    "Thanks to all your help Priti is starting to become much more confident. She stood up for herself against Harriet and even gave her a spanking. You wonder what she will do next. {b}Wait and see what happens.{/b}" if trr_confident
                    "You have been teaching Priti that it's OK to touch herself. You gave her some sexy lingerie to wear in her dorm room at night to help get her in the right mood. {b}Spy on Priti's room.{/b}" if priti_desire_test5
                    "Test Priti's ability to act on her desire for self love. {b}Complete task 1 and test Priti's progress by summoning her to your office.{/b}" if have_night_gown
                    "Complete step 1 and then test Priti's ability to act on her desire for self love. {b}Purchase new nightwear for her to wear.{/b}" if priti_desire_test3
                    "You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Teach a class{/b} to see what changes she can come up with." if priti_harriet_maid_01
                    " You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Spy on her room in the evening{/b} to see how she is getting on with the task." if priti_desires9 and harriet_maid
                    " You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Spy on her room in the evening{/b} to see how she is getting on with the task. You will also need to {b}complete Harriet's questline{/b} to continue with Priti's story." if priti_desires9 and not harriet_maid
                    "Test Priti's ability to act on her desire to feel sexy. {b}Complete task 1 and test Priti's progress by summoning her to your office.{/b}" if priti_desire_test2
                    "Test Priti's confidence and ability to stand up to authority using the chocolate cake Patricia made for you. {b}Complete task 1 and test Priti's progress by summoning her to your office.{/b}" if have_cake
                    "Complete task 1 and then test Priti's confidence and ability to act on her desires. You're going to need to find something she really craves. {b}Open the cafeteria and speak with the manager about purchasing a chocolate cake.{/b}"
                show if priti_desires and not priti_bad and not trr_confident
                complete if False

            step 3:
                text:
                    "With your help Priti is blossoming into the brave and confident woman you always knew she could be. For her final test, you asked her what she desired most. She asked to do another photoshoot together and to eat more cake. You suggested meeting at the cafeteria at the weekend when it will be empty. {b}Meet Priti at the cafeteria on Saturday afternoon.{/b}" if priti_desire_test6
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. She accepted responsibility and offered herself up for punishment. However, you saw no need to spank her. Her training has been successful and there is no need to correct her behaviour further. She is ready for your next test. {b}Test Priti's ability to act on her desire for the opposite sex.{/b}" if trr_refuse_punish
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. Although you didn't blame her for her actions you decided she needed to be punished. {b}Punish Priti and raise her level using the punishment system.{/b}" if priti_punish1 or priti_punish_anyway
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. {b}Wait until after school and decide on Priti's fate.{/b}" if trr_food_fight
                    "Thanks to all your help Priti is starting to become much more confident. She stood up for herself against Harriet and even gave her a spanking. You wonder what she will do next. {b}Wait and see what happens.{/b}" if trr_confident
                    "You have been teaching Priti that it's OK to touch herself. You gave her some sexy lingerie to wear in her dorm room at night to help get her in the right mood. {b}Spy on Priti's room.{/b}" if priti_desire_test5
                    "Test Priti's ability to act on her desire for self love. {b}Complete task 1 and 2 and test Priti's progress in your office after a punishment.{/b}" if have_night_gown
                    "Complete steps 1 and 2 and then test Priti's ability to act on her desire for self love. {b}Purchase new nightwear for her to wear.{/b}" if priti_desire_test3
                    "You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Teach a class{/b} to see what changes she can come up with." if priti_harriet_maid_01
                    " You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Spy on her room in the evening{/b} to see how she is getting on with the task." if priti_desires9 and harriet_maid
                    " You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Spy on her room in the evening{/b} to see how she is getting on with the task. You will also need to {b}complete Harriet's questline{/b} to continue with Priti's story." if priti_desires9 and not harriet_maid
                    "Test Priti's ability to act on her desire to feel sexy. {b}Complete task 1 and test Priti's progress in your office after a punishment.{/b}" if priti_desire_test2
                    "Test Priti's confidence and ability to stand up to authority using the chocolate cake Patricia made for you. {b}Complete task 1 and test Priti's progress in your office after a punishment.{/b}" if have_cake
                    "Complete tasks 1 and 2 and then test Priti's confidence and ability to act on her desires. You're going to need to find something she really craves. {b}Open the cafeteria and speak with the manager about purchasing a chocolate cake.{/b}"
                show if priti_bad and not priti_desires and not trr_confident
                complete if False

            step 3:
                text:
                    "With your help Priti is blossoming into the brave and confident woman you always knew she could be. For her final test, you asked her what she desired most. She asked to do another photoshoot together and to eat more cake. You suggested meeting at the cafeteria at the weekend when it will be empty. {b}Meet Priti at the cafeteria on Saturday afternoon.{/b}" if priti_desire_test6
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. She accepted responsibility and offered herself up for punishment. However, you saw no need to spank her. Her training has been successful and there is no need to correct her behaviour further. She is ready for your next test. {b}Test Priti's ability to act on her desire for the opposite sex.{/b}" if trr_refuse_punish
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. Although you didn't blame her for her actions you decided she needed to be punished. {b}Punish Priti and raise her level using the punishment system.{/b}" if priti_punish1 or priti_punish_anyway
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. {b}Wait until after school and decide on Priti's fate.{/b}" if trr_food_fight
                    "Thanks to all your help Priti is starting to become much more confident. She stood up for herself against Harriet and even gave her a spanking. You wonder what she will do next. {b}Wait and see what happens.{/b}" if trr_confident
                    "You have been teaching Priti that it's OK to touch herself. You gave her some sexy lingerie to wear in her dorm room at night to help get her in the right mood. {b}Spy on Priti's room.{/b}" if priti_desire_test5
                    "Test Priti's ability to act on her desire for self love. {b}Complete tasks 1 and 2 and test Priti's progress in your office.{/b} You can do this either after her punishment or by summoning her with the phone on your desk." if have_night_gown
                    "Complete steps 1 and 2 and then test Priti's ability to act on her desire for self love. {b}Purchase new nightwear for her to wear.{/b}" if priti_desire_test3
                    "You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Teach a class{/b} to see what changes she can come up with." if priti_harriet_maid_01
                    " You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Spy on her room in the evening{/b} to see how she is getting on with the task." if priti_desires9 and harriet_maid
                    " You decided to test Priti's ability to act on her desire to feel sexy by telling her to make some alterations to her uniform. {b}Spy on her room in the evening{/b} to see how she is getting on with the task. You will also need to {b}complete Harriet's questline{/b} to continue with Priti's story." if priti_desires9 and not harriet_maid
                    "Test Priti's ability to act on her desire to feel sexy. {b}Complete tasks 1 and 2 and test Priti's progress in your office.{/b} You can do this either as punishment or by summoning her with the phone on your desk." if priti_desire_test2
                    "Test Priti's confidence and ability to stand up to authority using the chocolate cake Patricia made for you. {b}Complete tasks 1 and 2 and test Priti's progress in your office.{/b} You can do this either after her punishment or by summoning her with the phone on your desk." if have_cake
                    "Complete tasks 1 and 2 and then test Priti's confidence and ability to act on her desires. You're going to need to find something she really craves. {b}Open the cafeteria and speak with the manager about purchasing a chocolate cake.{/b}"
                show if priti_bad and priti_desires and not trr_confident
                complete if False

            step 1:
                text "Thanks to all your help Priti is starting to become much more confident. She stood up for herself against Harriet and even gave her a spanking. You wonder what she will do next. {b}Wait and see what happens.{/b}"
                show if trr_confident

            step 2:
                text:
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. She accepted responsibility and offered herself up for punishment. However, you saw no need to spank her. Her training has been successful and there is no need to correct her behaviour further. She is ready for your next test. {b}Test Priti's ability to act on her desire for the opposite sex.{/b}" if trr_refuse_punish
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. Although you didn't blame her for her actions you decided she needed to be punished. {b}Punish Priti and raise her level using the punishment system.{/b}" if priti_punish1 or priti_punish_anyway
                    "Priti stood up for herself against a bully but inadvertently started a major food fight in the process. {b}Wait until after school and decide on Priti's fate.{/b}"
                show if trr_food_fight

            step 3:
                text "With your help Priti is blossoming into the brave and confident woman you always knew she could be. For her final test, you asked her what she desired most. She asked to do another photoshoot together and to eat more cake. You suggested meeting at the cafeteria at the weekend when it will be empty. {b}Meet Priti at the cafeteria on Saturday afternoon.{/b}"
                show if priti_desire_test6

            step:
                text "You've reached the end of Priti's story line for this update."
                show if priti_69

    ########################################

        quest:
            name "Pride and President"
            category "Students"
            pic "info_pap.png"
            keyword "pap"

            description "Maxine's self-appointed position as Student President and her demands on behalf of the students have the potential to interfere with your plans for this school. You must find leverage, to take advantage of something she is passionate about to keep her in her place."

            show_cond maxine_office_reminder

            step 1:
                text "Donate generously to Maxine, to show your dedication to charity. You often see her when on patrol."
                complete if mr_donation > 119

            step 2:
                text "Check what Maxine is up to in the dorms at night. You've seen her hanging around in Rachel's room before."
                complete if max_mp_nd

            step 3:
                text "Pass time in your office by watching porn and wait for Maxine to show up."
                complete if maxine_uw1

            step 4:
                text "Wait for Maxine to approach you with a proposal."
                show if maxine_uw1 and mr_donation > 119

            step 5:
                text "Wait for a response from Mr Mykock to Maxine's proposal."
                show if maxines_charity_request

            step:
                text "Recruit additional students to enrol at the school who might be comfortable showing off their bodies."
                show if maxine_fundraiser_prestart
                complete if jasmine_student

            step:
                text "Find an appropriate photographer by advancing the quest: {i}[mykock.name]{/i}"
                show if maxine_fundraiser_prestart
                complete if ada_voyeur
            step:
                text "Find current students who need to be more comfortable showing off their bodies. Encourage Lucy to do more while cleaning your flat."
                show if maxine_fundraiser_prestart
                complete if lucy_hj_offer

            step:
                text "Find current students who need to be more comfortable showing off their bodies. Finish Priti's story line."
                show if maxine_fundraiser_prestart
                complete if priti_69

            step:
                text "Find current students who need to be more comfortable showing off their bodies. Observe Liz closely in class."
                show if maxine_fundraiser_prestart
                complete if liz_fingered_class

            step:
                text "Find current students who need to be more comfortable showing off their bodies. Help Alice with her studying difficulties."
                show if maxine_fundraiser_prestart
                complete if alice_paper3

            step:
                text "Find current students who need to be more comfortable showing off their bodies. Help Rachel with her body image issues."
                show if maxine_fundraiser_prestart
                complete if rachel_pet

            step:
                text "Enough girls seem ready so you can bring Maxine's proposal to a board vote. Be sure the {color=#df7ac4}{b}Horniness{/b}{/color} of the school is at 14 or higher."
                show if jasmine_student and lucy_hj_offer and priti_69 and liz_fingered_class and alice_paper3 and rachel_pet and maxine_fundraiser_prestart and max_mp_nd and ada_voyeur

            step:
                text "Wait for the board meeting next Friday."
                show if maxine_fundraiser_seen

            step:
                text "You've reached the end of Maxine's story line."
                show if pp_minimal


        # Blank quest

        quest:
            keyword "blank_quest"
            show_cond False

        if called:
            return


################################################################
#                                                              #
#  ███████╗ ██████╗██████╗ ███████╗███████╗███╗   ██╗███████╗  #
#  ██╔════╝██╔════╝██╔══██╗██╔════╝██╔════╝████╗  ██║██╔════╝  #
#  ███████╗██║     ██████╔╝█████╗  █████╗  ██╔██╗ ██║███████╗  #
#  ╚════██║██║     ██╔══██╗██╔══╝  ██╔══╝  ██║╚██╗██║╚════██║  #
#  ███████║╚██████╗██║  ██║███████╗███████╗██║ ╚████║███████║  #
#  ╚══════╝ ╚═════╝╚═╝  ╚═╝╚══════╝╚══════╝╚═╝  ╚═══╝╚══════╝  #
################################################################


# These variables contains the last quest shown
default main_quest_viewing = blank_quest
default staff_quest_viewing = blank_quest
default students_quest_viewing = blank_quest

# Only useful to not have ultra long lines of code.
define q_tab = {"Main":1,"Staff":2,"Students":3}
define q_view_var = {"Main":"main_quest_viewing","Staff":"staff_quest_viewing","Students":"students_quest_viewing"}

default quest_to_see_next = blank_quest

# This screen will displayed the quest at the left and called the screen which display the right page. Need the category of quest you want to display.
screen quest_screen_main(category="",quest_to_show=quest_to_see_next if type(quest_to_see_next) is Quest_ else blank_quest):

    $ quest_to_show = quest_to_show*quest_to_show.can_show

    tag menu
    zorder 5
    modal True

    default cat = quest_to_show.category or category or "Main"
    default quest_part = 0
    default page = quest_pages(quest_to_show | eval(q_view_var[cat]),"handwritten_sa",13,0)[1]+1

    on "show" action [ SetVariable(q_view_var[cat],quest_to_show | eval(q_view_var[cat])),
                       SetVariable("quest_to_see_next",blank_quest)]


    add "q_tab" + str(q_tab[cat]) + ".png"


    $ quest = eval(q_view_var[cat])
    if type(quest) is not Quest_ or not quest.can_show:
        $ quest = (quests_to_show(cat) or [blank_quest])[0]
    $ quest = search_quest(quest.keyword)

    use CIQ_screen_ui
    use CQ_close_button

    textbutton "Main"     text_style "board_text"  sensitive cat != "Main"     action [Play("audio", "audio/turn_page.ogg"),  SetScreenVariable("cat","Main"),SetScreenVariable("page",quest_pages(eval(q_view_var["Main"]),"handwritten_sa",13,0)[1]+1)] xcenter 265 ypos 114
    textbutton "Staff"    text_style "board_text"  sensitive cat != "Staff"    action [Play("audio", "audio/turn_page2.ogg"), SetScreenVariable("cat","Staff"),SetScreenVariable("page",quest_pages(eval(q_view_var["Staff"]),"handwritten_sa",13,0)[1]+1)] xcenter 456 ypos 114
    textbutton "Students" text_style "board_text"  sensitive cat != "Students" action [Play("audio", "audio/turn_page3.ogg"), SetScreenVariable("cat","Students"),SetScreenVariable("page",quest_pages(eval(q_view_var["Students"]),"handwritten_sa",13,0)[1]+1)] xcenter 650 ypos 114

    # This Vbox displays the quest at the left.
    vbox:
        spacing 10
        xpos 230 ypos 190
        xmaximum 390

        for i in quests_to_show(cat):
            $ is_link = quest != i
            textbutton "\u2022 " + __(i.name) style "board" sensitive is_link action [SetScreenVariable("quest_part",0),SetVariable(q_view_var[cat], i),SetScreenVariable("page",quest_pages(i,"handwritten_sa",13,0)[1]+1)]
            if len(i.parts_to_show)>1 and not is_link:
                vbox xpos 30:
                    for j in range(len(i.parts_to_show)):
                        textbutton str(j+1) + ") " + __(i.parts_to_show[j].quest_part_name) style "board_sub" sensitive quest_part != j action [SetScreenVariable("quest_part",j),SetScreenVariable("page",quest_pages(i,"handwritten_sa",13,j)[1]+1)]

    # Here we display the right page.
    if quest and quest.can_show:
        use quest_text(quest,page,quest_part)



# This screen is the right page of the screen. Contains the quest displayed.
screen quest_text(quest,page,quest_part):
    python:

        q_spacing = 13
        notestyle = "handwritten_sa"

        step_list, pages, page_turn = quest_pages(quest,notestyle,q_spacing,quest_part)

    if pages:
        use notespage_screen2(pages,page)

    text quest.name style "handwritten_c" xpos 760 ypos 215 xmaximum 520

    vbox xpos 760 ypos 265 xmaximum 520:
            spacing q_spacing
            if quest.description:
                text quest.description style "handwritten_sa"
            for i in range(page_turn[min(len(page_turn)-1,page-1)],page_turn[min(len(page_turn)-1,page)]):
                text str(step_list[i]) style notestyle

    if quest.pic:
        add quest.pic xalign 0 yalign 0 #Tinker with these numbers as needed to change where the image goes


# This screen displayed the page change button if we need it. Only displayed if there are more than one page.
# shows "=>" if we're not at the last page and "<=" if we're not on the first one.
screen notespage_screen2(pages,page):
    if page - 1:
        textbutton "{b}<=={/b}" style "hand_nav" xpos 665 ypos 180 action [SetScreenVariable("page",page-1)]
    textbutton "{b}" + str(page) + " of " + str(pages+1) + "{/b}" style "hand_nav" xpos 665 ypos 207
    if page - 1 != pages:
        textbutton "{b}==>{/b}" style "hand_nav" xpos 665 ypos 235 action [SetScreenVariable("page",page+1)]


screen q_case(quest,brand_new = False):
    # c_case and inv_case are in screens custom.rpy
    zorder 3
    modal True
    key "K_RETURN" action Return("no_click")
    $ new_quest = quest
    add "inv_briefcase.png":
        xcenter 960
        ycenter 540
    add "quest_blank.png" at alert_size:
        xcenter 960
        ycenter 600
    if new_quest:
        add new_quest.pic at alert_size:
            xcenter 960
            ycenter 600
    vbox:
        xcenter 960
        ycenter 500
        offset (20,20)
        xmaximum 600
        spacing 5
        first_spacing 80
#        text __("Quest Log Update") style "handwritten_c" size 36
        text __("Quest Log Update") style "briefcase_text" size 48
        if brand_new:
            text __("A new quest has been added!") style "handwritten_sa" size 20
        else:
            text __("You have an update") style "handwritten_sa" size 20
        if new_quest:
            text new_quest.name style "handwritten_sa" bold True size 20
        text __("Click to view the full quest log") style "handwritten_sa" size 20

    button:
        xysize(1920,1080)
        action [Hide("q_case"),Return("no_click")]
    button:
        xysize(583,629) # without case (576,324)
        xcenter 960
        ycenter 540
        action [Hide("q_case"),Return("click")]



######################################################
#                                                    #
#  ██╗      █████╗ ██████╗ ███████╗██╗     ███████╗  #
#  ██║     ██╔══██╗██╔══██╗██╔════╝██║     ██╔════╝  #
#  ██║     ███████║██████╔╝█████╗  ██║     ███████╗  #
#  ██║     ██╔══██║██╔══██╗██╔══╝  ██║     ╚════██║  #
#  ███████╗██║  ██║██████╔╝███████╗███████╗███████║  #
#  ╚══════╝╚═╝  ╚═╝╚═════╝ ╚══════╝╚══════╝╚══════╝  #
######################################################


label q_log(l_quest="",is_new=False):

    if l_quest:
        if not l_quest.can_show :
            return
        play sound "audio/scribble.ogg"
        $ quest_to_see_next = l_quest
        call screen q_case(l_quest,is_new)
        if _return == "click":
            show screen quest_screen_main(quest_to_show=l_quest)
    else:
        play sound "audio/scribble.ogg"
        show info_box onlayer screens
        centered "{size=23}Your Quest Log has been updated.{/size}"
        hide info_box onlayer screens
    return


################################################################################
#                                                                              #
#  ███████╗██╗   ██╗███╗   ██╗ ██████╗████████╗██╗ ██████╗ ███╗   ██╗███████╗  #
#  ██╔════╝██║   ██║████╗  ██║██╔════╝╚══██╔══╝██║██╔═══██╗████╗  ██║██╔════╝  #
#  █████╗  ██║   ██║██╔██╗ ██║██║        ██║   ██║██║   ██║██╔██╗ ██║███████╗  #
#  ██╔══╝  ██║   ██║██║╚██╗██║██║        ██║   ██║██║   ██║██║╚██╗██║╚════██║  #
#  ██║     ╚██████╔╝██║ ╚████║╚██████╗   ██║   ██║╚██████╔╝██║ ╚████║███████║  #
#  ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝   ╚═╝   ╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚══════╝  #
################################################################################


init python:

    def no_quest():
        for cat in q_view_var:
            if type(eval(q_view_var[cat])) is str:
                try:
                    setattr(store,q_view_var[cat],search_quest(eval(q_view_var[cat])))
                except:
                    setattr(store,q_view_var[cat],blank_quest)
            if not eval(q_view_var[cat]) and quests_to_show(cat):
                setattr(store,q_view_var[cat],quests_to_show(cat)[0])
        return

    config.python_callbacks.append(no_quest)


    def quests_to_show(category):
        return [x for x in quests_in_category(category) if x.can_show]

    # Returns the list of steps to show for the quest given, the number of pages it'll take to show them and when to change pages.
    # notestyle is the style we'll use for the text and q_spacing the spacing between two steps.
    def quest_pages(quest,notestyle,q_spacing,quest_part):

        if not quest or type(quest) is not Quest_:
            return [0,0]

        step_list = quest.parts_to_show[quest_part].steps_to_show
        quest_desc_y = get_size(Text(quest.description,style=notestyle,xmaximum =520))[1]

        y_total = 0
        pages = 0
        page_turn = [0]
        i = 0

        for i in range(len(step_list)):
            text_to_show = Text(str(step_list[i]),style=notestyle,xmaximum =520)
            y_total += get_size(text_to_show)[1]
            if y_total > 740 - quest_desc_y - q_spacing:
                page_turn.append(i)
                pages += 1
                y_total = get_size(text_to_show)[1]
            else:
                y_total += q_spacing
        page_turn.append(i+1)

        return (step_list,pages,page_turn)



    def get_quest_category(quest_name):
        for i in quests:
            if str(i) == quest_name or i.keyword== quest_name:
                return i.category
        return ""



##############################################################
#                                                            #
#   ██████╗██╗      █████╗ ███████╗███████╗███████╗███████╗  #
#  ██╔════╝██║     ██╔══██╗██╔════╝██╔════╝██╔════╝██╔════╝  #
#  ██║     ██║     ███████║███████╗███████╗█████╗  ███████╗  #
#  ██║     ██║     ██╔══██║╚════██║╚════██║██╔══╝  ╚════██║  #
#  ╚██████╗███████╗██║  ██║███████║███████║███████╗███████║  #
#   ╚═════╝╚══════╝╚═╝  ╚═╝╚══════╝╚══════╝╚══════╝╚══════╝  #
##############################################################


init -100 python:

    # Give it a category, it'll return all the quests in this category
    def quests_in_category(category):
        return [x for x in quests if x.category == category]

    # You give a name or a keyword, it'll return the corresponding quest.
    def search_quest(name):
        return ([x for x in quests if x.name == name or x.keyword == name] or [""])[0]


    # Quest_ class is basically my lazyness to redo my quest class. I didn't want to change all to add parts in quests
    # so I imagined a way to not have to :)
    class Quest_():

        def __init__(self,parts):

            self.parts = []

            for i in range(len(parts)):

                self.parts.append(Quest(name     = parts[i]["name"],
                                     description = parts[i]["description"],
                                     pic         = parts[i]["pic"],
                                     category    = parts[i]["category"],
                                     steps       = parts[i]["steps"],
                                     show_cond   = parts[i]["show_cond"],
                                     stop_show   = parts[i]["stop_show"],
                                     part_cond   = parts[i]["part_cond"],
                                     quest_part_name = parts[i]["quest_part_name"],
                                     keyword     = parts[i]["keyword"]))

                if parts[i]["keyword"]:
                    setattr(store,parts[i]["keyword"],self)

        def __mul__(self,other):
            global blank_quest
            if not other:
                return blank_quest
            return self

        def __or__(self,other):
            global blank_quest
            if self == blank_quest:
                return other
            return self

        @property
        def parts_to_show(self):
            p = []
            for i in self.parts:
                if i.part_can_show:
                    p.append(i)
            return p

        # Since we don't give a name, description, etc.. to our Quest_ class but our Quest class,
        # If we ask the Quest_ class one of these args, it'll return the value for the first part of the quest.
        @property
        def category(self):
            return self[0].category

        @property
        def keyword(self):
            return self[0].keyword

        @property
        def description(self):
            return self[0].description

        @property
        def pic(self):
            return self[0].pic

        @property
        def steps(self):
            return self[0].steps

        @property
        def show_cond(self):
            return self[0].show_cond

        @property
        def stop_show(self):
            return self[0].stop_show

        @property
        def name(self):
            return self[0].name

        # To access any part of our quest, instead of having Quest_.part[i] we can call it with Quest_[i]
        def __getitem__(self,key):
            return self.parts[key]

        @property
        def description(self):
            return self[0].description

        def __repr__(self):
            return str(self[0])

        @property
        def steps_to_show(self):
            return self[0].steps_to_show

        @property
        def can_show(self):
            return self[0].can_show

    # Here my first quest class, when I hadn't think of parts in quests.
    class Quest():

        def __init__(self,name,description,pic,category,steps,show_cond,stop_show,part_cond,quest_part_name,keyword):

            self.name = name
            self.descriptions = description
            self.pic = pic
            self.category = category
            self.show_cond = show_cond
            self.stop_show = stop_show
            self.part_cond = part_cond
            self.quest_part_name = quest_part_name
            self.keyword = keyword or self.name

            self.steps = []

            for i in reversed(range(len(steps))):
                self.steps.append(Quest_step(steps[i],self.steps[-1] if i+1 < len(steps) else False))

            self.steps.reverse()

        @property
        def part_can_show(self):
            try:
                return eval(self.part_cond)
            except (SyntaxError, NameError, TypeError, ZeroDivisionError): pass
            return False

        # Since we can have multiple descriptions, it'll check the first with a True condition
        @property
        def description(self):
            for desc in self.descriptions:
                try:
                    if eval(desc["condition"]):
                        return __(eval(desc["text"]))
                except (SyntaxError, NameError, TypeError, ZeroDivisionError): pass
            return ""

        # if we have str(quest), it'll return the name of the quest
        def __repr__(self):
            return __(self.name)

        # Checks in all the steps which ones can be shown and return a list of them
        @property
        def steps_to_show(self):
            q = []

            for step in self.steps:
                if step.can_show:
                    q.append(step)

            return q

        # return True if the quest have to be shown, False if not
        @property
        def can_show(self):
            try:
                if eval(self.show_cond) and not eval(self.stop_show):
                    return True
            except (SyntaxError, NameError, TypeError, ZeroDivisionError): pass
            return False

    # And finally our last class for the steps
    class Quest_step():

        def __init__(self,step,next_step):

            self.show_cond = step["show if"]
            self.complete_cond = step["complete if"]
            self.name = step["name"]
            self.number = step["number"].strip()
            self.texts = step["text"].copy()
            self.next_step = next_step


        @property
        def can_show(self):
            try:
                if eval(self.show_cond):
                    return True
            except (SyntaxError, NameError, TypeError, ZeroDivisionError): pass
            return False

        # Here we check if we have a "complete if" condition. If not, it'll check if the next step is shown.
        # If yes, this step is complete. I created it like this so we don't have to write a "complete if" condition for all the steps.
        @property
        def complete(self):
            if self.complete_cond == "Next":
                return self.next_step.can_show if self.next_step else False
            try:
                return eval(self.complete_cond)
            except (SyntaxError, NameError, TypeError, ZeroDivisionError): pass
            return False

        # When we want to transform our step into a string, it'll check for all the texts we gave him the first one
        # with a True condition and return the text associated.
        def __str__(self):
            for i in self.texts:
                try:
                    if eval(i["condition"]):
                        return self.text_complete(i["text"])
                except (SyntaxError, NameError, TypeError, ZeroDivisionError): pass
            return ""

        # If the quest is completed, it display a little ☑ before it and grey the quest, else, it shows the number (or string or nothing) associated with the step before it.
        def text_complete(self,text):
            if self.complete:
                return "{color=#606060}{font=DejaVuSans.ttf}\u2611{/font} "+ __(eval(text)) + "{/color}"
                #return "{color=#606060}"+ str(self.number) + ") "+ text + " COMPLETE{/color}"

            try:
                n = eval(self.number)
            except (SyntaxError, NameError, TypeError, ZeroDivisionError):
                try:
                    n = eval(self.number.split(" if")[0])
                except (SyntaxError, NameError, TypeError, ZeroDivisionError):
                    n = ""
            return ((str(n) + ") ") if n else "") + __(eval(text))
