Mechanic fixes.

System now in place for machines having access requirements. Not yet used.
CE given special device analyzer in his locker.
Autolathes will now not eat the scanner and can be scanned by it.
This commit is contained in:
ComicIronic
2014-12-15 22:11:30 +00:00
parent 52ed27c732
commit c9e270538f
5 changed files with 32 additions and 8 deletions

View File

@@ -191,7 +191,7 @@ var/global/list/autolathe_recipes_hidden = list( \
return 1 return 1
if (O.m_amt == 0 && O.g_amt == 0) if (O.m_amt == 0 && O.g_amt == 0)
user << "<span class='warning'>This object does not contain significant amounts of metal or glass, or cannot be accepted by \the [src] due to size or hazardous materials.</span>" user << "<span class='warning'>This object does not contain significant amounts of metal or glass, or cannot be accepted by \the [src] due to size or hazardous materials.</span>"
return 1 return
/* /*
if (istype(O, /obj/item/weapon/grab) && src.hacked) if (istype(O, /obj/item/weapon/grab) && src.hacked)
var/obj/item/weapon/grab/G = O var/obj/item/weapon/grab/G = O

View File

@@ -25,6 +25,7 @@
new /obj/item/weapon/cartridge/ce(src) new /obj/item/weapon/cartridge/ce(src)
new /obj/item/device/radio/headset/heads/ce(src) new /obj/item/device/radio/headset/heads/ce(src)
new /obj/item/weapon/storage/toolbox/mechanical(src) new /obj/item/weapon/storage/toolbox/mechanical(src)
new /obj/item/device/device_analyser/advanced(src)
new /obj/item/clothing/suit/storage/hazardvest(src) new /obj/item/clothing/suit/storage/hazardvest(src)
new /obj/item/clothing/mask/gas(src) new /obj/item/clothing/mask/gas(src)
new /obj/item/device/multitool(src) new /obj/item/device/multitool(src)

View File

@@ -2345,6 +2345,14 @@ The required techs are the following:
materials = list("$iron" = 700, "$glass" = 2000, "$gold" = 100) materials = list("$iron" = 700, "$glass" = 2000, "$gold" = 100)
build_path = /obj/item/clothing/glasses/night build_path = /obj/item/clothing/glasses/night
/datum/design/device_analyser
name = "Device Analyser"
desc = "A device for scanning other devices. Meta."
id = "deviceanalyser"
req_tech = list("magnets"=3, "engineering"=4, "materials"=4, "programming"=3)
build_type = PROTOLATHE
materials = list("$iron" = 500, "$glass" = 1000, "$gold" = 200, "$silver" = 200)
build_path = /obj/item/device/device_analyser
///////////////////////////////////////// /////////////////////////////////////////
//////////////////Security/////////////// //////////////////Security///////////////

View File

@@ -1,6 +1,5 @@
//You use this to scan items and machines to recreate them in a fabricator or the flatpacker //You use this to scan items and machines to recreate them in a fabricator or the flatpacker
//You can scan syndicate items, but only with the syndicate version (might be overpowered, so I'll make it expensive) //You can scan syndicate items, but only with the syndicate version (might be overpowered, so I'll make it expensive)
/datum
/obj/item/device/device_analyser /obj/item/device/device_analyser
name = "device analyzer" name = "device analyzer"
@@ -11,12 +10,14 @@
var/list/loaded_designs = list() //the stored designs var/list/loaded_designs = list() //the stored designs
var/max_designs = 10 var/max_designs = 10
var/syndi_filter = 1 //whether the scanner should filter traitor tech items. 1 is filtered, 0 is not filtered var/syndi_filter = 1 //whether the scanner should filter traitor tech items. 1 is filtered, 0 is not filtered
var/access_avoidance = 0 //whether the scanner can ignore access requirements for machines. 1 is ignore, 0 is not
var/loadone = 0 //whether or not it should load just one at a time. 0 is all at once, 1 is one at a time var/loadone = 0 //whether or not it should load just one at a time. 0 is all at once, 1 is one at a time
flags = FPRINT | TABLEPASS flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT slot_flags = SLOT_BELT
w_class = 2 w_class = 2
item_state = "electronic" item_state = "electronic"
m_amt = 300 m_amt = 0 //so the autolathe doesn't try to eat it
g_amt = 0
w_type = RECYK_ELECTRONIC w_type = RECYK_ELECTRONIC
origin_tech = "magnets=3;engineering=4;materials=4;programming=3" origin_tech = "magnets=3;engineering=4;materials=4;programming=3"
@@ -26,6 +27,8 @@
usr <<"<span class='notice'> You set the Device Analyzer to [loadone ? "transfer one design" : "transfer all designs"] on use.</span>" usr <<"<span class='notice'> You set the Device Analyzer to [loadone ? "transfer one design" : "transfer all designs"] on use.</span>"
/obj/item/device/device_analyser/afterattack(var/atom/A, mob/user, proximity_flag) //Hurrah for after-attack /obj/item/device/device_analyser/afterattack(var/atom/A, mob/user, proximity_flag) //Hurrah for after-attack
if(get_turf(src) != get_turf(user)) //we aren't in the same place as our holder, so we have been moved and can ignore scanning
return
if(proximity_flag != 1) if(proximity_flag != 1)
return return
if(istype(A, /obj)) //don't want to scan mobs or anything like that if(istype(A, /obj)) //don't want to scan mobs or anything like that
@@ -36,7 +39,7 @@
return return
if(O.origin_tech || istype(O, /obj/machinery)) //two requirements: items have origin_tech, machines are checked in... if(O.origin_tech || istype(O, /obj/machinery)) //two requirements: items have origin_tech, machines are checked in...
switch(CanCreateDesign(O)) //this proc. Checks to see if there's anything illegal or bad in the thing before scanning it switch(CanCreateDesign(O, user)) //this proc. Checks to see if there's anything illegal or bad in the thing before scanning it
if(1) if(1)
if(max_designs && !(max_designs <= loaded_designs.len)) if(max_designs && !(max_designs <= loaded_designs.len))
loaded_designs += new /datum/design/mechanic_design(O) loaded_designs += new /datum/design/mechanic_design(O)
@@ -45,7 +48,9 @@
else else
user << "\icon [src] \The [src] flashes a message on-screen: \"Too many designs loaded.\"" user << "\icon [src] \The [src] flashes a message on-screen: \"Too many designs loaded.\""
if(-1) if(-1)
user <<"<span class='rose'>\icon [src] \The [src]'s safety features prevent you from scanning that item.</span>" user <<"<span class='rose'>\icon [src] \The [src]'s safety features prevent you from scanning that object.</span>"
if(-2)
user <<"<span class='rose'>\icon [src] \The [src]'s access requirements prevent you from scanning that object.</span>"
else //no origin_tech, no scans. else //no origin_tech, no scans.
user <<"<span class='rose'>\The [src] can't seem to scan \the [O]!</span>" user <<"<span class='rose'>\The [src] can't seem to scan \the [O]!</span>"
else //no origin_tech, no scans. else //no origin_tech, no scans.
@@ -56,9 +61,16 @@
/obj/item/device/device_analyser/syndicate /obj/item/device/device_analyser/syndicate
desc = "A suspicious-looking device anaylzer. A thorough examination reveals that it lacks the required Nanotrasen logo, and that the safety features have been disabled." desc = "A suspicious-looking device anaylzer. A thorough examination reveals that it lacks the required Nanotrasen logo, and that the safety features have been disabled."
syndi_filter = 0 syndi_filter = 0
access_avoidance = 1 //we aren't forced to have the access for a machine - perfect for traitors
origin_tech = "magnets=3;engineering=4;materials=4;programming=3;syndicate=3" origin_tech = "magnets=3;engineering=4;materials=4;programming=3;syndicate=3"
/obj/item/device/device_analyser/proc/CanCreateDesign(var/obj/O) /obj/item/device/device_analyser/advanced
name = "advanced device analyzer"
desc = "An electromagnetic scanner used by mechanics. This version can skip machine access, as well as having a higher storage capacity."
access_avoidance = 1
max_designs = 20
/obj/item/device/device_analyser/proc/CanCreateDesign(var/obj/O, mob/user)
if(!istype(O)) if(!istype(O))
return 0 return 0
@@ -69,6 +81,8 @@
var/list/techlist var/list/techlist
if(istype(O, /obj/machinery)) if(istype(O, /obj/machinery))
var/obj/machinery/M = O var/obj/machinery/M = O
if(user && (!M.allowed(user) && M.mech_flags & MECH_SCAN_ACCESS) && !src.access_avoidance) //if we require access, and don't have it, and the scanner can't bypass it
return -2
if(M.component_parts) if(M.component_parts)
for(var/obj/item/weapon/circuitboard/CB in M.component_parts) //fetching the circuit by looking in the parts for(var/obj/item/weapon/circuitboard/CB in M.component_parts) //fetching the circuit by looking in the parts
if(istype(CB)) if(istype(CB))

View File

@@ -933,8 +933,9 @@ var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accesse
#define TRUELOCKS 128 //does it make a truly locked lockbox? If not set, the lockboxes made are unlockable by any crew with an ID #define TRUELOCKS 128 //does it make a truly locked lockbox? If not set, the lockboxes made are unlockable by any crew with an ID
// Mecca scanner flags // Mecca scanner flags
#define MECH_SCAN_FAIL 1 // Cannot be scanned at all. #define MECH_SCAN_FAIL 1 // Cannot be scanned at all.
#define MECH_SCAN_ILLEGAL 2 // Can only be scanned by the antag scanner. #define MECH_SCAN_ILLEGAL 2 // Can only be scanned by the antag scanner.
#define MECH_SCAN_ACCESS 4 // Can only be scanned with the access required for the machine
// EMOTES! // EMOTES!