I want to modify the way Tactical Points work ; as of now, I want to make it so that their maximum value is 3, and hitting an enemy with a basic attack gives you 1 TP (and this is the only way to gain TP, for example taking damage from enemies doesn't work anymore)
With the code I have here, everything works perfectly :
Now I want to make it so that TPs are shared between allies : if an ally uses 1 TP to do something, all allies lose 1 TP as well, and if an ally gains 1 TP, the others gain it too, etc.
I've been trying to implement this for over an hour, without success. The code I have (and my other tries) were generated by ChatGPT as I barely have any experience in programming, but I just can't make it work, so I was wondering if anyone could help.
Here is one of my failed codes, just in case it can help :
With the code I have here, everything works perfectly :
Now I want to make it so that TPs are shared between allies : if an ally uses 1 TP to do something, all allies lose 1 TP as well, and if an ally gains 1 TP, the others gain it too, etc.
I've been trying to implement this for over an hour, without success. The code I have (and my other tries) were generated by ChatGPT as I barely have any experience in programming, but I just can't make it work, so I was wondering if anyone could help.
Here is one of my failed codes, just in case it can help :