예제 #1
0
        private string AdjustChallengeRating(string originalChallengeRating, int additionalHitDice, string creatureType)
        {
            var creatureTypeDivisor = typeAndAmountSelector.SelectOne(TableNameConstants.TypeAndAmount.Advancements, creatureType);
            var divisor             = creatureTypeDivisor.Amount;
            var advancementAmount   = additionalHitDice / divisor;

            return(ChallengeRatingConstants.IncreaseChallengeRating(originalChallengeRating, advancementAmount));
        }
예제 #2
0
 private void UpdateCreatureChallengeRating(Creature creature)
 {
     if (creature.HitPoints.RoundedHitDiceQuantity >= 8)
     {
         creature.ChallengeRating = ChallengeRatingConstants.IncreaseChallengeRating(creature.ChallengeRating, 2);
     }
     else if (creature.HitPoints.RoundedHitDiceQuantity >= 4)
     {
         creature.ChallengeRating = ChallengeRatingConstants.IncreaseChallengeRating(creature.ChallengeRating, 1);
     }
 }
예제 #3
0
        private void UpdateCreatureChallengeRating(Creature creature)
        {
            var challengeRatings = ChallengeRatingConstants.GetOrdered();
            var index            = Array.IndexOf(challengeRatings, creature.ChallengeRating);
            var threeIndex       = Array.IndexOf(challengeRatings, ChallengeRatingConstants.Three);

            if (index > -1 && index + 2 < threeIndex)
            {
                creature.ChallengeRating = ChallengeRatingConstants.Three;
            }
            else
            {
                creature.ChallengeRating = ChallengeRatingConstants.IncreaseChallengeRating(creature.ChallengeRating, 2);
            }
        }
예제 #4
0
        private string AdjustChallengeRating(string originalSize, string advancedSize, string originalChallengeRating)
        {
            var sizes             = SizeConstants.GetOrdered();
            var originalSizeIndex = Array.IndexOf(sizes, originalSize);
            var advancedIndex     = Array.IndexOf(sizes, advancedSize);
            var largeIndex        = Array.IndexOf(sizes, SizeConstants.Large);

            if (advancedIndex < largeIndex || originalSize == advancedSize)
            {
                return(originalChallengeRating);
            }

            var increase = advancedIndex - Math.Max(largeIndex - 1, originalSizeIndex);
            var adjustedChallengeRating = ChallengeRatingConstants.IncreaseChallengeRating(originalChallengeRating, increase);

            return(adjustedChallengeRating);
        }
예제 #5
0
        private void UpdateCreatureChallengeRating(Creature creature, HitPoints animalHitPoints)
        {
            var increase = 2;

            if (animalHitPoints.HitDice[0].Quantity > 20)
            {
                increase = 6;
            }
            else if (animalHitPoints.HitDice[0].Quantity > 10)
            {
                increase = 5;
            }
            else if (animalHitPoints.HitDice[0].Quantity > 5)
            {
                increase = 4;
            }
            else if (animalHitPoints.HitDice[0].Quantity > 2)
            {
                increase = 3;
            }

            creature.ChallengeRating = ChallengeRatingConstants.IncreaseChallengeRating(creature.ChallengeRating, increase);
        }
예제 #6
0
 private void UpdateCreatureChallengeRating(Creature creature)
 {
     creature.ChallengeRating = ChallengeRatingConstants.IncreaseChallengeRating(creature.ChallengeRating, 2);
 }
예제 #7
0
        public void IncreaseOutOfRange_Zero(int increase)
        {
            var newCr = ChallengeRatingConstants.IncreaseChallengeRating(ChallengeRatingConstants.Zero, increase);

            Assert.That(newCr, Is.EqualTo(increase.ToString()));
        }
예제 #8
0
        public void IncreaseOutOfRange_Fractional(string cr, int increase, int expected)
        {
            var newCr = ChallengeRatingConstants.IncreaseChallengeRating(cr, increase);

            Assert.That(newCr, Is.EqualTo(expected.ToString()));
        }
예제 #9
0
        public void IncreaseOutOfRange_Whole()
        {
            var newCr = ChallengeRatingConstants.IncreaseChallengeRating("9266", 90210);

            Assert.That(newCr, Is.EqualTo(99476.ToString()));
        }
예제 #10
0
        public void Increase_WholeNumber(string challengeRating, int increase, string expected)
        {
            var newCr = ChallengeRatingConstants.IncreaseChallengeRating(challengeRating, increase);

            Assert.That(newCr, Is.EqualTo(expected));
        }