コード例 #1
0
        public Paladin()
        {
            SetName("Paladin");
            HitDie = "1d10";

            ///////////////////
            // PROFICIENCIES //
            ///////////////////

            SetProficiencyBonus(2);
            var Proficiencies = new Dictionary <string, List <string> >()
            {
                { "Armor", new List <string>()
                  {
                      "Light Armor", "Medium Armor", "Shields"
                  } },
                { "Weapons", new List <string>()
                  {
                      "Simple Weapons", "Martial Weapons"
                  } },
                { "Tools", new List <string>() },
                { "Saving Throws", new List <string>()
                  {
                      "Wisdom", "Charisma"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Paladins can select two skills from the following list
            var paladinSkillProfs = new List <string>()
            {
                "Athletics",
                "Insight",
                "Intimidation",
                "Medicine",
                "Persuasion",
                "Religion"
            };

            // Shuffle list and add the top two
            paladinSkillProfs = Tools.ShuffleList(paladinSkillProfs);
            Proficiencies["Skills"].Add(paladinSkillProfs[0]);
            Proficiencies["Skills"].Add(paladinSkillProfs[1]);

            SetProficiencies(Proficiencies);

            ///////////////
            // EQUIPMENT //
            ///////////////

            // Paladins start with a martial weapon and a shield or two martial weapons
            List <Weapon> martialWeapons = GetWeapons().Where(w => w.WeaponType == "Martial Melee").ToList();
            List <Weapon> simpleWeapons  = GetWeapons().Where(w => w.WeaponType == "Simple Melee").ToList();

            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                Weapon weapon = Tools.ShuffleList(martialWeapons)[0];
                PrimaryWeapon = weapon;
                Shield        = new Shield("Shield");
                break;

            case 1:
                // I assume the two weapons imply duel-weilding
                List <Weapon> OneHandedMartialWeapons = martialWeapons.Where(w => w.Twohanded == false).ToList();
                Weapon        weapon1 = Tools.ShuffleList(OneHandedMartialWeapons)[0];
                Weapon        weapon2 = Tools.ShuffleList(OneHandedMartialWeapons)[0];
                PrimaryWeapon = weapon1;
                OffHandWeapon = weapon2;
                break;
            }

            // Paladins also get five javelins or any simple melee weapon
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                for (int i = 0; i <= 4; i++)
                {
                    AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Javelin").ToList()[0]);
                }
                break;

            case 1:
                AdditionalWeapons.Add(Tools.ShuffleList(simpleWeapons)[0]);
                break;
            }

            // And a priest’s pack or an explorer’s pack
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                EquipmentPack = GetPacks().Where(p => p.Name == "Priest's Pack").ToList()[0];
                break;

            case 1:
                EquipmentPack = GetPacks().Where(p => p.Name == "Explorer's Pack").ToList()[0];
                break;
            }

            // Chain mail and a holy symbol
            Armor      = GetArmor().Where(a => a.Name == "Chain Mail").ToList()[0];
            HolySymbol = new HolySymbol("Holy Symbol");

            //////////////
            // FEATURES //
            //////////////

            Features.Add(new Feature("Divine Sense", "", 1));
            Features.Add(new Feature("Lay on Hands", "", 1));
        }
コード例 #2
0
ファイル: Druid.cs プロジェクト: KingFruit85/dnd
        public Druid()
        {
            SetName("Druid");
            HitDie = "1d8";

            ///////////////////
            // PROFICIENCIES //
            ///////////////////

            SetProficiencyBonus(2);
            var Proficiencies = new Dictionary <string, List <string> >()
            {
                { "Armor", new List <string>()
                  {
                      "Light Armor (Non - Metal)", "Medium Armor (Non - Metal)", "Shields (Non - Metal)"
                  } },                                                                                                              // (druids will not wear armor or use shields made of metal)
                { "Weapons", new List <string>()
                  {
                      "Clubs", "Daggers", "Darts", "Javelins", "Maces", "Quarterstaffs", "Scimitars", "Sickles", "Slings", "Spears"
                  } },
                { "Tools", new List <string>()
                  {
                      "Herbalism Kit"
                  } },
                { "Saving Throws", new List <string>()
                  {
                      "Intelligence", "Wisdom"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Druids can select two skills from the following list
            var druidSkillProfs = new List <string>()
            {
                "Arcana",
                "Animal Handling",
                "Insight",
                "Medicine",
                "Nature",
                "Perception",
                "Religion",
                "Survival"
            };

            // Shuffle list and add the top two
            druidSkillProfs = Tools.ShuffleList(druidSkillProfs);
            Proficiencies["Skills"].Add(druidSkillProfs[0]);
            Proficiencies["Skills"].Add(druidSkillProfs[1]);

            SetProficiencies(Proficiencies);

            ///////////////
            // EQUIPMENT //
            ///////////////
            var simpleWeapons  = GetWeapons().Where(w => w.WeaponType == "Simple Melee").ToList();
            var martialWeapons = GetWeapons().Where(w => w.WeaponType == "Martial Melee").ToList();


            //  Druids get a wooden shield or any simple weapon
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                Shield = new Shield("Wooden Shield");
                break;

            case 1:
                AdditionalWeapons.Add(Tools.ShuffleList(simpleWeapons)[0]);
                break;
            }

            //  a scimitar or any simple melee weapon
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                PrimaryWeapon = Tools.ShuffleList(simpleWeapons)[0];
                break;

            case 1:
                PrimaryWeapon = martialWeapons.Where(w => w.Name == "Scimitar").ToList()[0];
                break;
            }


            //  Leather armor, an explorer’s pack, and a druidic focus
            Armor         = GetArmor().Where(a => a.Name == "Leather Armor").ToList()[0];
            EquipmentPack = GetPacks().Where(p => p.Name == "Explorer's Pack").ToList()[0];
            DruidicFocus  = new DruidicFocus("Druidic Focus");

            ///////////////
            //  Spells   //
            ///////////////
            // Druids know
            // 2 x Cantrips
            // 2 x level 1 spells

            SpellSlots = 2;

            List <string> clericCantrips = new List <string>()
            {
                "Guidance",
                "Mending",
                "Produce Flame",
                "Resistance",
                "Shillelagh"
            };

            Cantrips = Tools.ReturnXSpellsFromList(clericCantrips, 2);

            List <string> clericLevel1Spells = new List <string>()
            {
                "Charm Person",
                "Create or Destroy Water",
                "Cure Wounds",
                "Detect Magic",
                "Detect Poison and Disease",
                "Entangle",
                "Faerie Fire",
                "Fog Cloud",
                "Healing Word",
                "Jump",
                "Longstrider",
                "Purify Food and Drink",
                "Speak with Animals",
                "Thunderwave"
            };

            Level1Spells = Tools.ReturnXSpellsFromList(clericLevel1Spells, SpellSlots);

            //////////////
            // FEATURES //
            //////////////

            Features.Add(new Feature("Druidic", "", 1));
            // Add druidic language
            Features.Add(new Feature("Spellcasting", "", 1));
        }
コード例 #3
0
        public Fighter()
        {
            SetName("Fighter");
            HitDie = "1d10";

            ///////////////////
            // PROFICIENCIES //
            ///////////////////

            SetProficiencyBonus(2);
            var Proficiencies = new Dictionary <string, List <string> >()
            {
                { "Armor", new List <string>()
                  {
                      "Light Armor", "Medium Armor", "Heavy Armor", "Shields"
                  } },
                { "Weapons", new List <string>()
                  {
                      "Simple Weapons", "Martial Weapons"
                  } },
                { "Tools", new List <string>() },
                { "Saving Throws", new List <string>()
                  {
                      "Strength", "Constitution"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Fighters can select two skills from the following list
            var fighterSkillProfs = new List <string>()
            {
                "Acrobatics",
                "Animal Handling",
                "Athletics",
                "History",
                "Insight",
                "Intimidation",
                "Perception",
                "Survival"
            };

            // Shuffle list and add the top two
            fighterSkillProfs = Tools.ShuffleList(fighterSkillProfs);
            Proficiencies["Skills"].Add(fighterSkillProfs[0]);
            Proficiencies["Skills"].Add(fighterSkillProfs[1]);

            SetProficiencies(Proficiencies);

            ///////////////
            // EQUIPMENT //
            ///////////////

            // Fighters get either chain mail or leather armor, a longbow, and 20 arrows

            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:

                Armor = GetArmor().Where(a => a.Name == "Chain Mail").ToList()[0];
                break;

            case 1:
                Armor = GetArmor().Where(a => a.Name == "Leather Armor").ToList()[0];
                AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Longbow").ToList()[0]);
                Ammunition.Add(new Ammunition("bolt", 20, "A longbow arrow"));
                break;
            }

            // They also get either a martial weapon and a shield or two martial weapons

            var    martialWeapons = GetWeapons().Where(w => w.WeaponType == "Martial Melee").ToList();
            Weapon weaponToAdd;

            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                weaponToAdd   = Tools.ShuffleList(martialWeapons)[0];
                PrimaryWeapon = weaponToAdd;
                Shield        = new Shield("Shield");
                break;

            case 1:
                // Get 1-h martial weapons and add to mainhand and offhand
                var OHMartialWeapons = martialWeapons.Where(w => w.Twohanded == false).ToList();
                OHMartialWeapons = Tools.ShuffleList(OHMartialWeapons);

                var index = Tools.GetRandomNumberInRange(0, OHMartialWeapons.Count);
                PrimaryWeapon = OHMartialWeapons[index];

                index         = Tools.GetRandomNumberInRange(0, OHMartialWeapons.Count);
                OffHandWeapon = OHMartialWeapons[index];

                break;
            }

            //  And a light crossbow and 20 bolts or two handaxes

            var handAxe = GetWeapons().Where(w => w.Name == "Handaxe").ToList()[0];

            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Light Crossbow").ToList()[0]);
                Ammunition.Add(new Ammunition("bolt", 20, "A simple bolt"));
                break;

            case 1:
                AdditionalWeapons.Add(handAxe);
                AdditionalWeapons.Add(handAxe);
                break;
            }

            // And finally a dungeoneer’s pack or an explorer’s pack

            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                EquipmentPack = GetPacks().Where(p => p.Name == "Dungeoneer's Pack").ToList()[0];
                break;

            case 1:
                EquipmentPack = GetPacks().Where(p => p.Name == "Explorer's Pack").ToList()[0];
                break;
            }

            //////////////
            // FEATURES //
            //////////////

            Features.Add(new Feature("Fighting Style", "", 1));
            Features.Add(new Feature("Second Wind", "", 1));

            var fightingstyles = new List <string>()
            {
                "Archery",
                "Defense",
                "Dueling",
                "Great Weapon Fighting",
                "Protection",
                "Two-Weapon Fighting"
            };

            FightingStyle = Tools.ShuffleList(fightingstyles)[0];
        }