using UnityEngine; using System.Collections.Generic; /// /// Inventory System -- Base Item. Note that it would be incredibly tedious to create all items by hand, Warcraft style. /// It's a lot more straightforward to create all items to be of the same level as far as stats go, then specify an /// appropriate level range for the item where it will appear. Effective item stats can then be calculated by lowering /// the base stats by an appropriate amount. Add a quality modifier, and you have additional variety, Terraria 1.1 style. /// [System.Serializable] public class InvBaseItem { public enum Slot { None, // First element MUST be 'None' Weapon, // All the following elements are yours to customize -- edit, add or remove as you desire Shield, Body, Shoulders, Bracers, Boots, Trinket, _LastDoNotUse, // Flash export doesn't support Enum.GetNames :( } /// /// 16-bit item ID, generated by the system. /// Not to be confused with a 32-bit item ID, which actually contains the ID of the database as its prefix. /// public int id16; /// /// Name of this item. /// public string name; /// /// This item's custom description. /// public string description; /// /// Slot that this item belongs to. /// public Slot slot = Slot.None; /// /// Minimum and maximum allowed level for this item. When random loot gets generated, /// only items within appropriate level should be considered. /// public int minItemLevel = 1; public int maxItemLevel = 50; /// /// And and all base stats this item may have at a maximum level (50). /// Actual object's stats are calculated based on item's level and quality. /// public List stats = new List(); /// /// Game Object that will be created and attached to the specified slot on the body. /// This should typically be a prefab with a renderer component, such as a sword, /// a bracer, shield, etc. /// public GameObject attachment; /// /// Object's main material color. /// public Color color = Color.white; /// /// Atlas used for the item's icon. /// public UIAtlas iconAtlas; /// /// Name of the icon's sprite within the atlas. /// public string iconName = ""; }