public static void ApplyAttributesTo( BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount )
{
m_IsRunicTool = isRunicTool;
m_LuckChance = luckChance;
m_Props.SetAll( false );
bool isShield = ( armor is BaseShield );
int baseCount = ( isShield ? 7 : 20 );
int baseOffset = ( isShield ? 0 : 4 );
if ( !isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All )
m_Props.Set( 3, true ); // remove mage armor from possible properties
if ( armor.Resource >= CraftResource.RegularLeather && armor.Resource <= CraftResource.BarbedLeather )
{
m_Props.Set( 0, true ); // remove lower requirements from possible properties for leather armor
m_Props.Set( 2, true ); // remove durability bonus from possible properties
}
if ( armor.RequiredRace == Race.Elf )
m_Props.Set( 7, true ); // elves inherently have night sight and elf only armor doesn't get night sight as a mod
for ( int i = 0; i < attributeCount; ++i )
{
int random = GetUniqueRandom( baseCount );
if ( random == -1 )
break;
random += baseOffset;
}
}