From 44aa2ba225cdee3372aeb3b7ff00030de56719a2 Mon Sep 17 00:00:00 2001 From: ComicIronic Date: Sun, 19 Apr 2015 14:29:42 -0700 Subject: [PATCH] Code rework of placing things on walls. Stuff goes under types. Types have procs. Never have 500 lines of repeated code again. I came very close to crying while editing this. You should appreciate that. ---- This commit entirely reworks how placing things on walls work- Posters have intentionally been left alone to reduce the amount of lines changed. With this commit, wall-mounted objects are no longer snowflaked into the wall file. --- code/__HELPERS/unsorted.dm | 5 +- code/game/machinery/alarm.dm | 98 +------------------ code/game/machinery/newscaster.dm | 34 +------ code/game/objects/items/apc_frame.dm | 43 -------- .../items/mountable_frames/air_alarm.dm | 16 +++ .../items/mountable_frames/apc_frame.dm | 29 ++++++ .../items/mountable_frames/fire_alarm.dm | 10 ++ .../objects/items/mountable_frames/frames.dm | 25 +++++ .../objects/items/mountable_frames/lights.dm | 39 ++++++++ .../items/mountable_frames/mountables.dm | 34 +++++++ .../mountable_frames/newscaster_frame.dm | 32 ++++++ .../items/stacks/sheets/sheet_types.dm | 10 +- code/game/turfs/simulated/walls.dm | 39 +------- code/game/turfs/simulated/walls_reinforced.dm | 27 +---- .../living/silicon/robot/drone/drone_items.dm | 8 +- code/modules/power/apc.dm | 6 +- code/modules/power/lighting.dm | 58 ----------- .../research/designs/autolathe_designs.dm | 2 +- maps/cyberiad.dmm | 4 +- paradise.dme | 8 +- 20 files changed, 217 insertions(+), 310 deletions(-) delete mode 100644 code/game/objects/items/apc_frame.dm create mode 100644 code/game/objects/items/mountable_frames/air_alarm.dm create mode 100644 code/game/objects/items/mountable_frames/apc_frame.dm create mode 100644 code/game/objects/items/mountable_frames/fire_alarm.dm create mode 100644 code/game/objects/items/mountable_frames/frames.dm create mode 100644 code/game/objects/items/mountable_frames/lights.dm create mode 100644 code/game/objects/items/mountable_frames/mountables.dm create mode 100644 code/game/objects/items/mountable_frames/newscaster_frame.dm diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 9462083757e..43f4808a076 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1511,7 +1511,8 @@ var/list/WALLITEMS = list( "/obj/machinery/newscaster", "/obj/machinery/firealarm", "/obj/structure/noticeboard", "/obj/machinery/door_control", "/obj/machinery/computer/security/telescreen", "/obj/machinery/embedded_controller/radio/simple_vent_controller", "/obj/item/weapon/storage/secure/safe", "/obj/machinery/door_timer", "/obj/machinery/flasher", "/obj/machinery/keycard_auth", - "/obj/structure/mirror", "/obj/structure/closet/fireaxecabinet", "/obj/machinery/computer/security/telescreen/entertainment" + "/obj/structure/mirror", "/obj/structure/closet/fireaxecabinet", "/obj/machinery/computer/security/telescreen/entertainment", + "/obj/structure/sign" ) /proc/gotwallitem(loc, dir) for(var/obj/O in loc) @@ -1541,7 +1542,7 @@ var/list/WALLITEMS = list( for(var/obj/O in get_step(loc, dir)) for(var/item in WALLITEMS) if(istype(O, text2path(item))) - if(O.pixel_x == 0 && O.pixel_y == 0) + if(abs(O.pixel_x) <= 10 && abs(O.pixel_y) <= 10) return 1 return 0 diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 777268f0aef..a41fcc019f9 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -1014,10 +1014,9 @@ else if(istype(W, /obj/item/weapon/wrench)) user << "You remove the fire alarm assembly from the wall!" - var/obj/item/alarm_frame/frame = new /obj/item/alarm_frame() - frame.loc = user.loc + new /obj/item/mounted/frame/alarm_frame(get_turf(user)) playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) - del(src) + qdel(src) return 0 @@ -1049,50 +1048,6 @@ Just a object used in constructing air alarms m_amt = 50 g_amt = 50 - -/* -AIR ALARM ITEM -Handheld air alarm frame, for placing on walls -Code shamelessly copied from apc_frame -*/ -/obj/item/alarm_frame - name = "air alarm frame" - desc = "Used for building Air Alarms" - icon = 'icons/obj/monitors.dmi' - icon_state = "alarm_bitem" - flags = CONDUCT - -/obj/item/alarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params) - if (istype(W, /obj/item/weapon/wrench)) - new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 ) - del(src) - return - ..() - -/obj/item/alarm_frame/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_loc(usr) - var/area/A = loc.loc - if (!istype(loc, /turf/simulated/floor)) - usr << "\red Air Alarm cannot be placed on this spot." - return - if (A.requires_power == 0 || A.name == "Space") - usr << "\red Air Alarm cannot be placed in this area." - return - - if(gotwallitem(loc, ndir)) - usr << "\red There's already an item on this wall!" - return - - new /obj/machinery/alarm(loc, ndir, 1) - del(src) - /* FIRE ALARM */ @@ -1213,8 +1168,7 @@ FIRE ALARM else if(istype(W, /obj/item/weapon/wrench)) user << "You remove the fire alarm assembly from the wall!" - var/obj/item/firealarm_frame/frame = new /obj/item/firealarm_frame() - frame.loc = user.loc + new /obj/item/mounted/frame/firealarm(get_turf(user)) playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) del(src) return @@ -1385,52 +1339,6 @@ Just a object used in constructing fire alarms m_amt = 50 g_amt = 50 - -/* -FIRE ALARM ITEM -Handheld fire alarm frame, for placing on walls -Code shamelessly copied from apc_frame -*/ -/obj/item/firealarm_frame - name = "fire alarm frame" - desc = "Used for building Fire Alarms" - icon = 'icons/obj/monitors.dmi' - icon_state = "fire_bitem" - flags = CONDUCT - -/obj/item/firealarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params) - if (istype(W, /obj/item/weapon/wrench)) - new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 ) - del(src) - return - ..() - -/obj/item/firealarm_frame/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_loc(usr) - var/area/A = loc.loc - if (!istype(loc, /turf/simulated/floor)) - usr << "\red Fire Alarm cannot be placed on this spot." - return - if (A.requires_power == 0 || A.name == "Space") - usr << "\red Fire Alarm cannot be placed in this area." - return - - if(gotwallitem(loc, ndir)) - usr << "\red There's already an item on this wall!" - return - - new /obj/machinery/firealarm(loc, ndir, 1) - - del(src) - - /obj/machinery/partyalarm name = "\improper PARTY BUTTON" desc = "Cuban Pete is in the house!" diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 248908ed824..5ce4008235f 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -40,7 +40,7 @@ src.backup_author = "" src.censored = 0 src.is_admin_channel = 0 - + /datum/feed_channel/proc/announce_news() return "Breaking news from [channel_name]!" @@ -55,36 +55,6 @@ var/datum/feed_network/news_network = new /datum/feed_network //The global n var/list/obj/machinery/newscaster/allCasters = list() //Global list that will contain reference to all newscasters in existence. -/obj/item/newscaster_frame - name = "newscaster frame" - desc = "Used to build newscasters, just secure to the wall." - icon_state = "newscaster" - item_state = "syringe_kit" - m_amt = 14000 - g_amt = 8000 - -/obj/item/newscaster_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) - var/area/A = loc.loc - if (!istype(loc, /turf/simulated/floor)) - usr << "Newscaster cannot be placed on this spot." - return - if (A.requires_power == 0 || A.name == "Space") - usr << "Newscaster cannot be placed in this area." - return - for(var/obj/machinery/newscaster/T in loc) - usr << "There is another newscaster here." - return - var/obj/machinery/newscaster/N = new(loc) - N.pixel_y -= (loc.y - on_wall.y) * 32 - N.pixel_x -= (loc.x - on_wall.x) * 32 - qdel(src) - /obj/machinery/newscaster name = "newscaster" desc = "A standard Nanotrasen-licensed newsfeed handler for use in commercial space stations. All the news you absolutely have no use for, in one place!" @@ -741,7 +711,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co user << "Now [anchored ? "un" : ""]securing [name]" playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 60)) - new /obj/item/newscaster_frame(loc) + new /obj/item/mounted/frame/newscaster_frame(loc) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) qdel(src) return diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm deleted file mode 100644 index 764be72b131..00000000000 --- a/code/game/objects/items/apc_frame.dm +++ /dev/null @@ -1,43 +0,0 @@ -// APC HULL - -/obj/item/apc_frame - name = "APC frame" - desc = "Used for repairing or building APCs" - icon = 'icons/obj/apc_repair.dmi' - icon_state = "apc_frame" - flags = CONDUCT - -/obj/item/apc_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params) - ..() - if (istype(W, /obj/item/weapon/wrench)) - new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 ) - del(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)) - return - var/turf/loc = get_turf(usr) - var/area/A = loc.loc - if (!istype(loc, /turf/simulated/floor)) - usr << "\red APC cannot be placed on this spot." - return - if (A.requires_power == 0 || A.name == "Space") - usr << "\red APC cannot be placed in this area." - return - if (A.get_apc()) - usr << "\red This area already has APC." - return //only one APC per area - for(var/obj/machinery/power/terminal/T in loc) - if (T.master) - usr << "\red There is another network terminal here." - return - else - var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(loc) - C.amount = 10 - usr << "You cut the cables and disassemble the unused power terminal." - del(T) - new /obj/machinery/power/apc(loc, ndir, 1) - del(src) diff --git a/code/game/objects/items/mountable_frames/air_alarm.dm b/code/game/objects/items/mountable_frames/air_alarm.dm new file mode 100644 index 00000000000..28fe58e567e --- /dev/null +++ b/code/game/objects/items/mountable_frames/air_alarm.dm @@ -0,0 +1,16 @@ +/* +AIR ALARM ITEM +Handheld air alarm frame, for placing on walls +Code shamelessly copied from apc_frame +*/ +/obj/item/mounted/frame/alarm_frame + name = "air alarm frame" + desc = "Used for building Air Alarms" + icon = 'icons/obj/monitors.dmi' + icon_state = "alarm_bitem" + m_amt = 2000 + mount_reqs = list("simfloor", "nospace") + +/obj/item/mounted/frame/alarm_frame/do_build(turf/on_wall, mob/user) + new /obj/machinery/alarm(get_turf(src), get_dir(on_wall, user), 1) + qdel(src) \ No newline at end of file diff --git a/code/game/objects/items/mountable_frames/apc_frame.dm b/code/game/objects/items/mountable_frames/apc_frame.dm new file mode 100644 index 00000000000..5e092638707 --- /dev/null +++ b/code/game/objects/items/mountable_frames/apc_frame.dm @@ -0,0 +1,29 @@ +/obj/item/mounted/frame/apc_frame + name = "APC frame" + desc = "Used for repairing or building APCs" + icon = 'icons/obj/apc_repair.dmi' + icon_state = "apc_frame" + mount_reqs = list("simfloor", "nospace") + +/obj/item/mounted/frame/apc_frame/try_build(turf/on_wall, mob/user) + if(..()) + var/turf/turf_loc = get_turf(user) + var/area/area_loc = turf_loc.loc + if (area_loc.get_apc()) + user << "This area already has an APC." + return //only one APC per area + for(var/obj/machinery/power/terminal/T in turf_loc) + if (T.master) + user << "There is another network terminal here." + return + else + var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(turf_loc) + C.amount = 10 + user << "You cut the cables and disassemble the unused power terminal." + qdel(T) + return 1 + return + +/obj/item/mounted/frame/apc_frame/do_build(turf/on_wall, mob/user) + new /obj/machinery/power/apc(get_turf(src), get_dir(user, on_wall), 1) + qdel(src) \ No newline at end of file diff --git a/code/game/objects/items/mountable_frames/fire_alarm.dm b/code/game/objects/items/mountable_frames/fire_alarm.dm new file mode 100644 index 00000000000..ceec9b7c716 --- /dev/null +++ b/code/game/objects/items/mountable_frames/fire_alarm.dm @@ -0,0 +1,10 @@ +/obj/item/mounted/frame/firealarm + name = "fire alarm frame" + desc = "Used for building Fire Alarms" + icon = 'icons/obj/monitors.dmi' + icon_state = "fire_bitem" + mount_reqs = list("simfloor", "nospace") + +/obj/item/mounted/frame/firealarm/do_build(turf/on_wall, mob/user) + new /obj/machinery/firealarm(get_turf(src), get_dir(on_wall, user), 1) + qdel(src) \ No newline at end of file diff --git a/code/game/objects/items/mountable_frames/frames.dm b/code/game/objects/items/mountable_frames/frames.dm new file mode 100644 index 00000000000..f8d097be795 --- /dev/null +++ b/code/game/objects/items/mountable_frames/frames.dm @@ -0,0 +1,25 @@ +/obj/item/mounted/frame + name = "mountable frame" + desc = "Place it on a wall." + var/sheets_refunded = 2 + var/list/mount_reqs = list() //can contain simfloor, nospace. Used in try_build to see if conditions are needed, then met + +/obj/item/mounted/frame/attackby(obj/item/weapon/W, mob/user) + ..() + if (istype(W, /obj/item/weapon/wrench) && sheets_refunded) + //new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded ) + var/obj/item/stack/sheet/metal/M = getFromPool(/obj/item/stack/sheet/metal, get_turf(src)) + M.amount = sheets_refunded + qdel(src) + +/obj/item/mounted/frame/try_build(turf/on_wall, mob/user) + if(..()) //if we pass the parent tests + var/turf/turf_loc = get_turf(user) + + if (src.mount_reqs.Find("simfloor") && !istype(turf_loc, /turf/simulated/floor)) + user << "[src] cannot be placed on this spot." + return + if (src.mount_reqs.Find("nospace") && (areaMaster.requires_power == 0 || areaMaster.name == "Space")) + user << "[src] cannot be placed in this area." + return + return 1 \ No newline at end of file diff --git a/code/game/objects/items/mountable_frames/lights.dm b/code/game/objects/items/mountable_frames/lights.dm new file mode 100644 index 00000000000..cb264794f6b --- /dev/null +++ b/code/game/objects/items/mountable_frames/lights.dm @@ -0,0 +1,39 @@ +/obj/item/mounted/frame/light_fixture + name = "light fixture frame" + desc = "Used for building lights." + icon = 'icons/obj/lighting.dmi' + icon_state = "tube-construct-item" + var/fixture_type = "tube" + mount_reqs = list("simfloor") + +/obj/item/mounted/frame/light_fixture/do_build(turf/on_wall, mob/user) + user << "You begin attaching [src] to \the [on_wall]." + playsound(get_turf(src), 'sound/machines/click.ogg', 75, 1) + var/constrdir = user.dir + var/constrloc = get_turf(user) + if (!do_after(user, 30)) + return + var/obj/machinery/light_construct/newlight + switch(fixture_type) + if("bulb") + newlight = new /obj/machinery/light_construct/small(constrloc) + if("tube") + newlight = new /obj/machinery/light_construct(constrloc) + else + newlight = new /obj/machinery/light_construct/small(constrloc) + newlight.dir = constrdir + newlight.fingerprints = src.fingerprints + newlight.fingerprintshidden = src.fingerprintshidden + newlight.fingerprintslast = src.fingerprintslast + + user.visible_message("[user] attaches \the [src] to \the [on_wall].", \ + "You attach \the [src] to \the [on_wall].") + qdel(src) + +/obj/item/mounted/frame/light_fixture/small + name = "small light fixture frame" + desc = "Used for building small lights." + icon = 'icons/obj/lighting.dmi' + icon_state = "bulb-construct-item" + fixture_type = "bulb" + sheets_refunded = 1 \ No newline at end of file diff --git a/code/game/objects/items/mountable_frames/mountables.dm b/code/game/objects/items/mountable_frames/mountables.dm new file mode 100644 index 00000000000..e280b8e0cc3 --- /dev/null +++ b/code/game/objects/items/mountable_frames/mountables.dm @@ -0,0 +1,34 @@ +/obj/item/mounted + var/list/buildon_types = list(/turf/simulated/wall) + + +/obj/item/mounted/afterattack(var/atom/A, mob/user, proximity_flag) + var/found_type = 0 + for(var/turf_type in src.buildon_types) + if(istype(A, turf_type)) + found_type = 1 + break + + if(found_type) + if(try_build(A, user, proximity_flag)) + return do_build(A, user) + else + ..() + +/obj/item/mounted/proc/try_build(turf/on_wall, mob/user, proximity_flag) //checks + if(!on_wall || !user) + return + if (proximity_flag != 1) //if we aren't next to the wall + return + if (!( get_dir(on_wall,user) in cardinal)) + user << "You need to be standing next to a wall to place \the [src]." + return + + if(gotwallitem(get_turf(user), get_dir(on_wall,user))) + user << "There's already an item on this wall!" + return + + return 1 + +/obj/item/mounted/proc/do_build(turf/on_wall, mob/user) //the buildy bit after we pass the checks + return diff --git a/code/game/objects/items/mountable_frames/newscaster_frame.dm b/code/game/objects/items/mountable_frames/newscaster_frame.dm new file mode 100644 index 00000000000..f853bbadf66 --- /dev/null +++ b/code/game/objects/items/mountable_frames/newscaster_frame.dm @@ -0,0 +1,32 @@ +/obj/item/mounted/frame/newscaster_frame + name = "newscaster frame" + desc = "Used to build newscasters, just secure to the wall." + icon_state = "newscaster" + item_state = "syringe_kit" + m_amt = 14000 + g_amt = 8000 + mount_reqs = list("simfloor", "nospace") + +/obj/item/mounted/frame/newscaster_frame/try_build(turf/on_wall, mob/user) + if(..()) + var/turf/loc = get_turf(usr) + var/area/A = loc.loc + if (!istype(loc, /turf/simulated/floor)) + usr << "Newscaster cannot be placed on this spot." + return + if (A.requires_power == 0 || A.name == "Space") + usr << "Newscaster cannot be placed in this area." + return + + for(var/obj/machinery/newscaster/T in loc) + usr << "There is another newscaster here." + return + + return 1 + return + +/obj/item/mounted/frame/newscaster_frame/do_build(turf/on_wall, mob/user) + var/obj/machinery/newscaster/N = new /obj/machinery/newscaster(get_turf(src), get_dir(on_wall, user), 1) + N.pixel_y -= (loc.y - on_wall.y) * 32 + N.pixel_x -= (loc.x - on_wall.x) * 32 + qdel(src) \ No newline at end of file diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 72aa63abf2e..66dd12bf0b9 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -64,12 +64,12 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ ), 4), \ 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/mounted/frame/light_fixture, 2), \ + new/datum/stack_recipe("small light fixture frame", /obj/item/mounted/frame/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/mounted/frame/apc_frame, 2), \ + new/datum/stack_recipe("air alarm frame", /obj/item/mounted/frame/alarm_frame, 2), \ + new/datum/stack_recipe("fire alarm frame", /obj/item/mounted/frame/firealarm, 2), \ null, \ ) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 8c5b9018c30..6a763055b3b 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -451,46 +451,9 @@ O.show_message("The wall was sliced apart by [user]!", 1, "You hear metal being sliced apart and sparks flying.", 2) return - else if(istype(W,/obj/item/apc_frame)) - var/obj/item/apc_frame/AH = W - AH.try_build(src) + else if(istype(W,/obj/item/mounted)) //if we place it, we don't want to have a silly message return - else if(istype(W,/obj/item/newscaster_frame)) - var/obj/item/newscaster_frame/AH = W - AH.try_build(src) - return 1 - - else if(istype(W,/obj/item/alarm_frame)) - var/obj/item/alarm_frame/AH = W - AH.try_build(src) - return - - else if(istype(W,/obj/item/firealarm_frame)) - var/obj/item/firealarm_frame/AH = W - AH.try_build(src) - return - - else if(istype(W,/obj/item/light_fixture_frame)) - var/obj/item/light_fixture_frame/AH = W - AH.try_build(src) - return - - else if(istype(W,/obj/item/light_fixture_frame/small)) - var/obj/item/light_fixture_frame/small/AH = W - AH.try_build(src) - return -/* - else if(istype(W,/obj/item/rust_fuel_compressor_frame)) - var/obj/item/rust_fuel_compressor_frame/AH = W - AH.try_build(src) - return - - else if(istype(W,/obj/item/rust_fuel_assembly_port_frame)) - var/obj/item/rust_fuel_assembly_port_frame/AH = W - AH.try_build(src) - return -*/ //Poster stuff else if(istype(W,/obj/item/weapon/contraband/poster)) place_poster(W,user) diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index 1ff89a02a3f..2ef06abefae 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -284,32 +284,7 @@ del(MS) //APC - else if( istype(W,/obj/item/apc_frame) ) - var/obj/item/apc_frame/AH = W - AH.try_build(src) - - else if(istype(W,/obj/item/newscaster_frame)) - var/obj/item/newscaster_frame/AH = W - AH.try_build(src) - return 1 - - else if( istype(W,/obj/item/alarm_frame) ) - var/obj/item/alarm_frame/AH = W - AH.try_build(src) - - else if(istype(W,/obj/item/firealarm_frame)) - var/obj/item/firealarm_frame/AH = W - AH.try_build(src) - return - - else if(istype(W,/obj/item/light_fixture_frame)) - var/obj/item/light_fixture_frame/AH = W - AH.try_build(src) - return - - else if(istype(W,/obj/item/light_fixture_frame/small)) - var/obj/item/light_fixture_frame/small/AH = W - AH.try_build(src) + else if(istype(W,/obj/item/mounted)) return //Poster stuff diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index d5d1d17e120..199720a1e0e 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -14,10 +14,10 @@ /obj/item/weapon/airlock_electronics, /obj/item/weapon/module/power_control, /obj/item/weapon/stock_parts, - /obj/item/light_fixture_frame, - /obj/item/apc_frame, - /obj/item/alarm_frame, - /obj/item/firealarm_frame, + /obj/item/mounted/frame/light_fixture, + /obj/item/mounted/frame/apc_frame, + /obj/item/mounted/frame/alarm_frame, + /obj/item/mounted/frame/firealarm, /obj/item/weapon/table_parts, /obj/item/weapon/rack_parts, /obj/item/weapon/camera_assembly, diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 3d66d939f93..48d3a52b0b0 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -525,14 +525,14 @@ "You disassembled the broken APC frame.",\ "\red You hear welding.") else - new /obj/item/apc_frame(loc) + new /obj/item/mounted/frame/apc_frame(loc) user.visible_message(\ "\red [src] has been cut from the wall by [user.name] with the weldingtool.",\ "You cut the APC frame from the wall.",\ "\red You hear welding.") del(src) return - else if (istype(W, /obj/item/apc_frame) && opened && emagged) + else if (istype(W, /obj/item/mounted/frame/apc_frame) && opened && emagged) emagged = 0 if (opened==2) opened = 1 @@ -541,7 +541,7 @@ "You replace the damaged APC frontal panel with a new one.") del(W) update_icon() - else if (istype(W, /obj/item/apc_frame) && opened && ((stat & BROKEN) || malfhack)) + else if (istype(W, /obj/item/mounted/frame/apc_frame) && opened && ((stat & BROKEN) || malfhack)) if (has_electronics) user << "You cannot repair this APC until you remove the electronics still inside." return diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index aa3d951bef8..9d7166614f2 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -9,64 +9,6 @@ #define LIGHT_BROKEN 2 #define LIGHT_BURNED 3 - - -/obj/item/light_fixture_frame - 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 - -/obj/item/light_fixture_frame/attackby(obj/item/weapon/W as obj, mob/living/user as mob, params) - if (istype(W, /obj/item/weapon/wrench)) - new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded ) - del(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_loc(usr) - if (!istype(loc, /turf/simulated/floor)) - usr << "\red [src.name] cannot be placed on this spot." - return - usr << "Attaching [src] to the wall." - playsound(src.loc, 'sound/machines/click.ogg', 75, 1) - var/constrdir = usr.dir - var/constrloc = usr.loc - if (!do_after(usr, 30)) - 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.", \ - "You attach [src] to the wall.") - del(src) - -/obj/item/light_fixture_frame/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 - /obj/machinery/light_construct name = "light fixture frame" desc = "A light fixture under construction." diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm index 50a3ef773b1..2c5c73f5374 100644 --- a/code/modules/research/designs/autolathe_designs.dm +++ b/code/modules/research/designs/autolathe_designs.dm @@ -255,7 +255,7 @@ id = "newscaster_frame" build_type = AUTOLATHE materials = list("$metal" = 14000, "$glass" = 8000) - build_path = /obj/item/newscaster_frame + build_path = /obj/item/mounted/frame/newscaster_frame category = list("initial", "Construction") /datum/design/rcd_ammo diff --git a/maps/cyberiad.dmm b/maps/cyberiad.dmm index c78f4256be3..f43d9fe0fce 100644 --- a/maps/cyberiad.dmm +++ b/maps/cyberiad.dmm @@ -5780,7 +5780,7 @@ "chh" = (/obj/machinery/firealarm{dir = 8; pixel_x = -24},/turf/simulated/floor,/area/engine/controlroom) "chi" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 6},/obj/machinery/vending/eva,/turf/simulated/floor,/area/engine/controlroom) "chj" = (/obj/machinery/atmospherics/unary/vent_pump{dir = 8; on = 1},/obj/structure/table,/obj/machinery/recharger{pixel_y = 0},/turf/simulated/floor,/area/engine/controlroom) -"chk" = (/obj/structure/table,/obj/item/apc_frame,/turf/simulated/floor,/area/engine/controlroom) +"chk" = (/obj/structure/table,/obj/item/mounted/frame/apc_frame,/turf/simulated/floor,/area/engine/controlroom) "chl" = (/obj/structure/table,/obj/item/stack/cable_coil{pixel_x = 3; pixel_y = -7},/obj/item/stack/cable_coil{pixel_x = 3; pixel_y = -7},/turf/simulated/floor,/area/engine/controlroom) "chm" = (/obj/machinery/light_switch{pixel_x = -23; pixel_y = 0},/turf/simulated/floor{icon_state = "dark"},/area/construction) "chn" = (/obj/machinery/atmospherics/pipe/simple/hidden/supply,/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor{icon_state = "dark"},/area/construction) @@ -6191,7 +6191,7 @@ "cpc" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0; tag = ""},/turf/simulated/floor{icon_state = "floorgrime"},/area/assembly/assembly_line) "cpd" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0; tag = ""},/obj/item/weapon/paper,/turf/simulated/floor{icon_state = "floorgrime"},/area/assembly/assembly_line) "cpe" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_x = 0; tag = ""},/turf/simulated/floor/plating,/area/assembly/assembly_line) -"cpf" = (/obj/item/apc_frame,/obj/structure/cable{d2 = 8; icon_state = "0-8"},/turf/simulated/floor/plating,/area/assembly/assembly_line) +"cpf" = (/obj/item/mounted/frame/apc_frame,/obj/structure/cable{d2 = 8; icon_state = "0-8"},/turf/simulated/floor/plating,/area/assembly/assembly_line) "cpg" = (/obj/structure/stool,/turf/simulated/floor{icon_state = "floorgrime"},/area/assembly/assembly_line) "cph" = (/obj/effect/decal/cleanable/blood/oil,/turf/simulated/floor{icon_state = "floorgrime"},/area/assembly/assembly_line) "cpi" = (/obj/machinery/door/firedoor/border_only,/obj/machinery/door/airlock/glass_engineering{icon_state = "door_locked"; locked = 1; name = "Assembly Line (KEEP OUT)"; req_access_txt = "32"; req_one_access_txt = "0"},/turf/simulated/floor{icon_state = "floorgrime"},/area/assembly/assembly_line) diff --git a/paradise.dme b/paradise.dme index 47cb9cbd971..6ad81a0b75f 100644 --- a/paradise.dme +++ b/paradise.dme @@ -559,7 +559,6 @@ #include "code\game\objects\effects\spawners\bombspawner.dm" #include "code\game\objects\effects\spawners\gibspawner.dm" #include "code\game\objects\effects\spawners\vaultspawner.dm" -#include "code\game\objects\items\apc_frame.dm" #include "code\game\objects\items\ashtray.dm" #include "code\game\objects\items\blueprints.dm" #include "code\game\objects\items\bodybag.dm" @@ -610,6 +609,13 @@ #include "code\game\objects\items\devices\radio\headset.dm" #include "code\game\objects\items\devices\radio\intercom.dm" #include "code\game\objects\items\devices\radio\radio.dm" +#include "code\game\objects\items\mountable_frames\air_alarm.dm" +#include "code\game\objects\items\mountable_frames\apc_frame.dm" +#include "code\game\objects\items\mountable_frames\fire_alarm.dm" +#include "code\game\objects\items\mountable_frames\frames.dm" +#include "code\game\objects\items\mountable_frames\lights.dm" +#include "code\game\objects\items\mountable_frames\mountables.dm" +#include "code\game\objects\items\mountable_frames\newscaster_frame.dm" #include "code\game\objects\items\robot\robot_items.dm" #include "code\game\objects\items\robot\robot_parts.dm" #include "code\game\objects\items\robot\robot_upgrades.dm"