Exemple #1
0
        public Func <Equipment, bool> ValidateOpenExplicit(ExplicitOptions explicitOptions)
        {
            return((item) =>
            {
                var affixCount = item.Rarity == EquipmentRarity.Normal ? 0 :
                                 item.Rarity == EquipmentRarity.Magic ? 1 :
                                 item.Rarity == EquipmentRarity.Rare ? 3 : 0;

                if (explicitOptions == ExplicitOptions.Any)
                {
                    return item.Stats.Count < affixCount * 2;
                }

                if (explicitOptions == ExplicitOptions.None)
                {
                    return item.Stats.Count == affixCount * 2;
                }

                if (explicitOptions == ExplicitOptions.Prefix)
                {
                    return item.Prefixes.Count < affixCount;
                }

                if (explicitOptions == ExplicitOptions.Suffix)
                {
                    return item.Suffixes.Count < affixCount;
                }

                throw new InvalidOperationException("Invalid open explicit validation");
            });
        }
Exemple #2
0
        public Func <Equipment, bool> ValidateHasExplicit(ExplicitOptions explicitOptions)
        {
            switch (explicitOptions)
            {
            case (ExplicitOptions.Any):
                return(item => item.Stats.Any());

            case (ExplicitOptions.Prefix):
                return(item => item.Prefixes.Any());

            case (ExplicitOptions.Suffix):
                return(item => item.Suffixes.Any());

            case (ExplicitOptions.None):
                return(item => !item.Stats.Any());

            case (ExplicitOptions.MasterMod):
                return(item => item.Stats.Any(x => x.Affix.GenerationType == "crafted"));
            }
            throw new InvalidOperationException("Invalid explicit validation");
        }
Exemple #3
0
        public Action <Equipment, AffixManager, CurrencyModifiers> RemoveExplicit(ExplicitOptions explicitOptions)
        {
            // Todo: Add modifiers that include prefix/suffix blocking

            return((item, affixManager, currencyModifier) => {
                switch (explicitOptions)
                {
                case ExplicitOptions.Any:
                    StatFactory.RemoveExplicit(_random, item, currencyModifier);
                    break;

                case ExplicitOptions.Prefix:
                    throw new NotImplementedException();
                    break;

                case ExplicitOptions.Suffix:
                    throw new NotImplementedException();
                    break;
                }
            });
        }
Exemple #4
0
        public Action <Equipment, AffixManager, CurrencyModifiers> AddExplicit(ExplicitOptions explicitOptions)
        {
            // Todo: Add modifiers that include prefix/suffix blocking

            return((item, affixManager, currencyModifier) => {
                switch (explicitOptions)
                {
                case ExplicitOptions.Any:
                    StatFactory.AddExplicit(_random, item, affixManager, currencyModifier);
                    break;

                case ExplicitOptions.Prefix:
                    throw new NotImplementedException();
                    break;

                case ExplicitOptions.Suffix:
                    throw new NotImplementedException();
                    break;

                case ExplicitOptions.Crusader:
                    StatFactory.AddInfluenceExplicit(Influence.Crusader, _random, item, affixManager, currencyModifier);
                    break;

                case ExplicitOptions.Hunter:
                    StatFactory.AddInfluenceExplicit(Influence.Hunter, _random, item, affixManager, currencyModifier);
                    break;

                case ExplicitOptions.Warlord:
                    StatFactory.AddInfluenceExplicit(Influence.Warlord, _random, item, affixManager, currencyModifier);
                    break;

                case ExplicitOptions.Redeemer:
                    StatFactory.AddInfluenceExplicit(Influence.Redeemer, _random, item, affixManager, currencyModifier);
                    break;
                }
            });
        }