# The script of the game goes in this file.

$ ending = "Ending # 1"

# Set up LayeredImage Sprites
layeredimage flandre:

    always "flandre_base"

    yoffset -250

    group face auto:
        attribute happy default

layeredimage remilia:

    always "remilia_base"

    yoffset -250

    group face auto:
        attribute happy default

image invite = "invite.png"

# Declare characters used by this game. The color argument colorizes the
# name of the character.

define f = Character("Flandre Scarlet", what_outlines=[( 0, "#b4404a", 2, 2 )] )
define f_nvl = Character("Flandre Scarlet", kind=nvl, what_outlines=[( 0, "#b4404a", 2, 2 )])
define r = Character("Remilia Scarlet", what_outlines=[( 0, "#b4404a", 2, 2 )] )
define r_nvl = Character("Remilia Scarlet", kind=nvl, what_outlines=[( 0, "#b4404a", 2, 2 )])
define k = Character("Kono", what_outlines=[( 0, "#b4404a", 2, 2 )] )
define k_nvl = Character("Kono", kind=nvl, what_outlines=[( 0, "#b4404a", 2, 2 )])
define u = Character("", what_outlines=[( 0, "#b4404a", 2, 2 )] )
define u_nvl = Character("", kind=nvl, what_outlines=[( 0, "#b4404a", 2, 2 )])
define nar_nvl = nvl_narrator

image splash_anim_1:

    "gui/renpy-logo.png"
    xalign 0.5 yalign -0.5
    ease_quad 5.0 xalign 0.5 yalign 0.5 rotate 360
    linear 2.0 zoom 1.0

label splashscreen:

    scene black

    $ persistent.caption = True

    ## The first time the game is launched, players can set their accessibility settings.
    if not persistent.caption:

        menu:

            "Do you want sound captions on? They describe music and sound effects in text.{fast}"

            "On":

                $ persistent.sound_captions = True

            "Off":

                pass

        menu:

            "Do you want image captions on? They describe game visuals in text.{fast}"
            "On":

                $ persistent.image_captions = True

            "Off":

                pass

        "These options can be changed at any time in the menu.{fast}"

        ## This message will not appear in subsequent launches of the game when
        ## the following variable becomes true.
        $ persistent.caption = True

    ## Here begins our splashscreen animation.
    show splash_anim_1
    
    ## The first time the game is launched, players cannot skip the animation.
    if not persistent.seen_splash:
        
        ## No input will be detected for the set time stated.
        ## Set this to be a little longer than how long the animation takes.
        $ renpy.pause(7.5, hard=True)
 
        $ persistent.seen_splash = True
    
    ## Players can skip the animation in subsequent launches of the game.
    else:
 
        if renpy.pause(7.5):
 
            jump skip_splash

    scene black
    with fade
 
    label skip_splash:
 
        pass
 
    return

## The game starts here.

label start:

    "Prologue: Night"

    "{i}The performer who transformed at will.{/i}"
    "{i}Her life could no longer continue still.{/i}"
    "{i}Named after a legend, her life went downhill,{/i}"
    "{i}When she was taken by the Scarlet Devil.{/i}"

    menu:

        "Begin":
            pass

    # Show a background. This uses a placeholder by default, but you can
    # add a file (named either "bg room.png" or "bg room.jpg") to the
    # images directory to show it.

    stop music fadeout 2.0

    scene dungeon with fade

    u "My first memories..."

    u "...were set in brimstone and fire."

    play music "Brimstone.mp3" fadein 2 fadeout 2

    $ shake()

    $ renpy.pause(1, hard=True)

    u "Burnt, bare, broken."

    $ shake()

    u "The flames' lick was worse than any hundreds of lashings."

    u "Yet it refused to die."

    u "I cried out for my mother."

    $ shake()

    u "I cried for her forgiveness."

    u "And she embraced me."

    $ shake()

    u "She embraced me in the flames."

    u "I watched her burn."

    u "I felt her ashen skin."

    u "And her eyes, lit by a flame."

    k "A bright, ruby red."

    stop music fadeout 2.0

    scene village with Fade(0.5,4,0)

    $ renpy.pause(3.5, hard=True)

    play audio "clapping.mp3"

    k "Thank you for listening to today's rakugo performance."
    
    "Woodcutter" "That was interesting."

    "Florist" "So intense! Not at all like your usual rakugo."

    "Kono chuckles."

    k "Haha, I was just trying a different style of story."

    "Florist" "That's our Kono alright."

    "Fisherman" "Always {i}\"trying something different\"{/i}!"

    "Woodcutter" "If this is different, then I don't want to know what's normal!"

    "Kono smiled at the chattering of the restuarant."

    play audio "sepette.mp3"

    "???" "{i}Go to Misty Lake.{fast}{/i}"

    k "?"

    k "Who said that?"

    "???" "{i}When the moon hangs low, and the sun's beams have pierced the heavens in a golden spear...{/i}"

    "???" "{i}I will meet you by the end of its hilt.{/i}"

    k "..."

    k "{i}That voice...{/i}"

    menu:
            "...it unnerved me.":

                k "{i}It was like the grinding of an axe against a stone.{/i}"
                k "{i}Grabbing me by the throat.{/i}"
                $ remilia_relationship = 5

            "...it sounded so sweet.":

                k "{i}It was like the sweet call of a songbird.{/i}"
                k "{i}Begging me to follow.{/i}"
                $ remilia_relationship = 15

    stop sound fadeout 1.0

    "???" "Another one of your fine works, Konohana-hime."

    "Kono turned around."

    k "You know I don't like being called that Rinnosuke-san."

    k "Still, I didn't expect to see you here."

    "Rinnosuke" "Hooh, well I don't come to the vilage very often."

    "This is Rinnosuke-san, the go-to-guy for weird outsider artifacts."

    "Rinnosuke" "That is, besides to see your performances."

    k "..."

    k "You wouldn't happen to know if anything special is happening today? Especially by Misty Lake?"

    "Rinnosuke" "Ah, today no."

    "Rinnosuke" "But now that you mention special..."

    "Rinnosuke" "Tomorrow is the summer solstice. Longest, hottest day of year."

    "Rinnosuke" "What, are you going to go to Misty Lake?"

    k "Mmm-"

    menu:
            "No.":

                k "I'd just be asking to pranked by a fairy."
                "Rinnosuke" "How sensible."
                $ rinnosuke_relationship = 30

            "Yeah.":

                "Rinnosuke" "Well, you better hope none of the fairies are there right about now."
                $ rinnosuke_relationship = 35

            "It's none of your buisness.":

                "Rinnosuke" "Suit yourself."
                $ rinnosuke_relationship = 20

    "Rinnosuke" "If you do see a fairy though, try this."
    "Rinnosuke hands over a strange metal object with a glass sphere in the middle."
    "Rinnosuke" "It's an electric lantern. Very bright."
    "Rinnosuke" "If you turn it on up close to a fairy, it might stop them for a little bit."

    k "Thank you."

    "Rinnosuke" "My pleasure."

    "Rinnosuke" "You know, your performance today was really something else."

    "Rinnosuke" "It's kind of familiar too..."
    
    "Rinnosuke" "Reminds me of a legend..."

    "Rinnosuke" "Anyways. I enjoyed it a lot."

    "Rinnosuke" "Stay safe."

    $ renpy.pause(1.5, hard=True)

    scene black with Fade(0.5,2,0)

    k "Despite my better logic telling me not to go..."

    k "...that it was a youkai trying lure me out to eat me..."

    k "I left for misty lake anyway."

    k "I don't know why."

    k "I just felt it was fate."

    $ renpy.pause(1.5, hard=True)

    scene dawn1 with Fade(0.5,2,0)

    play music "Brimstone.mp3" fadein 2 fadeout 2

    k "Wow. Not a fairy in sight."

    k "And it is pretty warm for dawn."

    k "So, where's the golden spear?"

    $ renpy.pause(1.0, hard=True)

    scene black with Dissolve(1)

    "???" "{i}Go to Misty Lake.{fast}{/i}"

    k "?"

    k "Who said that?"

    "???" "{i}When the moon hangs low, and the sun's beams have pierced the heavens in a golden spear...{/i}"

    "???" "{i}I will meet you by the end of its hilt.{/i}"

    $ renpy.pause(1.0, hard=True)

    scene dawn2 with Dissolve(1)

    k "I suppose I'll just have to wait."

    k "{i}sigh{/i}{nw}"

    $ renpy.pause(5, hard=True)

    k "What a beatuiful lake.{nw}"

    $ renpy.pause(4, hard=True)

    k "The sun's reflection against the water is so pretty.{nw}"

    play sound "boom.mp3"

    $ renpy.pause(3, hard=True)

    k "Almost like...{nw}"

    $ renpy.pause(2, hard=True)

    show remilia shadow

    r "A spear."

    "The Scarlet Devil picked up the young performer with immense strength."

    "At the same time, she was blocking the rising sun's rays using her spear Gungnir, casting herself in shadow."

    k "Aagh!"

    "Kono fumbled for the lantern Rinnosuke gave her, and turned it on."

    show remilia happy

    play music "sepette.mp3"

    r "Don't worry, my dear. You're safe with me."

    scene sky with Dissolve(0.5)

    "Remilia leapt into the sky with Kono in hand."

    k "..."

    "Kono couldn't speak."

    r "Kono was it?"

    k "Y-yes."

    k "From Konohanasakuya-hime."

    r "Ah, the goddess who set herself and her children on fire to prove their immortality."

    show remilia serious

    r "But Kono is such a bland name, don't you think?"

    k "..."

    k "?"

    r "Well, I suppose the story isn't bad."

    r "Full name's a mouthful though."

    r "Konohanasakuya-hime..."

    r "How about..."

    r "Sakuya?"

    k "!?"

    k "W-What?"

    r "Yes, I think you'll be Sakuya."

    k "..."
    
    scene outside with Dissolve(0.5)

    r "This is where you will serve me."

    "The sound of frantic footsteps could be heard from inside the mansion."

    show flandre:
        xalign -4.0
        yalign 1.0

    show flandre happy

    f "Hey sis!"

    f "Is she going to be our mom?"

    r "She'll be our maid, Flandre."

    r "This is Sakuya."

    menu:
            "Y-yes. Hello.":

                f "Hiya~!"
                $ remilia_relationship += 10
                $ flandre_relationship = 20

            "...":

                f "Sakuya's shy isn't she?"
                $ remilia_relationship += 0
                $ flandre_relationship = 15

    r "Anyways, this will be your new home."

    k "..."

    k "And with little more than a sigh..."

    "Kono-{nw}"

    "Sakuya fainted."

    $ renpy.end_replay()

label credits:
    
    # End Credits

    ## We hide the quickmenu for the End Credits so they don't appear at the bottom.
    $ show_quick_menu = False

    scene black with fade

    ## Find "End Credits Scroll" in screens.rpy to change text.
    call screen credits

    $ persistent.credits_seen = True

    # $ _game_menu_screen = "save"

    scene black
    with fade
    
    # Players can skip the credits in subsequent playthroughs of the game.
    label skip_credits:
 
        pass

    ## We re-enable the quickscreen as the credits are over.

    $ show_quick_menu = True

    ## Makes [result] work. This needs to be near the end of the game
    ## for it to work properly.
    $ percent()

    ## We display a screen that shows how much the player has seen and played of the game.
    show screen results

    if persistent.game_clear:

        pass

    else:

        if readtotal == 100:

            $ achievement.grant("Completionist")
            show devnotes_unlock at truecenter

            $ persistent.game_clear = True

            ## The game will show our text displayable so the player can read it
            ## And only continue when there is input
            pause

    # This ends the game.
    return
