mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 19:15:11 +01:00
Merge pull request #1229 from SinTwo/construction_update
Construction update
This commit is contained in:
@@ -6,8 +6,10 @@
|
||||
w_class = 4.0
|
||||
canhear_range = 2
|
||||
flags = CONDUCT | NOBLOODY
|
||||
var/circuit = /obj/item/weapon/circuitboard/intercom
|
||||
var/number = 0
|
||||
var/last_tick //used to delay the powercheck
|
||||
var/wiresexposed = 0
|
||||
|
||||
/obj/item/device/radio/intercom/custom
|
||||
name = "station intercom (Custom)"
|
||||
@@ -81,6 +83,41 @@
|
||||
spawn (0)
|
||||
attack_self(user)
|
||||
|
||||
/obj/item/device/radio/intercom/attackby(obj/item/W as obj, mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
if(istype(W, /obj/item/weapon/screwdriver)) // Opening the intercom up.
|
||||
wiresexposed = !wiresexposed
|
||||
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
|
||||
if(wiresexposed)
|
||||
if(!on)
|
||||
icon_state = "intercom-p_open"
|
||||
else
|
||||
icon_state = "intercom_open"
|
||||
else
|
||||
icon_state = "intercom"
|
||||
return
|
||||
if (wiresexposed && istype(W, /obj/item/weapon/wirecutters))
|
||||
user.visible_message("<span class='warning'>[user] has cut the wires inside \the [src]!</span>", "You have cut the wires inside \the [src].")
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
new/obj/item/stack/cable_coil(get_turf(src), 5)
|
||||
var/obj/structure/frame/A = new /obj/structure/frame( src.loc )
|
||||
var/obj/item/weapon/circuitboard/M = new circuit( A )
|
||||
A.frame_type = "intercom"
|
||||
A.pixel_x = pixel_x
|
||||
A.pixel_y = pixel_y
|
||||
A.circuit = M
|
||||
A.set_dir(dir)
|
||||
A.anchored = 1
|
||||
for (var/obj/C in src)
|
||||
C.forceMove(loc)
|
||||
A.state = 2
|
||||
A.icon_state = "intercom_2"
|
||||
M.deconstruct(src)
|
||||
qdel(src)
|
||||
else
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/item/device/radio/intercom/receive_range(freq, level)
|
||||
if (!on)
|
||||
return -1
|
||||
@@ -110,9 +147,15 @@
|
||||
on = A.powered(EQUIP) // set "on" to the power status
|
||||
|
||||
if(!on)
|
||||
icon_state = "intercom-p"
|
||||
if(wiresexposed)
|
||||
icon_state = "intercom-p_open"
|
||||
else
|
||||
icon_state = "intercom-p"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
if(wiresexposed)
|
||||
icon_state = "intercom_open"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/item/device/radio/intercom/locked
|
||||
var/locked_frequency
|
||||
|
||||
Reference in New Issue
Block a user