Example #1
0
        public Item ItemGenerator(Item i, ItemName[] itemNameDropTable, ItemAffixs[] itemPrefixDropTable, ItemAffixs[] itemSuffixDropTable, ItemStats[] itemStatDropTable, ItemRarities[] itemRarityDropTable, ItemRequirements[] itemRequirementsDropTable)
        {
            if (itemNameDropTable == null || itemPrefixDropTable == null || itemSuffixDropTable == null || itemStatDropTable == null || itemRarityDropTable == null || itemRequirementsDropTable == null)
            {
                Debug.Log("A table doesn't have anything in it");
            }
            int itemNameDropTableNumber = Random.Range(0, itemNameDropTable.Length);

            i.itemName = itemNameDropTable[itemNameDropTableNumber];
            i.itemType = i.itemName.itemType;
            int itemRequirementsDropTableNumber = Random.Range(0, itemRequirementsDropTable.Length);

            i.itemRequirements = itemRequirementsDropTable[itemRequirementsDropTableNumber];
            int itemRarityDropTableNumber = Random.Range(0, itemRarityDropTable.Length);

            i.itemRarity = itemRarityDropTable[itemRarityDropTableNumber];
            i            = itemRarity.RarityAffixGenerator(i, itemPrefixDropTable, itemSuffixDropTable);
            i.itemStat1  = itemStatDropTable[0];
            i.itemStat2  = itemStatDropTable[1];
            i.itemStat3  = itemStatDropTable[2];
            i.itemStat4  = itemStatDropTable[3];
            i.itemStat5  = itemStatDropTable[4];
            i.itemStat6  = itemStatDropTable[5];
            i.itemStat1  = itemStat1.ItemModStatGenerator(i, i.itemStat1, i.itemMod1, i.itemMod2, i.itemMod3, i.itemMod4, i.itemMod5, i.itemMod6);
            i.itemStat2  = itemStat2.ItemModStatGenerator(i, i.itemStat2, i.itemMod1, i.itemMod2, i.itemMod3, i.itemMod4, i.itemMod5, i.itemMod6);
            i.itemStat3  = itemStat3.ItemModStatGenerator(i, i.itemStat3, i.itemMod1, i.itemMod2, i.itemMod3, i.itemMod4, i.itemMod5, i.itemMod6);
            i.itemStat4  = itemStat4.ItemModStatGenerator(i, i.itemStat4, i.itemMod1, i.itemMod2, i.itemMod3, i.itemMod4, i.itemMod5, i.itemMod6);
            i.itemStat5  = itemStat5.ItemModStatGenerator(i, i.itemStat5, i.itemMod1, i.itemMod2, i.itemMod3, i.itemMod4, i.itemMod5, i.itemMod6);
            i.itemStat6  = itemStat6.ItemModStatGenerator(i, i.itemStat6, i.itemMod1, i.itemMod2, i.itemMod3, i.itemMod4, i.itemMod5, i.itemMod6);
            if (i.itemPrefixs1 == null && i.itemSuffixs1 == null)
            {
                i.itemCombinedNameString = ConvertString.CombineNameString("", i.itemName.ItemNameString, "");
            }
            else if (i.itemSuffixs1 == null)
            {
                i.itemCombinedNameString = ConvertString.CombineNameString(i.itemPrefixs1.itemAffixString, i.itemName.ItemNameString, "");
            }
            else if (i.itemPrefixs1 == null)
            {
                i.itemCombinedNameString = ConvertString.CombineNameString("", i.itemName.ItemNameString, i.itemSuffixs1.itemAffixString);
            }
            else
            {
                i.itemCombinedNameString = ConvertString.CombineNameString(i.itemPrefixs1.itemAffixString, i.itemName.ItemNameString, i.itemSuffixs1.itemAffixString);
            }
            return(i);
        }
Example #2
0
 public ItemStats ItemModStatGenerator(Item i, ItemStats itemStat, ItemMod itemMod1, ItemMod itemMod2, ItemMod itemMod3, ItemMod itemMod4, ItemMod itemMod5, ItemMod itemMod6)
 {
     if (itemMod1 == null)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, null);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemStat.name == itemMod1.itemStatModifiying.name)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, itemMod1);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemMod1 == null || itemMod2 == null)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, null);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemStat.name == itemMod2.itemStatModifiying.name)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, itemMod2);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemMod1 == null || itemMod2 == null || itemMod3 == null)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, null);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemStat.name == itemMod3.itemStatModifiying.name)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, itemMod3);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemMod1 == null || itemMod2 == null || itemMod3 == null || itemMod4 == null)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, null);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemStat.name == itemMod4.itemStatModifiying.name)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, itemMod4);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemMod1 == null || itemMod2 == null || itemMod3 == null || itemMod4 == null || itemMod5 == null)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, null);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemStat.name == itemMod5.itemStatModifiying.name)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, itemMod5);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemMod1 == null || itemMod2 == null || itemMod3 == null || itemMod4 == null || itemMod5 == null || itemMod6 == null)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, null);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else if (itemStat.name == itemMod6.itemStatModifiying.name)
     {
         itemStat.itemStatInt          = ItemStatGenerators(i.itemName, i.itemType, i.itemRarity, i.itemRequirements, itemMod6);
         itemStat.itemStatOnItemString = ConvertString.ItemStatStringGenerator(itemStat.itemStatInt, itemStat.itemStatString);
         return(itemStat);
     }
     else
     {
         return(itemStat);
     }
 }
Example #3
0
 public ItemMod SetItemMods(Item i, ItemMod itemMod)
 {
     itemMod.itemModOnItemString = ConvertString.ItemModStringGenerator(itemMod.itemModIntModifier, itemMod.itemModDescriptionString);
     return(itemMod);
 }