This started when I noticed equilbrium sustains were once again broken by meditating (well not broken, but the sustain cost disappeared). The obvious long-term fix is to add a minimum value to the ActorResource interface and have equilibrium raise that instead of decreasing the maximum as other sustains do. I also have added min/max arguments to the defineResource function, which default to 0 and 100 as currently expected in ToME. Finally I changed all of the postUseTalent sustain changes to actually use incMax/incMin functions instead of directly changing the maximum value. This is because the incMax/incMin functions now bound the current value as well. I think this code was already somewhere else for the decreasing of minimum values, and I will look for it later to remove the redundancy. The first version of the patch can be found here: http://pastebin.com/EpqhHXK5.
I have tested that using Icy Skin from 0 equilibrium properly increases equilibrium to 30, and that you cannot then meditate below 30. After removing Icky Skin you can meditate back down to 0, so that seems to work well. The question is if there are any other bugs introduced in other resources, and I will be testing that soon.
Adding a min vaue to ActorResource interface
Moderator: Moderator
Adding a min vaue to ActorResource interface
<DarkGod> lets say it's intended
Re: Adding a min vaue to ActorResource interface
I thought that this was the intended behavior...
As for adding the min value, it would indeed be very handy for many uses. For instance, a module could want to allow a resource to go negative (like HP in a D&D module where death comes only at -10 HP).
As for adding the min value, it would indeed be very handy for many uses. For instance, a module could want to allow a resource to go negative (like HP in a D&D module where death comes only at -10 HP).
Re: Adding a min vaue to ActorResource interface
I assume you are talking about my description of testing Icy Skin. Yes, the test works as intended but if you try this out in beta19 you will see that it does not work that way.Marcotte wrote:I thought that this was the intended behavior...
<DarkGod> lets say it's intended
Re: Adding a min vaue to ActorResource interface
No, I meant the say that I thought that the beta19 behavior (meditation being able to reset equilibrium to zero while sustains are active) is the intended behavior.yufra wrote:I assume you are talking about my description of testing Icy Skin. Yes, the test works as intended but if you try this out in beta19 you will see that it does not work that way.Marcotte wrote:I thought that this was the intended behavior...
Whether that is true or not, is another question altogether.
Re: Adding a min vaue to ActorResource interface
Ah, I understand now. No, you are not supposed to be able to go below the "sustained equilibrium." The sustained talents are supposed to carry some sort of permanent cost along with them, and in most cases they reduce the total amount of a resource you can have or have a constant resource drain. The behavior in beta19 that you describe is effectively "sustains for free", where you can set it, meditate and now be running around without any permanent cost but having a permanent bonus. Previous versions of this bug have been found and fixed, but it is broken again in beta19. The original post outlined a permanent way to fix this problem as well as extend the ActorResource interface to make such resources easier to handle in the future.Marcotte wrote: No, I meant the say that I thought that the beta19 behavior (meditation being able to reset equilibrium to zero while sustains are active) is the intended behavior.
Whether that is true or not, is another question altogether.
<DarkGod> lets say it's intended
Re: Adding a min vaue to ActorResource interface
This patch broke Paradox (caps it at 100) and I'm guessing it's doing the same to Equilibrium (though I haven't checked and it's much less of an issue).
Re: Adding a min vaue to ActorResource interface
I haven't tested it, but changing by should do the trick.
Code: Select all
max = max or 100
Code: Select all
max = (max == nil) and 100 or max
Re: Adding a min vaue to ActorResource interface
Tested it. Seems to work good.
Re: Adding a min vaue to ActorResource interface
Thanks Marcotte, I sent the patch to DG.
<DarkGod> lets say it's intended