The autodoc should have an option to install or remove CBMs from an NPC ally. install_bionics is a member of the player class, so it should apply to NPCs already.
The iexamine::autodoc function would need to detect additional friendly NPCs in the vicinity, and if there are any, query whether to install the CBMs on the player or one of the NPCs. I think most of the rest of the logic flows pretty much unchanged, replacing player &p with &player selected_NPC in a couple of instances.
Obviously, NPCs won't have the AI to use active CBMs, but the passive stat boosters and armor could be applied to them right now. And a future revision of the NPC AI code could let them take advantage of some of the active defense CBMs like dielectric capacitance or active utility CBMs like aero-evaporator.
I intend to implement this sometime in the next two weeks unless someone tells me not to or wants to take it over themselves.
I intend to implement this sometime in the next two weeks unless someone tells me not to or wants to take it over themselves.
Done. Extremely looking forward to this. Appreciate your hard work.
If there are CBMs the NPC can't use, they need to be blacklisted.
Otherwise, no objection, ideally the NPC will only allow this if they trust you a LOT, but that's a preexisting issue that I'm not going to treat as a blocker for adding this.
I think it's going to be easier to whitelist the CBMs that an NPC can use.
Power Storage
Joint Torsion Ratchet
Air Filter
Alloy Playing
Electroshock
Submdermal Carbon
Cerebral Booster, Diamond Cornea, Muscle Augmentation, Synaptic Accelerator, Targeting Sytem, (Nictating Membrane, Oxygenator - why bother?)
Anti-Glare
Integrated Toolset (maybe?)
Internal Storage
Recycler Unit (I hope)
Fingertip Razors
Offensive Defensive System
Active Defense System
Dielectric Capacitance System
Thermal Dissipiation
Repair Nanobots
Bionic Claws / Molecular Blade
The various implanted guns
Aero-Evaporator
Ethanol Burner, Internal Furnace, Metabolic Interchange, Microreactors
Cranial Flashlight
Implanted Night Vision / Infrared Vision
Implant UPS
Uncanny Dodge
Power Armor Interface
Radiation Scrubber System
You probably can't get enough trust to give an NPC a Fusion Blaster Arm, and it's certainly a bad idea, but Chain Lightning or Finger Laser is possibly safe.
Teleportation Unit
Time Dilation
Probability Travel
Plutionium Filter / Purger
Hydraulic Muscles
I forsee a mod that spawns NPCs with CBMs in the future.
Faulty CBMs
Blood Analysis
Clock
Facial Distortion
Fingerhack
Fingerpick
Climate Control
Leukocyte Breeder
Olfactory Mask
Scent Vision
Terranian Sonar
Water Extraction Unit
Blood Filter
Cable Charger
Dosimeter
Permanent blacklist CBMs (some of these may move off the blacklist if NPC code changes such as NPCs caring about temperature)
Just to Devil's Advocate for some of these, although how "useful" I don't know:
Faulty CBMs --- could make an interesting dynamic NPC quest or static NPC quest to help them get those removed (would result in super high trust).
Clock --- increases complaints of eating/sleeping "Hey partner, when we sleepin'? It's [current time]!" or "Jeez, it's been [hours since NPC slept], I need to rest!" Or even simply, "Almost supper time, I wonder what they're servin' for dinner?" --- I guess more for emergent dialogue.
Cable Charger --- human powered vehicles or bases. Evil.
Dosimeter --- good for more emergent dialogue, "Hey [character name], I'm pickin' up radiation 'round here. Are we sure about this?" etc
I forsee a mod that spawns NPCs with CBMs in the future.
Why a mod? We already some mod content that should be in mainline imo (NPC traits), and NPC with CBMs should be definitely mainlined too.
I was planning to have two whitelist flags: NPC_INSTALL and NPC_START. All NPC_INSTALL CBMs would be ones that NPCs could start with and would consent to letting you install, while NPC_START would be faulty CBMs that NPCs might start with but wouldn't let you install.
Clock or dosimeter would be interesting emergent dialogue, but I don't have time to get my NPCs to tell me when they're going to sleep in the middle of the zombie infested city, and that's a higher priority task than checking a dosimeter. But sure, as a long term plan.
iexamine changes are (hopefully) complete and I can make a friendly NPC into a patient:
something isn't working in install_bionics but progress is progress.
First pass of the code is https://github.com/CleverRaven/Cataclysm-DDA/pull/24503
Most helpful comment
iexamine changes are (hopefully) complete and I can make a friendly NPC into a patient:

something isn't working in install_bionics but progress is progress.