public void Upgrade(MetricUpgrade upgrade_) { if (!temporaryUpgradeMap.ContainsKey(upgrade_)) { temporaryUpgradeMap.Add(upgrade_, 0); } var metricUpgrade = skillUpgrade[upgrade_.Metric]; var temporaryUpgrade = temporaryUpgradeMap[upgrade_]; var temporaryLevel = metricUpgrade.Level + temporaryUpgrade; if (metricUpgrade.Level < 0 && temporaryUpgrade == 0) { throw new WestException("Tried upgrading a skill the wrong way"); } if (MetricUpgrade.WeightedLevel(temporaryLevel, 1) >= 1.0f) { throw new WestException("Tried upgrading a capped metric"); } if (metricUpgrade.Level >= 0 && OverallWeight() >= 1.0f) { throw new WestException("Tried upgrading a capped skill"); } if (temporaryLevel >= 0 && SpecializationPoints() == 0) { throw new WestException("No more spec poitns to spend"); } pointsSpent += (temporaryLevel >= 0) ? 1 : -1; ++temporaryUpgradeMap[upgrade_]; SkillSpecialized(); }
public double Factor(MetricUpgrade upgrade_) { if (temporaryUpgradeMap.ContainsKey(upgrade_)) { return(1.0);// MetricUpgrade.Factor(temporaryUpgradeMap[upgrade_] + upgrade_.Level, 1.0); // upgrade_.Metric.Upgrade); } return(upgrade_.Factor()); }
public double Level(MetricUpgrade upgrade_) { if (temporaryUpgradeMap.ContainsKey(upgrade_)) { return(temporaryUpgradeMap[upgrade_] + upgrade_.Level); } return(upgrade_.Level); }
public double WeightedLevel(MetricUpgrade upgrade_) { if (temporaryUpgradeMap.ContainsKey(upgrade_)) { return(MetricUpgrade.WeightedLevel(temporaryUpgradeMap[upgrade_] + upgrade_.Level, 1)); } return(upgrade_.WeightedLevel()); }
public MetricUpgrade.SpecializeSign Sign(MetricUpgrade upgrade_) { if (temporaryUpgradeMap.ContainsKey(upgrade_)) { return(MetricUpgrade.Sign(temporaryUpgradeMap[upgrade_] + upgrade_.Level)); } return(MetricUpgrade.Sign(upgrade_.Level)); }