What makes an implant / bionic part removable? I've tried changing the parts in my mod (https://github.com/EliaTarasoff/rimworld-implants) to subclass <HediffDef ParentName="AddedBodyPartBase"> instead of <HediffDef ParentName="ImplantHediffBase"> (not on a branch, sorry), but that doesn't seem to do it. Neither does setting <addedPartProps><solid>true</solid</addedPartProps> (a guess). <spawnThingOnRemoved>HeartSymbiote</spawnThingOnRemoved> has been there from the start, and it doesn't seem to be what does it either. What am I missing here?
Take a look at the recipe for ExciseCarcinoma. You need a surgery recipe that removes the Hediff of the implant/bionic part. As long as spawnThingOnRemoved is set, you'll get the part back. (Implants use the workerClass Recipe_InstallImplant to preserve the existing part, where bionic parts use Recipe_InstallArtificialBodyPart to replace the part and any sub-parts).
Cool, will try that when I get home! :)
Is <spawnThingOnRemoved> all that's needed on a surgery, to make the part given back? Or does it need to subclass BodyPartArtificialBase instead of ImplantBase? It seems like my symbiote-removal surgeries don't actually give back the item, but my artificial lung gets removed just fine. Also noteworthy, that anything that subclasses BodyPartArtificialBase gets a removal surgery for free in the game, but if you subclass implants, you need to add a surgery recipe yourself, for that thing.
So apparently the recipes to remove Hediffs go through an entirely separate process, and only Recipe_RemoveBodyPart actually triggers SpawnThingsFromHediffs to create the spawnThingOnRemoved. At the moment, I can't think of any way to make an implant re-spawn on being removed without making a custom recipe class that inherits from Recipe_Surgery.
I can deal with this. Some will be body-horror body-parts that can be re-aquired (just like that horrible fish-tongue thing!), and others will be non-recoverable infested paras...I mean "delicate symbiotes".