
# Setting up the characters and their colours

define pleroma = Character("Pleroma", image="pleroma", who_color="#eda664")

define mc = Character("Unoriginal Main Character", who_color="#64abed")

define admin = Character("Administrator",who_color="#64abed")

define grumb = Character("Grumbulon", image="grumb",who_color="#e9a0d9")

define weeble = Character("Weeble", image="weeble",who_color="#64ed7b")

define lain = Character(name="Lain",who_color="#fcfcfc")


# A few variables needed along the game

default instance_name = "0"

default grumb_played = False

default weeble_played = False


# Music

default chill = "audio/chill.mp3"
default funny = "audio/funny.mp3"
default sad = "audio/sad.mp3"
default madness = "audio/madness.mp3"

# Sounds

default ding = "audio/ding.mp3"
default whoosh = "audio/whoosh.mp3"
default scratch = "audio/record-scratch.mp3"


init python:
    import re

    # simple url check so instances get checked before proceeding

    def check_instance(instance):

        try:
            instance = re.findall(r'([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?', instance)[0][0]
        except Exception as e:
            instance = "0"
        return instance                            




# The game starts here.

label start:

    stop music fadeout 5.0
    scene bg startup
    with fade
    pause 4.0

    lain "People use mastodon because they love the community. "
    
    lain "People use pleroma because they love me."

    pause 0.5
    scene bg room with dissolve
    pause 0.5
    play music chill loop fadein 4.5

    "You wake up in your bedroom earlier than usual."
    "You turn to your nightstand to see the red glowing numbers on your clock that read 12:36 PM."

    mc "Wow I'm up earlier than usual."
    mc "Today is the day I setup a pleroma instance."
    mc "I hope it's as cool as it sounds."

    "You make your way way to your desk where you turn on your ThinkPad™ laptop." 
    
    scene bg desk with dissolve
    pause 0.5
    scene bg desk light with dissolve
    pause 0.5

    "You recall browsing the /g/ board earlier that week and seeing a thread on the fediverse."
    
    "As a user put it:
    Fediverse is a based decentralized schizo-esoteric lain-pilled free-speech alternative platform for chads too wired for the typical soy-liberal pronoun cuck safespaces that most NPCs use these days."

    "You're not to sure what that means but the thread had a link to the pleroma install guide and you're already banned on twitter so you don't have anything to lose."


    "With all the prerequisites done, you go down the list of instructions until you're asked to input a domain name."

    mc "Hmmmm what was that domain I bought again?…"
    jump instance_choice


label instance_choice:
        
        
    $instance_name = renpy.input(prompt="URL: ")
    $instance_name = str(check_instance(instance_name))
    

    if instance_name == "0":
    
        mc "Oops, that's not right, let's try again."  
        jump instance_choice
    
    if instance_name == "waifuism.life":

        mc "I'm  not a weeb, what was it again?"
        jump instance_choice

    if instance_name == "bungle.online":

        mc "No no, that one was taken."
        jump instance_choice        

    if instance_name == "freecumextremist.com":
    
        mc "Seriously? Nah nah, this isn't right that couldn't be."
        jump instance_choice


    mc "Oh that's right, [instance_name]."

    "You start your pleroma instance and no errors pop up. You've done it!"
    
    "You've successfully installed pleroma! Now you just need to create your account."

    mc "I'll just keep it simple and name myself admin."
    mc "Not like I had a more creative option"

    #{MC's name changes to Admin}

    "You put in [instance_name] into your Brave Browser and see your brand new instance."

    scene bg desk pl #[Scene switches to a close up of the computer screen with the default pleroma page on it]

    admin "Wow kinda looks like a more retro aesthetic twitter."
    admin "Now let me test out this account."

    "You log into your account and before you can do much else something weird happens."

    show pleroma normal
    with dissolve
    stop music fadeout 1.0
    play sound ding
    show pleroma normal talk
    with dissolve

    pleroma "Greetings Admin-kun..."

    show pleroma normal
    with dissolve


    menu:
        "What the hell is this a bug?!":
            pass
        "Oh god I'm going schizo…":
            pass
        


    show pleroma normal smug 
    with dissolve
    pause 0.5

    show pleroma normal smug talk
    with dissolve

    pleroma "I'm sorry I didn't mean to scare you."

    play music chill fadein 5.0

    show pleroma normal talk
    with dissolve

    pleroma "You can call me Pleroma-Tan. I am the software your instance is running on."

    show pleroma normal
    with dissolve

    admin "When I decided to join the fediverse and create an instance I didn't expect my software to be this.."


    show pleroma normal smug talk
    with dissolve
    
    pleroma "…Cute?"

    show pleroma normal
    with dissolve

    admin "W-w-weird!"

    show pleroma handup talk
    with dissolve

    pleroma "No worries Admin-kun. The fediverse is very different from other social sites and I'm here to help you learn."

    show pleroma handup
    with dissolve

    admin "And why do you keep calling me admin?"

    show pleroma normal talk
    with dissolve

    pleroma "Isn't that your name on the account?"

    pleroma "It wouldn't be wise to put your full name out on the fediverse or the internet in general."

    show pleroma normal
    with dissolve

    admin "I suppose"

    show pleroma normal talk
    with dissolve

    pleroma "Besides I don't need your full name…"

    show pleroma normal smug talk
    with dissolve

    pleroma "Unless you want me to have your name, but I think you're supposed to buy me a ring first."

    show pleroma smug
    with dissolve

    admin "What?!"

    "You're not sure how to feel about all this. You just wanted a chill social media to post some memes on and now you have this weird fox lady saying embarrassing things."

    show pleroma normal talk
    with dissolve

    pleroma "Anyway are you ready to join the fediverse?"

    show pleroma normal
    with dissolve

    "You look at your screen skeptically. Why was there no mention of Pleroma-tan in the /g/ thread or the install documents? Is this a prank? Did you install the wrong thing? Everything about this just seemed very sketchy to you."

    "On the other hand, this is probably the most female attention you've had in years so it wouldn't hurt to indulge a little bit. Besides it's just computer software. It's not real or anything."

    admin "Sure I'm ready"

    show pleroma hands grin
    with dissolve
    pleroma "Great!"
    stop music fadeout 1.0
    "..."
    pause 1.5
    play sound whoosh
    scene bg enterfedi with vpunch
    play music funny

    " Before you could process what is happening, Pleroma-tan extends a hand out from the computer screen and grabs onto you."
    "You let a scared yelp as she pulls you to the screen."
    "Your adrenaline spikes as your mind is trying to process what is happening and how it's even possible."
    "Despite all the shock you can't help but look down and think."
    "Wow her hands are soft."

    "End of chapter 1"
    
    return

    jump chapter2
    
