You probably don’t want to lose a leg, but if you have to there are many options now that were unthinkable not long ago. That is, if you can afford them. A microprocessor knee — a prosthetic with some smarts in it — can run anywhere from $25,000 to well over $100,000. However [Lucas Galey], a PhD candidate at the University of Texas El Paso in a recent paper claims to be able to produce a comparable artificial knee for under $1,000. If the paper is too long to read, Amplitude has a good summary including what it means to people who need them.
Of course, the cost of making something like this is almost incidental. The cost of approvals, testing, and other factors mean that even with about $500 in parts, the retail price would be much higher. Probably not $25,000, though.