diff --git a/code/_onclick/hud/action.dm b/code/_onclick/hud/action.dm index 836d0dee4f1..04c8b790dd7 100644 --- a/code/_onclick/hud/action.dm +++ b/code/_onclick/hud/action.dm @@ -249,4 +249,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..c111fce09ad 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -337,6 +337,8 @@ Class Procs: return src.attack_hand(user) /obj/machinery/attack_hand(mob/user as mob) + if(!interact_offline && stat & (NOPOWER|BROKEN|MAINT)) + return 1 if(user.lying || user.stat) return 1 @@ -344,6 +346,11 @@ Class Procs: user << "You don't have the dexterity to do this!" return 1 +/* + //distance checks are made by atom/proc/DblClick + if ((get_dist(src, user) > 1 || !istype(src.loc, /turf)) && !istype(user, /mob/living/silicon)) + return 1 +*/ if (ishuman(user)) var/mob/living/carbon/human/H = user if(H.getBrainLoss() >= 60) @@ -352,17 +359,10 @@ 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 src.add_fingerprint(user) - return ..() + return 0 /obj/machinery/CheckParts() RefreshParts() @@ -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..52563eb5689 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: [capitalize(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 += "[capitalize(copytext(mat, 2))]
" //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/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/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