From d1fc384533b13994bd55e64191258076af1a6d5c Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Tue, 17 Jan 2012 20:34:12 -0500 Subject: [PATCH] allow non-MMI brains to ghost (since they can't do anything), admin-spawnable bone repairing syrum --- code/game/objects/items.dm | 12 ++++ .../objects/items/weapons/surgery_tools.dm | 65 +++++++++++++++++++ code/modules/mob/living/carbon/brain/MMI.dm | 11 ++++ code/modules/mob/living/carbon/brain/brain.dm | 9 ++- 4 files changed, 96 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 0183dcc26d3..5e7fe129478 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -335,6 +335,10 @@ user << "\blue You're going to need to remove their head cover first." return + var/datum/organ/external/head = H.organs["head"] + if(head.destroyed) + user << "\blue Put it where? There's no head." + //since these people will be dead M != usr if(M:brain_op_stage == 4.0) @@ -361,6 +365,14 @@ else M.key = brainmob.key + // force re-entering corpse + if (!M.client) + for(var/mob/dead/observer/ghost in world) + if(ghost.corpse == brainmob && ghost.client) + ghost.cancel_camera() + ghost.reenter_corpse() + break + M:brain_op_stage = 3.0 del(src) diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm index 31942a02edc..d3369524cd0 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -1019,3 +1019,68 @@ CIRCULAR SAW if(5) z="[usr] performs chiropractice on [m]'s [organ.display_name]" return z + + + +/obj/item/weapon/boneinjector + name = "Bone-repairing Nanites Injector" + desc = "This injects the person with nanites that repair bones." + icon = 'items.dmi' + icon_state = "implanter1" + throw_speed = 1 + throw_range = 5 + w_class = 1.0 + var/uses = 5 + +/obj/item/weapon/boneinjector/attack_paw(mob/user as mob) + return attack_hand(user) + +/obj/item/weapon/boneinjector/proc/inject(mob/M as mob) + if(istype(M,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = M + for(var/name in H.organs) + var/datum/organ/external/e = H.organs[name] + if(e.destroyed) // this is nanites, not space magic + continue + e.brute_dam = 0.0 + e.burn_dam = 0.0 + e.bandaged = 0.0 + e.wound_size = 0.0 + e.max_damage = initial(e.max_damage) + e.bleeding = 0 + e.open = 0 + e.broken = 0 + e.destroyed = 0 + e.perma_injury = 0 + e.update_icon() + H.update_body() + H.update_face() + H.UpdateDamageIcon() + + uses-- + if(uses == 0) + spawn(0)//this prevents the collapse of space-time continuum + del(src) + return uses + +/obj/item/weapon/boneinjector/attack(mob/M as mob, mob/user as mob) + if (!istype(M, /mob)) + return + if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") + user << "\red You don't have the dexterity to do this!" + return + M.attack_log += text("\[[time_stamp()]\] Has been injected with [name] by [user.name] ([user.ckey])") + user.attack_log += text("\[[time_stamp()]\] Used the [name] to inject [M.name] ([M.ckey])") + + if (user) + for(var/mob/O in viewers(M, null)) + O.show_message(text("\red [] has been injected with [] by [].", M, src, user), 1) + //Foreach goto(192) + if (!(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))) + user << "\red Apparently it didn't work." + return + inject(M)//Now we actually do the heavy lifting. + + if(!isnull(user))//If the user still exists. Their mob may not. + user.show_message(text("\red You inject [M]")) + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index 2819d8d7627..b0931dfee20 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -32,8 +32,17 @@ O:brainmob = null brainmob.loc = src brainmob.container = src + brainmob.verbs -= /mob/proc/ghost brainmob.stat = 0 + // force re-entering corpse + if (!brainmob.client) + for(var/mob/dead/observer/ghost in world) + if(ghost.corpse == brainmob && ghost.client) + ghost.cancel_camera() + ghost.reenter_corpse() + break + user.drop_item() del(O) @@ -66,6 +75,7 @@ brainmob.container = null//Reset brainmob mmi var. brainmob.loc = brain//Throw mob into brain. brain.brainmob = brainmob//Set the brain to use the brainmob + brainmob.verbs += /mob/proc/ghost brainmob = null//Set mmi brainmob var to null icon_state = "mmi_empty" @@ -78,6 +88,7 @@ brainmob.real_name = H.real_name brainmob.dna = H.dna brainmob.container = src + brainmob.verbs -= /mob/proc/ghost name = "Man-Machine Interface: [brainmob.real_name]" icon_state = "mmi_full" diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 140e40742d5..acab2597802 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -29,4 +29,11 @@ return 1 if (istype(other, /mob/living/carbon/metroid)) return 1 - return ..() \ No newline at end of file + return ..() + + Login() + if(!container) + verbs += /mob/proc/ghost + + Logout() + verbs -= /mob/proc/ghost \ No newline at end of file