Constructor
new DragonTraits(indices)
Constructs a formal DragonTraits object from a generic object containing indices in FRjs/data arrays for any/all of a single dragon's traits. Calling the constructor directly is useful for converting traits into scrying workshop links, and for quickly getting the actual data objects for all traits.
Any traits that are left undefined, or which are invalid, will be set to a default value; index 0 for most traits, and for genes the index of Basic.
Name | Type | Description |
---|---|---|
indices | Object | An object defining any/all of a single dragon's traits. It may contain any of the following keys, with values being indices in the appropriate array from
|
- Source
Members
indices :Object
Object containing all traits as indices in the applicable array from FRjs/data
.
The structure of the object is:
{
breed: number,
eye: number,
element: number,
gender: number,
age: number,
colour: {
primary: number,
secondary: number,
tertiary: number
},
gene: {
primary: number,
secondary: number,
tertiary: number
}
}
- Object
- Source
scrylink :string
A link to the scrying workshop for a dragon with all defined traits.
- string
- Source
values :Object
An object containing all traits as data objects from FRjs/data
.
The structure of the object is:
{
breed: FR.Breed,
eye: FR.EyeType,
element: FR.BasicTrait,
gender: FR.BasicTrait,
age: FR.BasicTrait,
colour: {
primary: FR.Colour,
secondary: FR.Colour,
tertiary: FR.Colour
},
gene: {
primary: FR.Gene,
secondary: FR.Gene,
tertiary: FR.Gene
}
}
- Object
- Source
Methods
(static) fromProfile(profile) → {DragonTraits}
Returns a DragonTraits
object containing all traits defined in the contents of the given dragon profile. Note: gender is not present in text on dragon profiles, and will be the default of Male.
Name | Type | Description |
---|---|---|
profile | string | The text contents of a dragon's profile page. NOT the page HTML; what you get by selecting all text on the page in the browser window and copying it. |
- Source
- Type:
- DragonTraits
(static) fromScrylink(link) → {DragonTraits}
Returns a DragonTraits
object containing all the traits defined in the given scrying workshop link.
Name | Type | Description |
---|---|---|
link | string | A scrying workshop link. NOT a link to a saved morphology; a URL for exact morphology parameters. |
- Source
- Type:
- DragonTraits