diff --git a/code/_onclick/hud/action.dm b/code/_onclick/hud/action.dm index 9975a86d1eb..9987fe47511 100644 --- a/code/_onclick/hud/action.dm +++ b/code/_onclick/hud/action.dm @@ -250,4 +250,35 @@ if(owner.mind) if(target in owner.mind.spell_list) return 0 - return !(target in owner.spell_list) \ No newline at end of file + return !(target in owner.spell_list) + + //Action button controlling a mob's research examine ability. +/datum/action/scan_mode + name = "Toggle Research Scanner" + button_icon_state = "scan_mode" + check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_ALIVE + action_type = AB_INNATE + var/devices = 0 //How may enabled scanners the mob has + +/datum/action/scan_mode/Activate() + active = 1 + owner.research_scanner = 1 + owner << " Research analyzer is now active." + +/datum/action/scan_mode/Deactivate() + active = 0 + owner.research_scanner = 0 + owner << " Research analyzer deactivated." + +/datum/action/scan_mode/Grant(mob/living/T) + devices += 1 + ..(T) + +/datum/action/scan_mode/CheckRemoval(mob/living/user) + if(devices) + return 0 + return 1 + +/datum/action/scan_mode/Remove(mob/living/T) + owner.research_scanner = 0 + ..(T) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index bed10ccf131..87485873569 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -352,11 +352,11 @@ Class Procs: else if(prob(H.getBrainLoss())) user << "You momentarily forget how to use [src]." return 1 - + if(panel_open) src.add_fingerprint(user) return 0 - + if(!interact_offline && stat & (NOPOWER|BROKEN|MAINT)) return 1 @@ -439,9 +439,7 @@ Class Procs: var/obj/item/weapon/circuitboard/CB = locate(/obj/item/weapon/circuitboard) in component_parts var/P if(W.works_from_distance) - user << "Following parts detected in the machine:" - for(var/var/obj/item/C in component_parts) - user << " [C.name]" + display_parts(user) for(var/obj/item/weapon/stock_parts/A in component_parts) for(var/D in CB.req_components) if(ispath(A.type, D)) @@ -460,15 +458,23 @@ Class Procs: break RefreshParts() else - user << "Following parts detected in the machine:" - for(var/var/obj/item/C in component_parts) - user << " [C.name]" + display_parts(user) if(shouldplaysound) W.play_rped_sound() return 1 else return 0 +/obj/machinery/proc/display_parts(mob/user) + user << "Following parts detected in the machine:" + for(var/obj/item/C in component_parts) + user << "\icon[C] [C.name]" + +/obj/machinery/examine(mob/user) + ..(user) + if(user.research_scanner && component_parts) + display_parts(user) + /obj/machinery/proc/dismantle() playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(loc) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 77ff6660206..6f4597ef7d8 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -136,7 +136,31 @@ if(5.0) size = "huge" - return ..(user, distance, "", "It is a [size] item.") + ..(user, distance, "", "It is a [size] item.") + + if(user.research_scanner) //Mob has a research scanner active. + var/msg = "*--------*
" + + if(origin_tech) + msg += "Testing potentials:
" + var/list/techlvls = params2list(origin_tech) + for(var/T in techlvls) //This needs to use the better names. + msg += "Tech: [CallTechName(T)] | Magnitude: [techlvls[T]]
" + msg += "Research reliability: [reliability]%
" + if(crit_fail) + msg += "Critical failure detected in subject!
" + else + msg += "No tech origins detected.
" + + + if(materials.len) + msg += "Extractable materials:
" + for(var/mat in materials) + msg += "[CallMaterialName(mat)]
" //Capitize first word, remove the "$" + else + msg += "No extractable materials detected.
" + msg += "*--------*" + user << msg /obj/item/attack_hand(mob/user as mob) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 209ce95acbe..42042932135 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -79,9 +79,27 @@ /obj/item/clothing/glasses/science name = "Science Goggles" - desc = "nothing" + desc = "A pair of snazzy goggles used to protect against chemical spills. Fitted with an analyzer for scanning items." icon_state = "purple" item_state = "glasses" + prescription_upgradable = 0 + +/obj/item/clothing/glasses/science/equipped(mob/user, slot) + if(slot == slot_glasses) + user.scanner.Grant(user) + ..(user, slot) + +/obj/item/clothing/glasses/science/dropped(mob/user) + user.scanner.devices -= 1 + ..(user) + +/obj/item/clothing/glasses/science/night + name = "Night Vision Science Goggle" + desc = "Now you can science in darkness." + icon_state = "nvpurple" + item_state = "glasses" + darkness_view = 8 + see_darkness = 0 /obj/item/clothing/glasses/janitor name = "Janitorial Goggles" diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index cbc449410fc..bd7b023b5b6 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -68,6 +68,7 @@ //Some tidying-up. flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'Nanotrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'" + scanner.Grant(src) update_icons() /mob/living/silicon/robot/drone/init() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index f7372a79f5f..329f1b04a91 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -150,6 +150,7 @@ var/list/robot_verbs_default = list( hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank") hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank") + scanner.Grant(src) /mob/living/silicon/robot/proc/init(var/alien=0) aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 37af6e961a9..4f3ad8d2d6b 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -131,6 +131,9 @@ var/datum/hud/hud_used = null + var/research_scanner = 0 //For research scanner equipped mobs. Enable to show research data when examining. + var/datum/action/scan_mode/scanner = new + var/list/grabbed_by = list( ) var/list/requests = list( ) diff --git a/code/modules/research/designs/equipment_designs.dm b/code/modules/research/designs/equipment_designs.dm index 330098a2383..87f4db7e1f0 100644 --- a/code/modules/research/designs/equipment_designs.dm +++ b/code/modules/research/designs/equipment_designs.dm @@ -10,7 +10,7 @@ materials = list(MAT_METAL = 1000, MAT_GLASS = 500, MAT_PLASMA = 1500, MAT_URANIUM = 200) build_path = /obj/item/weapon/weldingtool/experimental category = list("Equipment") - + /datum/design/health_hud name = "Health Scanner HUD" desc = "A heads-up display that scans the humans in view and provides accurate data about their health status." @@ -120,4 +120,24 @@ materials = list(MAT_METAL = 6000, MAT_GLASS = 2000) build_path = /obj/item/device/detective_scanner locked = 1 //no validhunting scientists. + category = list("Equipment") + +/datum/design/sci_goggles + name = "Science Goggles" + desc = "Goggles fitted with a portable analyzer capable of determining the research worth of an item or components of a machine." + id = "scigoggles" + req_tech = list("materials" = 3, "magnets" = 3, "engineering" = 2) + build_type = PROTOLATHE + materials = list(MAT_METAL = 250, MAT_GLASS = 300) + build_path = /obj/item/clothing/glasses/science + category = list("Equipment") + +/datum/design/nv_sci_goggles + name = "Night Vision Science Goggles" + desc = "Like Science google, but works in darkness." + id = "nvscigoggles" + req_tech = list("materials" = 5, "magnets" = 5, "engineering" = 4) + build_type = PROTOLATHE + materials = list(MAT_METAL = 250, MAT_GLASS = 300, MAT_PLASMA = 250, MAT_URANIUM = 1000) + build_path = /obj/item/clothing/glasses/science category = list("Equipment") \ No newline at end of file diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 9072217e4f7..f0e7a0ddf69 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -54,7 +54,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, var/selected_category var/list/datum/design/matching_designs = list() //for the search function -/obj/machinery/computer/rdconsole/proc/CallTechName(var/ID) //A simple helper proc to find the name of a tech with a given ID. +/proc/CallTechName(ID) //A simple helper proc to find the name of a tech with a given ID. var/datum/tech/check_tech var/return_name = null for(var/T in subtypesof(/datum/tech)) @@ -68,7 +68,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, return return_name -/obj/machinery/computer/rdconsole/proc/CallMaterialName(var/ID) +proc/CallMaterialName(ID) var/datum/reagent/temp_reagent var/return_name = null if (copytext(ID, 1, 2) == "$") @@ -183,7 +183,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, /obj/machinery/computer/rdconsole/Topic(href, href_list) if(..()) return 1 - + if(!allowed(usr) && !isobserver(usr)) return 1 @@ -1115,7 +1115,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, dat += "" return dat - + /obj/machinery/computer/rdconsole/core name = "Core R&D Console" desc = "A console used to interface with R&D tools." @@ -1126,7 +1126,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, desc = "A console used to interface with R&D tools." id = 2 req_access = list(access_robotics) - + /obj/machinery/computer/rdconsole/experiment name = "E.X.P.E.R.I-MENTOR R&D Console" desc = "A console used to interface with R&D tools." @@ -1137,4 +1137,3 @@ won't update every console in existence) but it's more of a hassle to do. Also, desc = "A console used to interface with R&D tools." id = 4 req_access = list(access_mechanic) - \ No newline at end of file diff --git a/icons/mob/actions.dmi b/icons/mob/actions.dmi index b9602a93b1d..ca86e3b6814 100644 Binary files a/icons/mob/actions.dmi and b/icons/mob/actions.dmi differ diff --git a/icons/obj/clothing/glasses.dmi b/icons/obj/clothing/glasses.dmi index 2df0cf5540e..c41b8e60053 100644 Binary files a/icons/obj/clothing/glasses.dmi and b/icons/obj/clothing/glasses.dmi differ