Example #1
0
        /// <summary>
        /// Creates a Level 0 character. A level 0 character has no class but has the basic attributes selected
        /// Think of this as a young character before identifying their professions
        /// </summary>
        /// <returns>The level0.</returns>
        public CharacterSheet CreateLevel0()
        {
            var character = new CharacterSheet(this.skillGateway.All());

            character.Gender    = EnumHelpers.ChooseOne <Gender>();
            character.Alignment = EnumHelpers.ChooseOne <CharacterAlignment>();
            this.abilityGenerator.AssignAbilities(character.AbilityScores);
            this.raceSelector.ChooseRace(character);

            character.Languages.Add(
                this.languageSelector.PickLanguages(
                    character.Race,
                    character.AbilityScores.GetModifier(AbilityScoreTypes.Intelligence)));

            // Assign Age to adult
            character.Age = maturityGateway.Get(character.Race).Adulthood;

            //Generate a facial description
            var facials = new CreateFacialFeatures();

            character.FacialDescription = facials.CreateFace(character.Gender);

            // Names come last
            character.Name = this.nameGenerator.CreateFullName(character.Gender, character.Race.Name);

            character.History = GenerateHistory(character);

            return(character);
        }
Example #2
0
        /// <summary>
        /// Assigns the ability points.
        /// </summary>
        /// <param name="character">Character to assign an ability point to.</param>
        private void AssignAbilityPoints(CharacterSheet character)
        {
            // TODO: Move to generator / assigner / selector
            var ability = EnumHelpers.ChooseOne <AbilityScoreTypes>();
            var adjust  = new AbilityScoreAdjustment();

            adjust.Reason      = "Level Up";
            adjust.Modifier    = 1;
            adjust.AbilityName = ability;

            character.AbilityScores.GetAbility(ability).AddModifier(adjust);
        }
Example #3
0
 /// <summary>
 /// Sets the ability scores for race.
 /// </summary>
 /// <param name="abilities">Abilities for adjustments.</param>
 /// <param name="race">Race selected.</param>
 private void SetAbilityScoresForRace(AbilityScores abilities, Race race)
 {
     // Add Ability Modifiers
     foreach (var adj in race.AbilityModifiers)
     {
         if (adj.RacialModifier)
         {
             var ability = EnumHelpers.ChooseOne <AbilityScoreTypes>();
             var a       = abilities.GetAbility(ability);
             a.AddModifier(adj);
         }
         else
         {
             var a = abilities.GetAbility(adj.AbilityName);
             a.AddModifier(adj);
         }
     }
 }
Example #4
0
        public FacialDescription CreateFace(Gender gender)
        {
            var facial = new FacialDescription();

            facial.EyeColor  = EnumHelpers.ChooseOne <EyeColors>();
            facial.HairColor = EnumHelpers.ChooseOne <HairColors>();
            facial.HairStyle = EnumHelpers.ChooseOne <HairStyles>();

            if (gender == Gender.Male)
            {
                facial.FacialHair = EnumHelpers.ChooseOne <FacialHairStyles>();
            }
            else
            {
                facial.FacialHair = FacialHairStyles.None;
            }

            return(facial);
        }
Example #5
0
        private void NameParents(FamilyTree familyTree, string race, string lastName)
        {
            var matcher = EnumHelpers.ChooseOne <SurnameMatcher>();

            familyTree.Father.FirstName = namer.GetFirstName(Gender.Male, race);
            familyTree.Mother.FirstName = namer.GetFirstName(Gender.Female, race);
            if (matcher == SurnameMatcher.MotherMatch)
            {
                familyTree.Father.LastName = namer.GetLastName(race);
            }
            else
            {
                familyTree.Father.LastName = lastName;
            }
            if (matcher == SurnameMatcher.FatherMatch)
            {
                familyTree.Mother.LastName = namer.GetLastName(race);
            }
            else
            {
                familyTree.Mother.LastName = lastName;
            }
        }
Example #6
0
 public void ExecuteStep(CharacterSheet character)
 {
     character.Gender = EnumHelpers.ChooseOne <Gender>();
 }