Ejemplo 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);
        }
Ejemplo n.º 2
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);
        }