This is applied to the Shooting, Passing, Defending, and Keeping player attributes.
Code: Select all
unsigned int uiKO2Attribute=ScaleByAgilityAndMorale(uiPMAttribute)/2;
int ScaleByAgilityAndMorale(int iVal)
{
iVal*=iPlayerAgility;
iVal=SquareRoot(iVal);
int iMorale=iPlayerMorale/4; //Morale is signed so goes from -128 to 127 (-32 to 31 after divsion)
if (TeamA) iMorale=iMorale+10; //THE "10%" ADVANTAGE. WHY OH WHY OH WHY....
iVal=iVal+iMorale;
//clamp between range of 0 and 200
if (iVal>200)
iVal=200;
if (iVal<0)
iVal=0;
return iVal;
}
An afterthought.. By using this forumla and checking the Team A/B/N statistics, I guess it would be possible to create a big table of who can successfully tackle who