-
Notifications
You must be signed in to change notification settings - Fork 0
INQCharacter.js
The INQ Character was made to organize all of the details of a character into an accessible object, such as skills, weapons, psychic powers, talents, and traits.
When creating a new character, you will often want to parse a Roll20 character. INQCharacter will hand off the parsing job to INQCharacterParser.js, resulting in a complete INQCharacter.
Example
var character = getObj("character", characterid);
var inqcharacter = new INQCharacter(character);
Used to check if the INQCharacter has a specific Skill, Weapon, Psychic Power, Talent, or Trait.
If the item is not found in the specified list, it will return undefined.
If the item is found and it has no subgroups (see INQLink.js), it will return an object with the bonus of the item.
{Bonus: itemBonus}
If the item is found and it does have subgroups, it will return an array of objects, each listing their individual Bonus and Name.
[{Name: itemName, Bonus: itemBonus}, ... ]
Examples
//suppose that inqcharacter has the Skills "Scholastic Lore(Philosophy, Legend)"
//and "Scholastic Lore(Astronomy)+10" along with the Talent "Ambidextrous".
inqcharacter.has("Scholastic Lore", "Skills");
/*
returns [
{Name: Philosophy, Bonus: 0},
{Name: Legend, Bonus: 0},
{Name: Astronomy, Bonus: 10}
];
*/
inqcharacter.has("Ambidextrous", "Talents");
//returns {Bonus: 0}
inqcharacter.has("Ambidextrous", "Skills")
//returns undefined
Returns the total Characteristic bonus for the specified stat in the form of an integer.
Bonus = Floor(Characteristic/10) + Unnatural Characteristic
Uses the details of the INQCharacter to make a new Roll20 character.
If isPlayer is true, the notes will be written in the bio. If false, they will be written in the gmnotes. By default isPlayer is false.