Bay12 examine overhaul.

This commit overhauls the examine system to baystation's latest system,
including a more efficient verb approach, and a new status panel tab,
which shows more information for pre-defined objects.
This commit is contained in:
Tigercat2000
2015-09-14 11:51:40 -07:00
parent cfbbf104ac
commit 0603f73232
146 changed files with 1381 additions and 1090 deletions
+10 -14
View File
@@ -96,7 +96,7 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
/mob/dead/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
return 1
/*
Transfer_mind is there to check if mob is being deleted/not going to have a body.
@@ -192,7 +192,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
/mob/dead/observer/Move(NewLoc, direct)
/mob/dead/observer/Move(NewLoc, direct)
following = null
dir = direct
if(NewLoc)
@@ -221,16 +221,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/area/A = get_area_master(src)
if(A)
A.Entered(src)
..()
/mob/dead/observer/experience_pressure_difference()
return 0
/mob/dead/observer/examine()
if(usr)
usr << desc
/mob/dead/observer/can_use_hands() return 0
/mob/dead/observer/is_active() return 0
@@ -325,15 +321,15 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set category = "Ghost"
set name = "Teleport"
set desc= "Teleport to a location"
if(!isobserver(usr))
usr << "Not when you're not dead!"
return
usr.verbs -= /mob/dead/observer/proc/dead_tele
spawn(30)
usr.verbs += /mob/dead/observer/proc/dead_tele
var/area/thearea = ghostteleportlocs[A]
if(!thearea) return
@@ -414,7 +410,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/Life()
// to catch teleports etc which directly set loc
update_following()
return ..()
return ..()
/mob/dead/observer/verb/jumptomob(target in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak
set category = "Ghost"
@@ -509,7 +505,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
src << "\blue Temperature: [round(environment.temperature-T0C,0.1)]&deg;C"
src << "\blue Heat Capacity: [round(environment.heat_capacity(),0.1)]"
/mob/dead/observer/verb/view_manifest()
set name = "View Crew Manifest"
set category = "Ghost"
@@ -629,9 +625,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
client.images |= ghost_darkness_images
if (ghostimage)
client.images -= ghostimage //remove ourself
/mob/proc/can_admin_interact()
return 0
/mob/dead/observer/can_admin_interact()
return check_rights(R_ADMIN, 0, src)
@@ -44,7 +44,7 @@ var/const/MAX_ACTIVE_TIME = 400
Attach(M)
/obj/item/clothing/mask/facehugger/examine(mob/user)
..()
..(user)
if(!real)//So that giant red text about probisci doesn't show up.
return
switch(stat)
@@ -171,7 +171,7 @@ var/const/MAX_ACTIVE_TIME = 400
var/mob/living/carbon/human/H = target
if(!H.check_has_mouth())
return
if(!sterile)
//target.contract_disease(new /datum/disease/alien_embryo(0)) //so infection chance is same as virus infection chance
target.visible_message("<span class='danger'>[src] falls limp after violating [target]'s face!</span>", \
@@ -130,12 +130,8 @@
ghost_volunteers.Add(O)
/obj/item/device/mmi/posibrain/examine()
set src in oview()
if(!usr || !src) return
if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) )
usr << "<span class='notice'>Something is there but you can't see it.</span>"
/obj/item/device/mmi/posibrain/examine(mob/user)
if(!..(user))
return
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n[desc]\n"
@@ -150,8 +146,7 @@
else
msg += "<span class='deadsay'>It appears to be completely inactive.</span>\n"
msg += "<span class='info'>*---------*</span>"
usr << msg
return
user << msg
/obj/item/device/mmi/posibrain/emp_act(severity)
if(!src.brainmob)
+15 -22
View File
@@ -1,11 +1,4 @@
/mob/living/carbon/human/examine()
set src in view()
if(!usr || !src) return
if( usr.sdisabilities & BLIND || usr.blinded || usr.stat==UNCONSCIOUS )
usr << "<span class='notice'>Something is there but you can't see it.</span>"
return
/mob/living/carbon/human/examine(mob/user)
var/skipgloves = 0
var/skipsuitstorage = 0
var/skipjumpsuit = 0
@@ -182,7 +175,7 @@
else if(istype(wear_id, /obj/item/weapon/card/id)) //just in case something other than a PDA/ID card somehow gets in the ID slot :[
var/obj/item/weapon/card/id/idcard = wear_id
id = idcard.registered_name
if(id && (id != real_name) && (get_dist(src, usr) <= 1) && prob(10))
if(id && (id != real_name) && (get_dist(src, user) <= 1) && prob(10))
msg += "<span class='warning'>[t_He] [t_is] wearing \icon[wear_id] \a [wear_id] yet something doesn't seem right...</span>\n"
else*/
msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id].\n"
@@ -208,22 +201,22 @@
if(DWARF in mutations)
msg += "[t_He] [t_is] a halfling!\n"
var/distance = get_dist(usr,src)
if(istype(usr, /mob/dead/observer) || usr.stat == 2) // ghosts can see anything
var/distance = get_dist(user,src)
if(istype(user, /mob/dead/observer) || user.stat == 2) // ghosts can see anything
distance = 1
if (src.stat)
msg += "<span class='warning'>[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep.</span>\n"
if((stat == 2 || src.health <= config.health_threshold_crit) && distance <= 3)
msg += "<span class='warning'>[t_He] does not appear to be breathing.</span>\n"
if(istype(usr, /mob/living/carbon/human) && !usr.stat && distance <= 1)
for(var/mob/O in viewers(usr.loc, null))
O.show_message("[usr] checks [src]'s pulse.", 1)
if(istype(user, /mob/living/carbon/human) && !user.stat && distance <= 1)
for(var/mob/O in viewers(user.loc, null))
O.show_message("[user] checks [src]'s pulse.", 1)
spawn(15)
if(distance <= 1 && usr.stat != 1)
if(distance <= 1 && user.stat != 1)
if(pulse == PULSE_NONE)
usr << "<span class='deadsay'>[t_He] has no pulse[src.client ? "" : " and [t_his] soul has departed"]...</span>"
user << "<span class='deadsay'>[t_He] has no pulse[src.client ? "" : " and [t_his] soul has departed"]...</span>"
else
usr << "<span class='deadsay'>[t_He] has a pulse!</span>"
user << "<span class='deadsay'>[t_He] has a pulse!</span>"
msg += "<span class='warning'>"
if(fire_stacks > 0)
@@ -246,7 +239,7 @@
if(nutrition < 100)
msg += "[t_He] [t_is] severely malnourished.\n"
else if(nutrition >= 500)
if(usr.nutrition < 100)
if(user.nutrition < 100)
msg += "[t_He] [t_is] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n"
else
msg += "[t_He] [t_is] quite chubby.\n"
@@ -419,7 +412,7 @@
msg += "<span class='warning'><b>[src] has \a [implant] sticking out of [t_his] flesh!</span>\n"
if(digitalcamo)
msg += "[t_He] [t_is] repulsively uncanny!\n"
if(!wear_mask && is_thrall(src) && in_range(usr,src))
if(!wear_mask && is_thrall(src) && in_range(user,src))
msg += "Their features seem unnaturally tight and drawn.\n"
if(decaylevel == 1)
msg += "[t_He] [t_is] starting to smell.\n"
@@ -430,7 +423,7 @@
if(decaylevel == 4)
msg += "[t_He] [t_is] mostly dessicated now, with only bones remaining of what used to be a person.\n"
if(hasHUD(usr,"security"))
if(hasHUD(user,"security"))
var/perpname = "wot"
var/criminal = "None"
@@ -453,7 +446,7 @@
msg += "<span class = 'deptradio'>Criminal status:</span> <a href='?src=\ref[src];criminal=1'>\[[criminal]\]</a>\n"
msg += "<span class = 'deptradio'>Security records:</span> <a href='?src=\ref[src];secrecord=`'>\[View\]</a> <a href='?src=\ref[src];secrecordadd=`'>\[Add comment\]</a>\n"
if(hasHUD(usr,"medical"))
if(hasHUD(user,"medical"))
var/perpname = "wot"
var/medical = "None"
@@ -484,7 +477,7 @@
pose = addtext(pose,".") //Makes sure all emotes end with a period.
msg += "\n[t_He] is [pose]"
usr << msg
user << msg
//Helper procedure. Called by /mob/living/carbon/human/examine() and /mob/living/carbon/human/Topic() to determine HUD access to security and medical records.
/proc/hasHUD(mob/M as mob, hudtype)
@@ -1059,11 +1059,11 @@
if (href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
I.examine()
src.examinate(I)
if (href_list["lookmob"])
var/mob/M = locate(href_list["lookmob"])
M.examine()
src.examinate(M)
..()
return
@@ -1,12 +1,6 @@
/mob/living/carbon/slime/examine()
set src in oview()
if(!usr || !src) return
if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) )
usr << "<span class='notice'>Something is there but you can't see it.</span>"
return
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
/mob/living/carbon/slime/examine(mob/user)
..(user)
var/msg = ""
if (src.stat == DEAD)
msg += "<span class='deadsay'>It is limp and unresponsive.</span>\n"
else
@@ -47,5 +41,4 @@
msg += "</span>"
msg += "*---------*</span>"
usr << msg
return
user << msg
+5 -11
View File
@@ -1,12 +1,8 @@
/mob/living/silicon/ai/examine()
set src in oview()
if(!usr || !src) return
if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) )
usr << "<span class='notice'>Something is there but you can't see it.</span>"
/mob/living/silicon/ai/examine(mob/user)
if(!..(user))
return
var/msg = "<span class='info'>*---------*\nThis is \icon[src] <EM>[src]</EM>!\n"
var/msg = ""
if (src.stat == DEAD)
msg += "<span class='deadsay'>It appears to be powered-down.</span>\n"
else
@@ -27,10 +23,9 @@
msg += "</span>"
msg += "*---------*</span>"
usr << msg
usr.showLaws(src)
user << msg
user.showLaws(src)
return
/mob/proc/showLaws(var/mob/living/silicon/S)
return
@@ -38,4 +33,3 @@
/mob/dead/observer/showLaws(var/mob/living/silicon/S)
if(antagHUD || check_rights(R_MOD, 0, src))
S.laws.show_laws(src)
@@ -36,7 +36,7 @@
return 0
// Hide popout menu verbs
/mob/aiEye/examine(atom/A as mob|obj|turf in view())
/mob/aiEye/examinate(atom/A as mob|obj|turf in view())
set popup_menu = 0
set src = usr.contents
return 0
@@ -1,8 +1,7 @@
/mob/living/silicon/pai/examine() //removed as it was pointless...moved to the pai-card instead.
/* This is totally pointless because this mob is contained inside a card!
set src in oview()
/mob/living/silicon/pai/examine(mob/user) //removed as it was pointless...moved to the pai-card instead.
/*..(user) //This is totally pointless because this mob is contained inside a card!
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
var/msg = ""
if (src.stat == DEAD)
msg += "<span class='deadsay'>It appears to be offline.</span>\n"
else
@@ -22,6 +21,5 @@
msg += "</span>"
msg += "*---------*</span>"
usr << msg
*/
return
user << msg
*/
+4 -10
View File
@@ -496,16 +496,10 @@
src << "<span class='warning'>You are far too small to pull anything!</span>"
return
/mob/living/silicon/pai/examine()
/mob/living/silicon/pai/examine(mob/user)
..(user)
set src in oview()
if(!usr || !src) return
if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) )
usr << "<span class='notice'>Something is there but you can't see it.</span>"
return
var/msg = "<span class='info'>*---------*\nThis is \icon[src][name], a personal AI!"
var/msg = ""
switch(src.stat)
if(CONSCIOUS)
@@ -521,7 +515,7 @@
pose = addtext(pose,".") //Makes sure all emotes end with a period.
msg += "\nIt is [pose]"
usr << msg
user << msg
/mob/living/silicon/pai/bullet_act(var/obj/item/projectile/Proj)
..(Proj)
@@ -45,10 +45,10 @@
if(drone_progress >= 100)
visible_message("\The [src] voices a strident beep, indicating a drone chassis is prepared.")
/obj/machinery/drone_fabricator/examine()
..()
if(produce_drones && drone_progress >= 100 && istype(usr,/mob/dead) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
usr << "<BR><B>A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone.</B>"
/obj/machinery/drone_fabricator/examine(mob/user)
..(user)
if(produce_drones && drone_progress >= 100 && istype(user,/mob/dead) && config.allow_drone_spawn && count_drones() < config.max_maint_drones)
user << "<BR><B>A drone is prepared. Select 'Join As Drone' from the Ghost tab to spawn as a maintenance drone.</B>"
/obj/machinery/drone_fabricator/proc/count_drones()
var/drones = 0
@@ -101,7 +101,7 @@
if(!ticker || ticker.current_state < 3)
src << "<span class='warning'>You can't join as a drone before the game starts!</span>"
return
var/drone_age = 14 // 14 days to play as a drone
var/player_age_check = check_client_age(usr.client, drone_age)
if(player_age_check && config.use_age_restriction_for_antags)
@@ -128,7 +128,7 @@
pluralcheck = " [deathtimeminutes] minutes and"
var/deathtimeseconds = round((deathtime - deathtimeminutes * 600) / 10,1)
if (deathtime < 6000 && joinedasobserver == 0)
if (deathtime < 6000 && joinedasobserver == 0)
usr << "You have been dead for[pluralcheck] [deathtimeseconds] seconds."
usr << "<span class='warning'>You must wait 10 minutes to respawn as a drone!</span>"
return
@@ -1,12 +1,7 @@
/mob/living/silicon/robot/examine()
set src in oview()
/mob/living/silicon/robot/examine(mob/user)
..(user)
if(!usr || !src) return
if( (usr.sdisabilities & BLIND || usr.blinded || usr.stat) && !istype(usr,/mob/dead/observer) )
usr << "<span class='notice'>Something is there but you can't see it.</span>"
return
var/msg = "<span class='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>[custom_name ? ", [modtype] [braintype]" : ""]!\n"
var/msg = ""
var/obj/act_module = get_active_hand()
if(act_module)
msg += "It is holding \icon[act_module] \a [act_module].\n"
@@ -49,6 +44,5 @@
pose = addtext(pose,".") //Makes sure all emotes end with a period.
msg += "\nIt is [pose]"
usr << msg
usr.showLaws(src)
return
user << msg
user.showLaws(src)
@@ -46,10 +46,10 @@
qdel(src)
return
/mob/living/simple_animal/construct/examine()
set src in oview()
/mob/living/simple_animal/construct/examine(mob/user)
..(user)
var/msg = "<span cass='info'>*---------*\nThis is \icon[src] \a <EM>[src]</EM>!\n"
var/msg = ""
if (src.health < src.maxHealth)
msg += "<span class='warning'>"
if (src.health >= src.maxHealth/2)
@@ -59,8 +59,7 @@
msg += "</span>"
msg += "*---------*</span>"
usr << msg
return
user << msg
/mob/living/simple_animal/construct/attack_animal(mob/living/simple_animal/M as mob)
if(istype(M, /mob/living/simple_animal/construct/builder))
@@ -281,7 +281,7 @@
src << "\red There is nothing of interest to take."
return 0
/mob/living/simple_animal/spiderbot/examine()
..()
/mob/living/simple_animal/spiderbot/examine(mob/user)
..(user)
if(src.held_item)
usr << "It is carrying \a [src.held_item] \icon[src.held_item]."
user << "It is carrying \a [src.held_item] \icon[src.held_item]."
@@ -33,12 +33,12 @@
var/image/cap_living = null //Where we store our cap icons so we dont generate them constantly to update our icon
var/image/cap_dead = null
/mob/living/simple_animal/hostile/mushroom/examine()
..()
/mob/living/simple_animal/hostile/mushroom/examine(mob/user)
..(user)
if(health >= maxHealth)
usr << "<span class='info'>It looks healthy.</span>"
user << "<span class='info'>It looks healthy.</span>"
else
usr << "<span class='info'>It looks like it's been roughed up.</span>"
user << "<span class='info'>It looks like it's been roughed up.</span>"
/mob/living/simple_animal/hostile/mushroom/Life()
..()
@@ -354,7 +354,7 @@
qdel(src)
/obj/item/weapon/ectoplasm/revenant/examine(mob/user)
..()
..(user)
if(reforming)
user << "<span class='warning'>It is shifting and distorted. It would be wise to destroy this.</span>"
else if(!reforming)
+15 -2
View File
@@ -482,6 +482,18 @@ var/list/slot_equipment_priority = list( \
onclose(user, "mob\ref[src]")
return
//mob verbs are faster than object verbs. See http://www.byond.com/forum/?post=1326139&page=2#comment8198716 for why this isn't atom/verb/examine()
/mob/verb/examinate(atom/A as mob|obj|turf in view())
set name = "Examine"
set category = "IC"
if((is_blind(src) || usr.stat) && !isobserver(src))
src << "<span class='notice'>Something is there but you can't see it.</span>"
return 1
face_atom(A)
A.examine(src)
/mob/proc/ret_grab(obj/effect/list_container/mobl/L as obj, flag)
if ((!( istype(l_hand, /obj/item/weapon/grab) ) && !( istype(r_hand, /obj/item/weapon/grab) )))
if (!( L ))
@@ -620,7 +632,7 @@ var/list/slot_equipment_priority = list( \
if (!abandon_allowed)
usr << "<span class='warning'>Respawning is disabled.</span>"
return
if (stat != DEAD || !ticker)
usr << "<span class='boldnotice'>You must be dead to use this!</span>"
return
@@ -633,7 +645,7 @@ var/list/slot_equipment_priority = list( \
log_game("[key_name(usr)] respawn failed due to disconnect.")
return
client.screen.Cut()
if(!client)
log_game("[key_name(usr)] respawn failed due to disconnect.")
return
@@ -793,6 +805,7 @@ var/list/slot_equipment_priority = list( \
return
if (AM.anchored)
usr << "<span class='notice'>It won't budge!</span>"
return
var/mob/M = AM
+7
View File
@@ -458,6 +458,13 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM)
resting = !resting
src << "\blue You are now [resting ? "resting" : "getting up"]"
/proc/is_blind(A)
if(iscarbon(A))
var/mob/living/carbon/C = A
if(C.sdisabilities & BLIND || C.blinded)
return 1
return 0
/proc/get_multitool(mob/user as mob)
// Get tool
var/obj/item/device/multitool/P