Assemblies update

This commit is contained in:
c0
2015-09-04 11:22:37 +03:00
parent 7203e33ba5
commit df7386a4ec
53 changed files with 459 additions and 283 deletions
+7 -6
View File
@@ -256,9 +256,9 @@
text += "<br>Flash: <a href='?src=\ref[src];revolution=flash'>give</a>"
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
var/obj/item/device/assembly/flash/flash = locate() in L
if (flash)
if(!flash.broken)
if(!flash.crit_fail)
text += "|<a href='?src=\ref[src];revolution=takeflash'>take</a>."
else
text += "|<a href='?src=\ref[src];revolution=takeflash'>take</a>|<a href='?src=\ref[src];revolution=repairflash'>repair</a>."
@@ -807,18 +807,19 @@
if("takeflash")
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
var/obj/item/device/assembly/flash/flash = locate() in L
if (!flash)
usr << "<span class='danger'>Deleting flash failed!</span>"
qdel(flash)
if("repairflash")
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
var/obj/item/device/assembly/flash/flash = locate() in L
if (!flash)
usr << "<span class='danger'>Repairing flash failed!</span>"
else
flash.broken = 0
flash.crit_fail = 0
flash.update_icon()
@@ -1372,7 +1373,7 @@
ticker.mode.greet_revolutionary(src,0)
var/list/L = current.get_contents()
var/obj/item/device/flash/flash = locate() in L
var/obj/item/device/assembly/flash/flash = locate() in L
qdel(flash)
take_uplink()
var/fail = 0
+22 -2
View File
@@ -10,7 +10,6 @@ var/list/same_wires = list()
var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink")
/datum/wires
var/random = 0 // Will the wires be different for every single instance.
var/atom/holder = null // The holder
var/holder_type = null // The holder type; used to make sure that the holder is the correct type.
@@ -48,6 +47,7 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown",
/datum/wires/Destroy()
holder = null
signallers = list()
return ..()
/datum/wires/proc/GenerateWires()
@@ -68,13 +68,33 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown",
src.wires[colour] = index
//wires = shuffle(wires)
/datum/wires/proc/IsInteractionTool(obj/item/I)
if(istype(I, /obj/item/device/multitool))
return 1
if(istype(I, /obj/item/weapon/wirecutters))
return 1
if(istype(I, /obj/item/device/assembly))
var/obj/item/device/assembly/A = I
if(A.attachable)
return 1
return 0
/datum/wires/proc/Interact(mob/living/user)
var/html = null
if(holder && CanUse(user))
html = GetInteractWindow()
if(html)
if(user.machine != holder)
for(var/A in signallers)
if(istype(signallers[A], /obj/item))
var/obj/item/I = signallers[A]
if(I.on_found(user))
return
user.set_machine(holder)
else
user.unset_machine()