So JerryK here unfortunately is right on track, assuming you hae a P218G with the electronic ignition. That is what the later models 318's have. My 318 had the exact same problem.
Before wasting money, remember you only need three things to make the engine fire
1) Spark
2) Compression
3) Fuel
When it stops running see if it is getting a spark. If you have no spark, go ahead and waste some $$ on the new coil and condensor, but the bottom line is that the plastic sensor that sits on the engine block behind the flywheel gets tired and fails when hot... That little white thing produces the correct timing and voltage for the coil that fires off the spark plugs.
While it seems like a big effort, I could have your engine out in 30 minutes and the flywheel off in another ten. The entire project is no more than a three hour effort even if you have not done it before. The only slight trick is making a puller to get the flywheel off. And don't put oil or grease on the tapered crankshaft prior to putting the flywheel back on or it won't seat correctly.
Hope this helps.
Wayne