Short-term fix for tantrum spirals: consolation. Talking to a friend when unhappy trains their consolation skill and gives a happy thought. That way, friends aren't a deadly liability any more.
A bit more advanced balancing:
Two categories: Long-term modifiers, and short-term events.
- Long term modifiers ought to be small, and are static (having a child:+1, being married:+0, owning a *rose gold goblet*:+0.2, being handicapped:-1, living in a wealthy fortress:+0.1, having recently lost a child -1 etc.). Those are modified by personality.
- Short-term events just say how happy a dwarf should be when a particular event happens (eg. on a 1-10 scale: losing a child=0, losing a spouse=2, losing a limb=3, eating in a legendary dining room=8, having a drink=6, Just a boring day today=5, ...). Those are modified by personality.
- Dwarves have a short-term happiness memory. That number starts at 5, and when an event happens, it is averaged with the happiness score of that event (weighting may be changed).
- At any time, a dwarf's happiness is the short-term happiness + long term modifiers.
Eg. A dwarf has happiness 8 (6 short term, +2 from being married and having 2 children.)
He eats in a legendary dining room: happiness is now 9: ((6+8)/2)+2.
Nothing else happens that day: happiness is again 8: ((7+5)/2)+2.
The next day he loses his children in an unsecured lava channel: happiness first becomes 3 after losing the first: ((6+0)/2)+1-1,
then 0 after losing the second: ((3+0)/2)-2.
Depending on his personality, now he should have a serious chance at becoming depressed or tantruming.
If nothing else happens, the next day he'll be back at 1,25: ((1,5+5)/2)-2
The day after that, 3,75: ((6,5+5)/2)-2, etc.
This would allow long-term as well as short-term factor to be included. The hard-coded part is to decide which events ought to trigger an emotional update. The quantities themselves would be easily moddable