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 Initialize(ComponentContainer components) { this.usesPerDayStatistic = new BasicStat(this.UsesPerDayStatName()); this.healingDice = new DiceStatistic("Lay On Hands Dice", "1d6"); components.Add(usesPerDayStatistic); components.Add(healingDice); paladinLevel = components.Get <ClassLevel>(); }
public void SetsTheCupToMaximizeItsAmount() { var yaml = @"--- name: stat"; var max = new DiceMaximizeAmountModifier(yaml.ParseYaml()); var diceStat = new DiceStatistic("stat", "10d6"); diceStat.AddModifier(max); Assert.True(diceStat.Dice.MaximizeAmount); }
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 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()); }
public ChannelEnergy(IObjectStore configuration) { SaveDC = new BasicStat(configuration.GetObject("save-dc-stat")); DamageDice = new DiceStatistic(configuration.GetObject("dice-stat")); usesPerDayStatistic = new BasicStat(configuration.GetObject("uses-per-day-stat")); }