57 string lightAttPath =
string.Format(
"cfgVehicles %1 AttackActions AttackShort ammoType",
GetName());
58 string heavyAttPath =
string.Format(
"cfgVehicles %1 AttackActions AttackLong ammoType",
GetName());
59 string chaseAttPath =
string.Format(
"cfgVehicles %1 AttackActions AttackRun ammoType",
GetName());
62 GetGame().ConfigGetText(lightAttPath, lightAttAmmo);
64 GetGame().ConfigGetText(heavyAttPath, heavyAttAmmo);
66 GetGame().ConfigGetText(chaseAttPath, chaseAttAmmo);
100 float highestUtility = -1;
105 for (
int i = 0; i < attackGroup.Count(); ++i)
107 rnd =
Math.RandomFloat01();
113 if (utility > highestUtility)
115 mostSuitableAttack = attackType;
116 highestUtility = utility;
121 return mostSuitableAttack;
159 newType.m_Distance = pDistance;
160 newType.m_Pitch = pPitch;
161 newType.m_Type = pType;
162 newType.m_Subtype = pSubtype;
163 newType.m_AmmoType = pAmmoType;
164 newType.m_IsHeavy = pIsHeavy;
165 newType.m_Cooldown = pCooldown;
166 newType.m_Probability = pProbability;
174 if (pAttackType.m_Pitch != pPitch)
178 float distDiff = pAttackType.m_Distance - pTargetDistance;
182 float distDiffFrac = distDiff / 10;
183 float utilityDistance = (1 - distDiffFrac) * 100;
186 float probDiff = pAttackType.m_Probability - pProbability;
190 float utilityProbability = (1 - probDiff) * 10;
193 float util = utilityDistance + utilityProbability;