Constructor
new Character(paramsopt)
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
parameters |
Extends
Members
male
- Description:
Is this character male?
- Source:
Properties:
Name | Type | Description |
---|---|---|
male |
Is this character male?
objective
- Description:
Objective pronoun
character.gender => "female" character.objective => "her"
- Source:
Properties:
Name | Type | Description |
---|---|---|
objective |
Objective pronoun
character.gender
=> "female"
character.objective
=> "her"
personal
- Description:
Personal pronoun
character.gender => "female" character.personal => "she"
property personal
- Source:
Personal pronoun
character.gender
=> "female"
character.personal
=> "she"
property personal
points
- Description:
The total number of assigned trait points for this character is referred to as the character's "points".
- Source:
Properties:
Name | Type | Description |
---|---|---|
points |
The total number of assigned trait points for this character is referred to as the character's "points".
possessive
- Description:
Possessive pronoun
character.gender => "female" character.possessive => "her"
- Source:
Properties:
Name | Type | Description |
---|---|---|
possessive |
Possessive pronoun
character.gender
=> "female"
character.possessive
=> "her"
reflexive
- Description:
Reflexive pronoun (arguably redundant with the personal pronoun, may remove).
character.gender => "female" character.reflexive => "herself"
- Source:
Properties:
Name | Type | Description |
---|---|---|
reflexive |
Reflexive pronoun (arguably redundant with the personal pronoun, may remove).
character.gender
=> "female"
character.reflexive
=> "herself"
tags
- Description:
An array of string tags that characterize this item.
- Source:
- Overrides:
Properties:
Name | Type | Description |
---|---|---|
tags |
Set |
An array of string tags that characterize this item.
Methods
asJSON() → {String}
- Description:
Converts the model to JSON, converting sets to arrays.
- Source:
- Overrides:
Returns:
JSON
- Type
- String
changeTrait(traitName, value)
- Description:
Change a trait by a set number of points.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
traitName |
String | The trait to change |
|
value |
Number |
0
|
The amount to add or subtract. If the value is zero or less after change, the trait will be removed. |
has(tag) → {boolean}
- Description:
Does this model have the given tag?
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
tag |
String |
Returns:
true if it does, false otherwise
- Type
- boolean
is(tag) → {boolean}
- Description:
Does this model have the given tag?
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
tag |
String |
Returns:
true if it does, false otherwise
- Type
- boolean
not(tag) → {boolean}
- Description:
Does this model not have the given tag?
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
tag |
String |
Returns:
true if it does not have the tag, false otherwise
- Type
- boolean
typeOf(prefix) → {String}
- Description:
Given a prefix like
ammo
ormedia
, will return the specific tag for this item, such asammo:22
ormedia:35mm
.
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
prefix |
String | the prefix to match |
Returns:
the first tag found that matches this prefix
- Type
- String