1 public void RefreshBase() 2 { 3 //Get the Derived Characteristics from the Base Characteristic set 4 Derived = CalcDerived(Base); 5 } 6 7 private int healthModifier = 4; 8 private double pMod = 0.6; //Primary Modifier 9 private double sMod = 0.2; //Secondary Modifier 10 private DerivedCharacteristics CalcDerived (BaseCharacteristics baseIn) 11 { 12 DerivedCharacteristics derived = new DerivedCharacteristics(); 13 14 derived.MeleeAttackMod = FloorToInt(((double)baseIn.Brawn * pMod) + ((double)baseIn.Agility * sMod)); 15 derived.RangedAttackMod = FloorToInt(((double)baseIn.Focus * pMod) + ((double)baseIn.Agility * sMod)); 16 derived.Health = (FloorToInt(((double)baseIn.Fortitude * pMod) + ((double)baseIn.Brawn * sMod))) * healthMod; 17 derived.ActionPoints = FloorToInt(((double)baseIn.Fortitude * sMod) + ((double)baseIn.Focus * sMod)); 18 derived.Defense = FloorToInt(((double)baseIn.Agility * pMod) + ((double)baseIn.Focus * sMod)); 19 derived.Resistance = FloorToInt(((double)baseIn.Brawn * sMod) + ((double)baseIn.Fortitude * sMod)); 20 21 return derived; 22 } 23 24 private int FloorToInt(double value) 25 { 26 return (int)System.Math.Floor(value); 27 }