When a massive star detonates as a supernova