Thomas J. Mascia scattered casings around and then shot himself in the leg in a bid for attention, prosecutors said.