Пример #1
0
 /// <summary>
 /// Determines whether this instance is qualified the specified character.
 /// Character must have equal to or more of the specified ability
 /// </summary>
 /// <returns>true if the character is qualified</returns>
 /// <param name="character">Character to assess qualification.</param>
 public override bool IsQualified(CharacterSheet character)
 {
     return(character.AbilityScores.GetScore(this.Ability) >= this.Minimum);
 }
Пример #2
0
 /// <summary>
 /// Determines whether this instance is qualified the specified character.
 /// </summary>
 /// <returns>true if the character is qualified</returns>
 /// <param name="character">Character to assess qualification.</param>
 public override bool IsQualified(CharacterSheet character)
 {
     return(false);
 }
Пример #3
0
 /// <summary>
 /// Figures out if the character is qualified.
 /// </summary>
 /// <param name="character">Character to validate.</param>
 /// <returns>true if the character is qualified</returns>
 public bool IsQualified(CharacterSheet character)
 {
     return(Prerequisites.IsQualified(character));
 }
Пример #4
0
 /// <summary>
 /// Determines whether this instance is qualified the specified character.
 /// </summary>
 /// <returns><c>true</c> if this instance is qualified the specified character; otherwise, <c>false</c>.</returns>
 /// <param name="character">Character to assess qualification.</param>
 public abstract bool IsQualified(CharacterSheet character);
Пример #5
0
 /// <summary>
 /// Gets the qualifying feats that are also in tagged with the specified value.
 /// Allows getting qualifying combat feats for example
 /// </summary>
 /// <returns>The qualifying feats.</returns>
 /// <param name="character">Character to qualify.</param>
 /// <param name="tag">Tags to filter the feats.</param>
 public static IEnumerable <Feat> GetQualifyingFeats(CharacterSheet character, string tag)
 {
     return(GetQualifyingFeats(character).Where(x =>
                                                x.Tags.Contains(tag) || string.IsNullOrEmpty(tag)));
 }
Пример #6
0
 /// <summary>
 /// Gets all the qualifying feats for a character.
 /// </summary>
 /// <returns>The qualifying feats.</returns>
 /// <param name="character">Character that is validating.</param>
 public static IEnumerable <Feat> GetQualifyingFeats(CharacterSheet character)
 {
     return(GetFeats().Where(x => x.IsQualified(character) && !character.Feats.Contains(x)));
 }
Пример #7
0
        public CharacterSheetTextView(CharacterSheet character)
        {
            Name                 = character.Name;
            Gender               = character.Gender.ToString();
            Pronoun              = character.Gender.Pronoun();
            PossessivePronoun    = character.Gender.PossessivePronoun();
            this.Race            = Default(character.Race, SilverNeedle.Characters.Race.None).Name;
            this.Class           = Default(character.Class, SilverNeedle.Characters.Class.CreateForTesting()).Name;
            Alignment            = character.Alignment.ShortString();
            Initiative           = character.Initiative.TotalValue.ToModifierString();
            Senses               = FormatSenses(character);
            Perception           = character.SkillRanks.GetScore("Perception").ToModifierString();
            Size                 = character.Size.Size.ToString();
            Level                = character.Level.ToString();
            ArmorClass           = character.Defense.ArmorClass.ToString();
            TouchArmorClass      = character.Defense.TouchArmorClass.TotalValue.ToString();
            FlatFootedArmorClass = character.Defense.FlatFootedArmorClass.TotalValue.ToString();
            SpellResistance      = character.Defense.SpellResistance.TotalValue.ToString();
            HitPoints            = character.HitPoints.TotalValue.ToString();
            FortitudeSave        = character.Defense.FortitudeSave.ToString();
            ReflexSave           = character.Defense.ReflexSave.ToString();
            WillSave             = character.Defense.WillSave.ToString();
            DamageResistance     = character.Defense.EnergyResistance.Select(x => x.DisplayString()).ToArray();
            Immunities           = character.Defense.Immunities.Select(x => x.DamageType).ToArray();
            MovementSpeed        = character.Movement.MovementSpeed.ToString();
            MovementSquares      = character.Movement.BaseSquares.ToString();
            AttackTypes          = character.Offense.Attacks().Select(x => x.AttackType.ToString()).ToArray();
            Attacks              = character.Offense.Attacks().Select(x => x.DisplayString()).ToArray();
            Strength             = character.AbilityScores.GetScore(AbilityScoreTypes.Strength).ToString();
            StrengthModifier     = character.AbilityScores.GetModifier(AbilityScoreTypes.Strength).ToModifierString();

            Dexterity         = character.AbilityScores.GetScore(AbilityScoreTypes.Dexterity).ToString();
            DexterityModifier = character.AbilityScores.GetModifier(AbilityScoreTypes.Dexterity).ToModifierString();

            Constitution         = character.AbilityScores.GetScore(AbilityScoreTypes.Constitution).ToString();
            ConstitutionModifier = character.AbilityScores.GetModifier(AbilityScoreTypes.Constitution).ToModifierString();

            Intelligence         = character.AbilityScores.GetScore(AbilityScoreTypes.Intelligence).ToString();
            IntelligenceModifier = character.AbilityScores.GetModifier(AbilityScoreTypes.Intelligence).ToModifierString();

            Wisdom         = character.AbilityScores.GetScore(AbilityScoreTypes.Wisdom).ToString();
            WisdomModifier = character.AbilityScores.GetModifier(AbilityScoreTypes.Wisdom).ToModifierString();

            Charisma         = character.AbilityScores.GetScore(AbilityScoreTypes.Charisma).ToString();
            CharismaModifier = character.AbilityScores.GetModifier(AbilityScoreTypes.Charisma).ToModifierString();

            BaseAttackBonus       = character.Offense.BaseAttackBonus.ToString();
            CombatManeuverBonus   = character.Offense.CombatManeuverBonus.ToString();
            CombatManeuverDefense = character.Offense.CombatManeuverDefense.ToString();

            Feats         = character.Feats.Select(x => x.Name).ToArray();
            CapableSkills = character.SkillRanks.GetRankedSkills().Select(x => x.ToString()).ToArray();
            AllSkills     = character.SkillRanks.GetSkills().Select(x => x.ToString()).ToArray();

            Languages = character.Languages.Select(x => x.Name).ToArray();
            Gear      = character.Inventory.ToStringArray();

            Father      = character.History.FamilyTree.FatherName;
            Mother      = character.History.FamilyTree.MotherName;
            ClassOrigin = character.History.ClassOriginStory.Name;
            Drawback    = character.History.Drawback.Name;
            Homeland    = character.History.Homeland.Location;
            if (character.PersonalityType.Descriptors.HasChoices())
            {
                Personality = character.PersonalityType.Descriptors.Choose(3).ToArray();
            }
            if (character.PersonalityType.Weaknesses.HasChoices())
            {
                PersonalityWeaknesses = character.PersonalityType.Weaknesses.Choose(3).ToArray();
            }
            if (character.Ideal != null)
            {
                IdealName        = character.Ideal.Name;
                IdealDescription = character.Ideal.Description;
            }
            Quirks     = character.Get <Quirks>().Items.ToArray();
            FacialHair = character.Appearance.FacialHair.ToString();
            Age        = character.Age.ToString();
            Height     = character.Size.Height.ToInchesAndFeet();
            Weight     = character.Size.Weight.ToPoundsString();
            Money      = character.Inventory.CoinPurse.ToString();

            SpecialAbilities = character.Abilities.Select(x => x.DisplayString()).ToArray();
        }
Пример #8
0
 public bool IsQualifiedIgnorePrerequisites(CharacterSheet character)
 {
     return(!character.Feats.Contains(this) || this.AllowMultiple);
 }
Пример #9
0
 /// <summary>
 /// Figures out if the character is qualified.
 /// </summary>
 /// <param name="character">Character to validate.</param>
 /// <returns>true if the character is qualified</returns>
 public virtual bool IsQualified(CharacterSheet character)
 {
     return(Prerequisites.IsQualified(character.Components) &&
            IsQualifiedIgnorePrerequisites(character));
 }