/// <summary>Applies the mutagenic damage.</summary>
        /// <param name="originalDamage">The original damage.</param>
        /// <param name="damageInfo">The damage information.</param>
        /// <param name="pawn">The pawn.</param>
        /// <param name="result">The result.</param>
        /// <param name="mutagenicDef">The definition of the mutagenic damage hediff to add.</param>
        /// <param name="severityPerDamage">The severity per damage.</param>
        /// <param name="mutagen">The mutagen.</param>
        /// <exception cref="ArgumentNullException">
        ///     pawn
        ///     or
        ///     result
        /// </exception>
        public static void ApplyMutagenicDamage(float originalDamage, DamageInfo damageInfo, [NotNull] Pawn pawn,
                                                [NotNull] DamageWorker.DamageResult result,
                                                HediffDef mutagenicDef = null, float severityPerDamage = SEVERITY_PER_DAMAGE,
                                                MutagenDef mutagen     = null)
        {
            if (pawn == null)
            {
                throw new ArgumentNullException(nameof(pawn));
            }
            if (result == null)
            {
                throw new ArgumentNullException(nameof(result));
            }
            MutagenicDamageExtension ext = damageInfo.Weapon?.GetModExtension <MutagenicDamageExtension>()
                                           ?? damageInfo.Def?.GetModExtension <MutagenicDamageExtension>();

            mutagen      = mutagen ?? MutagenDefOf.defaultMutagen;
            mutagenicDef = mutagenicDef
                           ?? ext?.mutagenicBuildup
                           ?? MorphTransformationDefOf.MutagenicBuildup_Weapon;
            //first check if we're given a specific hediff to use
            //then use what's ever attached to the damage def
            //then use the default

            if (!mutagen.CanInfect(pawn))
            {
                return;
            }

            ApplyMutagen(originalDamage, damageInfo, pawn, mutagenicDef, severityPerDamage, result);
        }
        /// <summary>Gets the severity per damage.</summary>
        /// <param name="dInfo">The damage information.</param>
        /// <returns></returns>
        public static float GetSeverityPerDamage(this DamageInfo dInfo)
        {
            MutagenicDamageExtension ext = dInfo.Weapon?.GetModExtension <MutagenicDamageExtension>()
                                           ?? dInfo.Def?.GetModExtension <MutagenicDamageExtension>();
            float severityPerDamage = ext?.severityPerDamage
                                      ?? SEVERITY_PER_DAMAGE;

            return(severityPerDamage);
        }
        /// <summary>
        ///     Applies the pure mutagenic damage.
        /// </summary>
        /// this does not actually damage the pawn
        /// <param name="dInfo">The damage info.</param>
        /// <param name="pawn">The pawn.</param>
        /// <param name="mutationHediffDef">The mutation hediff definition.</param>
        /// <param name="severityPerDamage">The severity per damage.</param>
        /// <param name="mutagen">The mutagen.</param>
        public static void ApplyPureMutagenicDamage(DamageInfo dInfo, [NotNull] Pawn pawn,
                                                    HediffDef mutationHediffDef = null,
                                                    float severityPerDamage     = SEVERITY_PER_DAMAGE, MutagenDef mutagen = null)
        {
            mutagen = mutagen ?? MutagenDefOf.defaultMutagen;
            MutagenicDamageExtension ext = dInfo.Weapon?.GetModExtension <MutagenicDamageExtension>()
                                           ?? dInfo.Def?.GetModExtension <MutagenicDamageExtension>();

            mutationHediffDef = mutationHediffDef
                                ?? ext?.mutagenicBuildup
                                ?? MorphTransformationDefOf.MutagenicBuildup_Weapon;
            //first check if we're given a specific hediff to use
            //then use what's ever attached to the damage def
            //then use the default

            float severityToAdd = Mathf.Clamp(dInfo.Amount * severityPerDamage, 0, mutationHediffDef.maxSeverity);

            Hediff hediff = HediffMaker.MakeHediff(mutationHediffDef, pawn);

            hediff.Severity = severityToAdd;
            pawn.health.AddHediff(hediff);
        }