Yes, I’m back this time. I know you’re all saying “Ugh, this noob again?” I understand your pain. But I just need help with this question. Here’s the script, it’s on line 34.
using System.Collections.Generic;
public class ModifiedStat : BaseStat {
private List<ModifyingAttributtes> _mods; //A list of attributes taht modify this stat
private int _modValue; //The amount added to the _baseValue from the modifiers
public ModifiedStat() {
_mods = new List<ModifyingAttributtes>();
_modValue = 0;
}
public void AddModifier( ModifyingAttributtes mod) {
_mods.Add(mod);
}
private void CalculateModValue() {
_modValue = 0;
if(_mods.Count > 0)
foreach(ModifyingAttributtes att in _mods)
_modValue += (int)(att.attributte.AdjustedBaseValue * att.Ratio);
}
public new int AdjustBaseValue {
get { return BaseValue + BuffValue + _modValue; }
}
public void Update() {
CalculateModValue();
}
}
public struct ModifyingAttributtes {
public Attributte attributte;
public float Ratio;
}