Exemple #1
0
        private bool CheckWeaponAgainstOtherProficienciesAsIfMartial(IWeaponAttackStatistics weapon)
        {
            var martialize    = new ExoticToMartialWeaponDecorator(weapon);
            var proficiencies = components.GetAll <WeaponProficiency>().Exclude(this);

            return(proficiencies.IsProficient(martialize));
        }
Exemple #2
0
        private void SelectSkillFocus(ComponentContainer components)
        {
            var strategy   = components.Get <CharacterStrategy>();
            var skills     = components.Get <SkillRanks>();
            var skillTable = GetSkillTable(skills, strategy);

            DisableOptionsThatAlreadyHaveSkillFocus(skillTable, components.GetAll <SkillFocus>());
            SetSkillFocus(skillTable.ChooseRandomly());
        }
Exemple #3
0
        public void Execute(ComponentContainer components)
        {
            var options = _ragePowers
                          .All()
                          .GetAllQualified <RagePower>(components)
                          .Exclude(components.GetAll <RagePower>());
            var power = options.ChooseOne();

            components.Add(power);
        }
Exemple #4
0
        public void Initialize(ComponentContainer components)
        {
            var trainings = components.GetAll <WeaponTraining>().Exclude(this);

            this.Group = EnumHelpers.GetValues <WeaponGroup>().Where(grp => !trainings.Any(already => already.Group == grp)).ChooseOne();
            var offStats = components.Get <OffenseStats>();

            offStats.AddWeaponModifier(WeaponAttackBonus);
            offStats.AddWeaponModifier(WeaponDamageBonus);
        }
Exemple #5
0
        public bool IsQualified(ComponentContainer components)
        {
            var spellcasting = components.GetAll <ISpellCasting>();

            if (spellcasting.Empty())
            {
                return(false);
            }

            return(spellcasting.Any(x => x.CasterLevel >= this.CasterLevel));
        }
Exemple #6
0
        public bool IsQualified(ComponentContainer components)
        {
            var profs = components.GetAll <ArmorProficiency>();

            foreach (var p in profs)
            {
                if (p.IsProficient(Proficiency))
                {
                    return(!CheckForNonProficiency);
                }
            }
            return(CheckForNonProficiency);
        }
Exemple #7
0
 public void Initialize(ComponentContainer components)
 {
     sourceClass    = components.Get <ClassLevel>();
     domains        = components.GetAll <Domain>();
     CastingAbility = components.Get <AbilityScores>().GetAbility(castingAbilityType);
     SpellList      = new SpellList();
     foreach (var d in domains)
     {
         for (int spellLevel = 0; spellLevel < d.Spells.Length; spellLevel++)
         {
             SpellList.Add(spellLevel + 1, d.Spells[spellLevel]);
         }
     }
 }
Exemple #8
0
        public void Execute(ComponentContainer components)
        {
            var spellCasting = components.Get <SpontaneousCasting>();

            for (int spellLevel = 0; spellLevel <= spellCasting.GetHighestSpellLevelKnown(); spellLevel++)
            {
                var spellsToLearn = spellCasting.GetKnownSpellCount(spellLevel) - spellCasting.GetReadySpells(spellLevel).Count();

                if (spellsToLearn > 0)
                {
                    var spells = spellCasting.SpellList.GetSpells(spellLevel, components.GetAll <ISpellCastingRule>())
                                 .Where(s => spellCasting.CanLearnSpell(spellLevel, s))
                                 .Choose(spellsToLearn);
                    foreach (var s in spells)
                    {
                        spellCasting.LearnSpell(s);
                    }
                }
            }
        }
Exemple #9
0
 /// <summary>
 /// Determines whether this instance is qualified the specified character.
 /// </summary>
 /// <returns>true if the character is qualified</returns>
 /// <param name="character">Character to assess qualification.</param>
 public bool IsQualified(ComponentContainer components)
 {
     return(components.GetAll <IFeature>().Any(x => x.Name.EqualsIgnoreCase(SpecialAbilityName)));
 }
Exemple #10
0
 public void Initialize(ComponentContainer components)
 {
     druidLevels = components.GetAll <ClassLevel>().First(x => x.Class.Name.EqualsIgnoreCase("druid"));
 }
Exemple #11
0
 private IEnumerable <KiStrike> GetKiStrikes()
 {
     return(components.GetAll <KiStrike>());
 }
Exemple #12
0
        public bool IsQualified(ComponentContainer components)
        {
            var sc = components.GetAll <ISpellCasting>();

            return(sc.Any(x => x.SpellType == SpellType.Arcane));
        }