Ejemplo n.º 1
0
 public Item()
 {
     _name   = "Need Name";
     _value  = 0;
     _rarity = RarityTypes.Common;
     _maxDur = 50;
     _curDur = _maxDur;
 }
Ejemplo n.º 2
0
 public Item()
 {
     itemName = "Default";
     itemRarity = RarityTypes.Common;
     itemValue = 1;
     maxDur = 100;
     curDur = maxDur;
 }
Ejemplo n.º 3
0
 public Item()
 {
     _name = "Need Name";
     _value = 0;
     _rarity = RarityTypes.Common;
     _maxDur = 50;
     _curDur = _maxDur;
 }
Ejemplo n.º 4
0
 public Item()
 {
     _name = "I:NONAME";
     _value = 0;
     _rarity = RarityTypes.Common;
     _maxDur = 50;
     _curDur = _maxDur;
 }
Ejemplo n.º 5
0
 public Item(string name, int value, RarityTypes rare, int maxDur, int curDur)
 {
     _name = name;
     _value = value;
     _rarity = rare;
     _maxDur = maxDur;
     _curDur = curDur;
 }
Ejemplo n.º 6
0
Archivo: Item.cs Proyecto: riscvul/LD28
 public Item()
 {
     _name = "Unnamed";
     _value = 0;
     _rarity = RarityTypes.Common;
     _maxDurability = 50;
     _currentDurability = _maxDurability;
 }
Ejemplo n.º 7
0
 public Item(string name, int value, RarityTypes rare, int maxDur, int curDur)
 {
     _name   = name;
     _value  = value;
     _rarity = rare;
     _maxDur = maxDur;
     _curDur = curDur;
 }
Ejemplo n.º 8
0
 public Item(string name, RarityTypes rare, int val, int mDur, int cDur)
 {
     itemName = name;
     itemRarity = rare;
     itemValue = val;
     maxDur = mDur;
     curDur = cDur;
 }
Ejemplo n.º 9
0
Archivo: Item.cs Proyecto: Xenxes/Game
 public Item(string name, int value, RarityTypes rare, int maxDur, int curDur, bool stackable)
 {
     _name      = name;
     _value     = value;
     _rarity    = rare;
     _maxDur    = maxDur;
     _curDur    = curDur;
     _stackable = stackable;
 }
Ejemplo n.º 10
0
Archivo: Item.cs Proyecto: Xenxes/Game
 public Item()
 {
     _name      = "Error";
     _value     = 0;
     _rarity    = RarityTypes.Common;
     _maxDur    = 50;
     _curDur    = _maxDur;
     _stackable = false;
 }
Ejemplo n.º 11
0
    public string _itemDesc;     //added temp.

    public Item()
    {
        _itemID   = 0;
        _name     = "Need Name";
        _itemDesc = "Need Description";
        _rarity   = RarityTypes.Normal;
        _value    = 0;
        _itemIcon = null;
        _itemType = ItemType.Simple;
    }
Ejemplo n.º 12
0
 public Item2()
 {
     _name      = "Need Name";
     _value     = 0;
     _rarity    = RarityTypes.Common;
     _maxDur    = 50;
     _curDur    = _maxDur;
     _maxDamage = 0;
     _dmgVar    = 0;
 }
Ejemplo n.º 13
0
 public Item(string name, string desciption, int itemID, RarityTypes rare, int value, Texture2D icon, ItemType type)
 {
     _name     = name;
     _itemDesc = desciption;
     _itemID   = itemID;
     _rarity   = rare;
     _value    = value;
     _itemIcon = icon;
     _itemType = type;
 }
Ejemplo n.º 14
0
 public ItemTemplate(string name, string description, ItemCategories itemCategory, bool isStackable, bool isEquipable, bool isUsable, bool isGatchaDrop, RarityTypes rarityType)
 {
     Name         = name;
     Description  = description;
     ItemCategory = itemCategory;
     IsStackable  = isStackable;
     IsEquipable  = isEquipable;
     IsUsable     = isUsable;
     IsGatchaDrop = isGatchaDrop;
     RarityType   = rarityType;
 }
Ejemplo n.º 15
0
 public Item(string _objectSlug, string _itemName, string _description, double _monetaryValue,
             string[] _gachaType, ItemTypes _itemType, RarityTypes _rarityType, int _rarity)
 {
     this.ObjectSlug    = _objectSlug;
     this.ItemName      = _itemName;
     this.Description   = _description;
     this.MonetaryValue = _monetaryValue;
     this.GachaType     = _gachaType;
     this.ItemType      = _itemType;
     this.RarityType    = _rarityType;
     this.Rarity        = _rarity;
 }
Ejemplo n.º 16
0
 public Item2(string name, int value, RarityTypes rare, int maxDur, int curDur, int nDmg, float dmgV, int Def, ItemType type)
 {
     _name      = name;
     _value     = value;
     _rarity    = rare;
     _maxDur    = maxDur;
     _curDur    = curDur;
     _maxDamage = nDmg;
     _dmgVar    = dmgV;
     _defence   = Def;
     Itemtypes  = type;
 }
Ejemplo n.º 17
0
 public Item(string name, int val, RarityTypes rare, ItemEquipType itemType,
             int reqLvl, int enchants, bool sellable, int maxStacks,
             int curStacks, string description, bool canBeDropped)
 {
     _name          = name;
     _value         = val;
     _rarity        = rare;
     _requiredLevel = reqLvl;
     _canBeSold     = sellable;
     _itemType      = itemType;
     _maxStacks     = maxStacks;
     _curStacks     = curStacks;
     _description   = description;
     _canBeDropped  = canBeDropped;
 }
Ejemplo n.º 18
0
 public Item()
 {
     _name          = "Unnamed Item";
     _value         = 100;
     _rarity        = RarityTypes.Common;
     _itemType      = ItemEquipType.Clothing;
     _requiredLevel = 0;
     _canBeSold     = true;
     _icon          = Resources.Load("Item Icons/defaultItem") as Texture2D;
     _iconPath      = "Item Icons/defaultItem";
     _maxStacks     = 1;
     _curStacks     = 1;
     _description   = "";
     _canBeDropped  = true;
 }
Ejemplo n.º 19
0
 public ItemTemplate(ItemTemplatePoco ItemTemplatePoco)
 {
     Id               = ItemTemplatePoco.Id;
     ImageUrl         = ItemTemplatePoco.ImageUrl;
     ImageData        = ItemTemplatePoco.ImageData;
     Name             = ItemTemplatePoco.Name;
     ItemCategory     = ItemTemplatePoco.ItemCategory;
     IsStackable      = ItemTemplatePoco.IsStackable;
     IsEquipable      = ItemTemplatePoco.IsEquipable;
     IsUsable         = ItemTemplatePoco.IsUsable;
     IsGatchaDrop     = ItemTemplatePoco.IsGatchaDrop;
     BaseStats        = ItemTemplatePoco.BaseStats;
     BaseAttributes   = ItemTemplatePoco.BaseAttributes;
     UpgradeMaterials = ItemTemplatePoco.UpgradeMaterials;
     RarityType       = ItemTemplatePoco.RarityType;
 }
Ejemplo n.º 20
0
 public Color GetColor(RarityTypes rarity)
 {
     if (rarity == RarityTypes.Common)
     {
         return(CommonColor);
     }
     else if (rarity == RarityTypes.UnCommon)
     {
         return(UnCommonColor);
     }
     else if (rarity == RarityTypes.Rare)
     {
         return(RareColor);
     }
     else if (rarity == RarityTypes.Epic)
     {
         return(EpicColor);
     }
     else if (rarity == RarityTypes.Legendary)
     {
         return(LegendaryColor);
     }
     return(NoColor);
 }
Ejemplo n.º 21
0
 public Item(string name, int value, RarityTypes rare, int maxDur, int curDur)
 {
     _name = name;
     _value = value;
 }
Ejemplo n.º 22
0
 public ItemTemplateBuilder WithRarity(int rarityId)
 {
     rarityType = (RarityTypes)rarityId;
     return(this);
 }
Ejemplo n.º 23
0
    public static RarityTypes RandomizeRarity()
    {
        //Default rarity to common
        RarityTypes itemRarity = RarityTypes.Common;

        //default to the commonDrops randomness
        int[] intToUse = _commonDrops;

        //Randomize rarirty depending on chestRarity type
        int randomizer = Random.Range(1, 100 + 1);


        switch (chestRarity)
        {
        case "random":
            intToUse = _randomDrops;
            break;

        case "any":
            intToUse = _anyDrops;
            break;

        case "common":
            intToUse = _commonDrops;
            break;

        case "uncommon":
            intToUse = _uncommonDrops;
            break;

        case "rare":
            intToUse = _rareDrops;
            break;

        case "epic":
            intToUse = _epicDrops;
            break;

        case "legendary":
            intToUse = _legendDrops;
            break;
        }

        //private static int[] _legendDrops = new int[]{0,0,20,50,30};

        int commonItems   = intToUse[0];
        int uncommonItems = intToUse[0] + intToUse[1];
        int rareItems     = intToUse[0] + intToUse[1] + intToUse[2];
        int epicItems     = intToUse[0] + intToUse[1] + intToUse[2] + intToUse[3];
        int legendItems   = intToUse[0] + intToUse[1] + intToUse[2] + intToUse[3] + intToUse[4];

        if (randomizer < (intToUse[0] + 1))
        {
            itemRarity = RarityTypes.Common;
        }
        else if (commonItems < randomizer && randomizer < uncommonItems + 1)
        {
            itemRarity = RarityTypes.Uncommon;
        }
        else if (uncommonItems < randomizer && randomizer < rareItems + 1)
        {
            itemRarity = RarityTypes.Rare;
        }
        else if (rareItems < randomizer && randomizer < epicItems + 1)
        {
            itemRarity = RarityTypes.Epic;
        }
        else if (epicItems < randomizer && randomizer < legendItems + 1)
        {
            itemRarity = RarityTypes.Legendary;
        }
        //itemRarity = RarityTypes.Legendary;
        return(itemRarity);
    }
Ejemplo n.º 24
0
    //Pass 3 variables
    // 1. The type of item to make, or random.
    // 2. The rarity of the item (higher rarity , better buffs etc)
    //    This should hopefully be a random factor, e.g. 30% of getting rares or w/e
    // 3. Item level, low levels can get rare items but only do low dmg
    //    Higher item levels will be rare and also have higher dps.

    public static Item CreateItem(string itemType, string chestRarityType, int chestLevel)
    {
        //reset for buffs
        procAdded       = false;
        dmgAdded        = false;
        critChanceAdded = false;
        critDmgAdded    = false;
        moveSpeedAdded  = false;
        socketsAdded    = false;

        //init
        chestRarity  = chestRarityType;
        levelOfChest = chestLevel;

        //set rarity
        itemRarity = RandomizeRarity();

        Item item = new Item();

        //call the method to create that base item type
        //fill in all of the values for the item type

        //RANDOM EQUIPS or RANDOM ALL
        if (itemType == "random")
        {
            int randomNum = Random.Range(1, 100 + 1);
            if (randomNum < 20)
            {
                itemType = "weapon";
            }
            else if (randomNum < 70)
            {
                itemType = "armor";
            }
            else if (randomNum < 90)
            {
                itemType = "consum";
            }
            else
            {
                itemType = "socket";
            }
        }
        else
        {
            itemType = "armor";
        }

        //itemType = "weapon";
        //chestRarity = "legendary";

        switch (itemType)
        {
        case "weapon":
            item = CreateWeapon();
            break;

        case "armor":
            item = CreateArmor();
            break;

        case "socket":
            item = CreateSocketItem();
            break;

        case "consum":
            item = CreateConsumable();
            break;

        default:
            item = ItemGenerator.CreateItem("random", chestRarity, levelOfChest);
            break;
        }


        //Only for things which can be equipped
        if (item.ItemType != ItemEquipType.Consumable &&
            item.ItemType != ItemEquipType.Socket)
        {
            item.Rarity        = itemRarity;
            item.RequiredLevel = chestLevel + Random.Range(-4, 3 + 1);

            if (item.RequiredLevel == 0 || item.RequiredLevel < 0)
            {
                item.RequiredLevel = 1;
            }

            if (item.RequiredLevel > 100)
            {
                item.RequiredLevel = 100;
            }


            item       = AddBuffs(item);
            item.Name  = GenerateName(item);
            item.Value = CalculateValue(item);
        }



        //Finally, if it's a consumable (add other stuff later) we will set item to common
        //later we want to change this for buffs/perm buffs, as they are rarer
        //also want to add similar thing at end for sockets and quest items
        //so quest items aren't showing up as legendary items etc
        //quest items shud have unique color
        if (item.ItemType == ItemEquipType.Consumable)
        {
            item.Rarity = RarityTypes.Common;
        }

        //Example
//		if(item.ItemType == ItemEquipType.Weapon){
//			AddProc (item,1.55f);
//			(item as Weapon).ProcModifier = 0.5f;
//			(item as Weapon).Sockets = 5;
//		}

        if (item.Description == "")
        {
            item.Description = "An item I've found during my adventures.";
        }

        return(item);
    }
Ejemplo n.º 25
0
    void OnGUI()
    {
        if (itemManager != null)
        {
            List <WeaponItem> weaponList = new List <WeaponItem>();
            List <ArmorItem>  armorList  = new List <ArmorItem>();
            newItemID = _itemList.Count;

            for (int i = 0; i < _itemList.Count; i++)
            {
                if (_itemList[i].GetType() == typeof(WeaponItem))
                {
                    weaponList.Add((WeaponItem)_itemList[i]);
                }
                if (_itemList[i].GetType() == typeof(ArmorItem))
                {
                    armorList.Add((ArmorItem)_itemList[i]);
                }
            }
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Item Type: ");
            currentItemToCreate = (ItemToCreate)EditorGUILayout.EnumPopup(currentItemToCreate);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.LabelField("General Attributes:", EditorStyles.boldLabel);
            newItemID    = EditorGUILayout.IntField("ID (BE CAREFUL): ", newItemID);
            newItemName  = EditorGUILayout.TextField("Name: ", newItemName);
            newItemDesc  = EditorGUILayout.TextField("Description: ", newItemDesc);
            newItemValue = EditorGUILayout.IntField("Item Value: ", newItemValue);
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Icon: ");
            newItemIcon = (Texture2D)EditorGUILayout.ObjectField(newItemIcon, typeof(Texture2D), true);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Rarity: ");
            newItemRarity = (RarityTypes)EditorGUILayout.EnumPopup(newItemRarity);
            EditorGUILayout.EndHorizontal();


            switch (currentItemToCreate)
            {
            case ItemToCreate.Weapon:
                EditorGUILayout.LabelField("Weapon-Specific Attributes:", EditorStyles.boldLabel);
                newWeaponMaxDamage = EditorGUILayout.IntField("Max Damage: ", newWeaponMaxDamage);
                newWeaponMinDamage = EditorGUILayout.IntField("Min Damage: ", newWeaponMinDamage);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel("Damage Type: ");
                newWeaponDamageType = (DamageType)EditorGUILayout.EnumPopup(newWeaponDamageType);
                EditorGUILayout.EndHorizontal();
                break;

            case ItemToCreate.Armor:
                EditorGUILayout.LabelField("Armor-Specific Attributes:", EditorStyles.boldLabel);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel("Armor Slot: ");
                newArmorSlot = (ArmorSlot)EditorGUILayout.EnumPopup(newArmorSlot);
                EditorGUILayout.EndHorizontal();
                newArmorLvl = EditorGUILayout.IntField("Armor Level: ", newArmorLvl);
                break;
            }

            if (GUILayout.Button("Add New Item"))
            {
                switch (currentItemToCreate)
                {
                case ItemToCreate.Weapon:
                    WeaponItem newWeapon = (WeaponItem)ScriptableObject.CreateInstance <WeaponItem>();
                    newWeapon.Name            = newItemName;
                    newWeapon.ItemDescription = newItemDesc;
                    newWeapon.ItemID          = newItemID;
                    newWeapon.ItemIcon        = newItemIcon;
                    newWeapon.Value           = newItemValue;
                    newWeapon.Rarity          = newItemRarity;
                    newWeapon.MaxDamage       = newWeaponMaxDamage;
                    newWeapon.MinDamage       = newWeaponMinDamage;
                    newWeapon.TypeOfDamage    = newWeaponDamageType;
                    newWeapon.ItemTypeV       = (ItemType)currentItemToCreate;
                    _itemList.Add(newWeapon);
                    break;

                case ItemToCreate.Armor:
                    ArmorItem newArmor = (ArmorItem)ScriptableObject.CreateInstance <ArmorItem>();
                    newArmor.Name            = newItemName;
                    newArmor.ItemDescription = newItemDesc;
                    newArmor.ItemID          = newItemID;
                    newArmor.ItemIcon        = newItemIcon;
                    newArmor.Value           = newItemValue;
                    newArmor.Rarity          = newItemRarity;
                    newArmor.ArmorLevel      = newArmorLvl;
                    newArmor.Slot            = newArmorSlot;
                    newArmor.ItemTypeV       = (ItemType)currentItemToCreate;
                    _itemList.Add(newArmor);
                    break;
                }
            }

            EditorGUILayout.Space();

            showingLists          = EditorGUILayout.Foldout(showingLists, "Item Database");
            EditorGUI.indentLevel = 2;


//			if (showingLists){
//				EditorGUILayout.LabelField("Total items: " + _itemList.Count);
//				EditorGUILayout.LabelField("Total weapons: " + weaponList.Count);
//				EditorGUILayout.LabelField("Total armor items: " + armorList.Count);
//				EditorGUILayout.Space();
//
//				scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
//				EditorGUI.indentLevel -= 1;
//				showingWeapons = EditorGUILayout.Foldout(showingWeapons, "Weapons");
//				if (showingWeapons){
//					EditorGUI.indentLevel += 2;
//					for (int i = 0; i < weaponList.Count; i++){
//						EditorGUILayout.BeginHorizontal();
//						EditorGUILayout.LabelField(weaponList[i].Name);
//						if (GUILayout.Button("-")){
//							_itemList.Remove(_itemList[i]);
//						}
//						EditorGUILayout.EndHorizontal();
//						EditorGUI.indentLevel +=1;
//						weaponList[i].ItemID = EditorGUILayout.IntField ("ID: ", weaponList[i].ItemID);
//						weaponList[i].Name = EditorGUILayout.TextField ("Name: ", weaponList[i].Name);
//						weaponList[i].ItemDescription = EditorGUILayout.TextField ("Description: ", weaponList[i].ItemDescription);
//						weaponList[i].Value = EditorGUILayout.IntField ("Value: ", weaponList[i].Value);
//						weaponList[i].MaxDamage = EditorGUILayout.IntField ("Max Damage: ", weaponList[i].MaxDamage);
//						weaponList[i].MinDamage = EditorGUILayout.IntField ("Min Damage: ", weaponList[i].MinDamage);
//						EditorGUILayout.BeginHorizontal();
//						EditorGUILayout.PrefixLabel("Damage Type: ");
//						weaponList[i].TypeOfDamage = (DamageType)EditorGUILayout.EnumPopup(weaponList[i].TypeOfDamage);
//						EditorGUILayout.EndHorizontal();
//						EditorGUI.indentLevel -=1;
//					}
//					EditorGUI.indentLevel -= 2;
//				}
//				showingArmor = EditorGUILayout.Foldout(showingArmor, "Armor Items");
//				if (showingArmor){
//					EditorGUI.indentLevel += 2;
//					for (int i = 0; i < armorList.Count; i++){
//						EditorGUILayout.BeginHorizontal();
//						EditorGUILayout.LabelField(armorList[i].Name);
//						if (GUILayout.Button("-")){
//							_itemList.Remove(_itemList[i]);
//						}
//						EditorGUILayout.EndHorizontal();
//						EditorGUI.indentLevel +=1;
//						armorList[i].ItemID = EditorGUILayout.IntField ("ID: ", armorList[i].ItemID);
//						armorList[i].Name = EditorGUILayout.TextField ("Name: ", armorList[i].Name);
//						armorList[i].ItemDescription = EditorGUILayout.TextField ("Description: ", armorList[i].ItemDescription);
//						armorList[i].Value = EditorGUILayout.IntField ("Value: ", armorList[i].Value);
//						armorList[i].ArmorLevel = EditorGUILayout.IntField("Armor Level: ", armorList[i].ArmorLevel);
//						EditorGUI.indentLevel -=1;
//					}
//					EditorGUI.indentLevel -= 2;
//				}
//				EditorGUILayout.EndScrollView();
//			}
            EditorGUI.indentLevel -= 2;
            showingIDList          = EditorGUILayout.Foldout(showingIDList, "ID list");
            EditorGUI.indentLevel  = 2;
            if (showingIDList)
            {
                for (int i = 0; i < _itemList.Count; i++)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField(_itemList[i].ItemID.ToString() + ":\t" + _itemList[i].Name);
                    if (GUILayout.Button("Edit"))
                    {
                        AssetDatabase.OpenAsset(_itemList[i]);
                    }
                    if (GUILayout.Button("Remove"))
                    {
                        if (EditorUtility.DisplayDialog("Are you sure you want to remove object?", "Cannot be undone",
                                                        "Remove", "Cancel"))
                        {
                            _itemList.Remove(_itemList[i]);
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }
//			if (showingLists = true) EditorGUILayout.EndScrollView();
        }
    }