label w02d01_s07:

    scene black
    with fade

    call theme_tense from _call_theme_tense
    scene kitchen_bg lookatsink nighttime:
        subpixel True
        zoom 1.1
        xalign 0.0 yalign 0.5
        0.5
        parallel:
            ease 15.6 xalign 1.0
            ease 15.6 xalign 0.0
            repeat
    show denise_pd kitchen night unhappy:
        subpixel True
        zoom 1.2
        xalign 0.0 yalign 0.5
        0.5
        parallel:
            ease 4.6 xalign 1.0
            ease 4.6 xalign 0.0
            repeat
    with fade

    "[denise_name] starts pacing up and down while you try to figure out what is wrong."

    $ w02d01_s07_checked_wireless_yourself = False
    $ w02d01_s07_checked_internet_yourself = False
    $ w02d01_s07_checked_modem_yourself = False

    label w02d01_s07_diagnose:
    menu:
        "Check the wireless." if not w02d01_s07_checked_wireless_yourself:
            $ w02d01_s07_checked_wireless_yourself = True
            "You verify the connection with your wireless router."
            "The signal is strong, so wireless seems okay."

        "Check the internet." if not w02d01_s07_checked_internet_yourself:
            $ w02d01_s07_checked_internet_yourself = True
            "You turn off the wireless on your phone and enable the data connection."
            "You can load pages, albeit excruciatingly slow out here in the sticks."
            "You are happy to learn that civilization as we know it didn't collapse while you weren't looking."

        "[abgreen]Check the modem." if not w02d01_s07_checked_modem_yourself:
            $ w02d01_s07_checked_modem_yourself = True
            "You look at the modem provided by your ISP."
            "It flashes several angry lights at you."

    if not (w02d01_s07_checked_wireless_yourself and w02d01_s07_checked_internet_yourself and w02d01_s07_checked_modem_yourself):
        jump w02d01_s07_diagnose

    show kitchen_bg lookatsink nighttime:
        subpixel True
        0.5
        ease 3.2 zoom 1.0 xalign 0.5
    show denise_pd kitchen night neutral:
        subpixel True
        0.5
        ease 3.2 zoom 1.0 xalign 0.5
    with dissolve
    deni "What's wrong with it?"

    show denise_pd kitchen night smile
    with dissolve
    deni "Did you fix it?"

    default w02d01_s07_annoyed_count = 0
    menu:
        "[abgreen]Be patient.":
            pc "I found out where the problem is."
            pc "That's the first step, angel."
        "Be annoyed.":
            $ w02d01_s07_annoyed_count += 1
            pc "Working on it, angel."
            pc "I'll let you know when I'm done."

    show denise_pd kitchen night happy
    with dissolve
    deni "Please, hurry."

    show denise_pd kitchen night unhappy
    deni "The live stream is about to start and the connection is too slow without Wi-Fi."

    show kitchen_bg lookatsink nighttime:
        subpixel True
        0.5
        ease 2.3 zoom 1.1 xalign 0.0
        parallel:
            ease 15.6 xalign 1.0
            ease 15.6 xalign 0.0
            repeat
    show denise_pd kitchen night unhappy:
        subpixel True
        0.5
        ease 2.3 zoom 1.2 xalign 0.0
        parallel:
            ease 4.6 xalign 1.0
            ease 4.6 xalign 0.0
            repeat
    with dissolve

    $ w02d01_s07_cycled_power = False
    $ w02d01_s07_checked_connections = False

    label w02d01_s07_try_fix_modem:

    menu:
        "Check cables." if not w02d01_s07_checked_connections:
            $ w02d01_s07_checked_connections = True
            "You check the cables and the connectors on the modem."
            "At first glance, they look fine."
            "You wriggle the connectors a bit and press them down just to be sure."
            "It doesn't seem to help."

        "Cycle the power." if not w02d01_s07_cycled_power:
            $ w02d01_s07_cycled_power = True
            "You turn off the power to the modem, wait for a bit, then turn it on again."
            "After a minute or two of displaying different patterns of blinks, flashes and loops, the same angry lights flash back at you that did before."
            "That didn't solve the problem."

    if not (w02d01_s07_cycled_power and w02d01_s07_checked_connections):
        jump w02d01_s07_try_fix_modem

    menu:
        "Look up the pattern.":
            "You search for the pattern of flashing lights on the internet, using your excruciatingly slow data connection."
            "You find several people that experienced the same problem."
            "The solution seems to be calling your ISP and having them reset the connection on their end."

    show kitchen_bg lookatsink nighttime:
        subpixel True
        0.5
        ease 3.2 zoom 1.0 xalign 0.5
    show denise_pd kitchen night smile:
        subpixel True
        0.5
        ease 3.2 zoom 1.0 xalign 0.5
    with dissolve

    deni "Did you fix it now?"

    show denise_pd kitchen night neutral
    with dissolve
    deni "They must have started the live stream already."

    show denise_pd kitchen night unhappy
    with dissolve
    deni "I'm missing it!"

    menu:
        "[abgreen]Be patient.":
            pc "I need to call the internet people."
            pc "It'll be fixed soon, angel."
        "Be annoyed.":
            $ w02d01_s07_annoyed_count += 1
            pc "I'm working as fast as I can, angel."
            pc "You are just going to have to be patient."

    show kitchen_bg lookatsink nighttime:
        subpixel True
        0.5
        ease 2.3 zoom 1.1 xalign 0.0
        parallel:
            ease 15.6 xalign 1.0
            ease 15.6 xalign 0.0
            repeat
    show denise_pd kitchen night angry:
        subpixel True
        0.5
        ease 2.3 zoom 1.2 xalign 0.0
        parallel:
            ease 4.6 xalign 1.0
            ease 4.6 xalign 0.0
            repeat
    with dissolve
    deni "Gaaah...!"

    default w02d01_s07_denise_left = False
    default w02d01_s07_call_count = 0
    label w02d01_s07_recall_helpdesk:

    menu:
        "Call helpdesk.":
            "You call the helpdesk of your ISP..."

    $ w02d01_s07_call_count += 1
    if w02d01_s07_call_count >= 3:
        "...but this time, you bite your tongue and do exactly as directed."
        if not w02d01_s07_denise_left:
            show kitchen_bg lookatsink nighttime:
                subpixel True
                0.5
                ease 3.2 zoom 1.0 xalign 0.5
            show denise_pd kitchen night angry:
                subpixel True
                0.5
                parallel:
                    ease 3.2 zoom 1.0
                parallel:
                    ease 1.8 xanchor 0.0 xpos 1.0
            play audio [ "<silence 1.8>", "sounds/doorslam.ogg" ]
            "[denise_name] is fed up waiting and leaves, slamming the door behind her."

            $ w02d01_s07_denise_left = True
        "As it turns out, the problem required a reset of the connection on their end, after which everything starts to work again."

        jump w02d01_s07_end_of_conversation

    "...and work your way through a menu where each of the options you need seems to be the last one on the list the computer reads out."
    "After entering your 12 digit customer number for the third time, you are informed you will be connected to a technical support professional."

    pc "Finally."

    if not w02d01_s07_denise_left:
        show denise_pd kitchen night happy
        with dissolve
        deni "It's working?"
        pc "Not yet, angel."

        show denise_pd kitchen night angry
        with dissolve
        deni "Awww...!"

    "You spend about 15 minutes on hold."
    "You are disconnected."
    "You call again, work your way through the menu again, and are put on hold again."
    "After 25 minutes, you are connected to a technical support professional."

    "The technical support professional asks you to provide your 12 digit customer number."
    "You do so."
    "Then, you spend a few minutes explaining the problem, what you did to diagnose it, and the solution."

    "The technical support professional asks you to perform some simple steps to test the Wi-Fi."

    $ w02d01_s07_mnu_its_fine = "Wi-Fi's fine."
    $ w02d01_s07_spoke_its_fine = "I checked already, the Wi-Fi's fine."
    $ w02d01_s07_compliance_text = "You comply, and spend several minutes performing the checks the technical support professional asks you to perform."
    $ w02d01_s07_nottheproblem_text = "The technical support professional informs you your wireless doesn't seem to be the problem."
    call w02d01_s07_perform_task from _call_w02d01_s07_perform_task

    if w02d01_s07_need_redial:
        $ w02d01_s07_need_redial = False
        jump w02d01_s07_recall_helpdesk

    "The technical support professional asks you to check the cables on your modem."

    $ w02d01_s07_mnu_its_fine = "Cables are fine."
    $ w02d01_s07_spoke_its_fine = "I checked already, the cables are fine."
    $ w02d01_s07_compliance_text = "You comply, and spend several minutes checking the various cables and connections the technical support professional asks you to check."
    $ w02d01_s07_nottheproblem_text = "The technical support professional informs you your cables and connectors do not seem to be the problem."
    call w02d01_s07_perform_task from _call_w02d01_s07_perform_task_1

    if w02d01_s07_need_redial:
        $ w02d01_s07_need_redial = False
        jump w02d01_s07_recall_helpdesk

    "The technical support professional asks you to cycle the power on your modem."

    $ w02d01_s07_mnu_its_fine = "Already did that."
    $ w02d01_s07_spoke_its_fine = "I did that already, didn't solve the problem."
    $ w02d01_s07_compliance_text = "Prompted by the technician, you spend several minutes turning the device off, then on, then waiting for the lights to stabilize into the familiar angry pattern."
    $ w02d01_s07_nottheproblem_text = "The technical support professional informs you the reset did not solve the problem."
    call w02d01_s07_perform_task from _call_w02d01_s07_perform_task_2

    if w02d01_s07_need_redial:
        $ w02d01_s07_need_redial = False
        jump w02d01_s07_recall_helpdesk

    if not w02d01_s07_denise_left:
        show denise_pd kitchen night neutral
        with dissolve
        deni "This is taking forever!"

        show denise_pd kitchen night unhappy
        with dissolve
        deni "If it takes any longer, the live stream will be over!"

        menu:
            "[abgreen]Be patient.":
                pc "We're working on it, angel."
                pc "It'll be done soon, promise."
            "Be annoyed.":
                $ w02d01_s07_annoyed_count += 1
                pc "[denise_adr_pc_as_cap] is on the phone, angel."
                pc "Just go find something else to do."

        show denise_pd kitchen night angry
        with dissolve
        deni "Arg!"

        show kitchen_bg lookatsink nighttime:
            subpixel True
            0.5
            ease 3.2 zoom 1.0 xalign 0.5
        show denise_pd kitchen night angry:
            subpixel True
            0.5
            parallel:
                ease 3.2 zoom 1.0
            parallel:
                ease 1.8 xanchor 0.0 xpos 1.0
        play audio [ "<silence 1.8>", "sounds/doorslam.ogg" ]
        "She leaves the room, slamming the door behind her."

        $ w02d01_s07_denise_left = True

        "You turn your attention back to the call."

    "The technical support professional asks you to describe the lights and flash patterns."

    $ w02d01_s07_mnu_its_fine = "Already looked it up."
    $ w02d01_s07_spoke_its_fine = "I looked it up already, you can solve the problem by resetting the connection on your end."
    $ w02d01_s07_compliance_text = "You spend several minutes to describe if a light is dark, lit up, or flashing, and if the flashing is fast or slow, for each light in turn."
    $ w02d01_s07_nottheproblem_text = "The technical support professional informs you the problem is on their end."
    call w02d01_s07_perform_task from _call_w02d01_s07_perform_task_3

    if w02d01_s07_need_redial:
        $ w02d01_s07_need_redial = False
        $ w02d01_s07_redialed = True
        jump w02d01_s07_recall_helpdesk

    "The technical support professional puts you on hold for several seconds..."
    "...then comes back to you to inform you that they reset the connection and the problem should now be resolved."
    "The lights on the modem settle into a mostly green and stable pattern."

    label w02d01_s07_end_of_conversation:

    "From the bedroom, you hear [denise_name] shouting out."
    with hpunch
    deni "{size=-8}Yes!!! Finally!{/size}"

    "The technical support professional asks you to confirm the problem is solved."

    default w02d01_s07_ended_call = False
    label w02d01_s07_wrap_up_call:
    menu:
        "Refuse.":
            "You refuse."
            "The technical support professional insists."
        "[abgreen]Comply.":

            $ w02d01_s07_ended_call = True

            call music_fade_slow from _call_music_fade_slow_141
            "You inform the technical support professional the problems seems solved."
            "The technical support professional asks if you have any more questions."
            "You have not."
            "The technical support professional ask you if you are interested to take part in a survey at the end of the call."
            "You are not."
            "The technical support professional thanks you for calling and ends the call."
        "Get rude.":

            $ w02d01_s07_ended_call = True
            call music_fade_slow from _call_music_fade_slow_142
            "You start to express your current feelings about the technical support professional and the company they work for in a very honest way."
            "The technical support professional informs you they are not paid enough to listen to your abuse and breaks the connection."
            "You do not feel inclined to call them back and apologize."
        "Hang up.":

            $ w02d01_s07_ended_call = True
            call music_fade_slow from _call_music_fade_slow_143
            "You hang up."

    if not w02d01_s07_ended_call:
        jump w02d01_s07_wrap_up_call

    scene black
    with fade

    "Feeling rather drained from this encounter, you decide to crash on the couch."
    "[denise_name] seems to have retired to the bedroom, happy to finally see what's left of her live stream."
    "And after looking at some TV for a few minutes you realize you have absolutely no idea what you're watching."
    "You decide to call it a day and go to bed as well."

    return

label w02d01_s07_perform_task:
    default w02d01_s07_called_shibboleet = False
    $ w02d01_s07_refuse = 0
    $ w02d01_s07_complied = False
    $ w02d01_s07_need_redial = False

    label w02d01_s07_perform_task_again:
    menu:
        "'[w02d01_s07_mnu_its_fine]'" if w02d01_s07_refuse == 0:
            $ w02d01_s07_refuse += 1
            pc "[w02d01_s07_spoke_its_fine]"
            "The technical support professional insists."

        "Refuse." if w02d01_s07_refuse > 0:
            if w02d01_s07_refuse > 3:
                "The technical support professional regretfully informs you they cannot help you if you will not comply, and hangs up."
                $ w02d01_s07_need_redial = True
                return

            $ w02d01_s07_refuse += 1
            "You refuse."
            "The technical support professional insists."

        "Get rude." if w02d01_s07_refuse > 1:
            "You start to express your current feelings about the technical support professional and the company they work for in a very honest way."
            "The technical support professional informs you they are not paid enough to listen to your abuse and breaks the connection."
            $ w02d01_s07_need_redial = True
            return
        "[abgreen]Comply.":

            "[w02d01_s07_compliance_text]"
            $ w02d01_s07_complied = True

        "'Shibboleet!'" if (w02d01_s07_refuse > 1) and not w02d01_s07_called_shibboleet:
            $ w02d01_s07_called_shibboleet = True
            pc "Shibboleet!"
            "The technical support professional seems confused for a minute, but quickly recovers and reiterates the request."

    if not w02d01_s07_complied:
        jump w02d01_s07_perform_task_again

    if w02d01_s07_need_redial:
        return

    "[w02d01_s07_nottheproblem_text]"
    menu:
        "'I could have told you that.'" if w02d01_s07_refuse==0:
            pc "I could have told you that."
            "The technical support professional does not reply to that."
        "'I told you so.'" if w02d01_s07_refuse>0:
            pc "I told you so, didn't I?"
            "The technical support professional does not reply to that."
        "[abgreen]Say nothing.":
            pc "..."

    return
