public void ProcessModifier(Cup dice) { var copy = dice.Copy(); dice.Dice.Clear(); dice.AddDice(Equipment.DamageTables.ConvertDamageBySize(copy, Size).Dice); }
public void MultiplesOfTheSameDiceCanBeAdded() { var cup = new Cup(); cup.AddDice( Die.GetDice(DiceSides.d6, 4) ); Assert.Equal(new Die[] { Die.D6(), Die.D6(), Die.D6(), Die.D6() }, cup.Dice); }
public void CanBeSetToAllowsRollTheMaximumValue() { var cup = new Cup(); cup.AddDice(Die.GetDice(DiceSides.d6, 10)); cup.MaximizeAmount = true; Assert.Equal(60, cup.Roll()); Assert.Equal(60, cup.Roll()); Assert.Equal(60, cup.Roll()); }
public static Cup ConvertDamageBySize(Cup dice, CharacterSize size) { Cup converted = new Cup(); converted.Modifier = dice.Modifier; dice.Modifier = 0; var dieString = dice.ToString(); int index = mediumDamageTable.IndexOf(dieString); if (index == -1) { throw new DamageTableValueNotFoundException(dieString); } switch (size) { case CharacterSize.Tiny: converted.AddDice(DiceStrings.ParseDice(tinyDamageTable[index]).Dice); break; case CharacterSize.Small: converted.AddDice(DiceStrings.ParseDice(smallDamageTable[index]).Dice); break; case CharacterSize.Medium: converted.AddDice(DiceStrings.ParseDice(mediumDamageTable[index]).Dice); break; case CharacterSize.Large: converted.AddDice(DiceStrings.ParseDice(largeDamageTable[index]).Dice); break; default: throw new NotImplementedException(string.Format("Character Size: {0} has not been implemented in damage tables.", size)); } return(converted); }
public void ProcessModifier(Cup dice) { int diceCount = (classLevel.Level - StartLevel) / Rate; Repeat.Times(diceCount, () => dice.AddDice(DicePerLevel.Dice)); }