コード例 #1
0
ファイル: Cleric.cs プロジェクト: KingFruit85/dnd
        public Cleric()
        {
            SetName("Cleric");
            HitDie = "1d8";

            ///////////////////
            // 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"
                  } },
                { "Tools", new List <string>() },
                { "Saving Throws", new List <string>()
                  {
                      "Wisdom", "Charisma"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Clerics can select two skills from the following list
            var clericSkillProfs = new List <string>()
            {
                "History",
                "Insight",
                "Medicine",
                "Persuasion",
                "Religion"
            };

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

            // SRD Clerics can only be life domain, they are proficient in heavy armor
            Proficiencies["Armor"].Add("Heavy Armor");

            SetProficiencies(Proficiencies);

            ///////////////
            // EQUIPMENT //
            ///////////////
            // Clerics get a mace or a warhammer (if proficient)
            // Since Life domain clerics are not proficient in martial melee weapons we
            // just add a warhammer for now

            PrimaryWeapon = GetWeapons().Where(w => w.Name == "Warhammer").ToList()[0];

            // Life Clerics get either scale mail, leather armor, or chain mail (if proficient) at level 1
            // Since we are life clerics might as well get the best AC right?
            Armor = GetArmor().Where(a => a.Name == "Chain Mail").ToList()[0];

            // Clerics get either a light crossbow and 20 bolts or any simple weapon

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

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

            case 1:
                // Add a random simple weapon
                var simpleWeapons = GetWeapons().Where(w => w.WeaponType == "Simple Melee").ToList();
                var weapon        = Tools.ShuffleList(simpleWeapons)[0];
                AdditionalWeapons.Add(weapon);
                break;
            }

            // Clerics also get either 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;
            }

            // Clerics get a shield and a holy symbol
            Shield     = new Shield("Shield");
            HolySymbol = new HolySymbol("Holy Symbol");

            ///////////////
            //  Spells   //
            ///////////////
            // Clerics know
            // 3 cantrips
            // 2 level 1 spells

            SpellSlots = 2;

            List <string> clericCantrips = new List <string>()
            {
                "Guidance",
                "Light",
                "Mending",
                "Resistance",
                "Sacred Flame",
                "Thaumaturgy",
            };

            Cantrips = Tools.ReturnXSpellsFromList(clericCantrips, 3);

            List <string> clericLevel1Spells = new List <string>()
            {
                "Bane",
                "Bless",
                "Command",
                "Create or Destroy Water",
                "Cure Wounds",
                "Detect Evil and Good",
                "Detect Magic",
                "Detect Poison and Disease",
                "Guiding Bolt",
                "Healing Word",
                "Inflict Wounds",
                "Protection from Evil and Good",
                "Purify Food and Drink",
                "Sanctuary",
                "Shield of Faith"
            };

            Level1Spells = Tools.ReturnXSpellsFromList(clericLevel1Spells, SpellSlots);

            // Add Cleric features
            Features.Add(new Feature("Spellcasting", "", 1));
            Features.Add(new Feature("Divine Domain", "", 1));
        }
コード例 #2
0
        public Rogue()
        {
            SetName("Rogue");
            HitDie = "1d8";

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

            SetProficiencyBonus(2);
            var Proficiencies = new Dictionary <string, List <string> >()
            {
                { "Armor", new List <string>()
                  {
                      "Light Armor"
                  } },
                { "Weapons", new List <string>()
                  {
                      "Simple Weapons", "Hand Crossbow", "Longsword", "Rapiers", "Shortsword"
                  } },
                { "Tools", new List <string>()
                  {
                      "Thieves’ Tools"
                  } },
                { "Saving Throws", new List <string>()
                  {
                      "Dexterity", "Intelligence"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Rogues can select four skills from the following list
            var rogueSkillProfs = new List <string>()
            {
                "Acrobatics",
                "Athletics",
                "Deception",
                "Insight",
                "Intimidation",
                "Investigation",
                "Perception",
                "Performance",
                "Persuasion",
                "Sleight of Hand",
                "Stealth"
            };

            // Shuffle list and add the top four
            rogueSkillProfs = Tools.ShuffleList(rogueSkillProfs);
            Proficiencies["Skills"].Add(rogueSkillProfs[0]);
            Proficiencies["Skills"].Add(rogueSkillProfs[1]);
            Proficiencies["Skills"].Add(rogueSkillProfs[2]);
            Proficiencies["Skills"].Add(rogueSkillProfs[3]);


            SetProficiencies(Proficiencies);

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

            // Rogues start with a rapier or a shortsword
            Weapon rapier    = GetWeapons().Where(w => w.Name == "Rapier").ToList()[0];
            Weapon longSword = GetWeapons().Where(w => w.Name == "Longsword").ToList()[0];

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

            case 0:
                PrimaryWeapon = rapier;
                break;

            case 1:
                PrimaryWeapon = longSword;
                break;
            }

            // a shortbow and quiver of 20 arrows or a shortsword
            Weapon shortSword = GetWeapons().Where(w => w.Name == "Shortsword").ToList()[0];
            Weapon shortBow   = GetWeapons().Where(w => w.Name == "Shortbow").ToList()[0];

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

            case 0:
                AdditionalWeapons.Add(shortSword);
                break;

            case 1:
                AdditionalWeapons.Add(shortBow);
                Ammunition.Add(new Ammunition("shortbow arrows", 20, "A quiver of shortbow arrows"));
                break;
            }

            // a burglar’s pack, a dungeoneer’s pack, or an explorer’s pack
            switch (Tools.GetRandomNumberInRange(0, 2))
            {
            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;

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

            // Leather armor, two daggers, and thieves’ tools
            Armor = GetArmor().Where(a => a.Name == "Leather Armor").ToList()[0];
            AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Dagger").ToList()[0]);
            AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Dagger").ToList()[0]);
            OtherEquipment.Add("Thieves’ Tools");

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

            Features.Add(new Feature("Expertise", "", 1));
            Features.Add(new Feature("Sneak Attack", "", 1));
            Features.Add(new Feature("Thieves’ Cant", "", 1));
        }
コード例 #3
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));
        }
コード例 #4
0
        public Barbarian()
        {
            SetName("Barbarian");
            SetProficiencyBonus(2);
            HitDie = "1d12";

            // Populate Proficiencies
            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>()
                  {
                      "Strength", "Constitution"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Barbarians can select two skills from the following list
            var barbSkillProfs = new List <string>()
            {
                "Animal Handling",
                "Athletics",
                "Intimidation",
                "Nature",
                "Perception",
                "Survival"
            };

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

            SetProficiencies(Proficiencies);

            // Barbarians start with with a greataxe or any martial melee weapon
            switch (new Random().Next(0, 1))
            {
            default: throw new Exception("invalid option");

            case 0:
                PrimaryWeapon = GetWeapons().Where(w => w.Name == "Greataxe").ToList()[0];
                break;

            case 1:
                var MartialMeleeWeapons = GetWeapons().Where(w => w.WeaponType == "Martial Melee").ToList();
                MartialMeleeWeapons = Tools.ShuffleList(MartialMeleeWeapons);
                PrimaryWeapon       = MartialMeleeWeapons[0];
                break;
            }

            // Barbarians start also start with either 2 x handaxes or any simple weapon
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new Exception("number not in range");

            case 0:
                // Add Simple Weapon
                var simpleWeaponList = GetWeapons().Where(w => w.WeaponType == "Simple Melee").ToList();
                Tools.ShuffleList(simpleWeaponList);
                var randomWeapon = simpleWeaponList[0];
                AdditionalWeapons.Add(randomWeapon);
                break;

            case 1:
                // Add 2xHand axes
                for (int i = 0; i < 1; i++)
                {
                    AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Handaxe").ToList()[0]);
                }
                break;
            }

            // barbarians also start with an explorers pack and 4 x javelin
            EquipmentPack = GetPacks().Where(p => p.Name == "Explorer's Pack").ToList()[0];

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

            // Add Barbarian features
            Features.Add(new Feature("Rage", "", 1));
            Features.Add(new Feature("Unarmored Defense", "", 1));
        }
コード例 #5
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));
        }
コード例 #6
0
ファイル: Monk.cs プロジェクト: KingFruit85/dnd
        public Monk()
        {
            SetName("Monk");
            HitDie = "1d8";

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

            SetProficiencyBonus(2);

            var Proficiencies = new Dictionary <string, List <string> >()
            {
                { "Armor", new List <string>()
                  {
                  } },
                { "Weapons", new List <string>()
                  {
                      "Simple Weapons", "Shortswords"
                  } },
                { "Tools", new List <string>() },
                { "Saving Throws", new List <string>()
                  {
                      "Strength", "Dexterity"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Monks can select either one musical instrument or one artisan tool to be proficient in
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                var toolList = new Equipment().ReturnArtisansToolList().artisansTools;
                toolList = Tools.ShuffleList(toolList);
                Proficiencies["Tools"].Add(toolList[0].Name);
                break;

            case 1:
                var instrumentList = new Equipment().MusicalInstrument().MusicalInstruments;
                instrumentList = Tools.ShuffleList(instrumentList);
                Proficiencies["Tools"].Add(instrumentList[0].Name);
                break;
            }

            // Monks can select two skills from the following list
            var fighterSkillProfs = new List <string>()
            {
                "Acrobatics",
                "Athletics",
                "History",
                "Insight",
                "Religion",
                "Stealth"
            };

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

            SetProficiencies(Proficiencies);

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

            // Monks get either a shortsword or any simple weapon

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

            case 0:
                PrimaryWeapon = GetWeapons().Where(w => w.Name == "Shortsword").ToList()[0];
                break;

            case 1:
                var simpleWeapons = GetWeapons().Where(w => w.WeaponType == "Simple Melee").ToList();
                PrimaryWeapon = Tools.ShuffleList(simpleWeapons).ToList()[0];
                break;
            }

            // They also get 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;
            }


            // And 10 darts
            // This is a bit shit, perhaps darts should be treated as ammo?

            for (int i = 0; i <= 10; i++)
            {
                AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Dart").ToList()[0]);
            }

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

            Features.Add(new Feature("Unarmored Defense", "", 1));
            Features.Add(new Feature("Martial Arts", "", 1));
        }
コード例 #7
0
ファイル: Bard.cs プロジェクト: KingFruit85/dnd
        public Bard()
        {
            SetName("Bard");
            HitDie = "1d8";

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

            SetProficiencyBonus(2);

            var Proficiencies = new Dictionary <string, List <string> >()
            {
                { "Armor", new List <string>()
                  {
                      "Light Armor"
                  } },
                { "Weapons", new List <string>()
                  {
                      "Simple Weapons", "Hand Crossbows", "Longswords", "Rapiers", "Shortswords"
                  } },
                { "Tools", new List <string>() },
                { "Saving Throws", new List <string>()
                  {
                      "Dexterity", "Charisma"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Get 3 random instrument profs
            var instrumentList = new Equipment().MusicalInstrument().MusicalInstruments;

            instrumentList = Tools.ShuffleList(instrumentList);
            Proficiencies["Tools"].Add(instrumentList[0].Name);
            Proficiencies["Tools"].Add(instrumentList[1].Name);
            Proficiencies["Tools"].Add(instrumentList[2].Name);

            var bardSkillProfs = new List <string>()
            {
                "athletics",
                "acrobatics",
                "sleightOfHand",
                "arcana",
                "stealth",
                "history",
                "nature",
                "religion",
                "animalHandling",
                "insight",
                "medicine",
                "perception",
                "survival",
                "deception",
                "intimidation",
                "investigation",
                "performance",
                "persuasion"
            };

            // Get 3 ransom skill profs
            bardSkillProfs = Tools.ShuffleList(bardSkillProfs);
            Proficiencies["Skills"].Add(bardSkillProfs[0]);
            Proficiencies["Skills"].Add(bardSkillProfs[1]);
            Proficiencies["Skills"].Add(bardSkillProfs[2]);

            SetProficiencies(Proficiencies);

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

            // Bards get either a Lute or a random musical instrument
            // My implimentation only adds a lute if we're proficient
            // If not, then add a random instrument we are proficient in

            if (Proficiencies["Tools"].Contains("Lute"))
            {
                var lute = new Equipment().MusicalInstrument().MusicalInstruments.Where(i => i.Name == "Lute").ToList()[0];
                MusicalInstruments.Add(lute);
            }
            else
            {
                // Get a random instrument we are proficient in as a string
                var proficientInstrument = Tools.ShuffleList(Proficiencies["Tools"]).ToList()[0];
                // Reterive the instrument object
                var instrument = new Equipment().MusicalInstrument().MusicalInstruments.Where(i => i.Name == proficientInstrument).ToList()[0];
                MusicalInstruments.Add(instrument);
            }

            // All bards get a dagger and leather armor
            var dagger = GetWeapons().Where(w => w.Name == "Dagger").ToList()[0];

            AdditionalWeapons.Add(dagger);

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

            // They also get either a Diplomat's pack or and entertainer's pack
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new Exception("Option no valid");

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

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

            // They also get either a Rapier, Longsword or a any simple weapon
            switch (Tools.GetRandomNumberInRange(0, 2))
            {
            default: throw new Exception("Option no valid");

            case 0:
                PrimaryWeapon = GetWeapons().Where(w => w.Name == "Rapier").ToList()[0];
                break;

            case 1:
                PrimaryWeapon = GetWeapons().Where(w => w.Name == "Longsword").ToList()[0];
                break;

            case 2:
                var randomSimpleWeapon = GetWeapons().Where(w => w.WeaponType == "Simple Melee").ToList();
                randomSimpleWeapon = Tools.ShuffleList(randomSimpleWeapon);
                PrimaryWeapon      = randomSimpleWeapon[0];
                break;
            }

            //////////////
            //  SPELLS  //
            //////////////

            // At level 1 bards get
            // 2 x Cantrips
            // 2 x 1st level spells

            SpellSlots = 2;

            List <string> bardCantrips = new List <string>()
            {
                "Dancing Lights",
                "Light",
                "Mage Hand",
                "Mending",
                "Message",
                "Minor Illusion",
                "Prestidigitation",
                "True Strike"
            };

            Cantrips = Tools.ReturnXSpellsFromList(bardCantrips, 2);

            List <string> bardLevel1Spells = new List <string>()
            {
                "Bane",
                "Charm Person",
                "Comprehend Languages",
                "Cure Wounds",
                "Detect Magic",
                "Disguise Self",
                "Faerie Fire",
                "Feather Fall",
                "Healing Word",
                "Heroism",
                "Hideous Laughter",
                "Identify",
                "Illusory Script",
                "Longstrider",
                "Silent Image",
                "Sleep",
                "Speak with Animals",
                "Thunderwave",
                "Unseen Servant"
            };

            Level1Spells = Tools.ReturnXSpellsFromList(bardLevel1Spells, SpellSlots);

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

            // Add Bard Features
            Features.Add(new Feature("Spellcasting", "", 1));
            Features.Add(new Feature("Bardic Inspiration (d6)", "", 1));
        }
コード例 #8
0
ファイル: Warlock.cs プロジェクト: KingFruit85/dnd
        public Warlock()
        {
            SetName("Warlock");
            HitDie = "1d8";

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

            SetProficiencyBonus(2);

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

            // Warlocks can select two skills from the following list
            var warlockSkillProfs = new List <string>()
            {
                "Arcana",
                "Deception",
                "History",
                "Intimidation",
                "Investigation",
                "Nature",
                "Religion"
            };

            Proficiencies["Skills"].Add(warlockSkillProfs[0]);
            Proficiencies["Skills"].Add(warlockSkillProfs[1]);

            SetProficiencies(Proficiencies);

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

            // Warlocks get a light crossbow and 20 bolts or any simple weapon
            var 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:
                PrimaryWeapon = GetWeapons().Where(w => w.Name == "Light Crossbow").ToList()[0];
                Ammunition.Add(new Ammunition("light crossbow bolts", 20, "A quiver of light crossbow bolts"));
                break;

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

            // A component pouch or  an arcane focus
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                OtherEquipment.Add("Component Pouch");
                break;

            case 1:
                OtherEquipment.Add("Arcane Focus");
                break;
            }

            // A scholar’s pack or a dungeoneer’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 == "Scholar's Pack").ToList()[0];
                break;
            }


            // Leather armor, any simple weapon, and two daggers
            Armor = GetArmor().Where(a => a.Name == "Leather Armor").ToList()[0];

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

            AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Dagger").ToList()[0]);
            AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Dagger").ToList()[0]);

            //////////////
            //  SPELLS  //
            //////////////

            // At level 1 warlocks get
            // 2 x Cantrips
            // 2 x First level spells

            SpellSlots = 1;

            List <string> warlockCantrips = new List <string>()
            {
                "Chill Touch",
                "Mage Hand",
                "Minor Illusion",
                "Prestidigitation",
                "True Strike"
            };

            Cantrips = Tools.ReturnXSpellsFromList(warlockCantrips, 2);

            List <string> warlockLevel1Spells = new List <string>()
            {
                "Charm Person",
                "Comprehend Languages",
                "Expeditious Retreat",
                "Illusory Script",
                "Protection from Evil and Good",
                "Unseen Servant"
            };

            Level1Spells = Tools.ReturnXSpellsFromList(warlockLevel1Spells, SpellSlots);

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

            // Only details for the Fiend were released as Open Game Content by Wizards of the Coast
            Features.Add(new Feature("Otherworldly Patron", "", 1));
            WarlockPatron = "Fiend";
            Features.Add(new Feature("Pact Magic", "", 1));
        }
コード例 #9
0
ファイル: Sorcerer.cs プロジェクト: KingFruit85/dnd
        public Sorcerer()
        {
            SetName("Sorcerer");
            HitDie = "1d8";

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

            SetProficiencyBonus(2);
            var Proficiencies = new Dictionary <string, List <string> >()
            {
                { "Armor", new List <string>()
                  {
                  } },
                { "Weapons", new List <string>()
                  {
                      "Daggers", "Darts", "Slings", "Quarterstaffs", "Light Crossbows"
                  } },
                { "Tools", new List <string>()
                  {
                  } },
                { "Saving Throws", new List <string>()
                  {
                      "Constitution", "Charisma"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Sorcerers can select two skills from the following list
            var sorcererSkillProfs = new List <string>()
            {
                "Arcana",
                "Deception",
                "Insight",
                "Intimidation",
                "Persuasion",
                "Religion"
            };

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


            SetProficiencies(Proficiencies);

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

            // Sorcerers start with a light crossbow and 20 bolts or any simple weapon
            var 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:
                PrimaryWeapon = GetWeapons().Where(w => w.Name == "Light Crossbow").ToList()[0];
                Ammunition.Add(new Ammunition("light crossbow bolts", 20, "A quiver of light crossbow bolts"));
                break;

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

            // A component pouch or an arcane focus
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

            case 0:
                OtherEquipment.Add("Component Pouch");
                break;

            case 1:
                OtherEquipment.Add("Arcane Focus");
                break;
            }

            // 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;
            }

            // Two daggers
            AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Dagger").ToList()[0]);
            AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Dagger").ToList()[0]);

            //////////////
            //  SPELLS  //
            //////////////

            // At level 1 sorcerers get
            // 4 x Cantrips
            // 2 x 2 First level spells

            SpellSlots = 2;

            List <string> sorcererCantrips = new List <string>()
            {
                "Acid Splash",
                "Chill Touch",
                "Dancing Lights",
                "Fire Bolt",
                "Light",
                "Mage Hand",
                "Mending",
                "Message",
                "Minor Illusion",
                "Prestidigitation",
                "Ray of Frost",
                "Shocking Grasp",
                "True Strike"
            };

            Cantrips = Tools.ReturnXSpellsFromList(sorcererCantrips, 4);

            List <string> sorcererLevel1Spells = new List <string>()
            {
                "Burning Hands",
                "Charm Person",
                "Color Spray",
                "Comprehend Languages",
                "Detect Magic",
                "Disguise Self",
                "Expeditious Retreat",
                "False Life",
                "Feather Fall",
                "Fog Cloud",
                "Jump",
                "Mage Armor",
                "Magic Missile",
                "Shield",
                "Silent Image",
                "Sleep",
                "Thunderwave"
            };

            Level1Spells = Tools.ReturnXSpellsFromList(sorcererLevel1Spells, SpellSlots);

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

            Features.Add(new Feature("Spellcasting", "", 1));

            Features.Add(new Feature("Sorcerous Origin", "", 1));
            // SRD only contains draconic bloodline
            SorcerousOrigin = "Draconic";



            Dictionary <string, string> DA = new Dictionary <string, string>()
            {
                { "Black", "Acid" },
                { "Blue", "Lightning" },
                { "Brass", "Fire" },
                { "Bronze", "Lightning" },
                { "Copper", "Acid" },
                { "Gold", "Fire" },
                { "Green", "Poison" },
                { "Red", "Fire" },
                { "Silver", "Cold" },
                { "White", "Cold" }
            };

            int index = Tools.GetRandomNumberInRange(0, DA.Count - 1);
            KeyValuePair <string, string> pair = DA.ElementAt(index);

            DraconicAncestry = pair;

            // Hitpoint +1 per level added in Character.cs SetLevel1HitPoints()
            // Unarmored AC = 13 + Dex mod added in Character.cs CalculateArmorClass()
        }
コード例 #10
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];
        }
コード例 #11
0
        public Ranger()
        {
            SetName("Ranger");
            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>()
                  {
                      "Strength", "Dexterity"
                  } },
                { "Skills", new List <string>()
                  {
                  } }
            };

            // Paladins can select two skills from the following list
            var rangerSkillProfs = new List <string>()
            {
                "Animal Handling",
                "Athletics",
                "Insight",
                "Investigation",
                "Nature",
                "Perception",
                "Stealth",
                "Survival"
            };

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

            SetProficiencies(Proficiencies);


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

            // Rangers start with two shortswords or two simple melee weapons
            Weapon        shortSword    = GetWeapons().Where(w => w.Name == "Shortsword").ToList()[0];
            List <Weapon> simpleWeapons = Tools.ShuffleList(GetWeapons().Where(w => w.WeaponType == "Simple Melee").ToList());

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

            case 0:
                PrimaryWeapon = shortSword;
                OffHandWeapon = shortSword;
                break;

            case 1:
                PrimaryWeapon = simpleWeapons[0];
                OffHandWeapon = simpleWeapons[1];
                break;
            }
            // scale mail or leather armor
            switch (Tools.GetRandomNumberInRange(0, 1))
            {
            default: throw new System.Exception("number not in range");

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

            case 1:
                Armor = GetArmor().Where(a => a.Name == "Leather Armor").ToList()[0];
                break;
            }

            // 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;
            }

            // A longbow and a quiver of 20 arrows
            AdditionalWeapons.Add(GetWeapons().Where(w => w.Name == "Longbow").ToList()[0]);
            Ammunition.Add(new Ammunition("longbow arrows", 20, "A quiver of longbow arrows"));

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

            Features.Add(new Feature("Favored Enemy", "", 1));

            List <string> favoredEnemyList = new List <string>()
            {
                "aberrations",
                "beasts",
                "celestials",
                "constructs",
                "dragons",
                "elementals",
                "fey",
                "fiends",
                "giants",
                "monstrosities",
                "oozes",
                "plants",
                "undead"
            };

            // Will need to add the rest later, need to confirm an SRD list
            List <string> alternativefavoredEnemyList = new List <string>()
            {
                "gnolls",
                "orcs",
                "bugbears",
                "drow",
                "duergar",
                "dwarves",
                "elves",
                "gnomes",
                "goblins",
                "half-orcs",
                "half-elfs",
                "halflings",
                "hobgoblins",
                "humans",
                "kobolds",
                "lizardfolk",
                "maenads",
                "merfolk",
                "orcs",
                "svirfneblin",
                "troglodytes",
                "vampires",
                "werebears",
                "wereboars",
                "wererats",
                "weretigers",
                "werewolves",
                "Xephs"
            };

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

            case 0:
                FavoredEnemy.Add(Tools.ShuffleList(favoredEnemyList)[0]);
                break;

            case 1:
                var shuffledAltList = Tools.ShuffleList(alternativefavoredEnemyList);
                FavoredEnemy.Add(shuffledAltList[0]);
                FavoredEnemy.Add(shuffledAltList[1]);
                break;
            }

            Features.Add(new Feature("Natural Explorer", "", 1));

            List <string> favoredTerrain = new List <string>()
            {
                "arctic",
                "coast",
                "desert",
                "forest",
                "grassland",
                "mountain",
                "swamp"
            };

            FavoredTerrain = Tools.ShuffleList(favoredTerrain)[0];
        }