mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Conflicts: baystation12.dme code/defines/obj/weapon.dm code/game/mecha/equipment/tools/medical_tools.dm code/game/mecha/equipment/tools/tools.dm code/game/mecha/mecha.dm code/game/mecha/mecha_parts.dm code/game/objects/items/devices/flash.dm code/game/objects/items/devices/powersink.dm code/game/objects/items/devices/scanners.dm code/game/objects/items/stacks/sheets/glass.dm code/game/objects/items/stacks/sheets/sheet_types.dm code/game/objects/items/weapons/RCD.dm code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm code/game/objects/items/weapons/circuitboards/machinery/cloning.dm code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm code/game/objects/items/weapons/circuitboards/machinery/pacman.dm code/game/objects/items/weapons/circuitboards/machinery/power.dm code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm code/game/objects/items/weapons/circuitboards/machinery/research.dm code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm code/game/objects/items/weapons/flamethrower.dm code/game/objects/items/weapons/handcuffs.dm code/game/objects/items/weapons/kitchen.dm code/game/objects/items/weapons/shields.dm code/game/objects/items/weapons/storage/backpack.dm code/game/objects/items/weapons/surgery_tools.dm code/game/objects/items/weapons/teleportation.dm code/game/objects/items/weapons/tools.dm code/modules/assembly/igniter.dm code/modules/assembly/infrared.dm code/modules/assembly/mousetrap.dm code/modules/assembly/proximity.dm code/modules/assembly/signaler.dm code/modules/assembly/timer.dm code/modules/assembly/voice.dm code/modules/clothing/glasses/glasses.dm code/modules/hydroponics/trays/tray_tools.dm code/modules/mining/drilling/scanner.dm code/modules/mining/mine_items.dm code/modules/mining/ore.dm code/modules/mob/living/silicon/robot/analyzer.dm code/modules/power/rust/circuits_and_design.dm code/modules/projectiles/ammunition/boxes.dm code/modules/projectiles/guns/energy/laser.dm code/modules/projectiles/guns/energy/special.dm code/modules/projectiles/guns/energy/stun.dm code/modules/research/circuitprinter.dm code/modules/research/designs.dm code/modules/research/destructive_analyzer.dm code/modules/research/protolathe.dm code/modules/research/rdconsole.dm code/modules/research/research.dm code/modules/research/server.dm code/modules/research/xenoarchaeology/genetics/reconstitutor.dm
88 lines
2.6 KiB
Plaintext
88 lines
2.6 KiB
Plaintext
/*
|
|
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"
|
|
icon_state = "d_analyzer"
|
|
var/obj/item/weapon/loaded_item = null
|
|
var/decon_mod = 0
|
|
|
|
use_power = 1
|
|
idle_power_usage = 30
|
|
active_power_usage = 2500
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/New()
|
|
..()
|
|
component_parts = list()
|
|
component_parts += new /obj/item/weapon/circuitboard/destructive_analyzer(src)
|
|
component_parts += new /obj/item/weapon/stock_parts/scanning_module(src)
|
|
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
|
|
component_parts += new /obj/item/weapon/stock_parts/micro_laser(src)
|
|
RefreshParts()
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/RefreshParts()
|
|
var/T = 0
|
|
for(var/obj/item/weapon/stock_parts/S in src)
|
|
T += S.rating
|
|
decon_mod = T * 0.1
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/meteorhit()
|
|
qdel(src)
|
|
return
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/update_icon()
|
|
if(panel_open)
|
|
icon_state = "d_analyzer_t"
|
|
else if(loaded_item)
|
|
icon_state = "d_analyzer_l"
|
|
else
|
|
icon_state = "d_analyzer"
|
|
|
|
/obj/machinery/r_n_d/destructive_analyzer/attackby(var/obj/O as obj, var/mob/user as mob)
|
|
if(busy)
|
|
user << "<span class='notice'>\The [src] is busy right now.</span>"
|
|
return
|
|
if(loaded_item)
|
|
user << "<span class='notice'>There is something already loaded into \the [src].</span>"
|
|
return 1
|
|
if(default_deconstruction_screwdriver(user, O))
|
|
if(linked_console)
|
|
linked_console.linked_destroy = null
|
|
linked_console = null
|
|
return
|
|
if(default_deconstruction_crowbar(user, O))
|
|
return
|
|
if(default_part_replacement(user, O))
|
|
return
|
|
if(panel_open)
|
|
user << "<span class='notice'>You can't load \the [src] while it's opened.</span>"
|
|
return 1
|
|
if(!linked_console)
|
|
user << "<span class='notice'>\The [src] must be linked to an R&D console first.</span>"
|
|
return
|
|
if(istype(O, /obj/item) && !loaded_item)
|
|
if(isrobot(user)) //Don't put your module items in there!
|
|
return
|
|
if(!O.origin_tech)
|
|
user << "<span class='notice'>This doesn't seem to have a tech origin.</span>"
|
|
return
|
|
if(O.origin_tech.len == 0)
|
|
user << "<span class='notice'>You cannot deconstruct this item.</span>"
|
|
return
|
|
busy = 1
|
|
loaded_item = O
|
|
user.drop_item()
|
|
O.loc = src
|
|
user << "<span class='notice'>You add \the [O] to \the [src].</span>"
|
|
flick("d_analyzer_la", src)
|
|
spawn(10)
|
|
update_icon()
|
|
busy = 0
|
|
return 1
|
|
return
|