예제 #1
0
        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();
        }
예제 #2
0
 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());
 }
예제 #3
0
 public double Level(MetricUpgrade upgrade_)
 {
     if (temporaryUpgradeMap.ContainsKey(upgrade_))
     {
         return(temporaryUpgradeMap[upgrade_] + upgrade_.Level);
     }
     return(upgrade_.Level);
 }
예제 #4
0
 public double WeightedLevel(MetricUpgrade upgrade_)
 {
     if (temporaryUpgradeMap.ContainsKey(upgrade_))
     {
         return(MetricUpgrade.WeightedLevel(temporaryUpgradeMap[upgrade_] + upgrade_.Level, 1));
     }
     return(upgrade_.WeightedLevel());
 }
예제 #5
0
 public MetricUpgrade.SpecializeSign Sign(MetricUpgrade upgrade_)
 {
     if (temporaryUpgradeMap.ContainsKey(upgrade_))
     {
         return(MetricUpgrade.Sign(temporaryUpgradeMap[upgrade_] + upgrade_.Level));
     }
     return(MetricUpgrade.Sign(upgrade_.Level));
 }