Exemplo n.º 1
0
        public void AddItem(Item item)
        {
            if (item.Modifier.AffectedObject == AffectedObject.Stats && item.Modifier.AffectedValue == "constitution")
            {
                HitPoints.AddToMax((int)Math.Floor((item.Modifier.Value / 2.0)) * Level);
            }

            _items.Add(item);
        }
Exemplo n.º 2
0
 public Character(
     Name name,
     int str,
     int dex,
     int con,
     int wis,
     int _int,
     int cha)
 {
     Name      = name;
     Stats     = Stats.SetStats(str, dex, con, wis, _int, cha).Value;
     HitPoints = HitPoints.NewCharacter().Value;
 }
Exemplo n.º 3
0
        public void CalculateNewMaxHitPoints(Class _class)
        {
            var addedCon = 0;

            if (_items != null)
            {
                addedCon = _items.Where(e => e.Modifier.AffectedObject == AffectedObject.Stats && e.Modifier.AffectedValue == "constitution").Sum(e => e.Modifier.Value);
            }
            Random rand     = new Random();
            var    rolledHp = rand.Next(1, _class.HitDiceValue);

            var conbonus = (int)Math.Floor(((Stats.Constitution + addedCon) - 10) / 2.0);

            var addingHp = (rolledHp + conbonus) * _class.ClassLevel;

            HitPoints.AddToMax(addingHp);
        }