Screw it, give me dotPeek, I'll just go check myself.
Baby delivery is handled by SexManager.Delivery().
That method is called when you press the relevant button, performs all checks and moves to a "workplace" (here: bed, maternity bed, or ground), and handles creation of the new NPC after the animations are over and a random success value matches the success rate (a maternity bed has a success chance of 100%).
Creating a new NPC involves:
- Determining the sex (boy or girl), which can be overidden by cooking support abilities (the manju thing that forces a girl, and the penis thing that forces a boy).
- Determining the npcID, which is not a unique ID but rather the type of NPC to spawn (Native Girl, Large Native Girl, Under Ground Girl, Native Boy, Large Native Boy, Under Ground Boy), depending on baby sex and on the npcID of the mother. Some of these are locked behind a DLC check.
- Creating a new NPC of that npcID, via NPCManager.GenSpawn(). This method is called a lot and is the one that creates a generic, non-friend NPC, with random personalities, the generic default name depending on type (e.g. "Native Boy"), random age, random equipment, but this is also the method that sets the NPC's level, by calling NPCManager.NPCSetWorldLevel and GetWorldPositionLevel.
If you wish to know, given the map positions x and y, the equation that determines level is floor(clamp((sqrt(x^2 + y^2) - 200) / 10, 1, 100)).
The gist of it is: Level 1 at a corner, level 100 at the opposite corner, provided the map actually goes from 0 to 100. That matches your findings.
Note that there IS a Z axis which will make calculations completely bonkers if you are not at Z = -500.0, but I'm not sure if the game can actually change Z (so I've removed it from the equation) and it's still capped at 100 via clamp anyway. A random value between 0 and 6 excl. is added to the level.
- Actually naming the child. Girls go through RandomCharacter.GirlNaming(), boys through RandomCharacter.ManNaming(). These use the NameGenerator and localized names, which I didn't find (yet).
- Resetting the age to Zero. The age was previously generated and would have been within the npcID's normal range otherwise (between 6 and 18 excl. for girls/boys).
- Creating a unique friendID and making the NPC into a Friend, which adds it to the friend list and allows you to communicate with it.
- Changing the child's parameters, via RandomCharacter.GenChildSet.
This randomly selects one of either parents (mom or dad), and: Sets the child's color to the parent's colors, changes more colors if the mom was the one randomly selected, generates generic random hairstyles and proportions (not based on parent), copy special parameters for Under Ground Girls (I think it's for Sadako), and call NPCClassChange to change the class level depending on the mother's class level, which impacts attack animations. I'm not sure what this means, I think it's for Sadako, but it could also be for the Large Native Girls.
Also, they set status[8] to the father's friendID, and status[9] to the mother's friendID, which you see in Status.
- Logging the text you see on screen, resetting pregnancy state, incrementing the delivery count of the mother, and putting the child to idle.
All this to say: I don't see any code that actually sets the level of the child to either parent's level. The only code I see is the generic one that sets the level based on the current map's position (here, it's the mother's position when giving birth).
I'd love to make a npcID table. I think there's one, but I couldn't find it in the assets.