Hello everyone.
I'm making a turn-based game where items, weapons, potions can positively or negatively cause a player's attribute.
So, for example:
Amulet: +2 STRENGTH and -1 INTELLIGENCE for 2 turns
Sword: +1 STRENGTH for 10 turns
Potion: +1 STRENGTH for 3 turns
That is, these elements can increase and decrease the player's attributes for a certain time (turns).
But I don't know how to make these calculations.
I thought of making an array for each attribute:
array_force,
array_intelligence...
and any input matrix are added to the attribute:
matrix_strength atX [0] = 2 <(would be the same as +1 strength for 2 turns)
matrix_strength atX [1] = 3 <(would be the same as +1 strength for 3 turns)
matrix_strength atX [2] = 2 <(would be the same as +1 strength for 2 turns)
But then I would have a problem because I can only add, I would have to have another array_force only for negative values...
Cut me a little tricky... do you guys have any tips on how to do this smarter?