Esempio n. 1
0
        public void FromData_ReturnsSelection_WithDamage()
        {
            var damageData  = damageHelper.BuildData("my roll", "my damage type", "my condition");
            var damageEntry = damageHelper.BuildEntry(damageData);

            var data    = attackHelper.BuildData("name", damageEntry, "effect", 4.2, "attack type", 9266, "time period", true, true, true, true, string.Empty, string.Empty);
            var rawData = attackHelper.BuildEntry(data);

            var selection = AttackSelection.From(rawData);

            Assert.That(selection.AttackType, Is.EqualTo("attack type"));
            Assert.That(selection.Damages, Has.Count.EqualTo(1));
            Assert.That(selection.Damages[0].Roll, Is.EqualTo("my roll"));
            Assert.That(selection.Damages[0].Type, Is.EqualTo("my damage type"));
            Assert.That(selection.Damages[0].Condition, Is.EqualTo("my condition"));
            Assert.That(selection.DamageEffect, Is.EqualTo("effect"));
            Assert.That(selection.DamageBonusMultiplier, Is.EqualTo(4.2));
            Assert.That(selection.FrequencyQuantity, Is.EqualTo(9266));
            Assert.That(selection.FrequencyTimePeriod, Is.EqualTo("time period"));
            Assert.That(selection.IsMelee, Is.True);
            Assert.That(selection.IsNatural, Is.True);
            Assert.That(selection.IsPrimary, Is.True);
            Assert.That(selection.IsSpecial, Is.True);
            Assert.That(selection.Name, Is.EqualTo("name"));
            Assert.That(selection.Save, Is.Empty);
            Assert.That(selection.SaveAbility, Is.Empty);
            Assert.That(selection.SaveDcBonus, Is.Zero);
        }
Esempio n. 2
0
        private AttackSelection Parse(string input, string originalSize, string advancedSize)
        {
            var selection = AttackSelection.From(input);

            if (selection.IsNatural && originalSize != advancedSize)
            {
                foreach (var damage in selection.Damages)
                {
                    damage.Roll = GetAdjustedDamage(damage.Roll, originalSize, advancedSize);
                }
            }

            return(selection);
        }