public override IEnumerable <uint> GenerateScores(IRoller roller) { for (uint i = 0; i < ScoresCount; ++i) { yield return((uint)roller.RollMany(DieEnum.D6, 4).OrderBy(score => score).Skip(1).Sum(score => score)); } }
public uint GetD6ActionPointsRoll(Character character, IRoller roller) { uint rollsNumber = this.GetD6RollsAvailbleForActionPointRoll(character); if (rollsNumber == 1) { return(roller.Roll(DieEnum.D6)); } return(roller.RollMany(DieEnum.D6, rollsNumber).Max()); }
public override IEnumerable <uint> GenerateScores(IRoller roller) { uint[] numberOfDicesPerScore = new uint[ScoresCount]; numberOfDicesPerScore.Fill(3u); for (uint i = this._poolSize - (3 * ScoresCount); i <= this._poolSize; ++i) { numberOfDicesPerScore[roller.CoreGenerator.NextInt(0, (int)ScoresCount - 1)] += 1; } for (uint i = 0; i < ScoresCount; ++i) { yield return((uint)roller.RollMany(DieEnum.D6, numberOfDicesPerScore[i]).OrderByDescending(score => score).Take(3).Sum(score => score)); } }