Quality ​
Inherits: DatabaseResource < Resource
Defines item quality/rarity with display properties Create instances as .tres files for each quality tier
Properties ​
Color | color | Color.WHITE |
int | quality_tier | 1 |
int | drop_weight | 100 |
int | min_item_level | 0 |
float | budget_multiplier | 1.0 |
float | roll_spread | 0.5 |
int | prefixes_min | 0 |
int | prefixes_max | 0 |
int | suffixes_min | 0 |
int | suffixes_max | 0 |
int | silent_min | 0 |
int | silent_max | 0 |
int | effects_min | 0 |
int | effects_max | 0 |
int | sockets_min | 0 |
int | sockets_max | 0 |
Array[int] | socket_pool | [] |
float | vendor_value_multiplier | 1.0 |
NameMode | name_mode | NameMode.AFFIXES |
Array[QualityRule] | rules | [] |
VFXSelection | dropped_vfx |
Methods ​
int | roll_count( minimum: int, maximum: int, rng: RandomNumberGenerator ) |
bool | is_valid() |
Array[Dictionary] | validate() |
String | get_id() |
bool | is_higher_than( other: Quality ) |
bool | is_lower_than( other: Quality ) |
String | get_quality_description() |
Enumerations ​
enum NameMode ​
How the name of a generated item is made
- AFFIXES =
0- "Heavy Great Axe of the Monkey": the first prefix and the first suffix - BASE_ONLY =
1- "Great Axe": the colour of the quality tells the rest - QUALITY_WORD =
2- "Rare Great Axe": the name of the quality in front
Property descriptions ​
Color color = Color.WHITE ​
Color for UI display
int quality_tier = 1 ​
Numeric tier for sorting/comparison (1=lowest, 5=highest)
Quality Roll
int drop_weight = 100 ​
The share of this quality in the roll of an item that picks its quality (higher = more common)
int min_item_level = 0 ​
The lowest item level this quality can be rolled at (0 = any). Keeps Epic away from level 3 drops however lucky the roll
Budget
float budget_multiplier = 1.0 ​
Multiplies the stat budget of the item (Common 1, Magic 1.5, Rare 2.5 ...). See ItemBudget
float roll_spread = 0.5 ​
How unevenly the budget is split between the rolled bonuses: 0 = an even split, 1 = very uneven
Affix Slots
int prefixes_min = 0 ​
How many prefix affixes roll (picked from the affixes the item can have)
int prefixes_max = 0 ​
The most prefixes a generated item of this quality can get.
int suffixes_min = 0 ​
How many suffix affixes roll
int suffixes_max = 0 ​
The most suffixes a generated item of this quality can get.
int silent_min = 0 ​
How many silent affixes roll (affixes with no name: extra stats that do not change the name of the item)
int silent_max = 0 ​
The most silent affixes (without a name) a generated item of this quality can get.
int effects_min = 0 ​
How many effect affixes roll (affixes that give an effect)
int effects_max = 0 ​
The most effects a generated item of this quality can get.
Sockets
int sockets_min = 0 ​
Extra sockets the item gets
int sockets_max = 0 ​
The most sockets a generated item of this quality can get.
Array[int] socket_pool = [] ​
The socket types (SocketDefinition ids) an extra socket can be
Value and Name
float vendor_value_multiplier = 1.0 ​
Multiplies the vendor value of the item
NameMode name_mode = NameMode.AFFIXES ​
How the name of a generated item is made
Array[QualityRule] rules = [] ​
Custom rules for what the fields above do not cover (each QualityRule gets the item that is being generated)
Dropped Item
VFXSelection dropped_vfx ​
A visual effect shown on every item of this quality while it lies in the world (a beam of light for the rare ones). The item can have its own too: both are shown
Method descriptions ​
int roll_count( minimum: int, maximum: int, rng: RandomNumberGenerator ) ​
A random number of affixes between a minimum and a maximum (a maximum below the minimum counts as the minimum)
bool is_valid() ​
Validation
Array[Dictionary] validate() ​
Checks the settings. Gives the problems found (empty when it is fine).
String get_id() ​
Get ID from filename
bool is_higher_than( other: Quality ) ​
Helper method to check if this quality is higher than another
bool is_lower_than( other: Quality ) ​
Helper method to check if this quality is lower than another
String get_quality_description() ​
Get quality description including tier information