View Single Post
Flappi
Junior Member
 
Join Date: Jun 2010
Posts: 26

Old June 28th, 2010, 08:24 AM
Quote:
Originally Posted by Mathias View Post
In terms of the good saves, the prestige class's good save progression is not equal to the regular class's good save progression - 2.
If I don't mistake, the prc save bonus is:
good : floor ((prc_level+1)/2)
poor : floor ((prc_level+1)/3)
(in fact, it's just another way to round a non-integer result: Pathfinder don't round down for prc save).

Then, the difference between the prc save and the fractional save is:
good : 0.5*prc_level - int(0.5*prc_level+0.5)
poor : prc_level/3 - int(prc_level/3+1/3)

As a related note, sometime I add 0.01 inside the "int" functions. It's because it seems that for the computer, 1/3+1/3+1/3<1, and then int(1/3+1/3+1/3)=0. Therefore I add 0.01: int(1/3+1/3+1/3+0.01)=1. Since the minimum possible difference is 1/6 (the difference between 1/2 and 1/3), and that 0.01 is lower than 1/6, it shouldn't be a problem; but maybe there is a prettiest way. In the case of prc save, it's important at least for a poor save:
poor : prc_level/3 - int(prc_level/3+1/3+0.01)

Note that the result can be negative (eg for a good save and prc_level=1, or a poor save and prc_level=2); that why I create a floor function afterward (the floor function doesn't seems to be intrinsic).

Quote:
Also, don't forget that the user might have taken more than one base class, so I don't think you can just give the +2 only once.
that's the role of the variables gsvcount (good save counter) and gsvflag (good save flag)

gsvcount start at 0, and is increased by 1 each time a race or a base class has a good save; the counter isn't modified by prc.

gsvflag start at 0, and if the script find a prc with a good save, the flag becomes 1.

Then, at the end of the script:
* if gsvcount is 2 or more, we have too many +2 bonus from high save of base class: I remove the difference (2*(gsvcount-1)).
* if gsvcount is 0 and gsvflag is 1, there is no base class with high save (since gsvcount is 0), but one prc with good class. If you use the unearthed arcana rule, you should add 2 to the save, but it's debatable in Pathfinder (since the prc don't give the +2 bonus for high save, or even a +1 bonus: Pathfinder didn't intend to add a flat bonus to high save for prc), but I decided to add it.

I could do both with only one "if" statement (if (gsvcount>0) then remove 2*(gsvcount-1) (comment: it's 0 if gsvcount=1), elseif (gsvflag=1) (comment: in this case, we have gsvcount=0: no base class with high save) then add 2, endif). :/


Edit: as you see, I'm not a beginner in programing, but I'm a total beginner in XML and hero lab; probably there are some better way to do the same script.


Edit 2: the rule I wanted to script (to be sure we use the same):
* for each level of a class, add:
** 1/2 for a good save
** 1/3 for a poor save
* then, after each contribution of each class have been added, round down.
* if at least one class gives a good save (be it a base class or a prestige class), add +2 to the final base save.

Last edited by Flappi; June 28th, 2010 at 08:37 AM.
Flappi is offline   #9 Reply With Quote