public void ValueModifiersChangeTheModifierValue() { var yaml = @"--- name: Damage dice: 1d8"; var diceStat = new DiceStatistic(yaml.ParseYaml()); var mod = new ValueStatModifier("Damage", 6, "modifier"); diceStat.AddModifier(mod); Assert.Equal("1d8+6", diceStat.DisplayString()); }
public void DiceStatisticsCanParseADiceStringForTheirBasicStats() { var yaml = @"--- name: Damage dice: 1d8"; var diceStat = new DiceStatistic(yaml.ParseYaml()); Assert.Equal("1d8", diceStat.Dice.ToString()); Assert.Equal("Damage", diceStat.Name); Assert.Equal("1d8", diceStat.DisplayString()); }
public void AddsDiceToTheStatisticBasedOnLevelOfCharacter() { var character = CharacterTestTemplates.Cleric(); var diceStat = new DiceStatistic("stat-name", "1d6"); character.Add(diceStat); //Example based on channel energy var yaml = @"--- name: stat-name class: cleric dice: 1d6 rate: 2 start-level: 1"; var mod = new DiceClassLevelModifier(yaml.ParseYaml()); character.Add(mod); Assert.Equal("1d6", diceStat.DisplayString()); character.SetLevel(2); Assert.Equal("1d6", diceStat.DisplayString()); character.SetLevel(3); Assert.Equal("2d6", diceStat.DisplayString()); character.SetLevel(4); Assert.Equal("2d6", diceStat.DisplayString()); character.SetLevel(12); Assert.Equal("6d6", diceStat.DisplayString()); character.SetLevel(19); Assert.Equal("10d6", diceStat.DisplayString()); }
public void DiceStatisticsCanHaveModifiersAddedToThemToAddDiceToTheCup() { var yaml = @"--- name: Damage dice: 1d8"; var diceStat = new DiceStatistic(yaml.ParseYaml()); var mod = @"--- name: Damage dice: 1d6"; var modifier = new AddDiceModifier(mod.ParseYaml()); diceStat.AddModifier(modifier); Assert.Equal("1d8+1d6", diceStat.DisplayString()); }