Three men barged into a Lyneham flat where they gave one of the occupants an electric shock and violently beat him and a friend, a trial has heard.
The trial also heard that during the alleged home invasion one of the men asked to charge the electric weapon, while another brought the alleged victim a frozen pack to treat an injury.
Prosecutors allege the violent home invasion was committed by Kyle Butkovic, 27, and Ibrahim Kaddour, 24, to recoup a debt.
Both have pleaded not guilty to aggravated burglary. A third man allegedly involved will not face trial this week.
A man living at the house told the jury on Tuesday he had been out drinking in Civic with another man when they returned to the flat.
He said his two female housemates told him there had been an earlier break-in attempt and the door handle was broken.
While they were waiting for the locksmith, he said he opened the front door to a knock only to be "blinded by a stunning visual light".
He was struck in the chest with an "electrified device", he said.
The effect caused him to lose control of his bladder and he tried to spit at his attacker.
The witness, an apprentice chef, said a man started beating him and he was counting the punches on his fingers, but he lost count after 40.
He said one of the men held a knife at his throat and ordered him to hand over everything he had.
"I was being robbed, I guess," he said.
As he headed towards his bedroom, he told the court he saw one of the alleged attackers start beating another man in the house.
The attacker was demanding "where's the money?", and the witness said the amount asked for was around $45,000.
At one point, he said one of the attackers grabbed a frozen beef packet from the freezer and brought it to him for an injury to his eye.
They sat on the couch, smoked weed and talked about rugby, he said.
One of the alleged attackers allegedly asked one of the housemates to charge the electric weapon.
The witness said there was a woman he did not know wearing a toga costume from a Halloween party several days earlier still unconscious in his bedroom.
When he went to the bedroom to collect belongings, the witness said he saw one of the attackers running a knife along the woman's leg.
But he said he pulled the attacker off the woman and sustained a cut from the knife in the process.
The man told the jury he cried and begged the man not to hurt his cat.
At one point while another man was being assaulted on the couch, he said a locksmith arrived to fix the broken door handle.
Defence barristers pointed to multiple inconsistencies in the man's various statements to police and prosecutors.
The trial's first day, for example, was the first time he had spoken about handing the alleged attackers $1200 cash and a Macbook Air.
But the witness denied he was lying.
He agreed his housemates were selling cannabis from the home, but denied he was dealing cocaine or Valium.
He also denied a suggestion that that night he had simply let the three men into the home where they sat and drank with the group.
He denied that it was him who had attacked someone that night.
"To infer so would be defamation," he said.
"I'm a pacifist and a Buddhist."
It also emerged during cross-examination that when the witness went to hospital a couple of days later he was advised to stop taking drugs.
He was also advised to see his doctor for a mental health plan, the court heard.
The trial continues.