Merge pull request #11433 from Core0verload/framed

Buttons and wall frames rework
This commit is contained in:
Cheridan
2015-08-30 13:43:19 -05:00
64 changed files with 1956 additions and 2040 deletions
+4 -2
View File
@@ -52,9 +52,11 @@
//Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
/obj/item/device/assembly/proc/pulsed(radio = 0)
if(holder && (wires & WIRE_RECEIVE))
activate()
spawn(0)
activate()
if(radio && (wires & WIRE_RADIO_RECEIVE))
activate()
spawn(0)
activate()
return 1
+146
View File
@@ -0,0 +1,146 @@
/obj/item/device/assembly/control
name = "blast door controller"
desc = "A small electronic device able to control a blast door remotely."
icon_state = "control"
origin_tech = "magnets=1;programming=2"
attachable = 1
var/id = null
var/can_change_id = 0
/obj/item/device/assembly/control/examine(mob/user)
..()
if(id)
user << "It's channel ID is '[id]'."
/obj/item/device/assembly/control/activate()
cooldown = 1
var/openclose
for(var/obj/machinery/door/poddoor/M in machines)
if(M.id == src.id)
if(openclose == null)
openclose = M.density
spawn(0)
if(M)
if(openclose) M.open()
else M.close()
return
sleep(10)
cooldown = 0
/obj/item/device/assembly/control/airlock
name = "airlock controller"
desc = "A small electronic device able to control an airlock remotely."
id = "badmin" // Set it to null for MEGAFUN.
var/specialfunctions = OPEN
/*
Bitflag, 1= open (OPEN)
2= idscan (IDSCAN)
4= bolts (BOLTS)
8= shock (SHOCK)
16= door safties (SAFE)
*/
/obj/item/device/assembly/control/airlock/activate()
cooldown = 1
for(var/obj/machinery/door/airlock/D in airlocks)
if(D.id_tag == src.id)
if(specialfunctions & OPEN)
spawn(0)
if(D)
if(D.density) D.open()
else D.close()
return
if(specialfunctions & IDSCAN)
D.aiDisabledIdScanner = !D.aiDisabledIdScanner
if(specialfunctions & BOLTS)
if(!D.isWireCut(4) && D.hasPower())
D.locked = !D.locked
D.update_icon()
if(specialfunctions & SHOCK)
D.secondsElectrified = D.secondsElectrified ? 0 : -1
if(specialfunctions & SAFE)
D.safe = !D.safe
sleep(10)
cooldown = 0
/obj/item/device/assembly/control/massdriver
name = "mass driver controller"
desc = "A small electronic device able to control a mass driver."
/obj/item/device/assembly/control/massdriver/activate()
cooldown = 1
for(var/obj/machinery/door/poddoor/M in machines)
if (M.id == src.id)
spawn( 0 )
M.open()
return
sleep(10)
for(var/obj/machinery/mass_driver/M in machines)
if(M.id == src.id)
M.drive()
sleep(60)
for(var/obj/machinery/door/poddoor/M in machines)
if (M.id == src.id)
spawn( 0 )
M.close()
return
sleep(10)
cooldown = 0
/obj/item/device/assembly/control/igniter
name = "ignition controller"
desc = "A remote controller for a mounted igniter."
/obj/item/device/assembly/control/igniter/activate()
cooldown = 1
for(var/obj/machinery/sparker/M in machines)
if (M.id == src.id)
spawn( 0 )
M.ignite()
for(var/obj/machinery/igniter/M in machines)
if(M.id == src.id)
M.use_power(50)
M.on = !M.on
M.icon_state = "igniter[M.on]"
sleep(30)
cooldown = 0
/obj/item/device/assembly/control/flasher
name = "flasher controller"
desc = "A remote controller for a mounted flasher."
/obj/item/device/assembly/control/flasher/activate()
cooldown = 1
for(var/obj/machinery/flasher/M in machines)
if(M.id == src.id)
spawn(0)
M.flash()
sleep(50)
cooldown = 0
/obj/item/device/assembly/control/crematorium
name = "crematorium controller"
desc = "An evil-looking remote controller for a crematorium."
/obj/item/device/assembly/control/crematorium/activate()
cooldown = 1
for (var/obj/structure/bodycontainer/crematorium/C in crematoriums)
if (C.id == id)
C.cremate(usr)
sleep(50)
cooldown = 0
+7 -15
View File
@@ -398,7 +398,7 @@
user.visible_message(\
"[user.name] has removed the power control board from [src.name]!",\
"<span class='notice'>You remove the power control board.</span>")
new /obj/item/weapon/module/power_control(loc)
new /obj/item/weapon/electronics/apc(loc)
else if (opened!=2) //cover isn't removed
opened = 0
update_icon()
@@ -496,7 +496,7 @@
else if (istype(W, /obj/item/weapon/wirecutters) && terminal && opened && has_electronics!=2)
terminal.dismantle(user)
else if (istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics==0 && !((stat & BROKEN) || malfhack))
else if (istype(W, /obj/item/weapon/electronics/apc) && opened && has_electronics==0 && !((stat & BROKEN) || malfhack))
user.visible_message("[user.name] inserts the power control board into [src].", \
"<span class='notice'>You start to insert the power control board into the frame...</span>")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
@@ -505,7 +505,7 @@
has_electronics = 1
user << "<span class='notice'>You place the power control board inside the frame.</span>"
qdel(W)
else if (istype(W, /obj/item/weapon/module/power_control) && opened && has_electronics==0 && ((stat & BROKEN) || malfhack))
else if (istype(W, /obj/item/weapon/electronics/apc) && opened && has_electronics==0 && ((stat & BROKEN) || malfhack))
user << "<span class='warning'>You cannot put the board inside, the frame is damaged!</span>"
return
else if (istype(W, /obj/item/weapon/weldingtool) && opened && has_electronics==0 && !terminal)
@@ -525,13 +525,13 @@
"[user.name] has cut [src] apart with [W].",\
"<span class='notice'>You disassembled the broken APC frame.</span>")
else
new /obj/item/apc_frame(loc)
new /obj/item/wallframe/apc(loc)
user.visible_message(\
"[user.name] has cut [src] from the wall with [W].",\
"<span class='notice'>You cut the APC frame from the wall.</span>")
qdel(src)
return
else if (istype(W, /obj/item/apc_frame) && opened && emagged)
else if (istype(W, /obj/item/wallframe/apc) && opened && emagged)
emagged = 0
if (opened==2)
opened = 1
@@ -540,7 +540,7 @@
"<span class='notice'>You replace the damaged APC frontal panel with a new one.</span>")
qdel(W)
update_icon()
else if (istype(W, /obj/item/apc_frame) && opened && ((stat & BROKEN) || malfhack))
else if (istype(W, /obj/item/wallframe/apc) && opened && ((stat & BROKEN) || malfhack))
if (has_electronics)
user << "<span class='warning'>You cannot repair this APC until you remove the electronics still inside!</span>"
return
@@ -1232,15 +1232,7 @@
#undef APC_UPDATE_ICON_COOLDOWN
/*Power module, used for APC construction*/
/obj/item/weapon/module
icon = 'icons/obj/module.dmi'
icon_state = "std_module"
w_class = 2.0
item_state = "electronic"
flags = CONDUCT
/obj/item/weapon/module/power_control
/obj/item/weapon/electronics/apc
name = "power control module"
icon_state = "power_mod"
desc = "Heavy-duty switching circuits for power control."
+10 -56
View File
@@ -11,61 +11,20 @@
/obj/item/light_fixture_frame
/obj/item/wallframe/light_fixture
name = "light fixture frame"
desc = "Used for building lights."
icon = 'icons/obj/lighting.dmi'
icon_state = "tube-construct-item"
flags = CONDUCT
var/fixture_type = "tube"
var/obj/machinery/light/newlight = null
var/sheets_refunded = 2
result_path = /obj/machinery/light_construct
inverse = 1
/obj/item/light_fixture_frame/attackby(obj/item/weapon/W, mob/user, params)
if (istype(W, /obj/item/weapon/wrench))
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
qdel(src)
return
..()
/obj/item/light_fixture_frame/proc/try_build(turf/on_wall)
if (get_dist(on_wall,usr)>1)
return
var/ndir = get_dir(usr,on_wall)
if (!(ndir in cardinal))
return
var/turf/loc = get_turf(usr)
if (!istype(loc, /turf/simulated/floor))
usr << "<span class='warning'>[src.name] cannot be placed on this spot!</span>"
return
usr << "<span class='notice'>You begin attaching [src] to the wall...</span>"
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
var/constrdir = usr.dir
var/constrloc = usr.loc
if (!do_after(usr, 30, target = src))
return
switch(fixture_type)
if("bulb")
newlight = new /obj/machinery/light_construct/small(constrloc)
if("tube")
newlight = new /obj/machinery/light_construct(constrloc)
newlight.dir = constrdir
newlight.fingerprints = src.fingerprints
newlight.fingerprintshidden = src.fingerprintshidden
newlight.fingerprintslast = src.fingerprintslast
usr.visible_message("[usr.name] attaches [src] to the wall.", \
"<span class='notice'>You attach [src] to the wall.</span>")
qdel(src)
/obj/item/light_fixture_frame/small
/obj/item/wallframe/light_fixture/small
name = "small light fixture frame"
desc = "Used for building small lights."
icon = 'icons/obj/lighting.dmi'
icon_state = "bulb-construct-item"
flags = CONDUCT
fixture_type = "bulb"
sheets_refunded = 1
result_path = /obj/machinery/light_construct/small
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
/obj/machinery/light_construct
name = "light fixture frame"
@@ -79,10 +38,10 @@
var/sheets_refunded = 2
var/obj/machinery/light/newlight = null
/obj/machinery/light_construct/New()
/obj/machinery/light_construct/New(loc, ndir, building)
..()
if (fixture_type == "bulb")
icon_state = "bulb-construct-stage1"
if(building)
dir = ndir
/obj/machinery/light_construct/examine(mob/user)
..()
@@ -172,12 +131,7 @@
/obj/machinery/light_construct/small
name = "small light fixture frame"
desc = "A small light fixture under construction."
icon = 'icons/obj/lighting.dmi'
icon_state = "bulb-construct-stage1"
anchored = 1
layer = 5
stage = 1
fixture_type = "bulb"
sheets_refunded = 1
+2 -2
View File
@@ -255,7 +255,7 @@
return 1
if(!tracker)
if(istype(W, /obj/item/weapon/tracker_electronics))
if(istype(W, /obj/item/weapon/electronics/tracker))
if(!user.drop_item())
return
tracker = 1
@@ -264,7 +264,7 @@
return 1
else
if(istype(W, /obj/item/weapon/crowbar))
new /obj/item/weapon/tracker_electronics(src.loc)
new /obj/item/weapon/electronics/tracker(src.loc)
tracker = 0
user.visible_message("[user] takes out the electronics from the solar assembly.", "<span class='notice'>You take out the electronics from the solar assembly.</span>")
return 1
+2 -6
View File
@@ -76,9 +76,5 @@
// Tracker Electronic
/obj/item/weapon/tracker_electronics
name = "tracker electronics"
icon = 'icons/obj/doors/door_assembly.dmi'
icon_state = "door_electronics"
w_class = 2.0
/obj/item/weapon/electronics/tracker
name = "tracker electronics"
-9
View File
@@ -208,15 +208,6 @@
if(!compressor)
stat |= BROKEN
// THIS MAKES IT WORK!!!!!
// OLD FIX . Dunno how other engines handle this but this is how it should work: Turbine and compressor should be
// treated as walls to avoid conductivity and gas spread. This was the problem of the original turbine which was just
// a machinery - it didn't block the gas passage.
// /obj/machinery/power/turbine/CanPass(atom/movable/mover, turf/target, height=0)
// return !density
/obj/machinery/power/turbine/RefreshParts()
var/P = 0
for(var/obj/item/weapon/stock_parts/capacitor/C in component_parts)
@@ -111,7 +111,7 @@
id = "power control"
build_type = AUTOLATHE
materials = list(MAT_METAL = 100, MAT_GLASS = 100)
build_path = /obj/item/weapon/module/power_control
build_path = /obj/item/weapon/electronics/apc
category = list("initial", "Electronics")
/datum/design/airlock_board
@@ -119,7 +119,7 @@
id = "airlock_board"
build_type = AUTOLATHE
materials = list(MAT_METAL = 50, MAT_GLASS = 50)
build_path = /obj/item/weapon/airlock_electronics
build_path = /obj/item/weapon/electronics/airlock
category = list("initial", "Electronics")
/datum/design/firelock_board
@@ -127,7 +127,7 @@
id = "firelock_board"
build_type = AUTOLATHE
materials = list(MAT_METAL = 50, MAT_GLASS = 50)
build_path = /obj/item/weapon/firelock_board
build_path = /obj/item/weapon/electronics/firelock
category = list("initial", "Electronics")
/datum/design/airalarm_electronics
@@ -135,7 +135,7 @@
id = "airalarm_electronics"
build_type = AUTOLATHE
materials = list(MAT_METAL = 50, MAT_GLASS = 50)
build_path = /obj/item/weapon/airalarm_electronics
build_path = /obj/item/weapon/electronics/airalarm
category = list("initial", "Electronics")
/datum/design/firealarm_electronics
@@ -143,7 +143,7 @@
id = "firealarm_electronics"
build_type = AUTOLATHE
materials = list(MAT_METAL = 50, MAT_GLASS = 50)
build_path = /obj/item/weapon/firealarm_electronics
build_path = /obj/item/weapon/electronics/firealarm
category = list("initial", "Electronics")
/datum/design/pipe_painter
@@ -383,7 +383,7 @@
id = "camera_assembly"
build_type = AUTOLATHE
materials = list(MAT_METAL = 400, MAT_GLASS = 250)
build_path = /obj/item/weapon/camera_assembly
build_path = /obj/item/wallframe/camera
category = list("initial", "Construction")
/datum/design/newscaster_frame
@@ -391,7 +391,7 @@
id = "newscaster_frame"
build_type = AUTOLATHE
materials = list(MAT_METAL = 14000, MAT_GLASS = 8000)
build_path = /obj/item/newscaster_frame
build_path = /obj/item/wallframe/newscaster
category = list("initial", "Construction")
/datum/design/syringe