public int GetPower(Unit Owner, FormulaParser ActiveParser) { if (Owner != null) { return((int)(Convert.ToInt32(ActiveParser.Evaluate(PowerFormula)) * (1 + Owner.UnitStat.AttackUpgrades.Value * 0.05))); } else { return(Convert.ToInt32(ActiveParser.Evaluate(PowerFormula))); } }