コード例 #1
0
        public Tiefling()
        {
            SetName("Tiefling");

            SetRacePerk("Ability Score Increase", "Your Intelligence score increases by 1, and your Charisma score increases by 2.");
            SetAbilityScoreIncrease("INT", 1);
            SetAbilityScoreIncrease("CHA", 2);

            SetRacePerk("Age", "Tieflings mature at the same rate as humans but live a few years longer.");
            SetAge(Tools.GetRandomNumberInRange(18, 70));

            SetRacePerk("Alignment", " Tieflings might not have an innate tendency toward evil, but many of them end up there. Evil or not, an independent nature inclines many tieflings toward a chaotic alignment.");

            List <KeyValuePair <string, float> > weightedAlignments = new List <KeyValuePair <string, float> >()
            {
                new KeyValuePair <string, float>("Lawful Good", 0.0f),
                new KeyValuePair <string, float>("Neutral Good", 0.1f),
                new KeyValuePair <string, float>("Chaotic Good", 0.1f),
                new KeyValuePair <string, float>("Lawful Neutral", 0.0f),
                new KeyValuePair <string, float>("True Neutral", 0.1f),
                new KeyValuePair <string, float>("Chaotic Neutral", 0.1f),
                new KeyValuePair <string, float>("Lawful Evil", 0.1f),
                new KeyValuePair <string, float>("Neutral Evil", 0.1f),
                new KeyValuePair <string, float>("Chaotic Evil", 0.4f),
            };

            SetAlignment(weightedAlignments);

            SetRacePerk("Size", "Tieflings are about the same size and build as humans. Your size is Medium.");
            SetSize("Medium");

            SetRacePerk("Speed", "Your base walking speed is 30 feet.");
            SetSpeed(30);

            SetRacePerk("Darkvision", "Thanks to your infernal heritage, you have superior vision in dark and dim conditions. You can see in dim light within 60 feet of you as if it were bright light, and in darkness as if it were dim light. You can’t discern color in darkness, only shades of gray.");
            FeaturesToAdd.Add(new Feature("Darkvision", "Accustomed to life underground, you have superior vision in dark and dim conditions. You can see in dim light within 60 feet of you as if it were bright light, and in darkness as if it were dim light. You can’t discern color in darkness, only shades of gray.", 1));

            SetRacePerk("Hellish Resistance", "You have resistance to fire damage.");
            FeaturesToAdd.Add(new Feature("Hellish Resistance", "You have resistance to fire damage.", 1));

            SetRacePerk("Infernal Legacy", "You know the thaumaturgy cantrip. When you reach 3rd level, you can cast the hellish rebuke spell as a 2nd-level spell once with this trait and regain the ability to do so when you finish a long rest. When you reach 5th level, you can cast the darkness spell once with this trait and regain the ability to do so when you finish a long rest. Charisma is your spellcasting ability for these spells.");
            SpellsToAdd.Add("Thaumaturgy");

            SetRacePerk("Languages", "You can speak, read, and write Common and Infernal.");
            AddLangugage("Common");
            AddLangugage("Infernal");
        }
コード例 #2
0
        public Elf()
        {
            SetName("Elf");

            SetRacePerk("Ability Score Increase", "Ability Score Increase. Your Dexterity score increases by 2.");
            SetAbilityScoreIncrease("DEX", 2);

            SetRacePerk("Age", " Although elves reach physical maturity at about the same age as humans, the elven understanding of adulthood goes beyond physical growth to encompass worldly experience. An elf typically claims adulthood and an adult name around the age of 100 and can live to be 750 years old.");
            SetAge(Tools.GetRandomNumberInRange(100, 750));

            SetRacePerk("Alignment", "Elves love freedom, variety, and self-expression, so they lean strongly toward the gentler aspects of chaos. They value and protect others’ freedom as well as their own, and they are more often good than not. The drow are an exception; their exile has made them vicious and dangerous. Drow are more often evil than not.");

            List <KeyValuePair <string, float> > weightedAlignments = new List <KeyValuePair <string, float> >()
            {
                new KeyValuePair <string, float>("Lawful Good", 0.1f),
                new KeyValuePair <string, float>("Neutral Good", 0.1f),
                new KeyValuePair <string, float>("Chaotic Good", 0.3f),
                new KeyValuePair <string, float>("Lawful Neutral", 0.0f),
                new KeyValuePair <string, float>("True Neutral", 0.1f),
                new KeyValuePair <string, float>("Chaotic Neutral", 0.3f),
                new KeyValuePair <string, float>("Lawful Evil", 0.0f),
                new KeyValuePair <string, float>("Neutral Evil", 0.0f),
                new KeyValuePair <string, float>("Chaotic Evil", 0.1f),
            };

            SetAlignment(weightedAlignments);
            weightedAlignments = null;

            SetRacePerk("Size", "Elves range from under 5 to over 6 feet tall and have slender builds. Your size is Medium.");
            SetSize("Medium");

            SetRacePerk("Speed", "Your base walking speed is 30 feet.");
            SetSpeed(30);

            FeaturesToAdd.Add(new Feature("Darkvision", "Accustomed to life underground, you have superior vision in dark and dim conditions. You can see in dim light within 60 feet of you as if it were bright light, and in darkness as if it were dim light. You can’t discern color in darkness, only shades of gray.", 1));

            //TODO Add logic to include additional proficiency
            FeaturesToAdd.Add(new Feature("Keen Senses", "You have proficiency in the Perception skill.", 1));
            AddRaceProficiency("Perception", "skill");

            FeaturesToAdd.Add(new Feature("Fey Ancestry", "You have advantage on saving throws against being charmed, and magic can’t put you to sleep.", 1));
            FeaturesToAdd.Add(new Feature("Trance", "Elves don’t need to sleep. Instead, they meditate deeply, remaining semiconscious, for 4 hours a day. (The Common word for such meditation is \"trance.\") While meditating, you can dream after a fashion; such dreams are actually mental exercises that have become reflexive through years of practice. After resting in this way, you gain the same benefit that a human does from 8 hours of sleep.", 1));

            SetRacePerk("Languages", "You can speak, read, and write Common and Elvish. Elvish is fluid, with subtle intonations and intricate grammar. Elven literature is rich and varied, and their songs and poems are famous among other races. Many bards learn their language so they can add Elvish ballads to their repertoires.");
            AddLangugage("Common");
            AddLangugage("Elvish");

            SetSubRace("High Elf");
            SetRacePerk("Ability Score Increase (High Elf)", "Your Intelligence score increases by 1.");
            SetAbilityScoreIncrease("INT", 1);

            //TODO Add logic to include additional proficiency
            SetRacePerk("Elf Weapon Training", "You have proficiency with the longswords, shortsword, shortbow, and longbow.");
            AddRaceProficiency(new List <string>()
            {
                "Longswords", "Shortsword", "Shortbow", "Longbow"
            }, "weapon");

            SetRacePerk("Cantrip", "You know one cantrip of your choice from the wizard spell list. Intelligence is your spellcasting ability for it.");

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

            // Grabs a random element from the wizard cantrip list above
            SpellsToAdd.Add(wizardCantrips[new Random().Next(0, wizardCantrips.Count)]);

            SetRacePerk("Extra Language", "You can speak, read, and write one extra language of your choice.");
            AddLangugage();
            ;
        }