18 m_BarrelLength = CalculateBarrelLength(owner);
22 float GetBarrelLength()
25 return CalculateBarrelLength(m_OwnerItem) * 1000;
28 float CalculateBarrelLength(
ItemBase owner)
30 vector usti_hlavne_position = owner.GetSelectionPositionLS(
"usti hlavne" );
31 vector konec_hlavne_position = owner.GetSelectionPositionLS(
"konec hlavne" );
32 usti_hlavne_position = owner.ModelToWorld(usti_hlavne_position);
33 konec_hlavne_position = owner.ModelToWorld(konec_hlavne_position);
34 return vector.Distance(usti_hlavne_position, konec_hlavne_position);
38 void UpdateModifiers()
40 m_RecoilModifiers = GetModifierRaw(m_OwnerItem,
"recoilModifier");
41 m_SwayModifiers = GetModifierRaw(m_OwnerItem,
"swayModifier");
42 m_SightMisalignment = GetModifierRaw(m_OwnerItem,
"sightMisalignmentModifier");
44 for (
int i = 0; i < m_OwnerItem.GetInventory().AttachmentCount(); i++)
46 ItemBase attachment =
ItemBase.Cast(m_OwnerItem.GetInventory().GetAttachmentFromIndex(i));
49 m_RecoilModifiers[0] = m_RecoilModifiers[0] * temp_value[0];
50 m_RecoilModifiers[1] = m_RecoilModifiers[1] * temp_value[1];
51 m_RecoilModifiers[2] = m_RecoilModifiers[2] * temp_value[2];
54 m_SwayModifiers[0] = m_SwayModifiers[0] * temp_value[0];
55 m_SwayModifiers[1] = m_SwayModifiers[1] * temp_value[1];
56 m_SwayModifiers[2] = m_SwayModifiers[2] * temp_value[2];
58 temp_value =
PropertyModifiers.GetModifierRaw(attachment,
"sightMisalignmentModifier");
59 m_SightMisalignment[0] = m_SightMisalignment[0] * temp_value[0];
60 m_SightMisalignment[1] = m_SightMisalignment[1] * temp_value[1];
61 m_SightMisalignment[2] = m_SightMisalignment[2] * temp_value[2];
67 if( item.ConfigIsExisting(modifier_name) )
69 value = item.ConfigGetVector(modifier_name);