EDIT: Upon further reflection this morning, I'm glad I had this misunderstanding, because it taught me that characters' set attributes, while catered to, aren't guaranteed to be filled if a character rolls a low score. If, say, I want to make a creature type stronger, then I need to ensure it has the attribute points required to do so.
You don't actually have to do this -- the set attributes you give the creature don't require that attnum be high enough to afford them. It's just that if you send attnum below 0 by spending it all on base stats, there won't be any additional attribute points to randomly distribute. That's not game-breaking, it just means all creatures of that type will have exactly the base stats and no more.
It's pretty hard (maybe impossible?) to spend attnum into the negatives, however, since only the first 4 points of any base stat you allocate are actually taken out of attnum. The rest are free. For most purposes, you can buff a creature type (increase its attribute points) by just giving it set stats above 4.
Let's take, for example, the CEO. If I write this:
if(cr.type==CREATURE_CORPORATE_CEO)attnum=LCSrandom(20)+80
This would give a randomly generated Corporate CEO 81-100 attribute points, right?
Yes, plus any free attribute points that come from its starting stats being higher than 4. For example, if the CEO has a minimum Wisdom of 8, the CEO would end up with (attnum+4) attribute points, since 4 of its base wisdom points were free bonuses not taken out of attnum.
Either way, this would make CEOs pretty godly. CEOs start with the Conservative equivalent of juice as well, so their stats are boosted even more when you encounter them.
Not if I copy this function from the Hangin' Judge:
attcap[ATTRIBUTE_HEART]=1;
I presume that would force the attribute points elsewhere.
Sort of -- that is how attcap works, but the points that get reassigned to wisdom will respect the wisdom attcap instead. Only the 25% that actually stay in heart would be forced elsewhere, while the 75% that go to wisdom will stay in wisdom.
If you do increase the amount of attribute points a CEO can get then you have to make sure the attribute caps aren't too low or it looks like the game could get stuck in that while loop, ie if all attributes have reached their caps but there are still attribute points left distribute. Or better could be to add a check for that in the while loop.
Yeah, this is a real danger. If the attcaps aren't high enough to allow all the points you give the CEO to be allocated, the game will lock up. The default attcaps are fairly modest to ensure normal people seem well-rounded and human (not getting 20 strength and ~1 in all other stats, for example). The code that gives Mutants exceptionally high attcaps (50 per attribute) ensures this doesn't happen for the tougher mutants. For any other classes you give extra points to, you'll need to make sure the attcaps are high enough to allow them to spend all the points.