Fighter.calculateSecondaryStats C# (CSharp) Method

calculateSecondaryStats() public method

public calculateSecondaryStats ( ) : void
return void
	public void calculateSecondaryStats(){
		armor += strength * armorBase;
		fireResistance += endurance * fireResBase;
		coldResistance += endurance * coldResBase;
		lightningtResistance += endurance * lightResBase;
		
		accuracy += dexterity * accurBase;
		attackSpeed += dexterity * attSpeedBase;
		
		criticalChance += dexterity * critChanBase;
		criticalDamage += strength * critDmgBase;
		
		attackPower += strength * attPowerBase;
		
		maxHealth += endurance * hpBase;
		healthRegen += endurance * hpRegBase;
		
		health = maxHealth;
	}

Usage Example

	public void readPrimaryStats(){
		fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		fighter.setStrength((int) PlayerPrefs.GetInt("Strength"));
		fighter.setDexterity((int) PlayerPrefs.GetInt("Dexterity"));
		fighter.setEndurance((int) PlayerPrefs.GetInt("Endurance"));
		fighter.setLevel((int)PlayerPrefs.GetInt("Level"));
		fighter.calculateNewPrimaryStats();
		fighter.calculateSecondaryStats();
		//fighter.calculateLevel();
		fighter.calculateNextLevelXP();
	}