diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index afa0429bdc0..1c54b24ba6b 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -81,7 +81,24 @@ return 1 return 0 - +/proc/get_pain_modifier(mob/living/carbon/human/M) //returns modfier to make surgery harder if patient is conscious and feels pain + if(M.stat && !M.sleeping) //stat=0 if CONSCIOUS, 1=UNCONSCIOUS and 2=DEAD. Operating on dead people is easy, too. Just sleeping won't work, though. + return 1 + if(NO_PAIN in M.species.species_traits)//if you don't feel pain, you can hold still + return 1 + if(M.reagents.has_reagent("hydrocodone"))//really good pain killer + return 0.99 + if(M.reagents.has_reagent("morphine"))//Just as effective as Hydrocodone, but has an addiction chance + return 0.99 + if(M.drunk >= 80)//really damn drunk + return 0.95 + if(M.drunk >= 40)//pretty drunk + return 0.9 + if(M.reagents.has_reagent("sal_acid")) //it's better than nothing, as far as painkillers go. + return 0.85 + if(M.drunk >= 15)//a little drunk + return 0.85 + return 0.8 //20% failure chance /proc/get_location_modifier(mob/M) var/turf/T = get_turf(M) diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 8861380527a..1d836259cbe 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -116,6 +116,12 @@ prob_chance = allowed_tools[implement_type] prob_chance *= get_location_modifier(target) + + if(!ispath(surgery.steps[surgery.status], /datum/surgery_step/robotics))//Repairing robotic limbs doesn't hurt + if(ishuman(target)) + var/mob/living/carbon/human/H = target //typecast to human + prob_chance *= get_pain_modifier(H)//operating on conscious people is hard. + if(prob(prob_chance) || isrobot(user)) if(end_step(user, target, target_zone, tool, surgery)) advance = 1