From 5b8253fb57d586a0efd7600a56d769fe98ba4518 Mon Sep 17 00:00:00 2001 From: VampyrBytes Date: Tue, 19 Aug 2014 07:06:12 +0100 Subject: [PATCH] IPC and nuke disk fixes Fix for IPC revival Prevents nuke disk from being inserted via cavity surgery --- code/game/objects/items/weapons/tools.dm | 3 +++ .../mob/living/carbon/human/human_damage.dm | 9 ++++++- code/modules/power/cable.dm | 3 +++ code/modules/surgery/headreattach.dm | 4 --- code/modules/surgery/implant.dm | 27 ++++++++++--------- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index b38ed25be23..030028eae67 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -477,6 +477,9 @@ if(S.brute_dam) S.heal_damage(15,0,0,1) user.visible_message("\red \The [user] patches some dents on \the [M]'s [S.display_name] with \the [src].") + if(istype(M,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = M + H.updatehealth() return else user << "Nothing to fix!" diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 094a8064287..77a88796660 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -11,8 +11,15 @@ total_burn += O.burn_dam health = 100 - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute //TODO: fix husking - if( ((100 - total_burn) < config.health_threshold_dead) && stat == DEAD) //100 only being used as the magic human max health number, feel free to change it if you add a var for it -- Urist + if( (((100 - total_burn) < config.health_threshold_dead) && stat == DEAD) && (!species.flags & IS_SYNTHETIC))//100 only being used as the magic human max health number, feel free to change it if you add a var for it -- Urist ChangeToHusk() + if (species.flags & IS_SYNTHETIC) + var/datum/organ/external/H = get_organ(head) + if (!H.amputated) + if ((health >= (config.health_threshold_dead/100*75)) && stat == DEAD) //need to get them 25% away from death point before reviving them + dead_mob_list -= src + living_mob_list += src + stat = CONSCIOUS return /mob/living/carbon/human/getBrainLoss() diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 6ca34f77e81..c688127ad2b 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -630,6 +630,9 @@ obj/structure/cable/proc/cableColor(var/colorC) if(S.burn_dam > 0 && use(1)) S.heal_damage(0,15,0,1) user.visible_message("\red \The [user] repairs some burn damage on \the [M]'s [S.display_name] with \the [src].") + if(istype(M,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = M + H.updatehealth() return else user << "Nothing to fix!" diff --git a/code/modules/surgery/headreattach.dm b/code/modules/surgery/headreattach.dm index 704cdf98d2b..43d5c3c44d2 100644 --- a/code/modules/surgery/headreattach.dm +++ b/code/modules/surgery/headreattach.dm @@ -180,10 +180,6 @@ var/obj/item/weapon/organ/head/B = tool if (B.brainmob.mind) B.brainmob.mind.transfer_to(target) - if ((istype(B, /obj/item/weapon/organ/head/posi)) && (affected.status & ORGAN_ROBOT)) // cos you just know someone's going to put a robot head on a human body at some point! - dead_mob_list -= target - living_mob_list += target - target.stat = CONSCIOUS target.update_body() target.updatehealth() target.UpdateDamageIcon() diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 5408cbea2c5..6697c4cfc56 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -122,17 +122,20 @@ end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/chest/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \ - "\blue You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." ) - if (tool.w_class > get_max_wclass(affected)/2 && prob(50)) - user << "\red You tear some vessels trying to fit such big object in this cavity." - var/datum/wound/internal_bleeding/I = new (15) - affected.wounds += I - affected.owner.custom_pain("You feel something rip in your [affected.display_name]!", 1) - user.drop_item() - affected.hidden = tool - tool.loc = target - affected.cavity = 0 + if(istype(tool, /obj/item/weapon/disk/nuclear)) + user << "Central command would kill you if you implanted the disk into someone." + else + user.visible_message("\blue [user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \ + "\blue You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." ) + if (tool.w_class > get_max_wclass(affected)/2 && prob(50)) + user << "\red You tear some vessels trying to fit such big object in this cavity." + var/datum/wound/internal_bleeding/I = new (15) + affected.wounds += I + affected.owner.custom_pain("You feel something rip in your [affected.display_name]!", 1) + user.drop_item() + affected.hidden = tool + tool.loc = target + affected.cavity = 0 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/chest/affected = target.get_organ(target_zone) @@ -185,7 +188,7 @@ affected.implants -= obj target.hud_updateflag |= 1 << IMPLOYAL_HUD - + //Handle possessive brain borers. if(istype(obj,/mob/living/simple_animal/borer)) var/mob/living/simple_animal/borer/worm = obj