NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
InvGameItem Class Reference

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...

Public Types

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
}
 

Public Member Functions

 InvGameItem (int id)
 Create a game item with the specified ID. More...
 
 InvGameItem (int id, InvBaseItem bi)
 Create a game item with the specified ID and base item. More...
 
List< InvStatCalculateStats ()
 Calculate and return the list of effective stats based on item level and quality. More...
 

Public Attributes

Quality quality = Quality.Sturdy
 Item quality – applies a penalty or bonus to all base stats. More...
 
int itemLevel = 1
 Item's effective level. More...
 

Properties

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...
 

Detailed Description

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.

Member Enumeration Documentation

Enumerator
Broken 
Cursed 
Damaged 
Worn 
Sturdy 
Polished 
Improved 
Crafted 
Superior 
Enchanted 
Epic 
Legendary 
_LastDoNotUse 

Constructor & Destructor Documentation

InvGameItem.InvGameItem ( int  id)

Create a game item with the specified ID.

InvGameItem.InvGameItem ( int  id,
InvBaseItem  bi 
)

Create a game item with the specified ID and base item.

Member Function Documentation

List<InvStat> InvGameItem.CalculateStats ( )

Calculate and return the list of effective stats based on item level and quality.

Member Data Documentation

int InvGameItem.itemLevel = 1

Item's effective level.

Quality InvGameItem.quality = Quality.Sturdy

Item quality – applies a penalty or bonus to all base stats.

Property Documentation

InvBaseItem InvGameItem.baseItem
get

Base item used by this game item.

int InvGameItem.baseItemID
get

ID of the base item used to create this one.

Color InvGameItem.color
get

Item's color based on quality. You will likely want to change this to your own colors.

string InvGameItem.name
get

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: