In a fanfic, Hermione might start by trying to use her knowledge of transfiguration or charms to solve the problem. For example, she could try to transfigure a nearby object into a makeshift toilet. Or she could use a charm to hold her bladder for a longer time while she searches for an appropriate place. And if she's in a tight spot, she might even use her wits to convince someone to let her use their private facilities by making a very logical and persuasive argument.
Hermione is a very resourceful character. She would likely first try to hold it in while she figures out a proper solution. If she's in a public place like Hogwarts, she might look for a private corner or an empty classroom. She could also use her magic to create a temporary privacy shield if needed.
Hermione might also think about the reason why she's locked in. Is it a trap set by an enemy? If so, she'd start to plan how to outwit them once she gets out. She could use the time she's locked in to prepare herself mentally and magically. She might even try to find a way to turn the situation to her advantage, like using the room's contents to create a new spell or potion that could help her later.
Together, they would rely on their friendship and new - found love. They'd support each other through the tough times. Harry would be the one to face any physical threats while Hermione would handle the more intellectual aspects like making sure they have a proper plan for when the baby is born. They'd also have to deal with their own insecurities and fears, but their bond would help them get through it all.
Maybe Hermione is on a long and arduous adventure in the Forbidden Forest. She's been walking for hours and there's no proper place to relieve herself. She has to pee but she's also worried about being attacked by some dangerous creatures. So she has to keep looking for a safe spot while constantly being distracted by the growing need to pee.
Hermione's friends from the Ministry of Magic or other magical organizations would also react. Those who respect Hermione for her intelligence and contributions would be supportive. They might offer her more flexible work arrangements so she can take care of the baby. However, there might be some who are envious or judgmental. But overall, Hermione's true friends would surround her and the baby with love and protection.
First, be understanding and reassuring. It could be due to various reasons like a medical issue or just an unexpected situation. Offer support and privacy so she can clean up and feel comfortable.
Some characters might immediately rush to her aid. Harry and Ron, for instance, would be very concerned and would do everything they could to figure out what was wrong and protect her from whatever was causing her distress.
In these fanfictions, Hermione's character development often focuses on her growth in the face of adversity. The experiments force her to become more resourceful and self - reliant. She has to use her intelligence in new and extreme ways to survive. For example, she might figure out ways to escape or counteract the effects of the experiments.
Ron would probably try to use his humor to lighten the mood. He might crack jokes, even if they're not that funny, just to make Hermione smile. He'd also be very protective, not allowing anyone to stress Hermione out more than she already is. Hermione, on the other hand, would approach it with her usual intelligence. She'd have a plan for everything, from the birthing process to what to do immediately after the baby is born.
To make it family - friendly, focus on the comical aspects. For example, Hermione could be in a situation where she's trying to hold it while chasing a mischievous magical creature that's causing chaos. The story could show her determination not to let the creature get away while also dealing with her need to pee in a humorous way. There could be no vulgar language or inappropriate situations, just a fun adventure with a relatable problem.
She could start by joining new study groups or clubs at Hogwarts. Since she's so intelligent, she might find others with similar interests in advanced magic studies or ancient runes.