Example #1
0
 internal Action(ActionInput input)
     : this()
 {
     Name = input.Name;
     if (input.AttributesUsed != null)
     {
         AttributesUsed.AddRange(input.AttributesUsed);
     }
     if (input.SkillsUsed != null)
     {
         SkillsUsed.AddRange(input.SkillsUsed);
     }
     Limit = input.Limit;
 }
Example #2
0
        public ActionResult Do(IDiceBag bag, ICharacter source)
        {
            if (bag == null)
            {
                throw new ArgumentNullException("bag");
            }
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            var times = 0;

            AttributesUsed.ForEach(x => times += source.Attributes[x]);
            SkillsUsed.ForEach(x => times     += source.Skills[x]);

            var pool    = new DicePool(bag, times);
            var results = (Limit == LimitType.None)
                ? pool.Roll()
                : pool.Roll(source.Attributes.LimitValue(Limit));
            var rollNotation = buildNotation(source);

            return(new ActionResult(rollNotation, results));
        }