“Lois & Clark” star Dean Cain is locked in a nasty court battle over his baby boy — with his former Playboy Playmate ex-girlfriend accusing him of being a drug abuser and alcoholic.

Spanish actress and model Samantha Torres has filed suit in L.A. Superior Court in an attempt to gain sole custody of the couple’s 18-month-old son Christopher.

But Dean has vehemently denied her charges that he’s a substance abuser. And friends say the 35-year-old actor, who’s been producing and hosting the syndicated series “Ripley’s Believe It Or Not!,” has vowed to do whatever it takes to clear his name and win joint custody of his beloved boy.

“All Dean wants is for this legal nightmare to be over and for the court to grant him joint custody,” said a pal.

“Dean told me, ‘I just want to hash out a fair and equitable visitation schedule, where I can see my son on a regular basis without having to beg his mother all the time.

” ‘I’m a good father, despite what Samantha says in court papers. I don’t have a drug or booze problem and she knows it. I’ve even proven it to her and the court by submitting to regular drug screenings and I pass them with flying colors.’ “

Dean believes that Samantha is motivated by greed, said his pal.

“He told me, ‘She wants to milk every dime out of me that she can — she’s asked for millions of dollars!

“‘It really hurts me because I’ve been as generous as I possibly can be, even though we don’t have any kind of a legally binding support agreement.

“‘Up until very recently, I was paying $20,000 a month in support — and Samantha and I were never even married!’ “

The pal added: “Fortunately, things now are finally beginning to look up for Dean’s situation with his son. The court has granted him some regular visitation — he sees his son at least three times a week now.

“Dean told me, ‘Christopher is the greatest thing that’s ever happened to me and I think he needs to have me around in his life as much as I need him.

” ‘I’ll do whatever I need to do to keep him close to me!’ “