Esempio n. 1
0
        public Modifier AddModifier(ItemStatModifier newModifier, float quality)
        {
            Modifier mod = new Modifier(newModifier, quality);

            modifiers.Add(mod);
            return(mod);
        }
Esempio n. 2
0
 public Modifier(ItemStatModifier baseModifier, float quality)
 {
     name                      = baseModifier.name;
     value                     = baseModifier.GetRandomValue(quality);
     this.quality              = quality;
     display                   = baseModifier.displayText;
     rarity                    = baseModifier.rank;
     effect                   += baseModifier.effect.InvokeX <ModifyTable, float>;
     legendaryInstallEffect   += baseModifier.legendaryInstallEffect.InvokeX <float>;
     legendaryUninstallEffect += baseModifier.legendaryUninstallEffect.InvokeX;
 }
Esempio n. 3
0
            public Modifier ConvertToModifier()
            {
                ItemStatModifier genericMod = Resources.Load("Items/_Modifiers/" + name) as ItemStatModifier;

                if (genericMod == null)
                {
                    return(null);
                }
                Modifier mod = new Modifier(genericMod, 1);

                mod.value = value;
                return(mod);
            }
Esempio n. 4
0
        private void AddBaseModifiers(GenericItem baseItem, ModifiableItem item)
        {
            int        modifierCount = CalculateAmountOfModifiers(baseItem.maxModifierCount);
            List <int> indexCache    = new List <int>();

            for (int i = 0; i < modifierCount; i++)
            {
                int index;
                do
                {
                    index = Random.Range(0, baseItem.normalModifiers.Count);
                }while (indexCache.Contains(index));
                indexCache.Add(index);
                ItemStatModifier modifier = baseItem.normalModifiers[index];

                item.AddModifier(modifier, baseItem.modifierQuality);
            }
        }