[MIRROR] [READY] RND TECHWEBS + DEPARTMENTAL LATHES (#4014)
* [READY] RND TECHWEBS + DEPARTMENTAL LATHES * resetting all the maps because we can worry about them later. * Regexing * I'm fucked * Fixes * . * maps * bleh * ree * fixes
This commit is contained in:
committed by
kevinz000
parent
b5600cb91c
commit
cc0b768c72
@@ -3,7 +3,7 @@
|
||||
//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
|
||||
/obj/machinery/rnd
|
||||
name = "R&D Device"
|
||||
icon = 'icons/obj/machines/research.dmi'
|
||||
density = TRUE
|
||||
@@ -11,31 +11,34 @@
|
||||
use_power = IDLE_POWER_USE
|
||||
var/busy = FALSE
|
||||
var/hacked = FALSE
|
||||
var/disabled = 0
|
||||
var/disabled = FALSE
|
||||
var/shocked = FALSE
|
||||
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/rnd/proc/reset_busy()
|
||||
busy = FALSE
|
||||
|
||||
/obj/machinery/r_n_d/Destroy()
|
||||
/obj/machinery/rnd/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/rnd(src)
|
||||
|
||||
/obj/machinery/rnd/Destroy()
|
||||
QDEL_NULL(wires)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/r_n_d/proc/shock(mob/user, prb)
|
||||
/obj/machinery/rnd/proc/shock(mob/user, prb)
|
||||
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
|
||||
return 0
|
||||
return FALSE
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
return FALSE
|
||||
do_sparks(5, TRUE, src)
|
||||
if (electrocute_mob(user, get_area(src), src, 0.7, TRUE))
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/r_n_d/attack_hand(mob/user)
|
||||
/obj/machinery/rnd/attack_hand(mob/user)
|
||||
if(shocked)
|
||||
if(shock(user,50))
|
||||
return
|
||||
@@ -44,10 +47,10 @@
|
||||
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/attackby(obj/item/O, mob/user, params)
|
||||
/obj/machinery/rnd/attackby(obj/item/O, mob/user, params)
|
||||
if (shocked)
|
||||
if(shock(user,50))
|
||||
return 1
|
||||
return TRUE
|
||||
if (default_deconstruction_screwdriver(user, "[initial(icon_state)]_t", initial(icon_state), O))
|
||||
if(linked_console)
|
||||
disconnect_console()
|
||||
@@ -57,32 +60,28 @@
|
||||
if(default_deconstruction_crowbar(O))
|
||||
return
|
||||
if(is_open_container() && O.is_open_container())
|
||||
return 0 //inserting reagents into the machine
|
||||
return FALSE //inserting reagents into the machine
|
||||
if(Insert_Item(O, user))
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
//to disconnect the machine from the r&d console it's linked to
|
||||
/obj/machinery/r_n_d/proc/disconnect_console()
|
||||
/obj/machinery/rnd/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)
|
||||
//proc used to handle inserting items or reagents into rnd machines
|
||||
/obj/machinery/rnd/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)
|
||||
/obj/machinery/rnd/proc/is_insertion_ready(mob/user)
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>You can't load [src] 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'>[src] must be linked to an R&D console first!</span>")
|
||||
return
|
||||
@@ -98,16 +97,16 @@
|
||||
if(loaded_item)
|
||||
to_chat(user, "<span class='warning'>[src] is already loaded.</span>")
|
||||
return
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
|
||||
//we eject the loaded item when deconstructing the machine
|
||||
/obj/machinery/r_n_d/on_deconstruction()
|
||||
/obj/machinery/rnd/on_deconstruction()
|
||||
if(loaded_item)
|
||||
loaded_item.forceMove(loc)
|
||||
..()
|
||||
|
||||
/obj/machinery/r_n_d/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
|
||||
/obj/machinery/rnd/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
|
||||
var/stack_name
|
||||
if(ispath(type_inserted, /obj/item/ore/bluespace_crystal))
|
||||
stack_name = "bluespace"
|
||||
|
||||
Reference in New Issue
Block a user