Exemplo n.º 1
0
            private static float AdjustedToolArmourPenetration(float armourPenetration, VerbProperties instance, Tool tool, Pawn attacker, Thing equipment, HediffComp_VerbGiver hediffCompSource)
            {
                // Scale AP with stuff and pawn age
                if (TinyTweaksSettings.meleeArmourPenetrationFix && armourPenetration > -1)
                {
                    // Factor in equipment stuff
                    if (equipment != null && equipment.Stuff != null && instance.meleeDamageDef != null)
                    {
                        armourPenetration *= equipment.Stuff.GetStatValueAbstract(instance.meleeDamageDef.armorCategory.multStat);
                    }

                    // Factor in attacker
                    if (attacker != null)
                    {
                        armourPenetration *= instance.GetDamageFactorFor(tool, attacker, hediffCompSource);
                    }
                }
                return(armourPenetration);
            }