def get_vinyl(st: State):
    vinyl_disk.touch(st)
    sleep(3.5)
    skip(2)
    forward.do()
    center.click()
    sleep(18.5)
    intercourse(st, square=pos_four)
def get_derpy(st: State):
    Location([forward, rotate_left]).go(st)
    center.click()
    skip(2)
    center.click()
    skip()
    sleep(4)  # hearing
    center.click()
    skip(2)
    agree()
    skip()
    sleep(29)  # saving derpy & intro
    intercourse(st, square=pos_three, wait=13.2, click=0)
def intercourse(st: State, square: Pos, wait=0.8, click=0):
    """
    Manage clicking at the right time and places during the intercourse scene(s).
    Also update the state as needed.
    """
    square.click()
    sleep(6.6)
    pos_exclamation.click()
    sleep(wait)
    skip(click)
    sleep(.4)
    pos_end.click()
    sleep(5)
    pos_next.click()
    sleep(2.6)
    st.location = home
    st.day += 1
def get_trixie1(st: State):
    assert (st.pony == Pony.HORN)
    st.assert_moon()
    trixie.touch(st)  # Zoom
    break_shield_trixie(st)
    skip()
    pos_trixie_square.click()
    sleep(3.2)
    skip(5)
    sleep(3)
    skip(5)
    sleep(3)
    intercourse(st, square=pos_four, wait=3.2, click=5)
def encounter_trixie(st: State, action):
    if action == 'twilight':
        if 'trixie2' not in st.encounter:
            st.encounter['trixie2'] = 'twilight'
        else: pass
    elif action == 'trixie':
        if 'trixie1' not in st.encounter:
            sleep(.2)
            skip(7)
            st.encounter['trixie1'] = True
        elif 'trixie2' not in st.encounter: pass
        elif st.encounter['trixie2'] == 'trixie': pass
        else:
            st.encounter['trixie2'] = 'trixie'
            sleep(0.8)
            skip(2)
            sleep(3.5)
            skip()
def get_fluttershy(st: State):
    fluttershy_window.touch(st)
    skip(7)
    sleep(3.4)
    skip()
    fluttershy_lamp.touch(st)
    sleep(2.6)
    skip(2)
    sleep(.6)
    accept()  # Why?
    skip(8)
    sleep(.6)
    accept()  # Cheer up
    skip(2)
    sleep(.6)
    agree()  # Let's f**k
    skip(4)
    sleep(.6)
    accept()  # Want it?
    skip(4)
    sleep(3)
    intercourse(st, square=pos_four, wait=2.4, click=4)
def get_pinkie_pie(st: State):
    cake_house.go(st)
    forward.do()
    sleep(10)
    intercourse(st, square=pos_four, wait=2)
def break_shield_trixie(st: State):
    if 'trixie_shield' not in st.encounter:
        center.click()
        sleep(.8)
        skip(1)
        st.encounter['trixie_shield'] = True