예제 #1
0
        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();
        }
예제 #2
0
 private void UpdateConsumableSpeed(StatisticSheet stats, int modifier)
 {
     if (stats.consumableSpeed.bonusValue == 0)
     {
         return;
     }
     this.consumableSpeed.bonusValue += stats.consumableSpeed.bonusValue * modifier;
 }
예제 #3
0
 private void UpdateGloballReduction(StatisticSheet stats, int modifier)
 {
     if (stats.globalReduction.bonusValue == 0)
     {
         return;
     }
     this.globalReduction.bonusValue += stats.globalReduction.bonusValue * modifier;
 }
예제 #4
0
 private void UpdateHolyAmplification(StatisticSheet stats, int modifier)
 {
     if (stats.holyAmplification.bonusValue == 0)
     {
         return;
     }
     this.holyAmplification.bonusValue += stats.holyAmplification.bonusValue * modifier;
 }
예제 #5
0
 private void UpdateEnergy(StatisticSheet stats, int modifier)
 {
     if (stats.energy.bonusValue == 0)
     {
         return;
     }
     this.energy.bonusValue += stats.energy.bonusValue * modifier;
 }
예제 #6
0
 private void UpdateHealth(StatisticSheet stats, int modifier)
 {
     if (stats.health.bonusValue == 0)
     {
         return;
     }
     this.health.bonusValue += stats.health.bonusValue * modifier;
 }
예제 #7
0
 public void UpdateStatistics(StatisticSheet stats, int modfiier)
 {
     statistics.UpdateStatistics(stats, modfiier);
     if (currentHealth > maxHealth)
     {
         currentHealth = maxHealth;
     }
     if (currentEnergy > maxEnergy)
     {
         currentEnergy = maxEnergy;
     }
 }
예제 #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;
 }
예제 #9
0
        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);
        }