My character kept getting colds, so I tracked through the source to find out how to prevent them.
It looks like u.get_sick() is called every half hour of in-game time. You have a one in (900 + health + bonus from disease resistant) chance to catch a cold (or, 1/6 of the time, the flu). Health starts at zero and is modified up or down over time. This means that an “average” person, who is not particularly healthy or unhealthy, nor particularly disease resistant, gets sick about once every 18 days. If you know someone who gets sick every three weeks, you probably think they’re notably frail, don’t you?
You might think that you could prevent disease by living a healthy lifestyle, but I’ve been striving to only eat and drink things with positive health values and it hasn’t done a lot of good. The health values from comestibles accrue to a health modifier, which doesn’t actually make you healthier on its own. Every hour, the game picks a random number between 1 and 100 and compares it to (health - health mod). If it’s higher, your health goes up by one point, and if it’s lower, your health goes down by one point, and either way your modifier is multiplied by 3/4.
So no matter how much you strive to eat right and stay away from junk food and toxins, your modifier stays very small (unless you’re binging on non-food items like vitamins), which means the chance of gaining or losing a health point stays very close to 50-50, and you’re unlikely to ever shift it enough to make a large difference in how often you get sick - and even if you somehow managed to reach and keep 100 health, you would only go up to 20 days on average between sick days.
This seems like a lot of work for relatively little gain, considering that if I understand correctly you can prevent getting sick anyway by always wearing something with high environmental protection on your mouth, like a gas mask.
I’d propose that instead of a random chance, your health should always trend toward the modifier, the modifier should decay slowly enough that making a conscious effort to remain healthy is worthwhile, and the frequency of the get_sick() check should be modified by season length (less than once a season is reasonable, but with 90 day seasons you currently get sick something like 18 times a year). And maybe health should play a larger role in determining if you get sick at all. On the other hand, I think a lot of things currently don’t negatively affect your health but probably should (going a long time without food, drink, or sleep, getting poisoned by giant wasps, getting covered in boomer bile…)
If this is something people are interested in seeing overhauled, I can get to work on a PR.