View Single Post
  #11  
Old 12-10-2010, 05:16 PM
Cottus
Fire Beetle
 
Join Date: Sep 2010
Posts: 11
Default

Hate to bump this, but I am looking at the softcap code, and am a little confused.

Both thac0cap and thac20cap have checks to cap them, but they happen after the last time the values are used?

Code:
		if(atk_roll > mit_roll)
		{
			float a_diff = (atk_roll - mit_roll);
			float thac0 = attack_rating * RuleR(Combat, ACthac0Factor);
			d -= 10.0 * (a_diff / thac0);
			float thac0cap = ((attacker->GetLevel() * 9) + 20);
			if(thac0 > thac0cap)
			{
				thac0 = thac0cap;
			}
		}
		else if(mit_roll > atk_roll)
		{
			float m_diff = (mit_roll - atk_roll);
			float thac20 = mitigation_rating * RuleR(Combat, ACthac20Factor);
			d += 10 * (m_diff / thac20);
			float thac20cap = ((defender->GetLevel() * 9) + 20);
			if(thac20 > thac20cap)
			{
				thac20 = thac20cap;
			}
		}
Shouldnt that read:

Code:
		if(atk_roll > mit_roll)
		{
			float a_diff = (atk_roll - mit_roll);
			float thac0 = attack_rating * RuleR(Combat, ACthac0Factor);

			float thac0cap = ((attacker->GetLevel() * 9) + 20);
			if(thac0 > thac0cap)
			{
				thac0 = thac0cap;
			}

			d -= 10.0 * (a_diff / thac0);  // moved after the cap check

		}
		else if(mit_roll > atk_roll)
		{
			float m_diff = (mit_roll - atk_roll);
			float thac20 = mitigation_rating * RuleR(Combat, ACthac20Factor);

			float thac20cap = ((defender->GetLevel() * 9) + 20);
			if(thac20 > thac20cap)
			{
				thac20 = thac20cap;
			}

			d += 10 * (m_diff / thac20); // moved after the cap check

		}
Reply With Quote