DEFAULT_ARMOR = 1;

function Penetrate(WeaponDamage, armor, Distance)
	if not armor then return WeaponDamage / math.log10(10 + Distance) / 2 end
	local damage = WeaponDamage / math.log10(10 + Distance);
	local t = armor * armor * 0.1;

	if damage < t then 
		damage = damage / armor * 10;
	end
	return damage / 2;
end

local wound_coeff = 30;
local wound_level = 50;

function Wound(WeaponDamage, Distance)
	local damage = WeaponDamage / math.log10(10 + Distance);
	local rnd = object.RandomInt(100);
	if rnd > wound_coeff then
		damage = wound_level + damage * rnd;
	end
	return damage;
end

function WoundCoeff(WeaponDamage, Distance)
	local damage = WeaponDamage / math.log10(10 + Distance);
	return wound_coeff * damage + (100 - wound_coeff) * (wound_level + damage * 0.5 * (wound_coeff + 100));
end

function Splash(DetonationDamage, armor, DistFactor)
	local e = DetonationDamage * DistFactor * DistFactor;
	if armor > 0 then
		return (e / math.log10(armor)) / 6
	else
		return e / 3
	end
end
