示例#1
0
        /// <summary>
        /// Calculates what attacks are available to this instance
        /// </summary>
        /// <returns>List of attacks that are available</returns>
        public IList <AttackStatistic> Attacks()
        {
            var attacks = new List <AttackStatistic>();

            // Get A list of weapons and return them
            foreach (var weapon in this.inventory.Weapons)
            {
                var atk = new AttackStatistic();
                atk.Name   = weapon.Name;
                atk.Weapon = weapon;
                atk.Damage = DiceStrings.ParseDice(DamageTables.ConvertDamageBySize(weapon.Damage, this.Size.Size));
                if (weapon.IsMelee)
                {
                    atk.Damage.Modifier = AbilityScores.GetModifier(AbilityScoreTypes.Strength);
                    atk.AttackBonus     = this.MeleeAttackBonus();
                }
                else if (weapon.IsRanged)
                {
                    atk.AttackBonus = this.RangeAttackBonus();
                }

                // If not proficient, add a penalty to the attack bonus
                if (!this.IsProficient(weapon))
                {
                    atk.AttackBonus += UnproficientWeaponModifier;
                }

                attacks.Add(atk);
            }

            return(attacks);
        }
示例#2
0
 /// <summary>
 /// Gets the skill points per level.
 /// </summary>
 /// <returns>The skill points per level.</returns>
 public int GetSkillPointsPerLevel()
 {
     return(Class.SkillPoints + AbilityScores.GetModifier(AbilityScoreTypes.Intelligence));
 }