Imported and refactored PlayerCharacter from the old branch