[MIRROR] Gives engineering cyborgs an item they can use in place of circuits for basic construction (#2875)
* Gives engineering cyborgs an item they can use in place of circuits for basic construction * fixes
This commit is contained in:
committed by
Poojawa
parent
eb36f34267
commit
a286d0c313
@@ -434,6 +434,15 @@
|
||||
constructionStep = CONSTRUCTION_GUTTED
|
||||
update_icon()
|
||||
return
|
||||
if(istype(C, /obj/item/device/electroadaptive_pseudocircuit))
|
||||
var/obj/item/device/electroadaptive_pseudocircuit/P = C
|
||||
if(!P.adapt_circuit(user, 30))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
|
||||
"<span class='notice'>You adapt a firelock circuit and slot it into the assembly.</span>")
|
||||
constructionStep = CONSTRUCTION_GUTTED
|
||||
update_icon()
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/structure/firelock_frame/heavy
|
||||
|
||||
@@ -220,6 +220,16 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/device/electroadaptive_pseudocircuit))
|
||||
var/obj/item/device/electroadaptive_pseudocircuit/P = W
|
||||
if(!P.adapt_circuit(user, 15))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
|
||||
"<span class='notice'>You adapt a fire alarm circuit and slot it into the assembly.</span>")
|
||||
buildstage = 1
|
||||
update_icon()
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/wrench))
|
||||
user.visible_message("[user] removes the fire alarm assembly from the wall.", \
|
||||
"<span class='notice'>You remove the fire alarm assembly from the wall.</span>")
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//Used by engineering cyborgs in place of generic circuits.
|
||||
/obj/item/device/electroadaptive_pseudocircuit
|
||||
name = "electroadaptive pseudocircuit"
|
||||
desc = "An all-in-one circuit imprinter, designer, synthesizer, outfitter, creator, and chef. It can be used in place of any generic circuit board during construction."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "boris"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
materials = list(MAT_METAL = 50, MAT_GLASS = 300)
|
||||
origin_tech = "engineering=4"
|
||||
var/recharging = FALSE
|
||||
var/circuits = 5 //How many circuits the pseudocircuit has left
|
||||
var/static/recycleable_circuits = typecacheof(list(/obj/item/electronics/firelock, /obj/item/electronics/airalarm, /obj/item/electronics/firealarm, \
|
||||
/obj/item/electronics/apc))//A typecache of circuits consumable for material
|
||||
|
||||
/obj/item/device/electroadaptive_pseudocircuit/Initialize()
|
||||
. = ..()
|
||||
maptext = "[circuits]"
|
||||
|
||||
/obj/item/device/electroadaptive_pseudocircuit/examine(mob/user)
|
||||
..()
|
||||
if(iscyborg(user))
|
||||
to_chat(user, "<span class='notice'>It has material for <b>[circuits]</b> circuit[circuits == 1 ? "" : "s"]. Use the pseudocircuit on existing circuits to gain material.</span>")
|
||||
to_chat(user, "<span class='notice'>Serves as a substitute for <b>fire/air alarm</b>, <b>firelock</b>, and <b>APC</b> electronics.</span>")
|
||||
to_chat(user, "<span class='notice'>It can also be used on an APC with no power cell to <b>fabricate a low-capacity cell</b> at a high power cost.</span>")
|
||||
|
||||
/obj/item/device/electroadaptive_pseudocircuit/proc/adapt_circuit(mob/living/silicon/robot/R, circuit_cost = 0)
|
||||
if(QDELETED(R) || !istype(R))
|
||||
return
|
||||
if(!R.cell)
|
||||
to_chat(R, "<span class='warning'>You need a power cell installed for that.</span>")
|
||||
return
|
||||
if(!R.cell.use(circuit_cost))
|
||||
to_chat(R, "<span class='warning'>You don't have the power for that (you need [DisplayPower(circuit_cost)].)</span>")
|
||||
return
|
||||
if(recharging)
|
||||
to_chat(R, "<span class='warning'>[src] needs some time to recharge first.</span>")
|
||||
return
|
||||
if(!circuits)
|
||||
to_chat(R, "<span class='warning'>You need more material. Use [src] on existing simple circuits to break them down.</span>")
|
||||
return
|
||||
playsound(R, 'sound/items/rped.ogg', 50, TRUE)
|
||||
recharging = TRUE
|
||||
circuits--
|
||||
maptext = "[circuits]"
|
||||
icon_state = "[initial(icon_state)]_recharging"
|
||||
var/recharge_time = min(600, circuit_cost * 5) //40W of cost for one fabrication = 20 seconds of recharge time; this is to prevent spamming
|
||||
addtimer(CALLBACK(src, .proc/recharge), recharge_time)
|
||||
return TRUE //The actual circuit magic itself is done on a per-object basis
|
||||
|
||||
/obj/item/device/electroadaptive_pseudocircuit/afterattack(atom/target, mob/living/user, proximity)
|
||||
if(!proximity)
|
||||
return
|
||||
if(!is_type_in_typecache(target, recycleable_circuits))
|
||||
return
|
||||
circuits++
|
||||
maptext = "[circuits]"
|
||||
user.visible_message("<span class='notice'>User breaks down [target] with [src].</span>", \
|
||||
"<span class='notice'>You recycle [target] into [src]. It now has material for <b>[circuits]</b> circuits.</span>")
|
||||
playsound(user, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
qdel(target)
|
||||
|
||||
/obj/item/device/electroadaptive_pseudocircuit/proc/recharge()
|
||||
playsound(src, 'sound/machines/chime.ogg', 25, TRUE)
|
||||
recharging = FALSE
|
||||
icon_state = initial(icon_state)
|
||||
@@ -708,6 +708,16 @@
|
||||
qdel(W)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/device/electroadaptive_pseudocircuit))
|
||||
var/obj/item/device/electroadaptive_pseudocircuit/P = W
|
||||
if(!P.adapt_circuit(user, 25))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
|
||||
"<span class='notice'>You adapt an air alarm circuit and slot it into the assembly.</span>")
|
||||
buildstage = 1
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/wrench))
|
||||
to_chat(user, "<span class='notice'>You detach \the [src] from the wall.</span>")
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
|
||||
@@ -307,6 +307,7 @@
|
||||
/obj/item/device/analyzer,
|
||||
/obj/item/device/assembly/signaler/cyborg,
|
||||
/obj/item/areaeditor/blueprints/cyborg,
|
||||
/obj/item/device/electroadaptive_pseudocircuit,
|
||||
/obj/item/stack/sheet/metal/cyborg,
|
||||
/obj/item/stack/sheet/glass/cyborg,
|
||||
/obj/item/stack/sheet/rglass/cyborg,
|
||||
@@ -679,4 +680,4 @@
|
||||
/datum/robot_energy_storage/beacon
|
||||
max_energy = 30
|
||||
recharge_rate = 1
|
||||
name = "Marker Beacon Storage"
|
||||
name = "Marker Beacon Storage"
|
||||
@@ -546,6 +546,35 @@
|
||||
to_chat(user, "<span class='notice'>You place the power control board inside the frame.</span>")
|
||||
qdel(W)
|
||||
|
||||
else if(istype(W, /obj/item/device/electroadaptive_pseudocircuit) && opened)
|
||||
var/obj/item/device/electroadaptive_pseudocircuit/P = W
|
||||
if(!has_electronics)
|
||||
if(stat & BROKEN)
|
||||
to_chat(user, "<span class='warning'>[src]'s frame is too damaged to support a circuit.</span>")
|
||||
return
|
||||
if(!P.adapt_circuit(user, 50))
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] fabricates a circuit and places it into [src].</span>", \
|
||||
"<span class='notice'>You adapt a power control board and click it into place in [src]'s guts.</span>")
|
||||
has_electronics = TRUE
|
||||
locked = TRUE
|
||||
else if(!cell)
|
||||
if(stat & MAINT)
|
||||
to_chat(user, "<span class='warning'>There's no connector for a power cell.</span>")
|
||||
return
|
||||
if(!P.adapt_circuit(user, 500))
|
||||
return
|
||||
var/obj/item/stock_parts/cell/crap/empty/C = new(src)
|
||||
C.forceMove(src)
|
||||
cell = C
|
||||
chargecount = 0
|
||||
user.visible_message("<span class='notice'>[user] fabricates a weak power cell and places it into [src].</span>", \
|
||||
"<span class='warning'>Your [P.name] whirrs with strain as you create a weak power cell and place it into [src]!</span>")
|
||||
update_icon()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] has both electronics and a cell.</span>")
|
||||
return
|
||||
|
||||
else if (istype(W, /obj/item/weldingtool) && opened && has_electronics==0 && !terminal)
|
||||
var/obj/item/weldingtool/WT = W
|
||||
if (WT.get_fuel() < 3)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -831,6 +831,7 @@
|
||||
#include "code\game\objects\items\devices\camera_bug.dm"
|
||||
#include "code\game\objects\items\devices\chameleonproj.dm"
|
||||
#include "code\game\objects\items\devices\doorCharge.dm"
|
||||
#include "code\game\objects\items\devices\electroadaptive_pseudocircuit.dm"
|
||||
#include "code\game\objects\items\devices\flashlight.dm"
|
||||
#include "code\game\objects\items\devices\forcefieldprojector.dm"
|
||||
#include "code\game\objects\items\devices\geiger_counter.dm"
|
||||
|
||||
Reference in New Issue
Block a user