savingthrows(class_num, type, level);
Where you pass the character's class (as a number), the saving throw type, and the character's level. The function returns the base saving throw value as an integer between 0 (saving throw is godlike) and 100 (I know I'm going to die here...). The only place where this is used in the stock code is the for spell saving throws.
Now, there are probably other situations where it would be nice to "save vs strength" or "save vs dexterity" (I have some of these planning for future enhancements), and to me the simplest way is to extend the number of saving types, and allow the saving_throws function to handle these. However, the way this function is written at the moment is to have three levels of switch statements:
switch (class_num) {
switch (type) {
switch (level) {
}
}
}
This makes adding additional saving throw types a pain to code. Can anyone see any reason why the order of the switch statements couldn't be altered so that the outermost switch is done on type?




