page "start"
  restore_fetish_config
  goto_page "intro"
end

page "intro"
  image "school"

  create_button :start, "Start New Game"
    goto_page "intro-start"
  end
  create_button :resume2, "Enter Maze Code"
    goto_page "intro-resume"
  end
  create_button :resume, "Resume Game"
    goto_page "intro-resume"
  end

  say "<c:primary>Welcome to the Girls Naughty School</c>"
  say "This tease contains a <c:secondary>fully customizable maze</c> which is generated by random. Every time you start a new game, the paths, rooms and goals of the maze are shuffled leading to a totally new experience every time."
  say "You can additionally <c:secondary>configure your fetishes and toys</c> you want to include in this tease. Rooms not fitting to your interests won't be included in the maze."
  say "I hope you have a lot of fun while discovering the maze and being teased again and again. :)"
  say "Have fun and <c:danger>**always play safe**</c>."
  say "**Disclaimer:** I don't own any of the images in this tease. If you want to be credited for an image or want it to be removed, please let me now. All characters are at least 18 years or older."

  goto_page "intro-menu"
end

page "intro-menu"
  remove_button :start
  remove_button :resume2
  remove_button :resume

  image "school"
  say "So, let's get started. What do you want to do?", mode: :instant
  say "Choose <c:primary>'Start New Game'</c> if this is your first time", mode: :instant
  say "Choose <c:secondary>'Enter Maze Code'</c> if you want to replay a game by a code you got", mode: :instant
  say "Choose <c:warning>'Resume Game'</c> if you paused a game earlier and want to resume it", mode: :instant
  choices
    choice "Start New Game", color: :primary
      goto_page "intro-start"
    end
    choice "Enter Maze Code", color: :secondary
      goto_page "intro-resume"
    end
    choice "Resume Game", color: :warning
      goto_page "intro-resume"
    end
  end
end

page "intro-start"
  remove_button :start
  remove_button :resume2
  remove_button :resume
  image "intro1"
  say "Nice! So you're new to this game?", mode: :instant
  say "Let's setup the game so it fits your interests as best as possible. It only takes a few minutes."
  button "Start configuration"
  goto_page "config-fetish"
end

page "intro-resume"
  remove_button :start
  remove_button :resume2
  remove_button :resume
  image "intro2"
  say "Please enter the code you received without any spaces or quotation marks or so."
  prompt :tmp_string
  if resume_by_code(tmp_string)
    image "intro3"
    say "The code is correct! You can resume your previous game! Please prepare yourself :)", mode: :instant
    say "Fetishes: <eval>gameListFetishes()</eval>", mode: :instant
    say "Toys: <eval>gameListToys()</eval>", mode: :instant

    choices
      choice "Start Game"
        goto_page "before-entrance"
      end
      choice "Cancel"
        goto_page "intro-menu"
      end
    end
  else
    say "Sorry but the code seems to be invalid. Please check again whether you entered the code correct"
  end

  goto_page "intro-menu"
end

page "next-room"
  end_of_room
end

page "school-intro"
  create_button :skiprules, "Skip intro"
    goto_page "school-after-intro"
  end

  image "intro5"
  say "Oh, hi! You must be the demon hunter they sent to us."
  say "Hmmm.. But.. You're a boy. So either your boss doesn't like you very much or they really didn't know."
  say "Why? You really don't know about this school?"
  image "intro4"
  say "Okay... Let me explain you everthing. However, stark stroking in the meantime..."
  start_stroke :slow
  say "So... This school is teaching girls to be naughty, dominant and sadistic. It's all about girls dominating boys.", mode: :instant
  wait 8s, mode: :normal
  say "Sometimes we invite boys here to be teased and punished as real test subjects and well... I guess every girl in this school will think that you are one of those test subjects and just use you however they like.", mode: :instant
  wait 10s, mode: :normal

  image "intro6"
  stop_stroke
  start_stroke :medium
  say "Well.. Nothing we can do about it, I guess... However, let me explain your job and the rules of the school.", mode: :instant
  wait 8s, mode: :normal
  say "1. You are a BOY at a girls school. <c:secondary>Do whatever you are asked to do</c>! I don't want anyone to know about our demon problem.", mode: :instant
  wait 10s, mode: :normal
  say "2. <c:secondary>Don't ever cum!</c> Boys are not allowed to cum in this school and girls are not allowed to let boys cum. IF you cum, ruin it and click on the button on the right.", mode: :instant
  wait 10s, mode: :normal
  say "3. If you ever <c:secondary>edge without being told to</c>, click on the matching button on the right.", mode: :instant
  wait 7s, mode: :normal
  if difficult > 2
    say "4. You can take a <c:secondary>short break of up to 10 seconds after every page</c> if you need to.", mode: :instant
  else
    say "4. You can take a <c:secondary>short break of up to 20 seconds after every page</c> if you need to.", mode: :instant
  end
  wait 7s, mode: :normal
  say "5. Most of the time you can take a <c:secondary>break of 10 seconds after an edge</c>, if not told otherwise.", mode: :instant
  wait 7s, mode: :normal
  say "However, **always** play safe and don't harm yourself.", mode: :instant
  wait 10s, mode: :normal

  image "intro7"
  start_stroke :fast
  say "Now, about your job in this school. I ordered a professional demon hunter so I guess that's you.", mode: :instant
  wait 10s, mode: :normal
  say "There are some demons hidden in this school. I know of <c:primary>**at least** #{difficult} demons</c>, so I want you to catch those #{difficult} demons and come back to the entrance of the school afterwards.", mode: :instant
  wait 10s, mode: :normal
  say "It should be easy for you, just find the demons, catch them and come back here.", mode: :instant
  wait 10s, mode: :normal

  image "intro3"
  start_stroke :very_fast
  say "I guess that's all I can tell you. So.. Good luck and see you later.", mode: :instant
  wait 10s, mode: :normal
  stop_stroke

  remove_button :skiprules
  goto_page "school-after-intro"
end

page "school-after-intro"
  stop_stroke
  remove_button :stop
  goto_page "before-entrance"
end

page "before-entrance"
  #create_button :debug, "Debug Menu"
  #  goto_page "debug"
  #end

  create_button :stop, "Edged or Came", color: :danger
    goto_page "stop"
  end

  create_button :pause, "Quit game"
    goto_page "pause"
  end

  create_button :share, "Share maze"
    goto_page "share"
  end

  goto_page "$mazeGoToEntrance()"
end

page "entrance"
  image "hallway"
  say "Welcome to the entrance of our school. What do you want to do?"

  choices
    choice "Finish Game"
      goto_page "finish"
    end 
    choice "Enter School Building"
    end
  end

  end_of_room
end

page "finish-failed"
  image "finish1"
  say "Oh! Sorry... But you only caught #{current_num_catch} demons yet, but you have to catch #{difficult} demons to finish the game here. Come back later."
  goto_page "$mazeResumeAfterMove()"
end

page "finish"
  if current_num_catch < difficult
    goto_page "finish-failed"
  end

  if bad_fairy
    goto_page "badfairy"
  end

  if room82 && toy_vibrator
    image "room82"
    say "Remember when you told me that you'd like to be forced to wear a vibrator for two hours? How about doing it right now?."
    say "Let's keep it simple: Attach your vibrator to your penis and activate it on lowest power. You may not cum during the whole time. You may take a break whenever you want, as many times as you want. However, the breaks don't count in the two hours. Only when the vibrator is active the timer goes down."
    choices
      choice "Finished the two hours"
        say "Great!! You can remove it now and finish the game."
      end
      choice "Not enought time for this"
        say "Oh... Too sad. Maybe next time then?"
      end
      choice "Cummed"
        say "What?? You were forbidden to cum! You don't have a good control over yourself. No cumming in the next two weeks for you."
        button "Finish game"
        goto_page "fail-end"
      end
    end
  end

  remove_button :shimakazecum
  remove_button :shimakazeedge
  remove_button :stop
  remove_button :debug
  remove_button :pause
  remove_button :share
  remove_button :latex14
  remove_button :skip

  image "finish2"
  say "Yes! I knew you could do it! Thank you so much for your hard work."
  say "I guess as reward I can let you cum."
  say "Why don't you ask one of your demons to let you cum? Who do you like to finish with?"

  create_button :stop, "Cummed"
    goto_page "stop-cum"
  end

  choices
    choice "Hestia", if: maze_goal_state("takagi") == "catch"
      goto_page "takagi-finish"
    end
    choice "Rem", if: maze_goal_state("rem") == "catch"
      goto_page "rem-finish"
    end
    choice "Shimakaze", if: maze_goal_state("shimakaze") == "catch"
      goto_page "shimakaze-finish"
    end
    choice "Zero Two", if: maze_goal_state("zero") == "catch"
      goto_page "zero-finish"
    end
    choice "Miku", if: maze_goal_state("miku") == "catch"
      goto_page "miku-finish"
    end
    choice "Promised Girls By Latex Girl", if: latex13_goal
      goto_page "glans-finish"
    end
    choice "Return To School", if: is_maze_mode
      goto_page "before-entrance"
    end
  end
end

page "fail-end"
  remove_button :shimakazecum
  remove_button :shimakazeedge
  remove_button :stop
  remove_button :debug
  remove_button :pause
  remove_button :share
  remove_button :latex14
  remove_button :skip

  if latex16
    goto_page "latex16-fail"
  end
  if cd21
    goto_page "cd21-fail"
  end

  goto_page "end"
end

page "end"
  remove_button :shimakazecum
  remove_button :shimakazeedge
  remove_button :stop
  remove_button :debug
  remove_button :pause
  remove_button :share
  remove_button :latex14
  remove_button :skip

  #create_button :support, "Watch Ad: Ahegao Tissue Boxes"
  #  goto_page "ad"
  #end

  image "end"
  say "<c:primary>Thank you for playing this tease!</c>"
  say "I hope you enjoyed playing this tease! Don't forget, that you can always replay this tease and the maze will be totally different each time you play."
  #say "<c:#666>If you really want to support me, you can still click on the button on the right :D</c>"
  say "If you enjoyed the tease and want to leave some feedback, compliments or notify me about bugs, just leave a quick rating and post a message to the boards:", mode: :instant
  say "<c:secondary>https://milovana.com/forum/viewtopic.php?t=23229</c>"
  say "Special thanks to all beta testers: boytoy84, joedit3, vyyr, Fatfuckdigger69, Roundhound, redditaddict420, qatguy, TTCart and others!"
  say "I hope I'll see you next time."
  if is_maze_mode
    say "By the way: You can share this exact maze with friends by using this code:", mode: :instant
    say "<eval>gameCodeGenerate(curMaze, false)</eval>", mode: :instant
  end

  button "Rate tease now."

  stop_tease
end
