Echo Hollow

Because Pr0n is the Highest Form of Art.

User Tools

Site Tools


libtf:documentation:api:grammar

LibTF.Util.yourHisHer( person, thirdPerson )

  • Arguments:
    • person: the person for which to return the adjective.
    • thirdPerson : True if output should be in third-person, or False if it should be in second-person.
  • Returns: (String) The appropriate adjective given the person's sex and thirdPerson.
  • Throws: Nothing.

If thirdPerson is True, returns “his”, “her”, or “their” depending on whether the given Person's femininity Transformable indicates that they are male, female, or androgynous respectively.

If thirdPerson is False, returns “your”. This is useful for when the same passage/code is intended to generate text for both the player character and NPCs.

// if Joe is male...
alert( "There is a fire on " + Util.yourHisHer(tf("joe"),true) + " head!" );
// prints "There is a fire on his head!"
// if Joe is female...
alert( "There is a fire on " + Util.yourHisHer(tf("joe"),true) + " head!" );
// prints "There is a fire on her head!"
// regardless of Joe's sex, if Joe is the player character and we pass thirdPerson=false...
alert( "There is a fire on " + Util.yourHisHer(tf("joe"),false) + " head!" );
// prints "There is a fire on your head!"

LibTF.Util.YourHisHer( person, thirdPerson )

This method is identical to .yourHisHer(), except that the first letter of the returned string is capitalized.

alert( Util.YourHisHer(tf("joe"),true) + " head is on fire!" );
// prints "His head is on fire!"

LibTF.Util.youHeShe( person, thirdPerson, youTheyVerb=null, heSheVerb=null )

  • Arguments:
    • person: the person for which to return the sentence fragment.
    • thirdPerson : True if output should be in third-person, or False if it should be in second-person.
    • youTheyVerb: optional verb to output on you/they choice.
    • heSheVerb: optional verb to output on he/she choice.
  • Returns: (String) A sentence fragment.
  • Throws: Nothing.

Chooses “he”, “she”, “they”, or “you” in the same way as .yourHisHer().

If a youTheyVerb has been included, it will be appended to the return value if “you” or “they” is chosen.

If no heSheVerb has been included, but “he” or “she” is chosen, then the youTheyVerb will have an “s” appended to it, and will be appended to the return value. Otherwise, if a heSheVerb is included, then it will be appended instead.

alert( LibTF.Util.youHeShe(tf("joe"),true,"jump") ); // "he jumps"
alert( LibTF.Util.youHeShe(tf("joe"),false,"jump") ); // "you jump"
alert( LibTF.Util.youHeShe(tf("joe"),true,"are","is")+" jumping" ); // "he is jumping"
alert( LibTF.Util.youHeShe(tf("joe"),false,"are","is")+" jumping" ); // "you are jumping"

LibTF.Util.YouHeShe( person, thirdPerson, youTheyVerb, heSheVerb )

This method is identical to .youHeShe(), except that the first letter of the returned string is capitalized.

alert( LibTF.Util.YouHeShe(tf("joe"),true,"jump") ); // "He jumps"
alert( LibTF.Util.YouHeShe(tf("joe"),false,"jump") ); // "You jump"
alert( LibTF.Util.YouHeShe(tf("joe"),true,"are","is")+" jumping" ); // "He is jumping"
alert( LibTF.Util.YouHeShe(tf("joe"),false,"are","is")+" jumping" ); // "You are jumping"
libtf/documentation/api/grammar.txt · Last modified: 2018/09/24 17:32 by lee