@@ -1,138 +1,138 @@
|
||||
/*///////////////Circuit Imprinter (By Darem)////////////////////////
|
||||
Used to print new circuit boards (for computers and similar systems) and AI modules. Each circuit board pattern are stored in
|
||||
a /datum/desgin on the linked R&D console. You can then print them out in a fasion similar to a regular lathe. However, instead of
|
||||
using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
|
||||
*/
|
||||
/obj/machinery/r_n_d/circuit_imprinter
|
||||
/*///////////////Circuit Imprinter (By Darem)////////////////////////
|
||||
Used to print new circuit boards (for computers and similar systems) and AI modules. Each circuit board pattern are stored in
|
||||
a /datum/desgin on the linked R&D console. You can then print them out in a fasion similar to a regular lathe. However, instead of
|
||||
using metal and glass, it uses glass and reagents (usually sulfuric acis).
|
||||
|
||||
*/
|
||||
/obj/machinery/r_n_d/circuit_imprinter
|
||||
name = "circuit imprinter"
|
||||
desc = "Manufactures circuit boards for the construction of machines."
|
||||
icon_state = "circuit_imprinter"
|
||||
container_type = OPENCONTAINER
|
||||
|
||||
var/datum/material_container/materials
|
||||
var/efficiency_coeff
|
||||
|
||||
var/list/categories = list(
|
||||
"AI Modules",
|
||||
"Computer Boards",
|
||||
"Teleportation Machinery",
|
||||
"Medical Machinery",
|
||||
"Engineering Machinery",
|
||||
"Exosuit Modules",
|
||||
"Hydroponics Machinery",
|
||||
"Subspace Telecomms",
|
||||
"Research Machinery",
|
||||
"Misc. Machinery",
|
||||
"Computer Parts"
|
||||
)
|
||||
|
||||
desc = "Manufactures circuit boards for the construction of machines."
|
||||
icon_state = "circuit_imprinter"
|
||||
container_type = OPENCONTAINER
|
||||
|
||||
var/datum/material_container/materials
|
||||
var/efficiency_coeff
|
||||
|
||||
var/list/categories = list(
|
||||
"AI Modules",
|
||||
"Computer Boards",
|
||||
"Teleportation Machinery",
|
||||
"Medical Machinery",
|
||||
"Engineering Machinery",
|
||||
"Exosuit Modules",
|
||||
"Hydroponics Machinery",
|
||||
"Subspace Telecomms",
|
||||
"Research Machinery",
|
||||
"Misc. Machinery",
|
||||
"Computer Parts"
|
||||
)
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/Initialize()
|
||||
. = ..()
|
||||
materials = new(src, list(MAT_GLASS, MAT_GOLD, MAT_DIAMOND, MAT_METAL, MAT_BLUESPACE))
|
||||
create_reagents(0)
|
||||
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/circuit_imprinter(null)
|
||||
B.apply_default_parts(src)
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/Destroy()
|
||||
qdel(materials)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/circuitboard/machine/circuit_imprinter
|
||||
name = "Circuit Imprinter (Machine Board)"
|
||||
build_path = /obj/machinery/r_n_d/circuit_imprinter
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/reagent_containers/glass/beaker = 2)
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/RefreshParts()
|
||||
reagents.maximum_volume = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
reagents.maximum_volume += G.volume
|
||||
G.reagents.trans_to(src, G.reagents.total_volume)
|
||||
|
||||
materials.max_amount = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
materials.max_amount += M.rating * 75000
|
||||
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
T += M.rating
|
||||
efficiency_coeff = 2 ** (T - 1) //Only 1 manipulator here, you're making runtimes Razharas
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/blob_act(obj/structure/blob/B)
|
||||
if (prob(50))
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/proc/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material
|
||||
var/list/all_materials = being_built.reagents_list + being_built.materials
|
||||
|
||||
var/A = materials.amount(M)
|
||||
if(!A)
|
||||
A = reagents.get_reagent_amount(M)
|
||||
|
||||
return round(A / max(1, (all_materials[M]/efficiency_coeff)))
|
||||
|
||||
//we eject the materials upon deconstruction.
|
||||
/obj/machinery/r_n_d/circuit_imprinter/on_deconstruction()
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
reagents.trans_to(G, G.reagents.maximum_volume)
|
||||
materials.retrieve_all()
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/disconnect_console()
|
||||
linked_console.linked_imprinter = null
|
||||
..()
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/Insert_Item(obj/item/O, mob/user)
|
||||
|
||||
if(istype(O,/obj/item/stack/sheet))
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
var/sheet_material = materials.get_item_material_amount(O)
|
||||
if(!sheet_material)
|
||||
return
|
||||
|
||||
if(!materials.has_space(sheet_material))
|
||||
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
|
||||
return 1
|
||||
|
||||
var/obj/item/stack/sheet/stack = O
|
||||
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
|
||||
if(!in_range(src, stack) || !user.Adjacent(src))
|
||||
return
|
||||
var/amount_inserted = materials.insert_stack(O,amount)
|
||||
if(!amount_inserted)
|
||||
return 1
|
||||
else
|
||||
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount_inserted/10)))
|
||||
to_chat(user, "<span class='notice'>You add [amount_inserted] sheets to the [src.name].</span>")
|
||||
updateUsrDialog()
|
||||
|
||||
else if(istype(O, /obj/item/weapon/ore/bluespace_crystal)) //Bluespace crystals can be either a stack or an item
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
var/bs_material = materials.get_item_material_amount(O)
|
||||
if(!bs_material)
|
||||
return
|
||||
|
||||
if(!materials.has_space(bs_material))
|
||||
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
|
||||
return 1
|
||||
|
||||
materials.insert_item(O)
|
||||
use_power(MINERAL_MATERIAL_AMOUNT/10)
|
||||
to_chat(user, "<span class='notice'>You add [O] to the [src.name].</span>")
|
||||
qdel(O)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='warning'>You cannot insert this item into the [name]!</span>")
|
||||
return 1
|
||||
else
|
||||
materials = new(src, list(MAT_GLASS, MAT_GOLD, MAT_DIAMOND, MAT_METAL, MAT_BLUESPACE))
|
||||
create_reagents(0)
|
||||
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/circuit_imprinter(null)
|
||||
B.apply_default_parts(src)
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/Destroy()
|
||||
qdel(materials)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/circuitboard/machine/circuit_imprinter
|
||||
name = "Circuit Imprinter (Machine Board)"
|
||||
build_path = /obj/machinery/r_n_d/circuit_imprinter
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/reagent_containers/glass/beaker = 2)
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/RefreshParts()
|
||||
reagents.maximum_volume = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
reagents.maximum_volume += G.volume
|
||||
G.reagents.trans_to(src, G.reagents.total_volume)
|
||||
|
||||
materials.max_amount = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
materials.max_amount += M.rating * 75000
|
||||
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
T += M.rating
|
||||
efficiency_coeff = 2 ** (T - 1) //Only 1 manipulator here, you're making runtimes Razharas
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/blob_act(obj/structure/blob/B)
|
||||
if (prob(50))
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/proc/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material
|
||||
var/list/all_materials = being_built.reagents_list + being_built.materials
|
||||
|
||||
var/A = materials.amount(M)
|
||||
if(!A)
|
||||
A = reagents.get_reagent_amount(M)
|
||||
|
||||
return round(A / max(1, (all_materials[M]/efficiency_coeff)))
|
||||
|
||||
//we eject the materials upon deconstruction.
|
||||
/obj/machinery/r_n_d/circuit_imprinter/on_deconstruction()
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
reagents.trans_to(G, G.reagents.maximum_volume)
|
||||
materials.retrieve_all()
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/disconnect_console()
|
||||
linked_console.linked_imprinter = null
|
||||
..()
|
||||
|
||||
/obj/machinery/r_n_d/circuit_imprinter/Insert_Item(obj/item/O, mob/user)
|
||||
|
||||
if(istype(O,/obj/item/stack/sheet))
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
var/sheet_material = materials.get_item_material_amount(O)
|
||||
if(!sheet_material)
|
||||
return
|
||||
|
||||
if(!materials.has_space(sheet_material))
|
||||
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
|
||||
return 1
|
||||
|
||||
var/obj/item/stack/sheet/stack = O
|
||||
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
|
||||
if(!in_range(src, stack) || !user.Adjacent(src))
|
||||
return
|
||||
var/amount_inserted = materials.insert_stack(O,amount)
|
||||
if(!amount_inserted)
|
||||
return 1
|
||||
else
|
||||
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount_inserted/10)))
|
||||
to_chat(user, "<span class='notice'>You add [amount_inserted] sheets to the [src.name].</span>")
|
||||
updateUsrDialog()
|
||||
|
||||
else if(istype(O, /obj/item/weapon/ore/bluespace_crystal)) //Bluespace crystals can be either a stack or an item
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
var/bs_material = materials.get_item_material_amount(O)
|
||||
if(!bs_material)
|
||||
return
|
||||
|
||||
if(!materials.has_space(bs_material))
|
||||
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
|
||||
return 1
|
||||
|
||||
materials.insert_item(O)
|
||||
use_power(MINERAL_MATERIAL_AMOUNT/10)
|
||||
to_chat(user, "<span class='notice'>You add [O] to the [src.name].</span>")
|
||||
qdel(O)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='warning'>You cannot insert this item into the [name]!</span>")
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
+639
-639
File diff suppressed because it is too large
Load Diff
@@ -106,14 +106,6 @@
|
||||
build_path = /obj/item/weapon/circuitboard/computer/launchpad_console
|
||||
category = list ("Teleportation Machinery")
|
||||
|
||||
/*/datum/design/board/telepad
|
||||
name = "Machine Design (Telepad Board)"
|
||||
desc = "The circuit board for a telescience telepad."
|
||||
id = "telepad"
|
||||
req_tech = list("programming" = 4, "bluespace" = 5, "plasmatech" = 4, "engineering" = 4)
|
||||
build_path = /obj/item/weapon/circuitboard/machine/telesci_pad
|
||||
category = list ("Teleportation Machinery")
|
||||
*/
|
||||
/datum/design/board/teleconsole
|
||||
name = "Computer Design (Teleporter Console)"
|
||||
desc = "Allows for the construction of circuit boards used to build a teleporter control console."
|
||||
@@ -122,14 +114,6 @@
|
||||
build_path = /obj/item/weapon/circuitboard/computer/teleporter
|
||||
category = list("Teleportation Machinery")
|
||||
|
||||
/* /datum/design/board/telesci_console
|
||||
name = "Computer Design (Telepad Control Console Board)"
|
||||
desc = "Allows for the construction of circuit boards used to build a telescience console."
|
||||
id = "telesci_console"
|
||||
req_tech = list("programming" = 3, "bluespace" = 3, "plasmatech" = 4)
|
||||
build_path = /obj/item/weapon/circuitboard/computer/telesci_console
|
||||
category = list("Teleportation Machinery")
|
||||
*/
|
||||
/datum/design/board/sleeper
|
||||
name = "Machine Design (Sleeper Board)"
|
||||
desc = "The circuit board for a sleeper."
|
||||
|
||||
@@ -768,7 +768,7 @@
|
||||
construction_time = 100
|
||||
build_path = /obj/item/device/assembly/flash/handheld
|
||||
category = list("Misc")
|
||||
/*
|
||||
|
||||
/datum/design/flightsuit //Multi step build process/redo WIP
|
||||
name = "Flight Suit"
|
||||
desc = "A specialized hardsuit that is able to attach a flightpack and accessories.."
|
||||
@@ -801,4 +801,3 @@
|
||||
construction_time = 100
|
||||
category = list("Misc")
|
||||
req_tech = list("magnets" = 2, "combat" = 2, "plasmatech" = 3, "materials" = 3, "engineering" = 2, "powerstorage" = 2)
|
||||
*/
|
||||
@@ -201,7 +201,6 @@
|
||||
build_path = /obj/item/organ/eyes/robotic/glow
|
||||
category = list("Misc", "Medical Designs")
|
||||
|
||||
|
||||
/datum/design/cyberimp_breather
|
||||
name = "Breathing Tube Implant"
|
||||
desc = "This simple implant adds an internals connector to your back, allowing you to use internals without a mask and protecting you from being choked."
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
build_path = /obj/item/weapon/inducer/sci
|
||||
category = list("Power Designs")
|
||||
|
||||
|
||||
/datum/design/board/pacman
|
||||
name = "Machine Design (PACMAN-type Generator Board)"
|
||||
desc = "The circuit board that for a PACMAN-type portable generator."
|
||||
|
||||
@@ -17,6 +17,14 @@
|
||||
build_path = /obj/item/stack/sheet/mineral/plastitanium
|
||||
category = list("initial")
|
||||
|
||||
/datum/design/plaglass_alloy
|
||||
name = "Plasma + Glass alloy"
|
||||
id = "plasmaglass"
|
||||
build_type = SMELTER
|
||||
materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT, MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
|
||||
build_path = /obj/item/stack/sheet/glass/plasma
|
||||
category = list("initial")
|
||||
|
||||
/datum/design/alienalloy
|
||||
name = "Alien Alloy"
|
||||
desc = "A sheet of reverse-engineered alien alloy."
|
||||
@@ -25,4 +33,4 @@
|
||||
build_type = PROTOLATHE | SMELTER
|
||||
materials = list(MAT_METAL = 4000, MAT_PLASMA = 4000)
|
||||
build_path = /obj/item/stack/sheet/mineral/abductor
|
||||
category = list("Stock Parts")
|
||||
category = list("Stock Parts")
|
||||
|
||||
@@ -52,14 +52,14 @@
|
||||
build_path = /obj/item/weapon/shield/riot/tele
|
||||
category = list("Weapons")
|
||||
|
||||
/datum/design/lasercannon
|
||||
name = "Accelerator Laser Cannon"
|
||||
desc = "A heavy duty laser cannon. It does more damage the farther away the target is."
|
||||
id = "lasercannon"
|
||||
req_tech = list("combat" = 5, "magnets" = 5, "powerstorage" = 3)
|
||||
/datum/design/beamrifle
|
||||
name = "Beam Marksman Rifle"
|
||||
desc = "A powerful long ranged anti-material rifle that fires charged particle beams to obliterate targets."
|
||||
id = "beamrifle"
|
||||
req_tech = list("combat" = 7, "magnets" = 5, "powerstorage" = 5, "materials" = 7, "programming" = 5)
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 10000, MAT_GLASS = 3000, MAT_DIAMOND = 3000)
|
||||
build_path = /obj/item/weapon/gun/energy/lasercannon
|
||||
materials = list(MAT_METAL = 10000, MAT_GLASS = 5000, MAT_DIAMOND = 5000, MAT_URANIUM = 8000, MAT_SILVER = 4500, MAT_GOLD = 5000)
|
||||
build_path = /obj/item/weapon/gun/energy/beam_rifle
|
||||
category = list("Weapons")
|
||||
|
||||
/datum/design/decloner
|
||||
@@ -258,4 +258,4 @@
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 5000, MAT_GLASS = 1500, MAT_URANIUM = 1500, MAT_SILVER = 1500)
|
||||
build_path = /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow/large
|
||||
category = list("Weapons")
|
||||
category = list("Weapons")
|
||||
|
||||
@@ -1,69 +1,69 @@
|
||||
|
||||
|
||||
/*
|
||||
Destructive Analyzer
|
||||
|
||||
It is used to destroy hand-held objects and advance technological research. Controls are in the linked R&D console.
|
||||
|
||||
Note: Must be placed within 3 tiles of the R&D Console
|
||||
*/
|
||||
/obj/machinery/r_n_d/destructive_analyzer
|
||||
|
||||
|
||||
/*
|
||||
Destructive Analyzer
|
||||
|
||||
It is used to destroy hand-held objects and advance technological research. Controls are in the linked R&D console.
|
||||
|
||||
Note: Must be placed within 3 tiles of the R&D Console
|
||||
*/
|
||||
/obj/machinery/r_n_d/destructive_analyzer
|
||||
name = "destructive analyzer"
|
||||
desc = "Learn science by destroying things!"
|
||||
icon_state = "d_analyzer"
|
||||
var/decon_mod = 0
|
||||
|
||||
desc = "Learn science by destroying things!"
|
||||
icon_state = "d_analyzer"
|
||||
var/decon_mod = 0
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/Initialize()
|
||||
. = ..()
|
||||
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/destructive_analyzer(null)
|
||||
B.apply_default_parts(src)
|
||||
|
||||
/obj/item/weapon/circuitboard/machine/destructive_analyzer
|
||||
name = "Destructive Analyzer (Machine Board)"
|
||||
build_path = /obj/machinery/r_n_d/destructive_analyzer
|
||||
origin_tech = "magnets=2;engineering=2;programming=2"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/scanning_module = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1)
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/stock_parts/S in component_parts)
|
||||
T += S.rating
|
||||
decon_mod = T
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/proc/ConvertReqString2List(list/source_list)
|
||||
var/list/temp_list = params2list(source_list)
|
||||
for(var/O in temp_list)
|
||||
temp_list[O] = text2num(temp_list[O])
|
||||
return temp_list
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/disconnect_console()
|
||||
linked_console.linked_destroy = null
|
||||
..()
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/Insert_Item(obj/item/O, mob/user)
|
||||
if(user.a_intent != INTENT_HARM)
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
if(!O.origin_tech)
|
||||
to_chat(user, "<span class='warning'>This doesn't seem to have a tech origin!</span>")
|
||||
return
|
||||
var/list/temp_tech = ConvertReqString2List(O.origin_tech)
|
||||
if (temp_tech.len == 0)
|
||||
to_chat(user, "<span class='warning'>You cannot deconstruct this item!</span>")
|
||||
return
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='warning'>\The [O] is stuck to your hand, you cannot put it in the [src.name]!</span>")
|
||||
return
|
||||
busy = 1
|
||||
loaded_item = O
|
||||
O.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>You add the [O.name] to the [src.name]!</span>")
|
||||
flick("d_analyzer_la", src)
|
||||
spawn(10)
|
||||
icon_state = "d_analyzer_l"
|
||||
busy = 0
|
||||
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/destructive_analyzer(null)
|
||||
B.apply_default_parts(src)
|
||||
|
||||
/obj/item/weapon/circuitboard/machine/destructive_analyzer
|
||||
name = "Destructive Analyzer (Machine Board)"
|
||||
build_path = /obj/machinery/r_n_d/destructive_analyzer
|
||||
origin_tech = "magnets=2;engineering=2;programming=2"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/scanning_module = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser = 1)
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/weapon/stock_parts/S in component_parts)
|
||||
T += S.rating
|
||||
decon_mod = T
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/proc/ConvertReqString2List(list/source_list)
|
||||
var/list/temp_list = params2list(source_list)
|
||||
for(var/O in temp_list)
|
||||
temp_list[O] = text2num(temp_list[O])
|
||||
return temp_list
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/disconnect_console()
|
||||
linked_console.linked_destroy = null
|
||||
..()
|
||||
|
||||
/obj/machinery/r_n_d/destructive_analyzer/Insert_Item(obj/item/O, mob/user)
|
||||
if(user.a_intent != INTENT_HARM)
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
if(!O.origin_tech)
|
||||
to_chat(user, "<span class='warning'>This doesn't seem to have a tech origin!</span>")
|
||||
return
|
||||
var/list/temp_tech = ConvertReqString2List(O.origin_tech)
|
||||
if (temp_tech.len == 0)
|
||||
to_chat(user, "<span class='warning'>You cannot deconstruct this item!</span>")
|
||||
return
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='warning'>\The [O] is stuck to your hand, you cannot put it in the [src.name]!</span>")
|
||||
return
|
||||
busy = 1
|
||||
loaded_item = O
|
||||
O.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>You add the [O.name] to the [src.name]!</span>")
|
||||
flick("d_analyzer_la", src)
|
||||
spawn(10)
|
||||
icon_state = "d_analyzer_l"
|
||||
busy = 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,141 +1,141 @@
|
||||
GLOBAL_LIST_INIT(message_servers, list())
|
||||
|
||||
/datum/data_pda_msg
|
||||
var/recipient = "Unspecified" //name of the person
|
||||
var/sender = "Unspecified" //name of the sender
|
||||
var/message = "Blank" //transferred message
|
||||
GLOBAL_LIST_INIT(message_servers, list())
|
||||
|
||||
/datum/data_pda_msg
|
||||
var/recipient = "Unspecified" //name of the person
|
||||
var/sender = "Unspecified" //name of the sender
|
||||
var/message = "Blank" //transferred message
|
||||
var/icon/photo //Attached photo
|
||||
|
||||
/datum/data_pda_msg/New(var/param_rec = "",var/param_sender = "",var/param_message = "",var/param_photo=null)
|
||||
|
||||
if(param_rec)
|
||||
recipient = param_rec
|
||||
if(param_sender)
|
||||
sender = param_sender
|
||||
if(param_message)
|
||||
message = param_message
|
||||
if(param_photo)
|
||||
photo = param_photo
|
||||
|
||||
/datum/data_pda_msg/proc/get_photo_ref()
|
||||
if(photo)
|
||||
return "<a href='byond://?src=\ref[src];photo=1'>(Photo)</a>"
|
||||
return ""
|
||||
|
||||
/datum/data_pda_msg/Topic(href,href_list)
|
||||
..()
|
||||
if(href_list["photo"])
|
||||
var/mob/M = usr
|
||||
M << browse_rsc(photo, "pda_photo.png")
|
||||
M << browse("<html><head><title>PDA Photo</title></head>" \
|
||||
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
|
||||
+ "<img src='pda_photo.png' width='192' style='-ms-interpolation-mode:nearest-neighbor' />" \
|
||||
+ "</body></html>", "window=book;size=192x192")
|
||||
onclose(M, "PDA Photo")
|
||||
|
||||
/datum/data_rc_msg
|
||||
var/rec_dpt = "Unspecified" //name of the person
|
||||
var/send_dpt = "Unspecified" //name of the sender
|
||||
var/message = "Blank" //transferred message
|
||||
var/stamp = "Unstamped"
|
||||
var/id_auth = "Unauthenticated"
|
||||
var/priority = "Normal"
|
||||
|
||||
/datum/data_rc_msg/New(var/param_rec = "",var/param_sender = "",var/param_message = "",var/param_stamp = "",var/param_id_auth = "",var/param_priority)
|
||||
if(param_rec)
|
||||
rec_dpt = param_rec
|
||||
if(param_sender)
|
||||
send_dpt = param_sender
|
||||
if(param_message)
|
||||
message = param_message
|
||||
if(param_stamp)
|
||||
stamp = param_stamp
|
||||
if(param_id_auth)
|
||||
id_auth = param_id_auth
|
||||
if(param_priority)
|
||||
switch(param_priority)
|
||||
if(1)
|
||||
priority = "Normal"
|
||||
if(2)
|
||||
priority = "High"
|
||||
if(3)
|
||||
priority = "Extreme"
|
||||
else
|
||||
priority = "Undetermined"
|
||||
|
||||
/obj/machinery/message_server
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
icon_state = "server"
|
||||
name = "Messaging Server"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/datum/data_pda_msg/New(var/param_rec = "",var/param_sender = "",var/param_message = "",var/param_photo=null)
|
||||
|
||||
if(param_rec)
|
||||
recipient = param_rec
|
||||
if(param_sender)
|
||||
sender = param_sender
|
||||
if(param_message)
|
||||
message = param_message
|
||||
if(param_photo)
|
||||
photo = param_photo
|
||||
|
||||
/datum/data_pda_msg/proc/get_photo_ref()
|
||||
if(photo)
|
||||
return "<a href='byond://?src=\ref[src];photo=1'>(Photo)</a>"
|
||||
return ""
|
||||
|
||||
/datum/data_pda_msg/Topic(href,href_list)
|
||||
..()
|
||||
if(href_list["photo"])
|
||||
var/mob/M = usr
|
||||
M << browse_rsc(photo, "pda_photo.png")
|
||||
M << browse("<html><head><title>PDA Photo</title></head>" \
|
||||
+ "<body style='overflow:hidden;margin:0;text-align:center'>" \
|
||||
+ "<img src='pda_photo.png' width='192' style='-ms-interpolation-mode:nearest-neighbor' />" \
|
||||
+ "</body></html>", "window=book;size=192x192")
|
||||
onclose(M, "PDA Photo")
|
||||
|
||||
/datum/data_rc_msg
|
||||
var/rec_dpt = "Unspecified" //name of the person
|
||||
var/send_dpt = "Unspecified" //name of the sender
|
||||
var/message = "Blank" //transferred message
|
||||
var/stamp = "Unstamped"
|
||||
var/id_auth = "Unauthenticated"
|
||||
var/priority = "Normal"
|
||||
|
||||
/datum/data_rc_msg/New(var/param_rec = "",var/param_sender = "",var/param_message = "",var/param_stamp = "",var/param_id_auth = "",var/param_priority)
|
||||
if(param_rec)
|
||||
rec_dpt = param_rec
|
||||
if(param_sender)
|
||||
send_dpt = param_sender
|
||||
if(param_message)
|
||||
message = param_message
|
||||
if(param_stamp)
|
||||
stamp = param_stamp
|
||||
if(param_id_auth)
|
||||
id_auth = param_id_auth
|
||||
if(param_priority)
|
||||
switch(param_priority)
|
||||
if(1)
|
||||
priority = "Normal"
|
||||
if(2)
|
||||
priority = "High"
|
||||
if(3)
|
||||
priority = "Extreme"
|
||||
else
|
||||
priority = "Undetermined"
|
||||
|
||||
/obj/machinery/message_server
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
icon_state = "server"
|
||||
name = "Messaging Server"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
|
||||
var/list/datum/data_pda_msg/pda_msgs = list()
|
||||
var/list/datum/data_rc_msg/rc_msgs = list()
|
||||
var/active = 1
|
||||
var/decryptkey = "password"
|
||||
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
|
||||
var/list/datum/data_pda_msg/pda_msgs = list()
|
||||
var/list/datum/data_rc_msg/rc_msgs = list()
|
||||
var/active = 1
|
||||
var/decryptkey = "password"
|
||||
|
||||
/obj/machinery/message_server/Initialize()
|
||||
GLOB.message_servers += src
|
||||
decryptkey = GenerateKey()
|
||||
send_pda_message("System Administrator", "system", "This is an automated message. The messaging system is functioning correctly.")
|
||||
GLOB.message_servers += src
|
||||
decryptkey = GenerateKey()
|
||||
send_pda_message("System Administrator", "system", "This is an automated message. The messaging system is functioning correctly.")
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/message_server/Destroy()
|
||||
GLOB.message_servers -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/message_server/proc/GenerateKey()
|
||||
//Feel free to move to Helpers.
|
||||
var/newKey
|
||||
newKey += pick("the", "if", "of", "as", "in", "a", "you", "from", "to", "an", "too", "little", "snow", "dead", "drunk", "rosebud", "duck", "al", "le")
|
||||
newKey += pick("diamond", "beer", "mushroom", "assistant", "clown", "captain", "twinkie", "security", "nuke", "small", "big", "escape", "yellow", "gloves", "monkey", "engine", "nuclear", "ai")
|
||||
newKey += pick("1", "2", "3", "4", "5", "6", "7", "8", "9", "0")
|
||||
return newKey
|
||||
|
||||
/obj/machinery/message_server/process()
|
||||
//if(decryptkey == "password")
|
||||
// decryptkey = generateKey()
|
||||
if(active && (stat & (BROKEN|NOPOWER)))
|
||||
active = 0
|
||||
return
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/message_server/proc/send_pda_message(recipient = "",sender = "",message = "",photo=null)
|
||||
. = new/datum/data_pda_msg(recipient,sender,message,photo)
|
||||
pda_msgs += .
|
||||
|
||||
/obj/machinery/message_server/proc/send_rc_message(recipient = "",sender = "",message = "",stamp = "", id_auth = "", priority = 1)
|
||||
rc_msgs += new/datum/data_rc_msg(recipient,sender,message,stamp,id_auth)
|
||||
|
||||
/obj/machinery/message_server/attack_hand(mob/user)
|
||||
to_chat(user, "You toggle PDA message passing from [active ? "On" : "Off"] to [active ? "Off" : "On"]")
|
||||
active = !active
|
||||
update_icon()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/message_server/update_icon()
|
||||
if((stat & (BROKEN|NOPOWER)))
|
||||
icon_state = "server-nopower"
|
||||
else if (!active)
|
||||
icon_state = "server-off"
|
||||
else
|
||||
icon_state = "server-on"
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/blackbox_recorder
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "blackbox"
|
||||
name = "Blackbox Recorder"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/machinery/message_server/Destroy()
|
||||
GLOB.message_servers -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/message_server/proc/GenerateKey()
|
||||
//Feel free to move to Helpers.
|
||||
var/newKey
|
||||
newKey += pick("the", "if", "of", "as", "in", "a", "you", "from", "to", "an", "too", "little", "snow", "dead", "drunk", "rosebud", "duck", "al", "le")
|
||||
newKey += pick("diamond", "beer", "mushroom", "assistant", "clown", "captain", "twinkie", "security", "nuke", "small", "big", "escape", "yellow", "gloves", "monkey", "engine", "nuclear", "ai")
|
||||
newKey += pick("1", "2", "3", "4", "5", "6", "7", "8", "9", "0")
|
||||
return newKey
|
||||
|
||||
/obj/machinery/message_server/process()
|
||||
//if(decryptkey == "password")
|
||||
// decryptkey = generateKey()
|
||||
if(active && (stat & (BROKEN|NOPOWER)))
|
||||
active = 0
|
||||
return
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/message_server/proc/send_pda_message(recipient = "",sender = "",message = "",photo=null)
|
||||
. = new/datum/data_pda_msg(recipient,sender,message,photo)
|
||||
pda_msgs += .
|
||||
|
||||
/obj/machinery/message_server/proc/send_rc_message(recipient = "",sender = "",message = "",stamp = "", id_auth = "", priority = 1)
|
||||
rc_msgs += new/datum/data_rc_msg(recipient,sender,message,stamp,id_auth)
|
||||
|
||||
/obj/machinery/message_server/attack_hand(mob/user)
|
||||
to_chat(user, "You toggle PDA message passing from [active ? "On" : "Off"] to [active ? "Off" : "On"]")
|
||||
active = !active
|
||||
update_icon()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/message_server/update_icon()
|
||||
if((stat & (BROKEN|NOPOWER)))
|
||||
icon_state = "server-nopower"
|
||||
else if (!active)
|
||||
icon_state = "server-off"
|
||||
else
|
||||
icon_state = "server-on"
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/blackbox_recorder
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "blackbox"
|
||||
name = "Blackbox Recorder"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70)
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 100
|
||||
armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70)
|
||||
|
||||
+146
-146
@@ -1,149 +1,149 @@
|
||||
/*
|
||||
Protolathe
|
||||
|
||||
Similar to an autolathe, you load glass and metal sheets (but not other objects) into it to be used as raw materials for the stuff
|
||||
it creates. All the menus and other manipulation commands are in the R&D console.
|
||||
|
||||
Note: Must be placed west/left of and R&D console to function.
|
||||
|
||||
*/
|
||||
/obj/machinery/r_n_d/protolathe
|
||||
/*
|
||||
Protolathe
|
||||
|
||||
Similar to an autolathe, you load glass and metal sheets (but not other objects) into it to be used as raw materials for the stuff
|
||||
it creates. All the menus and other manipulation commands are in the R&D console.
|
||||
|
||||
Note: Must be placed west/left of and R&D console to function.
|
||||
|
||||
*/
|
||||
/obj/machinery/r_n_d/protolathe
|
||||
name = "protolathe"
|
||||
desc = "Converts raw materials into useful objects."
|
||||
icon_state = "protolathe"
|
||||
container_type = OPENCONTAINER
|
||||
|
||||
var/datum/material_container/materials
|
||||
var/efficiency_coeff
|
||||
|
||||
var/list/categories = list(
|
||||
"Power Designs",
|
||||
"Medical Designs",
|
||||
"Bluespace Designs",
|
||||
"Stock Parts",
|
||||
"Equipment",
|
||||
"Mining Designs",
|
||||
"Electronics",
|
||||
"Weapons",
|
||||
"Ammo",
|
||||
"Firing Pins",
|
||||
"Computer Parts"
|
||||
)
|
||||
|
||||
|
||||
desc = "Converts raw materials into useful objects."
|
||||
icon_state = "protolathe"
|
||||
container_type = OPENCONTAINER
|
||||
|
||||
var/datum/material_container/materials
|
||||
var/efficiency_coeff
|
||||
|
||||
var/list/categories = list(
|
||||
"Power Designs",
|
||||
"Medical Designs",
|
||||
"Bluespace Designs",
|
||||
"Stock Parts",
|
||||
"Equipment",
|
||||
"Mining Designs",
|
||||
"Electronics",
|
||||
"Weapons",
|
||||
"Ammo",
|
||||
"Firing Pins",
|
||||
"Computer Parts"
|
||||
)
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/Initialize()
|
||||
. = ..()
|
||||
create_reagents(0)
|
||||
materials = new(src, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE))
|
||||
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/protolathe(null)
|
||||
B.apply_default_parts(src)
|
||||
|
||||
/obj/item/weapon/circuitboard/machine/protolathe
|
||||
name = "Protolathe (Machine Board)"
|
||||
build_path = /obj/machinery/r_n_d/protolathe
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 2,
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/weapon/reagent_containers/glass/beaker = 2)
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/Destroy()
|
||||
qdel(materials)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/RefreshParts()
|
||||
reagents.maximum_volume = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
reagents.maximum_volume += G.volume
|
||||
G.reagents.trans_to(src, G.reagents.total_volume)
|
||||
|
||||
materials.max_amount = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
materials.max_amount += M.rating * 75000
|
||||
|
||||
var/T = 1.2
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
T -= M.rating/10
|
||||
efficiency_coeff = min(max(0, T), 1)
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/proc/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material
|
||||
var/list/all_materials = being_built.reagents_list + being_built.materials
|
||||
|
||||
var/A = materials.amount(M)
|
||||
if(!A)
|
||||
A = reagents.get_reagent_amount(M)
|
||||
|
||||
return round(A / max(1, (all_materials[M]*efficiency_coeff)))
|
||||
|
||||
//we eject the materials upon deconstruction.
|
||||
/obj/machinery/r_n_d/protolathe/on_deconstruction()
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
reagents.trans_to(G, G.reagents.maximum_volume)
|
||||
materials.retrieve_all()
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/disconnect_console()
|
||||
linked_console.linked_lathe = null
|
||||
..()
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/Insert_Item(obj/item/O, mob/user)
|
||||
|
||||
if(istype(O, /obj/item/stack/sheet))
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
var/sheet_material = materials.get_item_material_amount(O)
|
||||
if(!sheet_material)
|
||||
return
|
||||
|
||||
if(!materials.has_space(sheet_material))
|
||||
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
|
||||
return 1
|
||||
|
||||
var/obj/item/stack/sheet/stack = O
|
||||
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
|
||||
if(!in_range(src, stack) || !user.Adjacent(src))
|
||||
return
|
||||
var/amount_inserted = materials.insert_stack(O,amount)
|
||||
if(!amount_inserted)
|
||||
return 1
|
||||
else
|
||||
var/stack_name = stack.name
|
||||
busy = TRUE
|
||||
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount_inserted/10)))
|
||||
to_chat(user, "<span class='notice'>You add [amount_inserted] sheets to the [src.name].</span>")
|
||||
add_overlay("protolathe_[stack_name]")
|
||||
sleep(10)
|
||||
cut_overlay("protolathe_[stack_name]")
|
||||
busy = FALSE
|
||||
updateUsrDialog()
|
||||
|
||||
else if(istype(O, /obj/item/weapon/ore/bluespace_crystal)) //Bluespace crystals can be either a stack or an item
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
var/bs_material = materials.get_item_material_amount(O)
|
||||
if(!bs_material)
|
||||
return
|
||||
|
||||
if(!materials.has_space(bs_material))
|
||||
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
|
||||
return 1
|
||||
|
||||
materials.insert_item(O)
|
||||
busy = TRUE
|
||||
use_power(MINERAL_MATERIAL_AMOUNT/10)
|
||||
to_chat(user, "<span class='notice'>You add [O] to the [src.name].</span>")
|
||||
qdel(O)
|
||||
add_overlay("protolathe_bluespace")
|
||||
sleep(10)
|
||||
cut_overlay("protolathe_bluespace")
|
||||
busy = FALSE
|
||||
updateUsrDialog()
|
||||
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='warning'>You cannot insert this item into the [name]!</span>")
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
create_reagents(0)
|
||||
materials = new(src, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE))
|
||||
var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/protolathe(null)
|
||||
B.apply_default_parts(src)
|
||||
|
||||
/obj/item/weapon/circuitboard/machine/protolathe
|
||||
name = "Protolathe (Machine Board)"
|
||||
build_path = /obj/machinery/r_n_d/protolathe
|
||||
origin_tech = "engineering=2;programming=2"
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/matter_bin = 2,
|
||||
/obj/item/weapon/stock_parts/manipulator = 2,
|
||||
/obj/item/weapon/reagent_containers/glass/beaker = 2)
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/Destroy()
|
||||
qdel(materials)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/RefreshParts()
|
||||
reagents.maximum_volume = 0
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
reagents.maximum_volume += G.volume
|
||||
G.reagents.trans_to(src, G.reagents.total_volume)
|
||||
|
||||
materials.max_amount = 0
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
materials.max_amount += M.rating * 75000
|
||||
|
||||
var/T = 1.2
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
T -= M.rating/10
|
||||
efficiency_coeff = min(max(0, T), 1)
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/proc/check_mat(datum/design/being_built, M) // now returns how many times the item can be built with the material
|
||||
var/list/all_materials = being_built.reagents_list + being_built.materials
|
||||
|
||||
var/A = materials.amount(M)
|
||||
if(!A)
|
||||
A = reagents.get_reagent_amount(M)
|
||||
|
||||
return round(A / max(1, (all_materials[M]*efficiency_coeff)))
|
||||
|
||||
//we eject the materials upon deconstruction.
|
||||
/obj/machinery/r_n_d/protolathe/on_deconstruction()
|
||||
for(var/obj/item/weapon/reagent_containers/glass/G in component_parts)
|
||||
reagents.trans_to(G, G.reagents.maximum_volume)
|
||||
materials.retrieve_all()
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/disconnect_console()
|
||||
linked_console.linked_lathe = null
|
||||
..()
|
||||
|
||||
/obj/machinery/r_n_d/protolathe/Insert_Item(obj/item/O, mob/user)
|
||||
|
||||
if(istype(O, /obj/item/stack/sheet))
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
var/sheet_material = materials.get_item_material_amount(O)
|
||||
if(!sheet_material)
|
||||
return
|
||||
|
||||
if(!materials.has_space(sheet_material))
|
||||
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
|
||||
return 1
|
||||
|
||||
var/obj/item/stack/sheet/stack = O
|
||||
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
|
||||
if(!in_range(src, stack) || !user.Adjacent(src))
|
||||
return
|
||||
var/amount_inserted = materials.insert_stack(O,amount)
|
||||
if(!amount_inserted)
|
||||
return 1
|
||||
else
|
||||
var/stack_name = stack.name
|
||||
busy = TRUE
|
||||
use_power(max(1000, (MINERAL_MATERIAL_AMOUNT*amount_inserted/10)))
|
||||
to_chat(user, "<span class='notice'>You add [amount_inserted] sheets to the [src.name].</span>")
|
||||
add_overlay("protolathe_[stack_name]")
|
||||
sleep(10)
|
||||
cut_overlay("protolathe_[stack_name]")
|
||||
busy = FALSE
|
||||
updateUsrDialog()
|
||||
|
||||
else if(istype(O, /obj/item/weapon/ore/bluespace_crystal)) //Bluespace crystals can be either a stack or an item
|
||||
. = 1
|
||||
if(!is_insertion_ready(user))
|
||||
return
|
||||
var/bs_material = materials.get_item_material_amount(O)
|
||||
if(!bs_material)
|
||||
return
|
||||
|
||||
if(!materials.has_space(bs_material))
|
||||
to_chat(user, "<span class='warning'>The [src.name]'s material bin is full! Please remove material before adding more.</span>")
|
||||
return 1
|
||||
|
||||
materials.insert_item(O)
|
||||
busy = TRUE
|
||||
use_power(MINERAL_MATERIAL_AMOUNT/10)
|
||||
to_chat(user, "<span class='notice'>You add [O] to the [src.name].</span>")
|
||||
qdel(O)
|
||||
add_overlay("protolathe_bluespace")
|
||||
sleep(10)
|
||||
cut_overlay("protolathe_bluespace")
|
||||
busy = FALSE
|
||||
updateUsrDialog()
|
||||
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
to_chat(user, "<span class='warning'>You cannot insert this item into the [name]!</span>")
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
+1072
-1072
File diff suppressed because it is too large
Load Diff
+106
-106
@@ -1,109 +1,109 @@
|
||||
|
||||
|
||||
//All devices that link into the R&D console fall into thise type for easy identification and some shared procs.
|
||||
|
||||
|
||||
/obj/machinery/r_n_d
|
||||
name = "R&D Device"
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
|
||||
//All devices that link into the R&D console fall into thise type for easy identification and some shared procs.
|
||||
|
||||
|
||||
/obj/machinery/r_n_d
|
||||
name = "R&D Device"
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = IDLE_POWER_USE
|
||||
var/busy = 0
|
||||
var/hacked = 0
|
||||
var/disabled = 0
|
||||
var/shocked = 0
|
||||
var/obj/machinery/computer/rdconsole/linked_console
|
||||
var/obj/item/loaded_item = null //the item loaded inside the machine (currently only used by experimentor and destructive analyzer)
|
||||
|
||||
var/busy = 0
|
||||
var/hacked = 0
|
||||
var/disabled = 0
|
||||
var/shocked = 0
|
||||
var/obj/machinery/computer/rdconsole/linked_console
|
||||
var/obj/item/loaded_item = null //the item loaded inside the machine (currently only used by experimentor and destructive analyzer)
|
||||
|
||||
/obj/machinery/r_n_d/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/r_n_d(src)
|
||||
|
||||
/obj/machinery/r_n_d/Destroy()
|
||||
qdel(wires)
|
||||
wires = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/r_n_d/proc/shock(mob/user, prb)
|
||||
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
|
||||
return 0
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
do_sparks(5, TRUE, src)
|
||||
if (electrocute_mob(user, get_area(src), src, 0.7, TRUE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/r_n_d/attack_hand(mob/user)
|
||||
if(shocked)
|
||||
if(shock(user,50))
|
||||
return
|
||||
if(panel_open)
|
||||
wires.interact(user)
|
||||
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/attackby(obj/item/O, mob/user, params)
|
||||
if (shocked)
|
||||
if(shock(user,50))
|
||||
return 1
|
||||
if (default_deconstruction_screwdriver(user, "[initial(icon_state)]_t", initial(icon_state), O))
|
||||
if(linked_console)
|
||||
disconnect_console()
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(default_deconstruction_crowbar(O))
|
||||
return
|
||||
if(is_open_container() && O.is_open_container())
|
||||
return 0 //inserting reagents into the machine
|
||||
if(Insert_Item(O, user))
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
|
||||
//to disconnect the machine from the r&d console it's linked to
|
||||
/obj/machinery/r_n_d/proc/disconnect_console()
|
||||
linked_console = null
|
||||
|
||||
//proc used to handle inserting items or reagents into r_n_d machines
|
||||
/obj/machinery/r_n_d/proc/Insert_Item(obj/item/I, mob/user)
|
||||
return
|
||||
|
||||
//whether the machine can have an item inserted in its current state.
|
||||
/obj/machinery/r_n_d/proc/is_insertion_ready(mob/user)
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>You can't load the [src.name] while it's opened!</span>")
|
||||
return
|
||||
if (disabled)
|
||||
return
|
||||
if (!linked_console) // Try to auto-connect to new RnD consoles nearby.
|
||||
for(var/obj/machinery/computer/rdconsole/console in oview(3, src))
|
||||
if(console.first_use)
|
||||
console.SyncRDevices()
|
||||
|
||||
if(!linked_console)
|
||||
to_chat(user, "<span class='warning'>The [name] must be linked to an R&D console first!</span>")
|
||||
return
|
||||
if (busy)
|
||||
to_chat(user, "<span class='warning'>The [src.name] is busy right now.</span>")
|
||||
return
|
||||
if(stat & BROKEN)
|
||||
to_chat(user, "<span class='warning'>The [src.name] is broken.</span>")
|
||||
return
|
||||
if(stat & NOPOWER)
|
||||
to_chat(user, "<span class='warning'>The [src.name] has no power.</span>")
|
||||
return
|
||||
if(loaded_item)
|
||||
to_chat(user, "<span class='warning'>The [src] is already loaded.</span>")
|
||||
return
|
||||
return 1
|
||||
|
||||
|
||||
//we eject the loaded item when deconstructing the machine
|
||||
/obj/machinery/r_n_d/on_deconstruction()
|
||||
if(loaded_item)
|
||||
loaded_item.forceMove(loc)
|
||||
..()
|
||||
wires = new /datum/wires/r_n_d(src)
|
||||
|
||||
/obj/machinery/r_n_d/Destroy()
|
||||
qdel(wires)
|
||||
wires = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/r_n_d/proc/shock(mob/user, prb)
|
||||
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
|
||||
return 0
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
do_sparks(5, TRUE, src)
|
||||
if (electrocute_mob(user, get_area(src), src, 0.7, TRUE))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/machinery/r_n_d/attack_hand(mob/user)
|
||||
if(shocked)
|
||||
if(shock(user,50))
|
||||
return
|
||||
if(panel_open)
|
||||
wires.interact(user)
|
||||
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/attackby(obj/item/O, mob/user, params)
|
||||
if (shocked)
|
||||
if(shock(user,50))
|
||||
return 1
|
||||
if (default_deconstruction_screwdriver(user, "[initial(icon_state)]_t", initial(icon_state), O))
|
||||
if(linked_console)
|
||||
disconnect_console()
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(default_deconstruction_crowbar(O))
|
||||
return
|
||||
if(is_open_container() && O.is_open_container())
|
||||
return 0 //inserting reagents into the machine
|
||||
if(Insert_Item(O, user))
|
||||
return 1
|
||||
else
|
||||
return ..()
|
||||
|
||||
//to disconnect the machine from the r&d console it's linked to
|
||||
/obj/machinery/r_n_d/proc/disconnect_console()
|
||||
linked_console = null
|
||||
|
||||
//proc used to handle inserting items or reagents into r_n_d machines
|
||||
/obj/machinery/r_n_d/proc/Insert_Item(obj/item/I, mob/user)
|
||||
return
|
||||
|
||||
//whether the machine can have an item inserted in its current state.
|
||||
/obj/machinery/r_n_d/proc/is_insertion_ready(mob/user)
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>You can't load the [src.name] while it's opened!</span>")
|
||||
return
|
||||
if (disabled)
|
||||
return
|
||||
if (!linked_console) // Try to auto-connect to new RnD consoles nearby.
|
||||
for(var/obj/machinery/computer/rdconsole/console in oview(3, src))
|
||||
if(console.first_use)
|
||||
console.SyncRDevices()
|
||||
|
||||
if(!linked_console)
|
||||
to_chat(user, "<span class='warning'>The [name] must be linked to an R&D console first!</span>")
|
||||
return
|
||||
if (busy)
|
||||
to_chat(user, "<span class='warning'>The [src.name] is busy right now.</span>")
|
||||
return
|
||||
if(stat & BROKEN)
|
||||
to_chat(user, "<span class='warning'>The [src.name] is broken.</span>")
|
||||
return
|
||||
if(stat & NOPOWER)
|
||||
to_chat(user, "<span class='warning'>The [src.name] has no power.</span>")
|
||||
return
|
||||
if(loaded_item)
|
||||
to_chat(user, "<span class='warning'>The [src] is already loaded.</span>")
|
||||
return
|
||||
return 1
|
||||
|
||||
|
||||
//we eject the loaded item when deconstructing the machine
|
||||
/obj/machinery/r_n_d/on_deconstruction()
|
||||
if(loaded_item)
|
||||
loaded_item.forceMove(loc)
|
||||
..()
|
||||
|
||||
@@ -39,8 +39,8 @@ If you create T5+ please take a pass at gene_modder.dm [L40]. Max_values MUST fi
|
||||
max_w_class = WEIGHT_CLASS_NORMAL
|
||||
max_combined_w_class = 800
|
||||
works_from_distance = 1
|
||||
pshoom_or_beepboopblorpzingshadashwoosh = 'sound/items/PSHOOM.ogg'
|
||||
alt_sound = 'sound/items/PSHOOM_2.ogg'
|
||||
pshoom_or_beepboopblorpzingshadashwoosh = 'sound/items/pshoom.ogg'
|
||||
alt_sound = 'sound/items/pshoom_2.ogg'
|
||||
|
||||
/obj/item/weapon/storage/part_replacer/bluespace/content_can_dump(atom/dest_object, mob/user)
|
||||
if(Adjacent(user))
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
if(!istype(C))
|
||||
to_chat(user, "<span class='warning'>The potion can only be used on items or vehicles!</span>")
|
||||
return
|
||||
if(istype(C, /obj/item))
|
||||
if(isitem(C))
|
||||
var/obj/item/I = C
|
||||
if(I.slowdown <= 0)
|
||||
to_chat(user, "<span class='warning'>The [C] can't be made any faster!</span>")
|
||||
@@ -571,14 +571,14 @@
|
||||
|
||||
/obj/effect/timestop/proc/timestop()
|
||||
set waitfor = FALSE
|
||||
playsound(get_turf(src), 'sound/magic/TIMEPARADOX2.ogg', 100, 1, -1)
|
||||
playsound(get_turf(src), 'sound/magic/timeparadox2.ogg', 100, 1, -1)
|
||||
for(var/i in 1 to duration-1)
|
||||
for(var/atom/A in orange (freezerange, src.loc))
|
||||
if(isliving(A))
|
||||
var/mob/living/M = A
|
||||
if(M in immune)
|
||||
continue
|
||||
M.Stun(10, 1, 1)
|
||||
M.Stun(200, 1, 1)
|
||||
M.anchored = 1
|
||||
if(ishostile(M))
|
||||
var/mob/living/simple_animal/hostile/H = M
|
||||
@@ -608,7 +608,7 @@
|
||||
|
||||
|
||||
/obj/effect/timestop/proc/unfreeze_mob(mob/living/M)
|
||||
M.AdjustStunned(-10, 1, 1)
|
||||
M.AdjustStun(-200, 1, 1)
|
||||
M.anchored = 0
|
||||
if(ishostile(M))
|
||||
var/mob/living/simple_animal/hostile/H = M
|
||||
|
||||
Reference in New Issue
Block a user