mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +01:00
Hemostat/cautery steps now heal their targetted bodypart instead of a random one (#78380)
## About The Pull Request Title summarizes all. ## Why It's Good For The Game Fixes #48432 @Sealed101 ## Changelog 🆑 distributivgesetz fix: Clamping/closing a wound should now heal the bodypart that was damaged instead of a random one. /🆑
This commit is contained in:
@@ -157,12 +157,14 @@
|
||||
////////////////////////////////////////////
|
||||
|
||||
///Returns a list of damaged bodyparts
|
||||
/mob/living/carbon/proc/get_damaged_bodyparts(brute = FALSE, burn = FALSE, required_bodytype)
|
||||
/mob/living/carbon/proc/get_damaged_bodyparts(brute = FALSE, burn = FALSE, required_bodytype = NONE, target_zone = null)
|
||||
var/list/obj/item/bodypart/parts = list()
|
||||
for(var/X in bodyparts)
|
||||
var/obj/item/bodypart/BP = X
|
||||
if(required_bodytype && !(BP.bodytype & required_bodytype))
|
||||
continue
|
||||
if(!isnull(target_zone) && BP.body_zone != target_zone)
|
||||
continue
|
||||
if((brute && BP.brute_dam) || (burn && BP.burn_dam))
|
||||
parts += BP
|
||||
return parts
|
||||
@@ -197,8 +199,8 @@
|
||||
*
|
||||
* It automatically updates health status
|
||||
*/
|
||||
/mob/living/carbon/heal_bodypart_damage(brute = 0, burn = 0, updating_health = TRUE, required_bodytype)
|
||||
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute, burn, required_bodytype)
|
||||
/mob/living/carbon/heal_bodypart_damage(brute = 0, burn = 0, updating_health = TRUE, required_bodytype = NONE, target_zone = null)
|
||||
var/list/obj/item/bodypart/parts = get_damaged_bodyparts(brute, burn, required_bodytype, target_zone)
|
||||
if(!parts.len)
|
||||
return
|
||||
var/obj/item/bodypart/picked = pick(parts)
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
*
|
||||
* needs to return amount healed in order to calculate things like tend wounds xp gain
|
||||
*/
|
||||
/mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, updating_health = TRUE, required_bodytype)
|
||||
/mob/living/proc/heal_bodypart_damage(brute = 0, burn = 0, updating_health = TRUE, required_bodytype = NONE, target_zone = null)
|
||||
. = (adjustBruteLoss(-brute, FALSE) + adjustFireLoss(-burn, FALSE)) //zero as argument for no instant health update
|
||||
if(updating_health)
|
||||
updatehealth()
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
/datum/surgery_step/clamp_bleeders/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results)
|
||||
if(locate(/datum/surgery_step/saw) in surgery.steps)
|
||||
target.heal_bodypart_damage(20,0)
|
||||
target.heal_bodypart_damage(20, 0, target_zone = target_zone)
|
||||
if (ishuman(target))
|
||||
var/mob/living/carbon/human/human_target = target
|
||||
var/obj/item/bodypart/target_bodypart = human_target.get_bodypart(target_zone)
|
||||
@@ -137,7 +137,7 @@
|
||||
|
||||
/datum/surgery_step/close/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results)
|
||||
if(locate(/datum/surgery_step/saw) in surgery.steps)
|
||||
target.heal_bodypart_damage(45,0)
|
||||
target.heal_bodypart_damage(45, 0, target_zone = target_zone)
|
||||
if (ishuman(target))
|
||||
var/mob/living/carbon/human/human_target = target
|
||||
var/obj/item/bodypart/target_bodypart = human_target.get_bodypart(target_zone)
|
||||
|
||||
Reference in New Issue
Block a user