Bruce Robertson (James McAvoy) is a Detective Sergeant in Edinburgh; a scheming, manipulative, misanthropic man who spends his time indulging in drugs, alcohol, sexually abusive relationships, and "the games" his euphemism for the myriad foul plots he hatches directed at workmates. Robertson also delights in systematically bullying and taking advantage of his mild mannered friend Clifford Blades (Eddie Marsan), a member of Robertson's masonic lodge whose wife he repeatedly prank calls and harasses as part of one of his elaborate 'games' (transgressions for which he ultimately frames Blades himself).Robertson's main goal in life is to gain promotion to Detective Inspector, the path to which appears to open when he is assigned to oversee the investigation into the murder of a Japanese student. He slowly loses his grip on reality as he works the case, however, suffering from a series of increasingly severe hallucinations. These hallucinations become worse as the film gets closer to the end and Bruce's mental health begins to fade into a state of insanity. It is ultimately revealed through dream-like exchanges with his psychiatrist (Jim Broadbent) that he is on medication for bipolar disorder, and wracked with guilt over a tragic accident which led to the death of his younger brother at some point in his childhood. It also becomes clear that his wife had left him for another man some time prior to the film's events and is denying him access to his daughter, developments which sparked his desperate bid for promotion, and also led him to start dressing as his wife when off duty in order to 'keep her close to him'.While wandering the streets on such an occasion, he is taken by the gang responsible for the murder (which it is revealed that he witnessed at the start of film, but could not report to his colleagues for fear of disclosing his transvestism and problems at home) and badly beaten. He manages however to kill the gang leader by throwing him out of a window, and is found by his colleagues. Robertson not merely misses out on the promotion as a result of the events, but is in fact demoted to Constable and is reassigned to uniform. The film closes with Clifford watching a tape of Robertson apologising that was left for him upon his release from jail. Robertson then prepares to commit suicide by hanging himself, but is interrupted by a woman and her son knocking on his front door. Robertson then breaks the fourth wall and addresses the audience saying: "Same rules apply." and the chair slips from underneath him.