From 3999c0bfb59e5758eb3043f91f3da3dc54d0d577 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 17 Jul 2014 23:31:12 +0930 Subject: [PATCH] Fixed runtime with host bioscan, added verb cooldowns. --- code/modules/mob/living/silicon/pai/pai.dm | 94 +++++++++++-------- .../mob/living/silicon/pai/software.dm | 34 ++++--- 2 files changed, 76 insertions(+), 52 deletions(-) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index b3abbbd0fb8..1aff3b53ffe 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -260,7 +260,47 @@ src.unset_machine() src:cameraFollow = null -//This is used to convert the stationary pai item into a mobile pai mob. +//Addition by Mord_Sith to define AI's network change ability +/* +/mob/living/silicon/pai/proc/pai_network_change() + set category = "pAI Commands" + set name = "Change Camera Network" + src.reset_view(null) + src.unset_machine() + src:cameraFollow = null + var/cameralist[0] + + if(usr.stat == 2) + usr << "You can't change your camera network because you are dead!" + return + + for (var/obj/machinery/camera/C in Cameras) + if(!C.status) + continue + else + if(C.network != "CREED" && C.network != "thunder" && C.network != "RD" && C.network != "phoron" && C.network != "Prison") COMPILE ERROR! This will have to be updated as camera.network is no longer a string, but a list instead + cameralist[C.network] = C.network + + src.network = input(usr, "Which network would you like to view?") as null|anything in cameralist + src << "\blue Switched to [src.network] camera network." +//End of code by Mord_Sith +*/ + + +/* +// Debug command - Maybe should be added to admin verbs later +/mob/verb/makePAI(var/turf/t in view()) + var/obj/item/device/paicard/card = new(t) + var/mob/living/silicon/pai/pai = new(card) + pai.key = src.key + card.setPersonality(pai) + +*/ + +// Procs/code after this point is used to convert the stationary pai item into a +// mobile pai mob. This also includes handling some of the general shit that can occur +// to it. Really this deserves its own file, but for the moment it can sit here. ~ Z + /mob/living/silicon/pai/proc/fold_out() set category = "pAI Commands" set name = "Unfold Chassis" @@ -271,6 +311,10 @@ if(src.loc != card) return + if(world.time <= last_special) + return + + last_special = world.time + 100 verbs -= /mob/living/silicon/pai/proc/fold_out verbs += /mob/living/silicon/pai/proc/fold_up @@ -301,6 +345,9 @@ if(src.loc == card) return + if(world.time <= last_special) + return + close_up() /mob/living/silicon/pai/proc/choose_chassis() @@ -358,9 +405,15 @@ if(stat != 2) close_up() return +/mob/living/silicon/pai/attack_hand(mob/user as mob) + visible_message("[user.name] boops [src] on the head.") + close_up() + //I'm not sure how much of this is necessary, but I would rather avoid issues. /mob/living/silicon/pai/proc/close_up() + last_special = world.time + 100 + verbs -= /mob/living/silicon/pai/proc/fold_up verbs += /mob/living/silicon/pai/proc/fold_out @@ -375,41 +428,4 @@ card.loc = get_turf(card) src.forceMove(card) card.forceMove(card.loc) - canmove = 0 - -//Addition by Mord_Sith to define AI's network change ability -/* -/mob/living/silicon/pai/proc/pai_network_change() - set category = "pAI Commands" - set name = "Change Camera Network" - src.reset_view(null) - src.unset_machine() - src:cameraFollow = null - var/cameralist[0] - - if(usr.stat == 2) - usr << "You can't change your camera network because you are dead!" - return - - for (var/obj/machinery/camera/C in Cameras) - if(!C.status) - continue - else - if(C.network != "CREED" && C.network != "thunder" && C.network != "RD" && C.network != "phoron" && C.network != "Prison") COMPILE ERROR! This will have to be updated as camera.network is no longer a string, but a list instead - cameralist[C.network] = C.network - - src.network = input(usr, "Which network would you like to view?") as null|anything in cameralist - src << "\blue Switched to [src.network] camera network." -//End of code by Mord_Sith -*/ - - -/* -// Debug command - Maybe should be added to admin verbs later -/mob/verb/makePAI(var/turf/t in view()) - var/obj/item/device/paicard/card = new(t) - var/mob/living/silicon/pai/pai = new(card) - pai.key = src.key - card.setPersonality(pai) - -*/ + canmove = 0 \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 757b04b1ea2..fde71dc4541 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -438,9 +438,9 @@ for (var/ch_name in radio.channels) dat+=radio.text_sec_channel(ch_name, radio.channels[ch_name]) dat+={"[radio.text_wires()]"} - + return dat - + // Crew Manifest /mob/living/silicon/pai/proc/softwareManifest() var/dat = "" @@ -528,17 +528,25 @@ dat += {"

Medical Analysis Suite


Host Bioscan

"} - var/mob/living/M = src.loc - if(!istype(M, /mob/living)) - while (!istype(M, /mob/living)) - M = M.loc - if(istype(M, /turf)) - src.temp = "Error: No biological host found.
" - src.subscreen = 0 - return dat + + var/mob/living/M + //If we are not deployed, check the holder of the card. + if(src.loc == card) + M = card.loc + + //If we are deployed or the card is not held, check the first living mob in our turf. + if(!M || !istype(M)) + var/turf/T = get_turf(src) + M = locate(/mob/living/) in T.contents + + if(!M || !istype(M)) + src.temp = "Error: No biological host found.
" + src.subscreen = 0 + return dat + dat += {"Bioscan Results for [M]:
Overall Status: [M.stat > 1 ? "dead" : "[M.health]% healthy"]

- + Scan Breakdown:
Respiratory: [M.getOxyLoss() > 50 ? "" : ""][M.getOxyLoss()]
Toxicology: [M.getToxLoss() > 50 ? "" : ""][M.getToxLoss()]
@@ -676,7 +684,7 @@ dat += "" dat += "" dat += "Messages:
" - + dat += "" dat += "" for(var/index in pda.tnote) @@ -685,4 +693,4 @@ else dat += addtext("") dat += "
From", index["owner"],": ", index["message"], "
" - return dat + return dat