public Statistic consumableSpeed;        // increase consumable utilisation speed

        public void UpdateStatistics(StatisticSheet stats, int modifier = 1)
        {
            level += stats.level * modifier;
            UpdatePrimaryStatistics(stats, modifier);
            UpdateSecondaryStatistics(stats, modifier);
            PropagateSecondaryStatistics();
        }
 private void UpdateConsumableSpeed(StatisticSheet stats, int modifier)
 {
     if (stats.consumableSpeed.bonusValue == 0)
     {
         return;
     }
     this.consumableSpeed.bonusValue += stats.consumableSpeed.bonusValue * modifier;
 }
 private void UpdateGloballReduction(StatisticSheet stats, int modifier)
 {
     if (stats.globalReduction.bonusValue == 0)
     {
         return;
     }
     this.globalReduction.bonusValue += stats.globalReduction.bonusValue * modifier;
 }
 private void UpdateHolyAmplification(StatisticSheet stats, int modifier)
 {
     if (stats.holyAmplification.bonusValue == 0)
     {
         return;
     }
     this.holyAmplification.bonusValue += stats.holyAmplification.bonusValue * modifier;
 }
 private void UpdateEnergy(StatisticSheet stats, int modifier)
 {
     if (stats.energy.bonusValue == 0)
     {
         return;
     }
     this.energy.bonusValue += stats.energy.bonusValue * modifier;
 }
 private void UpdateHealth(StatisticSheet stats, int modifier)
 {
     if (stats.health.bonusValue == 0)
     {
         return;
     }
     this.health.bonusValue += stats.health.bonusValue * modifier;
 }
Beispiel #7
0
 public void UpdateStatistics(StatisticSheet stats, int modfiier)
 {
     statistics.UpdateStatistics(stats, modfiier);
     if (currentHealth > maxHealth)
     {
         currentHealth = maxHealth;
     }
     if (currentEnergy > maxEnergy)
     {
         currentEnergy = maxEnergy;
     }
 }
Beispiel #8
0
 void Start()
 {
     if (audioSource == null)
     {
         audioSource = GetComponent <AudioSource>();
     }
     if (audioSource == null)
     {
         audioSource = gameObject.AddComponent <AudioSource>();
     }
     characters.Add(this);
     inventory.owner = this;
     foreach (ItemInstance ii in initialItems)
     {
         inventory.AddItem(ii.item, ii.stackCount);
     }
     if (statistics == null)
     {
         statistics = new StatisticSheet();
     }
     statistics.PropagateSecondaryStatistics(); // to ensure all is computed nicely
     currentHealth = maxHealth;
     currentEnergy = maxEnergy;
 }
        public void UpdateSecondaryStatistics(StatisticSheet stats, int modifier = 1)
        {
            UpdateHealth(stats, modifier);
            UpdateEnergy(stats, modifier);
            UpdatePhysicalAmplification(stats, modifier);
            UpdatePhysicalReduction(stats, modifier);
            UpdateStrengthAmplification(stats, modifier);
            UpdateDexterityAmplification(stats, modifier);

            UpdateMagicalAmplification(stats, modifier);
            UpdateMagicalReduction(stats, modifier);
            UpdateDarkAmplification(stats, modifier);
            UpdateDarkReduction(stats, modifier);
            UpdateElementalAmplification(stats, modifier);
            UpdateElementalReduction(stats, modifier);
            UpdateHolyAmplification(stats, modifier);
            UpdateHolyReduction(stats, modifier);

            UpdateGlobalAmplification(stats, modifier);
            UpdateGloballReduction(stats, modifier);

            UpdateConsumableEfficiency(stats, modifier);
            UpdateConsumableSpeed(stats, modifier);
        }