Fixed runtime with host bioscan, added verb cooldowns.

This commit is contained in:
Zuhayr
2014-07-17 23:31:12 +09:30
parent 1345ee5a5c
commit 3999c0bfb5
2 changed files with 76 additions and 52 deletions
+55 -39
View File
@@ -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("<span class='danger'>[user.name] boops [src] on the head.</span>")
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
+21 -13
View File
@@ -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()]</TT></body></html>"}
return dat
// Crew Manifest
/mob/living/silicon/pai/proc/softwareManifest()
var/dat = ""
@@ -528,17 +528,25 @@
dat += {"<h2>Medical Analysis Suite</h2><hr>
<h4>Host Bioscan</h4>
"}
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. <br>"
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. <br>"
src.subscreen = 0
return dat
dat += {"<b>Bioscan Results for [M]</b>: <br>
Overall Status: [M.stat > 1 ? "dead" : "[M.health]% healthy"] <br><br>
<b>Scan Breakdown</b>: <br>
Respiratory: [M.getOxyLoss() > 50 ? "<font color=#FF5555>" : "<font color=#55FF55>"][M.getOxyLoss()]</font><br>
Toxicology: [M.getToxLoss() > 50 ? "<font color=#FF5555>" : "<font color=#55FF55>"][M.getToxLoss()]</font><br>
@@ -676,7 +684,7 @@
dat += "</li>"
dat += "</ul>"
dat += "Messages: <hr>"
dat += "<style>td.a { vertical-align:top; }</style>"
dat += "<table>"
for(var/index in pda.tnote)
@@ -685,4 +693,4 @@
else
dat += addtext("<tr><td class='a'><i><b>From</b></i></td><td class='a'><i><b>&rarr;</b></i></td><td><i><b><a href='byond://?src=\ref[src];software=pdamessage;target=",index["target"],"'>", index["owner"],"</a>: </b></i>", index["message"], "<br></td></tr>")
dat += "</table>"
return dat
return dat