yeah ... that's what we wantedVertigo said:thank you for the math lesson, but obviously you didn't understand the question that was being ask so i will explain it in more detail.
because you lost ~1HP for each acsend/descend under 100% health, is it posible to make it that when you descend again your character gets the original health total that he had before he acsended? Baring taking any damage before you descend again, of course.
Then the main question is, how would I know to add 1, if i don't want to store the health fraction of 0.25? You can't just always add one. If the health in your example was 100 instead of 60, Then this would add 25%*100=25 health. Your new health is 125. Now you descend without taking damage. Then you get 25*4=100 health. Now add 1, and you have 101 health. You just replicated my equation, making it a lot more difficult.Vertigo said:okay here is my stab at this problem:
you are character Y (it doesn't matter who)
you somehow got to 65 health
you then transform with a transfrom health multiplyer of 25%
so 65 * .25 = 16.25
now drop the .25 off of the 16.25 to give you just 16
remember 16 we will need it again
you then add 16 to 65 to give you 81 your transformed health level
you then descend while somehow taking no damage
now here is where that 16 comes in
now you just multiply 16 by the reciprocal of the %
so %25 is just 1/4 and the reciprocal of 1/4 is 4/1 or just 4
so 16 times 4 is 64
then just add 1 to 64 to give you 65 your original health level.
well that is my try at this problem.
easy you just add a piece of code that does it the current way for number that are divisible by 2 and 5. or better yet do it only when you dont have to round down.harSens said:Then the main question is, how would I know to add 1, if i don't want to store the health fraction of 0.25? You can't just always add one. If the health in your example was 100 instead of 60, Then this would add 25%*100=25 health. Your new health is 125. Now you descend without taking damage. Then you get 25*4=100 health. Now add 1, and you have 101 health. You just replicated my equation, making it a lot more difficult.
Then instead of the fraction I'd have to store that. Basicly I'm too lazy to store any pre transform info.Vertigo said:easy you just add a piece of code that does it the current way for number that are divisible by 2 and 5. or better yet do it only when you dont have to round down.
you would use my equation only where rounding down is needed, you wouldn't need to round if your numbers were all whole numbers. like the example you gave me.
Doh! i just thought of an easier way. When ever you round down just add one to the descended health total. So the only thing you would need to keep track of is when you round and when someone descends so that you can add one to their total hitpoints.harSens said:Then instead of the fraction I'd have to store that. Basicly I'm too lazy to store any pre transform info.