Could someone point me in the right direction code-wise if I wanted to create a trait that would activate after a girl had so many children? Was looking at making a custom trait that would activate after around 10 children or so and would increase happiness and libido as long as she continued to get pregnant. Just interested in possibly making some new traits and playing around with them.
Well, the trait is simple enough. You add that to the core traits file as discussed earlier.
For the effect, you'd need to find where happiness was adjusted at the end of the turn, check to see if the girl had the trait, check to see how many entries there are in her childList (which I
think refers to children and not a linked list of something else entirely - but check) and then if she has both trait and sufficient offspring, make the changes there.
There's a function called cGirls::updateHappyTraits that seems to do very similar things for traits like optimist or pessimist, so it's probably a good place to put your code.