Since it would be incredibly tedious to create thousands of unique items by hand, a simple solution is needed. Separating items into 2 parts is that solution. Base item contains stats that the item would have if it was max level. All base items are created with their stats at max level. Game item, the second item class, has an effective item level which is used to calculate effective item stats. Game items can be generated with a random level (clamped within base item's min/max level range), and with random quality affecting the item's stats.
More...
|
enum | Quality {
Quality.Broken,
Quality.Cursed,
Quality.Damaged,
Quality.Worn,
Quality.Sturdy,
Quality.Polished,
Quality.Improved,
Quality.Crafted,
Quality.Superior,
Quality.Enchanted,
Quality.Epic,
Quality.Legendary,
Quality._LastDoNotUse
} |
|
|
int | baseItemID [get] |
| ID of the base item used to create this one. More...
|
|
InvBaseItem | baseItem [get] |
| Base item used by this game item. More...
|
|
string | name [get] |
| Game item's name should prefix the quality More...
|
|
float | statMultiplier [get] |
| Put your formula for calculating the item stat modifier here. Simplest formula – scale it with quality and item level. Since all stats on base items are specified at max item level, calculating the effective multiplier is as simple as itemLevel/maxLevel. More...
|
|
Color | color [get] |
| Item's color based on quality. You will likely want to change this to your own colors. More...
|
|
Since it would be incredibly tedious to create thousands of unique items by hand, a simple solution is needed. Separating items into 2 parts is that solution. Base item contains stats that the item would have if it was max level. All base items are created with their stats at max level. Game item, the second item class, has an effective item level which is used to calculate effective item stats. Game items can be generated with a random level (clamped within base item's min/max level range), and with random quality affecting the item's stats.
Enumerator |
---|
Broken |
|
Cursed |
|
Damaged |
|
Worn |
|
Sturdy |
|
Polished |
|
Improved |
|
Crafted |
|
Superior |
|
Enchanted |
|
Epic |
|
Legendary |
|
_LastDoNotUse |
|
InvGameItem.InvGameItem |
( |
int |
id | ) |
|
Create a game item with the specified ID.
Create a game item with the specified ID and base item.
List<InvStat> InvGameItem.CalculateStats |
( |
| ) |
|
Calculate and return the list of effective stats based on item level and quality.
int InvGameItem.itemLevel = 1 |
Quality InvGameItem.quality = Quality.Sturdy |
Item quality – applies a penalty or bonus to all base stats.
Base item used by this game item.
int InvGameItem.baseItemID |
|
get |
ID of the base item used to create this one.
Item's color based on quality. You will likely want to change this to your own colors.
Game item's name should prefix the quality
float InvGameItem.statMultiplier |
|
get |
Put your formula for calculating the item stat modifier here. Simplest formula – scale it with quality and item level. Since all stats on base items are specified at max item level, calculating the effective multiplier is as simple as itemLevel/maxLevel.
The documentation for this class was generated from the following file:
- D:/Projects/NGUI/Assets/NGUI/Examples/Scripts/InventorySystem/System/InvGameItem.cs