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
+77 -21
View File
@@ -1,32 +1,78 @@
// APC HULL
/obj/item/wallframe
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT*2)
flags = CONDUCT
origin_tech = "materials=1;engineering=1"
item_state = "syringe_kit"
w_class = 2
var/result_path
var/inverse = 0
// For inverse dir frames like light fixtures.
/obj/item/apc_frame
/obj/item/wallframe/proc/try_build(turf/on_wall)
if(get_dist(on_wall,usr)>1)
return
var/ndir = get_dir(on_wall, usr)
if(!(ndir in cardinal))
return
var/turf/loc = get_turf(usr)
var/area/A = loc.loc
if(!istype(loc, /turf/simulated/floor))
usr << "<span class='warning'>You cannot place [src] on this spot!</span>"
return
if(A.requires_power == 0 || istype(A, /area/space))
usr << "<span class='warning'>You cannot place [src] in this area!</span>"
return
if(gotwallitem(loc, ndir, inverse*2))
usr << "<span class='warning'>There's already an item on this wall!</span>"
return
return 1
/obj/item/wallframe/proc/attach(turf/on_wall)
if(result_path)
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
usr.visible_message("[usr.name] attaches [src] to the wall.",
"<span class='notice'>You attach [src] to the wall.</span>",
"<span class='italics'>You hear clicking.</span>")
var/ndir = get_dir(on_wall,usr)
if(inverse)
ndir = turn(ndir, 180)
var/obj/O = new result_path(get_turf(usr), ndir, 1)
transfer_fingerprints_to(O)
qdel(src)
/obj/item/wallframe/attackby(obj/item/weapon/W, mob/user, params)
..()
var/metal_amt = round(materials[MAT_METAL]/MINERAL_MATERIAL_AMOUNT)
var/glass_amt = round(materials[MAT_GLASS]/MINERAL_MATERIAL_AMOUNT)
if (istype(W, /obj/item/weapon/wrench) && (metal_amt || glass_amt))
user << "<span class='notice'>You dismantle [src].</span>"
if(metal_amt)
new /obj/item/stack/sheet/metal(get_turf(src), metal_amt)
if(glass_amt)
new /obj/item/stack/sheet/glass(get_turf(src), glass_amt)
qdel(src)
// APC HULL
/obj/item/wallframe/apc
name = "\improper APC frame"
desc = "Used for repairing or building APCs"
icon = 'icons/obj/apc_repair.dmi'
icon_state = "apc_frame"
flags = CONDUCT
result_path = /obj/machinery/power/apc
/obj/item/apc_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), 2 )
qdel(src)
/obj/item/apc_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))
/obj/item/wallframe/apc/try_build(turf/on_wall)
if(!..())
return
var/turf/loc = get_turf(usr)
var/area/A = loc.loc
if (!istype(loc, /turf/simulated/floor))
usr << "<span class='warning'>APC cannot be placed on this spot!</span>"
return
if (A.requires_power == 0 || istype(A, /area/space))
usr << "<span class='warning'>APC cannot be placed in this area!</span>"
return
if (A.get_apc())
usr << "<span class='warning'>This area already has APC!</span>"
return //only one APC per area
@@ -39,5 +85,15 @@
C.amount = 10
usr << "<span class='notice'>You cut the cables and disassemble the unused power terminal.</span>"
qdel(T)
new /obj/machinery/power/apc(loc, ndir, 1)
qdel(src)
return 1
/obj/item/weapon/electronics
desc = "Looks like a circuit. Probably is."
icon = 'icons/obj/module.dmi'
icon_state = "door_electronics"
item_state = "electronic"
flags = CONDUCT
w_class = 2
origin_tech = "engineering=2;programming=1"
materials = list(MAT_METAL=50, MAT_GLASS=50)
@@ -33,12 +33,13 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 25, one_per_turf = 1, on_floor = 1), \
null, \
new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade), \
new/datum/stack_recipe("light fixture frame", /obj/item/light_fixture_frame, 2), \
new/datum/stack_recipe("small light fixture frame", /obj/item/light_fixture_frame/small, 1), \
new/datum/stack_recipe("light fixture frame", /obj/item/wallframe/light_fixture, 2), \
new/datum/stack_recipe("small light fixture frame", /obj/item/wallframe/light_fixture/small, 1), \
null, \
new/datum/stack_recipe("apc frame", /obj/item/apc_frame, 2), \
new/datum/stack_recipe("air alarm frame", /obj/item/alarm_frame, 2), \
new/datum/stack_recipe("fire alarm frame", /obj/item/firealarm_frame, 2), \
new/datum/stack_recipe("apc frame", /obj/item/wallframe/apc, 2), \
new/datum/stack_recipe("air alarm frame", /obj/item/wallframe/alarm, 2), \
new/datum/stack_recipe("fire alarm frame", /obj/item/wallframe/firealarm, 2), \
new/datum/stack_recipe("button frame", /obj/item/wallframe/button, 1), \
null, \
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, one_per_turf = 1, on_floor = 1), \
)
+1 -1
View File
@@ -357,7 +357,7 @@ RCD
activate()
var/obj/machinery/door/airlock/T = new airlock_type( A )
T.electronics = new/obj/item/weapon/airlock_electronics( src.loc )
T.electronics = new/obj/item/weapon/electronics/airlock( src.loc )
if(conf_access)
T.electronics.conf_access = conf_access.Copy()
@@ -37,9 +37,9 @@
new /obj/item/weapon/storage/toolbox/electrical(src)
new /obj/item/weapon/storage/toolbox/electrical(src)
new /obj/item/weapon/storage/toolbox/electrical(src)
new /obj/item/weapon/module/power_control(src)
new /obj/item/weapon/module/power_control(src)
new /obj/item/weapon/module/power_control(src)
new /obj/item/weapon/electronics/apc(src)
new /obj/item/weapon/electronics/apc(src)
new /obj/item/weapon/electronics/apc(src)
new /obj/item/device/multitool(src)
new /obj/item/device/multitool(src)
new /obj/item/device/multitool(src)
@@ -11,7 +11,7 @@
var/icontext = ""
var/base_icon_state = "door_as_"
var/glass_base_icon_state = "door_as_g"
var/obj/item/weapon/airlock_electronics/electronics = null
var/obj/item/weapon/electronics/airlock/electronics = null
var/airlock_type = /obj/machinery/door/airlock //the type path of the airlock once completed
var/glass_type = /obj/machinery/door/airlock/glass
var/created_name = null
@@ -506,7 +506,7 @@
src.state = 0
src.name = "secured airlock assembly"
else if(istype(W, /obj/item/weapon/airlock_electronics) && state == 1 )
else if(istype(W, /obj/item/weapon/electronics/airlock) && state == 1 )
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", \
"<span class='notice'>You start to install electronics into the airlock assembly...</span>")
@@ -534,9 +534,9 @@
user << "<span class='notice'>You remove the airlock electronics.</span>"
src.state = 1
src.name = "wired airlock assembly"
var/obj/item/weapon/airlock_electronics/ae
var/obj/item/weapon/electronics/airlock/ae
if (!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
ae = new/obj/item/weapon/electronics/airlock( src.loc )
else
ae = electronics
electronics = null
+6 -25
View File
@@ -176,10 +176,11 @@ var/global/list/crematoriums = new/list()
for(var/mob/living/M in contents)
if (M.stat!=2)
M.emote("scream")
//Logging for this causes runtimes resulting in the cremator locking up. Commenting it out until that's figured out.
//M.attack_log += "\[[time_stamp()]\] Has been cremated by <b>[user]/[user.ckey]</b>" //No point in this when the mob's about to be deleted
user.attack_log +="\[[time_stamp()]\] Cremated <b>[M]/[M.ckey]</b>"
log_attack("\[[time_stamp()]\] <b>[user]/[user.ckey]</b> cremated <b>[M]/[M.ckey]</b>")
if(user)
user.attack_log +="\[[time_stamp()]\] Cremated <b>[M]/[M.ckey]</b>"
log_attack("\[[time_stamp()]\] <b>[user]/[user.ckey]</b> cremated <b>[M]/[M.ckey]</b>")
else
log_attack("\[[time_stamp()]\] <b>UNKNOWN</b> cremated <b>[M]/[M.ckey]</b>")
M.death(1)
M.ghostize()
qdel(M)
@@ -194,26 +195,6 @@ var/global/list/crematoriums = new/list()
update_icon()
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) //you horrible people
/*
Crematorium Switch
*/
/obj/machinery/crema_switch/attack_hand(mob/user)
if(src.allowed(usr))
for (var/obj/structure/bodycontainer/crematorium/C in crematoriums)
if (C.id != id)
continue
C.cremate(user)
else
usr << "<span class='danger'>Access denied.</span>"
return
/obj/machinery/crema_switch/attackby(obj/item/W, mob/user, params)
if(W.GetID())
attack_hand(user)
else
return ..()
/*
* Generic Tray
@@ -286,4 +267,4 @@ Crematorium Switch
if(locate(/obj/structure/table) in get_turf(mover))
return 1
else
return 0
return 0
@@ -19,7 +19,7 @@
dir = NORTH
var/ini_dir
var/obj/item/weapon/airlock_electronics/electronics = null
var/obj/item/weapon/electronics/airlock/electronics = null
var/created_name = null
//Vars to help with the icon's name
@@ -189,7 +189,7 @@
name = "anchored windoor assembly"
//Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/weapon/airlock_electronics))
else if(istype(W, /obj/item/weapon/electronics/airlock))
if(!user.drop_item())
return
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
@@ -219,7 +219,7 @@
return
user << "<span class='notice'>You remove the airlock electronics.</span>"
name = "wired windoor assembly"
var/obj/item/weapon/airlock_electronics/ae
var/obj/item/weapon/electronics/airlock/ae
ae = electronics
electronics = null
ae.loc = loc