Пример #1
0
        public void Execute(Utility.ComponentContainer components)
        {
            // Select a simple weapon
            var choice = GatewayProvider.Get <Weapon>().SimpleWeapons().ChooseOne();

            components.Add(new WeaponProficiency(choice.ProficiencyName));
        }
Пример #2
0
        public void Execute(Utility.ComponentContainer components)
        {
            var casting   = components.Get <ISpellCasting>();
            var spellList = casting.SpellList;
            var book      = components.Get <Inventory>().Spellbooks.First();

            for (int level = 0; level < spellsToAdd.Length; level++)
            {
                if (spellsToAdd[level].EqualsIgnoreCase("ALL"))
                {
                    book.AddSpells(level, spellList.GetSpells(level, components.GetAll <ISpellCastingRule>()));
                }
                else
                {
                    int spellsToChoose = spellsToAdd[level].ToInteger();
                    if (addModifier)
                    {
                        spellsToChoose += casting.CastingAbility.TotalModifier;
                    }

                    book.AddSpells(
                        level,
                        spellList.GetSpells(level, components.GetAll <ISpellCastingRule>()).Where(x => !book.ContainsSpell(level, x))
                        .Choose(spellsToChoose)
                        );
                }
            }
        }
Пример #3
0
        public void Execute(Utility.ComponentContainer components)
        {
            var familiar = familiars.ChooseOne();
            var summon   = new SummonFamiliar(familiar);

            components.Add(summon);
        }
Пример #4
0
        public void Execute(Utility.ComponentContainer components)
        {
            var list   = new IAbility[] { new DivineBondMount(), new DivineBondWeapon() };
            var option = list.ChooseOne();

            components.Add(option);
        }
Пример #5
0
        public void Execute(Utility.ComponentContainer components)
        {
            var fav     = components.Get <FavoredTerrain>();
            var upgrade = fav.TerrainTypes.ChooseOne();

            fav.EnhanceBonus(upgrade);
        }
Пример #6
0
        public void Execute(Utility.ComponentContainer components)
        {
            RogueTalent selected = null;

            var characterTalents = components.GetAll <RogueTalent>();
            var availableTalents = this.rogueTalentGateway.Where(talent =>
                                                                 (!talent.IsAdvancedTalent ||
                                                                  talent.IsAdvancedTalent == selectAdvanced) &&
                                                                 characterTalents.None(x => x.Matches(talent.Name)));

            //Prefer Advanced Talents

            var advanced = availableTalents.Where(x => x.IsAdvancedTalent);

            if (advanced.Count() > 0)
            {
                selected = advanced.ChooseOne();
            }
            else
            {
                selected = availableTalents.ChooseOne();
            }

            components.Add(selected);
        }
Пример #7
0
        public void Execute(Utility.ComponentContainer components)
        {
            //TODO: Can be rewritten as stats that get a bonus....
            var favEnemy = components.Get <FavoredEnemy>();
            var upgrade  = favEnemy.CreatureTypes.ChooseOne();

            favEnemy.EnhanceBonus(upgrade);
        }
Пример #8
0
        public void Execute(Utility.ComponentContainer components)
        {
            var wizardCasting = components.Get <WizardCasting>();
            var school        = arcaneGateway.ChooseOne();

            wizardCasting.SetFocusSchool(school);
            components.Add(school);
        }
Пример #9
0
        public void Execute(Utility.ComponentContainer components)
        {
            var combatStyle = components.Get <CombatStyle>();
            var rangerLevel = components.Get <ClassLevel>();
            var token       = new FeatToken(combatStyle.GetFeats(rangerLevel.Level), true);

            components.Add(token);
        }
Пример #10
0
        public void Execute(Utility.ComponentContainer components)
        {
            var bloodline  = components.Get <Bloodline>();
            var casting    = components.Get <SpontaneousCasting>();
            var classLevel = components.Get <ClassLevel>();
            var bonusSpell = bloodline.GetBonusSpell(classLevel.Level);

            casting.LearnSpell(spellLevel, bonusSpell);
        }
Пример #11
0
        public void Execute(Utility.ComponentContainer components)
        {
            var bloodline      = components.Get <Bloodline>();
            var bloodlineLevel = components.Get <ClassLevel>();
            var powerType      = bloodline.GetPower(bloodlineLevel.Level);
            var power          = Reflector.Instantiate <IBloodlinePower>(powerType);

            components.Add(power);
        }
Пример #12
0
 public void Execute(Utility.ComponentContainer components)
 {
     for (int i = 0; i < domainCount; i++)
     {
         var currentDoms = components.GetAll <Domain>();
         var domains     = domainsGateway.Where(d => !currentDoms.Contains(d));
         var domain      = domains.ChooseOne();
         components.Add(domain);
     }
 }
Пример #13
0
        public void Execute(Utility.ComponentContainer components)
        {
            // Randomly pick 10 and gopherit
            var skillRanks = components.Get <SkillRanks>();
            var skills     = skillRanks.GetSkills().Choose(10);

            foreach (var s in skills)
            {
                skillRanks.SetClassSkill(s.Name);
            }
        }
Пример #14
0
        public void Execute(Utility.ComponentContainer components)
        {
            var fav = components.Get <FavoredTerrain>();

            if (fav == null)
            {
                fav = new FavoredTerrain();
                components.Add(fav);
            }
            fav.Add(this.terrainTypeGateway.Where(x => !fav.TerrainTypes.Contains(x)).ChooseOne());
        }
Пример #15
0
        public void Execute(Utility.ComponentContainer components)
        {
            var versatilePerformance = components.Get <VersatilePerformance>();
            var skillRanks           = components.Get <SkillRanks>();
            var performSkills        = skillRanks.GetSkills()
                                       .Where(x => x.Name.Contains("Perform") && !versatilePerformance.Skills.Contains(x))
                                       .GroupBy(x => x.Score());
            var highestGroup = performSkills.Max(x => x.Key);

            versatilePerformance.AddSkill(performSkills.First(x => x.Key == highestGroup).ChooseOne());
        }
Пример #16
0
        public void Execute(Utility.ComponentContainer components)
        {
            var domains = components.GetAll <Domain>();

            if (domains.Empty())
            {
                return;
            }

            var domainSpells = new DomainCasting(configuration);

            components.Add(domainSpells);
        }
Пример #17
0
        public void Execute(Utility.ComponentContainer components)
        {
            var favoredEnemy = components.Get <FavoredEnemy>();

            if (favoredEnemy == null)
            {
                favoredEnemy = new FavoredEnemy();
                components.Add(favoredEnemy);
            }
            var type = this.creatureTypeGateway.Where(x => !favoredEnemy.CreatureTypes.Contains(x)).ChooseOne();

            favoredEnemy.Add(type);
        }
Пример #18
0
        public void Execute(Utility.ComponentContainer components)
        {
            var mercies = components.Get <Mercies>();

            if (mercies == null)
            {
                mercies = new Mercies();
                components.Add(mercies);
            }

            var paladinLevel = components.Get <ClassLevel>();

            var selected = mercyGateway.Where(x => x.Level <= paladinLevel.Level && !mercies.MercyList.Contains(x)).ChooseOne();

            mercies.Add(selected);
        }
Пример #19
0
        public void Execute(Utility.ComponentContainer components)
        {
            var wizardCasting = components.Get <WizardCasting>();
            var focusSchool   = wizardCasting.FocusSchool;

            if (focusSchool.NoOppositionSchools)
            {
                return;
            }

            var opps = arcaneSchools.Where(
                x => x.Equals(focusSchool) == false && !x.NoOppositionSchools
                ).Choose(2);

            wizardCasting.SetOppositionSchools(opps);
        }
Пример #20
0
 public void Execute(Utility.ComponentContainer components)
 {
     components.Add(bloodlines.ChooseOne());
 }
Пример #21
0
        public void Execute(Utility.ComponentContainer components)
        {
            var bloodline = components.Get <Bloodline>();

            components.Add(new FeatToken(bloodline.GetBonusFeats()));
        }
Пример #22
0
 public void Execute(Utility.ComponentContainer components)
 {
     components.Get <CharacterStrategy>().AddLanguageChoices(this.languages);
 }
Пример #23
0
        public void Execute(Utility.ComponentContainer components)
        {
            var combat = combatStyleGateway.ChooseOne();

            components.Add(combat);
        }
Пример #24
0
 public bool IsQualified(Utility.ComponentContainer components)
 {
     return(this.Prerequisites.IsQualified(components));
 }