I am trying to work out how to make variable stats on my equipment (like diablo/PoE). For example with the healthy hat having health vary between 1 and 500 (for testing), rolled when the item is created.
I have tried something like this in StatsEquippableItem:
public void SetModifiers()
{
int additiveLength = additiveModifiers.Length;
Modifier newModifier = new Modifier
{
stat = Stat.Health,
value = Random.Range(1, 500)
};
additiveModifiers[additiveLength] = newModifier;
}
My problem is that I can’t work out how to call this code in the first place through the inventory system. If someone could advise whether I am vaguely on the right lines with this, or if I am trying to do something this inventory system isn’t really geared for?
Thanks in advance!