Research Examines!

Science Goggles and the Prototype Hardsuit Helmet may now scan items for
their research potential and machines for their contents.

Examine an item to gain additional data.
- Tech levels
- Materials that can be salvaged from it if recycled
- Reliability rating
- Crit failure, if present.

Examine a machine to learn the components used to build it.
This commit is contained in:
GunHog
2015-10-07 13:45:51 -05:00
parent 4697cdb1df
commit 4a5caf968a
5 changed files with 56 additions and 7 deletions
+12 -6
View File
@@ -385,9 +385,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))
@@ -406,14 +404,22 @@ 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
return 0
/obj/machinery/proc/display_parts(mob/user)
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>"
/obj/machinery/examine(mob/user)
..(user)
if(user.research_scanner && component_parts)
display_parts(user)
//called on machinery construction (i.e from frame to machinery) but not on initialization
/obj/machinery/proc/construction()
return
+25
View File
@@ -168,6 +168,31 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
user << "[pronoun] a [size] item." //e.g. They are a small item. or It is a bulky item.
if(user.research_scanner) //Mob has a research scanner active.
var/msg = "*--------* <BR>"
if(origin_tech)
msg += "<span class='notice'>Testing potentials:<BR>"
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]] <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 += "[capitalize(copytext(mat, 2))]<BR>" //Capitize first word, remove the "$"
else
msg += "<span class='danger'>No extractable materials detected.</span><BR>"
msg += "*--------* <BR>"
user << msg
/obj/item/attack_hand(mob/user)
if (!user) return
+9 -1
View File
@@ -33,10 +33,18 @@
/obj/item/clothing/glasses/science
name = "Science Goggles"
desc = "A pair of snazzy goggles used to protect against chemical spills."
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"
/obj/item/clothing/glasses/science/equipped(mob/user, slot)
user.research_scanner = 1
..(user, slot)
/obj/item/clothing/glasses/science/dropped(mob/user)
user.research_scanner = initial(user.research_scanner) //Because some mobs might have it defaulted to 1.
..(user)
/obj/item/clothing/glasses/night
name = "Night Vision Goggles"
desc = "You can totally see in the dark now!"
@@ -324,6 +324,14 @@
max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT
armor = list(melee = 10, bullet = 5, laser = 10, energy = 5, bomb = 100, bio = 100, rad = 60)
/obj/item/clothing/head/helmet/space/hardsuit/rd/equipped(mob/user, slot)
user.research_scanner = 1
..(user, slot)
/obj/item/clothing/head/helmet/space/hardsuit/rd/dropped(mob/user)
user.research_scanner = 0
..(user)
/obj/item/clothing/suit/space/hardsuit/rd
icon_state = "hardsuit-rd"
name = "prototype hardsuit"
+2
View File
@@ -93,6 +93,8 @@
var/datum/hud/hud_used = null
var/research_scanner = 0 //For research scanner equipped mobs. Enable to show research data when examining.
var/list/grabbed_by = list( )
var/list/requests = list( )