예제 #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));
 }