Lily brings a goat home from school. Ted celebrates his 30th birthday. Barney and Robin deal with the repercussions from their night together. Barney hires Marshall to help him find a loophole in The Bro Code.
The episode begins with the aftermath of the events of Sandcastles in the Sand. Barney and Robin are in bed together. Robin proposes that they pretend their tryst never happened, and Barney agrees. However, Barney feels quite awkward and uncomfortable around Ted at MacLaren's later in the day. Hoping to find an excuse for his and Robin's actions, Barney seeks out Marshall to help him find a loophole in the Bro Code, a document very important to Barney's life as a bro. Allegedly written by Barnabas Stinson in the 18th century when Benjamin Franklin and George Washington were too busy to write it themselves, the Bro Code proves to be a very tight document that Ted has followed flawlessly and Barney fails in finding a loophole. Though she seems fine with it at first, Robin finds the secret even harder to keep than Barney and eventually admits to Ted that she and Barney slept together. That night, when Barney picks up Ted in a limo to take him to Ted's 30th birthday party, an outraged Ted yells at Barney, telling him how wrong it was to sleep with his best friend's ex-girlfriend. Ted ends his rant by telling Barney that he not only does not want to be bros anymore, but also does not want to be his friend anymore.
Meanwhile, Lily rescues a goat named Missy when a farmer brings it to her kindergarten class and horrifies her students by going into great detail about what will happen to Missy when she visits the butcher. Lily plans to give the goat away to animal control, but becomes attached to the goat while waiting for Ted to arrive at his birthday party. Future Ted reveals at the end of the episode, after hinting at the destruction the goat would do, that he had the story wrong: Everything involving the goat actually takes place during his 31st birthday, at which point — Future Ted also reveals — Robin is living in the apartment.
The goat in Ted's bathroom on his 30th birthday was previously mentioned by Future Ted in Milk.
This episode reveals that, by Ted's 31st birthday, Robin will be living with Ted in the apartment. Robin later moves in with Ted in Not a Father's Day.
Barney refers to storing a mental image of breasts as a "BPEG", a concept he first discussed with Marshall in Where Were We?.
In Zip, Zip, Zip, Ted gives Barney his blessing to pursue Robin, before their relationship commences. Ted gets upset with Barney for hooking up with Robin after their relationship ends.
After Ted reveals to Barney that Robin told him about their hook-up, Ted makes a remark about Barney wanting to nail his mother. In Little Minnesota, Barney reveals that he kissed Ted's mom when he dropped her off at the airport, which he elaborates (and embellishes) upon in Home Wreckers, in which it is revealed that this happened immediately after the events in Brunch.
How did it happen? Ahh? Barney? I want to know. Tell me exactly how it happened.
Barney:
You mean, what position?
Ted:
(Jumps at Barney)
Barney:
You can't tell anyone. Attorney-client privilege.
Marshall:
Why are you doing this to me?
Barney:
Because I need you, Marshall, as my lawyer to prove I didn't do anything wrong.
Marshall:
How can I help you as your lawyer? You didn't break any laws, did you? Robin knows that you slept with her, doesn't she?
Barney:
I didn't break any state or federal laws. But I think I broke a much, much higher law. The Bro Code.
Barney:
In my experience the way it normally goes is: we lie her for a while, make a little awkward chit-chat.
Robin:
Check.
Barney:
Then I make up some cabinet meeting/heart surgery/rocket test flight I've got to be at. Slip out of your apartment and never call you again.
Robin:
And later at the bar you tell your good friend Robin the story of your latest conquest and she thinks to her self: "Who is this sad, self loathing idiot who climbed into bed with Barney Stinson?"
Barney:
Actually, you usually say it out loud.
Barney:
So, You're not mad?
Ted:
No, I'm not mad. Well, Robin and I broke up a year ago, we both dated lots of people since then, I'm with Stella now. Seriously, I'm fine with this.
Barney:
I'm so relieved to hear you say that.
Ted:
Yeah, yeah. Oh, I just remembered, my mom is coming in to town next month. Maybe you'd like to nail her too!!
Robin:
Okay, here is the deal Barney: the second my feet touch the floor this never happened.
Barney:
Okay. Wait (Barney lifts the sheet up). Right click, save as into the bpeg folder and okay. This never happened. It's a good plan.
Robin:
Now we go back to exactly the way things were before.
Barney:
Okay. Right. So, Robin?
Robin:
Yes, Barney?
Barney:
Guess who nailed the chick from Metro News One last night?
In the limo, when Ted derides Barney for sleeping with Robin, Ranjit yells at Barney in Persian. Ranjit was previously said to be from Bangladesh, but actor Marshall Manesh is from Iran, where Persian is spoken.
Lily asks if Barney is "all smooth down there", but in Columns she saw Barney naked when painting his portrait and so would already know the answer to that question.
While on the roof with the goat anticipating Ted's arrival at his party, Lily tells Barney that "Stella just arrived." However, Ted (as the narrator) later realizes that the events involving the goat took place a year later, in the episode The Leap, by which point he and Stella had broken up. In fact, Stella moved to California as described in the epilogue of As Fast As She Can, the episode immediately preceding The Leap. But it could be that only the goat related incidents were from his 31st birthday and not anything else mentioned. Because when Lily is talking to Robin about having sex with Barney, the goat is there, but the whole Robin/Barney sex thing happened around Ted's 30th birthday.
It is revealed that in The Bro Code, 'A mother of a Bro is off-limits', but Barney has admitted to kissing, and perhaps sleeping with Ted's mother, yet Barney does not acknowledge he has broken The Bro Code in this aspect.
It's revealed that Ted's birthday is April 25th, 1978.
The Bro Code is an actual book released as a tie-in for the show. Several of the quoted articles in the show are the same as in the book, although under different article numbers.
Curiously enough, according to Bro Code, Article 38, a bro should never punch another bro in the groin, "even in a fight to the death". Early in the episode, Marshall claims that Ted never broke the code. But Ted breaks the Bro Code by the end of the episode, when he punches Barney in the groin in the limo. Although Ted did punch Barney in the groin it can be assumed that Ted was able to do it because they were no longer bros and friends anymore. The fact that Barney gave Ted verbal permission to hit him "anywhere but the face" may also factor into Ted's possible exemption from the code.
In Barney's flashback to the writing of the Bro Code, the girl on past Barney's left is wearing a dress from the episode "Halloween" from the show Buffy the Vampire Slayer, which Alyson Hannigan also starred in.
This episode shares many similarities with Tick Tick Tick. Both episodes begin with Barney and Robin lying in bed together following on from a kiss at the end of the previous episode (Sandcastles in the Sand and Disaster Averted ). In both episodes they try to pretend it never happened but Barney is so nervous he almost slips up. Similarly in both episodes it is Barney who gets the rawer end of the deal. In this episode, Ted forgives Robin but refuses to forgive Barney, ending their friendship. In Tick Tick Tick, after agreeing to break up with their perspective partners so that they can be together, Barney breaks up with Nora but Robin stays with Kevin , leaving Barney heartbroken. Also the proceeding episodes' titles are similar: This episode is proceeded by Rebound Bro and Tick Tick Tick is proceeded by The Rebound Girl .