Data about Flight Rising's dragon traits and breeding mechanics, and utility functions to streamline working with that data.
Members
(static, constant) AGES :Array.<BasicTrait>
The two possible dragon ages in Flight Rising. Ordered as they are in-game.
- Array.<BasicTrait>
- See
(static, constant) BREEDS :Array.<Breed>
All available breeds in Flight Rising. Sorted by name (ascending). Data Source
- Array.<Breed>
- See
(static, constant) BreedType :string
Enum for breed types. This effects which genes are available on a breed, and which breed(s) it can be paired with.
- string
| Name | Type | Description |
|---|---|---|
ANCIENT | string | |
MODERN | string |
(static, constant) COLOURS :Array.<Colour>
All available colours in Flight Rising. Ordered as they are in-game. This should be treated as a circular array.
- Array.<Colour>
- See
(static, constant) ELEMENTS :Array.<BasicTrait>
All possible elements (flights) in Flight Rising. Ordered as they are in-game.
- Array.<BasicTrait>
- See
(static, constant) EYES :Array.<EyeType>
All possible eye types in Flight Rising. Sorted by probability (descending). Data Source (retrieved 2024-04-09 at 12:07 PM EST)
- Array.<EyeType>
- See
(static, constant) GENDERS :Array.<BasicTrait>
The two possible dragon genders in Flight Rising. Ordered as they are in-game.
- Array.<BasicTrait>
- See
(static, constant) GENES :Object
All available genes, organized into primary, secondary, and tertiary slots. Each slot is sorted by name (ascending). Data Source
This object has the following structure:
{
primary: Gene[],
secondary: Gene[],
tertiary: Gene[]
}
- Object
- See
(static, constant) Rarity :string
Enum for rarities. Every breed and gene has a rarity which affects it's probability of occurring through breeding.
- string
| Name | Type | Description |
|---|---|---|
PLENTIFUL | string | |
COMMON | string | |
UNCOMMON | string | |
LIMITED | string | |
RARE | string |
Methods
(static) areBreedsCompatible(one, two) → {boolean|undefined}
Returns true if the two given breeds are compatible for breeding -- meaning either they're both modern breeds, or they're the same ancient breed -- and false if they aren't. If either parameter is not an index in BREEDS, returns undefined.
| Name | Type | Description |
|---|---|---|
one | number | Index of the first breed. |
two | number | Index of the second breed. |
- Type:
- boolean |
undefined
(static) calcRarityProb(arr, one, two, target) → {number|undefined}
Compares two objects with rarities from the given array, and returns the probability of the given target outcome occurring. If the indexes aren't in the array, or the array members don't have rarities, returns undefined.
| Name | Type | Description |
|---|---|---|
arr | Array.<{rarity: Rarity}> | Array of objects with a |
one | number | Index in |
two | number | Index in |
target | number | Index in |
- See
- Type:
- number |
undefined
(static) colourRange(one, two) → {number}
Yields indices on COLOURS of all colours in the shortest range between the two given colours. If either parameter is not an index in COLOURS, yields nothing.
| Name | Type | Description |
|---|---|---|
one | number | Index of the first colour in the range. |
two | number | Index of the last colour in the range. |
- Type:
- number
(static) colourRangeLength(one, two) → {number|undefined}
Calculates the length of the shortest range between two colours. If either parameter is not an index in COLOURS, returns undefined.
| Name | Type | Description |
|---|---|---|
one | number | Index of the first colour in the range. |
two | number | Index of the last colour in the range. |
- Type:
- number |
undefined
(static) genesForBreed(slot, breedopt) → {number}
Yields indices on GENES of all genes available to a breed in a specific slot. If no breed id or an invalid breed id is provided, ignores restrictions and yields all genes for this slot. If the slot is invalid, yields nothing.
| Name | Type | Attributes | Description |
|---|---|---|---|
slot | "primary" | | The slot to retrieve genes for. | |
breed | number | <optional> | Index of the breed to retrieve genes for. |
- Type:
- number
(static) isColourInRange(one, two, target) → {boolean|undefined}
Returns true if the target colour is in the shortest range between two given colours, and false if it isn't. If any parameter is not an index in COLOURS, returns undefined. Range includes both end colours.
| Name | Type | Description |
|---|---|---|
one | number | Index of the first colour in the range. |
two | number | Index of the last colour in the range. |
target | number | Index of the target colour. |
- Type:
- boolean |
undefined
(static) isColourSubrangeInRange(range1, range2, target1, target2) → {boolean|undefined}
Returns true if the colour range from target1 to target2 is a sub-range of the colour range from range1 to range2, and false if not. If any parameter is not an index in COLOURS, returns undefined. Both ranges include both their end colours.
| Name | Type | Description |
|---|---|---|
range1 | number | Index of the first colour in the parent range. |
range2 | number | Index of the last colour in the parent range. |
target1 | number | Index of the first colour in the target range. |
target2 | number | Index of the last colour in the target range. |
- Type:
- boolean |
undefined
(static) nestSizesForBreeds(one, two) → {Array.<Nest>|undefined}
Returns an array containing possible nest sizes and their probabilities if dragons of the two given breeds are nested. If the given breeds are incompatible, or if either parameter is not an index in BREEDS, returns undefined.
| Name | Type | Description |
|---|---|---|
one | number | Index of the first breed. |
two | number | Index of the second breed. |
- See
- Type:
- Array.<Nest> |
undefined
(static) rarityTableLookup(rarity1, rarity2) → {Array.<number>|undefined}
Given two rarities to compare, returns an array containing, in order, the probability that rarity1 occurs and the probability that rarity2 occurs. If invalid rarities are given, returns undefined.
| Name | Type | Description |
|---|---|---|
rarity1 | Rarity | |
rarity2 | Rarity |
- See
- Type:
- Array.<number> |
undefined
Type Definitions
BasicTrait
- Object
| Name | Type | Description |
|---|---|---|
name | string | |
sid | number | The trait's on-site ID. |
Breed
- Object
| Name | Type | Description |
|---|---|---|
name | string | |
sid | number | The breed's on-site ID. |
type | BreedType | |
rarity | Rarity |
Colour
- Object
| Name | Type | Description |
|---|---|---|
name | string | |
sid | number | The colour's on-site ID. |
hex | string | The colour's main hex code. NOT prefixed. |
EyeType
- Object
| Name | Type | Description |
|---|---|---|
name | string | |
sid | number | The eye type's on-site ID. |
probability | number | The eye type's probability of showing up on a hatchling when breeding dragons. |
Gene
- Object
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
name | string | |||||||
rarity | Rarity | |||||||
sids | Object | Map of all on-site IDs that this gene may have. The | ||||||
isModern | boolean | Whether or not this gene is available on modern breeds. | ||||||
ancients | Array.<number> | Array of indices in | ||||||
sidForBreed | function | Given the index of a breed in Parameters:
Returns: |
Nest
- Object
| Name | Type | Description |
|---|---|---|
name | string | |
probability | number | The nest's probability of occurring when breeding dragons. |