:raphael_leave_party_to_work
  if !Managers.Villagers.isVillagerOnParty('Raphael')
    return
  end

  Raphael "I'm sorry <name>, but I need to go to work now. See you later."
  include remove_raphael_from_party

:raphael_leave_party_to_sleep
  if !Managers.Villagers.isVillagerOnParty('Raphael')
    return
  end
  
  Raphael "I'm sorry <name>, but it's getting late. I need to go to bed. See you tomorrow."
  include remove_raphael_from_party

:remove_raphael_from_party
  fade out
  wait 30
  js $gameParty.removeVillager('Raphael');
  fade in
  wait 30

:raphael_follower_event
  # #ToDo this needs to be moved to the curupira internal-mod
  if Switches.raphaelTalkedAboutForest
    if !Switches.talkedToCurupira
      Raphael ("What's wrong, <name>? Do you want to continue the investigation some other time?", "Yes", "No, Let's Continue", "No, Let's Continue")
      if response == "Yes"
        Raphael "Okay, see you later then!"
        include remove_raphael_from_party
        return
      end

      return
    end
  end

  Raphael ("What's wrong?", "I have to go", "Nevermind", "Nevermind")
  if response == "I have to go"
    Raphael "Okay, see you later then!"
    include remove_raphael_from_party
    return
  end

:raphael_join_party
  js Managers.Villagers.moveVillagerToParty('Raphael');


:invite_raphael_to_hang_out
  Player "Hello Raphael, are you free to hang out right now?"

  if Managers.Villagers.isVillagerAvailableToHangOut('Raphael')
    Raphael "Sure! I got nothing better to do."
    include raphael_join_party
  else
    if Managers.Time.hour >= 12
      Raphael "I would love to, but right now I have to work."
    else
      Raphael "It's too early to hang out now, invite me again later."
    end
  end

