Character
This class is created from the character object you specify in your game.
Constructor Summary
Public Constructor | ||
public |
constructor(args: object) |
Member Summary
Public Members | ||
public |
The ID you specified for this character. |
|
public |
The name you specified for this character. |
|
public |
state: * Arbitrary, JSON-safe data about this character. |
Private Members | ||
private |
|
Method Summary
Public Methods | ||
public |
addToQuality(id: string, delta: number): number Add an integer value to the given quality. |
|
public |
formatQuality(id: string): string Returns the formatted value of the given quality. |
|
public |
formatQualityName(id: string): string Return the human-readable name for the given quality ID. |
|
public |
getQuality(id: string): * Return the current value of this quality (without formatting it) |
|
public |
getQualityInitial(id: string): * Return the initial value of this quality from the start of the game(without formatting it). |
|
public |
setQuality(id: string, value: *) Qualities must be modified using this method. |
Public Constructors
Public Members
public id: string source
The ID you specified for this character. Must be unique across all characters.
public state: * source
Arbitrary, JSON-safe data about this character. You may update it any time you want.
Private Members
private _shallowQualities: {} source
Public Methods
public addToQuality(id: string, delta: number): number source
Add an integer value to the given quality.
public formatQuality(id: string): string source
Returns the formatted value of the given quality.
Params:
Name | Type | Attribute | Description |
id | string | ID of the quality whose value you want |
public formatQualityName(id: string): string source
Return the human-readable name for the given quality ID.
Params:
Name | Type | Attribute | Description |
id | string | ID of the quality whose value you want |
public getQuality(id: string): * source
Return the current value of this quality (without formatting it)
Params:
Name | Type | Attribute | Description |
id | string | ID of the quality whose value you want |
Return:
* |
public getQualityInitial(id: string): * source
Return the initial value of this quality from the start of the game(without formatting it). You can use this to see how the value has changed since the start of the game.
Params:
Name | Type | Attribute | Description |
id | string | ID of the quality whose value you want |
Return:
* |