mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Merge pull request #2330 from Robertha89/master
Science Goggle Analysers
This commit is contained in:
@@ -250,4 +250,35 @@
|
||||
if(owner.mind)
|
||||
if(target in owner.mind.spell_list)
|
||||
return 0
|
||||
return !(target in owner.spell_list)
|
||||
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 << "<span class='notice'> Research analyzer is now active.</span>"
|
||||
|
||||
/datum/action/scan_mode/Deactivate()
|
||||
active = 0
|
||||
owner.research_scanner = 0
|
||||
owner << "<span class='notice'> Research analyzer deactivated.</span>"
|
||||
|
||||
/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)
|
||||
|
||||
@@ -352,11 +352,11 @@ Class Procs:
|
||||
else if(prob(H.getBrainLoss()))
|
||||
user << "<span class='warning'>You momentarily forget how to use [src].</span>"
|
||||
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 << "<span class='notice'>Following parts detected in the machine:</span>"
|
||||
for(var/var/obj/item/C in component_parts)
|
||||
user << "<span class='notice'> [C.name]</span>"
|
||||
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 << "<span class='notice'>Following parts detected in the machine:</span>"
|
||||
for(var/var/obj/item/C in component_parts)
|
||||
user << "<span class='notice'> [C.name]</span>"
|
||||
display_parts(user)
|
||||
if(shouldplaysound)
|
||||
W.play_rped_sound()
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/proc/display_parts(mob/user)
|
||||
user << "<span class='notice'>Following parts detected in the machine:</span>"
|
||||
for(var/obj/item/C in component_parts)
|
||||
user << "<span class='notice'>\icon[C] [C.name]</span>"
|
||||
|
||||
/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)
|
||||
|
||||
@@ -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 = "*--------* <BR>"
|
||||
|
||||
if(origin_tech)
|
||||
msg += "<span class='notice'>Testing potentials:</span><BR>"
|
||||
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]] <BR>"
|
||||
msg += "Research reliability: [reliability]% <BR>"
|
||||
if(crit_fail)
|
||||
msg += "<span class='danger'>Critical failure detected in subject!</span><BR>"
|
||||
else
|
||||
msg += "<span class='danger'>No tech origins detected.</span><BR>"
|
||||
|
||||
|
||||
if(materials.len)
|
||||
msg += "<span class='notice'>Extractable materials:<BR>"
|
||||
for(var/mat in materials)
|
||||
msg += "[CallMaterialName(mat)]<BR>" //Capitize first word, remove the "$"
|
||||
else
|
||||
msg += "<span class='danger'>No extractable materials detected.</span><BR>"
|
||||
msg += "*--------*"
|
||||
user << msg
|
||||
|
||||
|
||||
/obj/item/attack_hand(mob/user as mob)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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( )
|
||||
|
||||
|
||||
@@ -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")
|
||||
@@ -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 += "</tr></table></div>"
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user