diff --git a/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_althland_excavation.dmm b/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_althland_excavation.dmm index 0d1520f434a..0d7ed5db187 100644 --- a/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_althland_excavation.dmm +++ b/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_althland_excavation.dmm @@ -941,7 +941,7 @@ /obj/effect/decal/cleanable/dirt, /obj/effect/decal/cleanable/dirt, /obj/item/reagent_containers/drinks/oilcan, -/obj/machinery/constructable_frame, +/obj/structure/machine_frame, /turf/simulated/floor/pod/light/lavaland_air{ oxygen = 0; nitrogen = 0 diff --git a/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_althland_facility.dmm b/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_althland_facility.dmm index 55c82dbefb0..e766b75b418 100644 --- a/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_althland_facility.dmm +++ b/_maps/map_files/RandomRuins/LavaRuins/lavaland_surface_althland_facility.dmm @@ -554,7 +554,7 @@ /obj/effect/decal/cleanable/dirt, /obj/effect/decal/cleanable/dirt, /obj/effect/decal/cleanable/dirt, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stack/cable_coil, /turf/simulated/floor/plating/lavaland_air, /area/ruin/unpowered/althland_processing) diff --git a/_maps/map_files/RandomRuins/SpaceRuins/abandoned_engi_sat.dmm b/_maps/map_files/RandomRuins/SpaceRuins/abandoned_engi_sat.dmm index 2b52f63894b..b7833525cf8 100644 --- a/_maps/map_files/RandomRuins/SpaceRuins/abandoned_engi_sat.dmm +++ b/_maps/map_files/RandomRuins/SpaceRuins/abandoned_engi_sat.dmm @@ -329,7 +329,7 @@ d2 = 2; icon_state = "0-2" }, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plasteel{ icon_state = "dark" }, @@ -561,7 +561,7 @@ /area/ruin/space/abandoned_engi_sat) "pM" = ( /obj/effect/decal/cleanable/dirt, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plasteel{ icon_state = "dark" }, @@ -1171,7 +1171,7 @@ /turf/simulated/floor/plating, /area/ruin/space/abandoned_engi_sat) "NM" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plasteel{ icon_state = "delivery" }, diff --git a/_maps/map_files/RandomRuins/SpaceRuins/deepstorage.dmm b/_maps/map_files/RandomRuins/SpaceRuins/deepstorage.dmm index 843c105b749..5f3147451b9 100644 --- a/_maps/map_files/RandomRuins/SpaceRuins/deepstorage.dmm +++ b/_maps/map_files/RandomRuins/SpaceRuins/deepstorage.dmm @@ -982,7 +982,7 @@ }, /area/ruin/space/deepstorage) "dR" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/catwalk, /area/ruin/space/deepstorage) "dT" = ( @@ -4475,7 +4475,7 @@ /area/ruin/space/deepstorage) "Br" = ( /obj/effect/decal/cleanable/dirt, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plasteel{ dir = 5; icon_state = "black" @@ -4702,7 +4702,7 @@ dir = 4 }, /obj/effect/decal/cleanable/dirt, -/obj/machinery/constructable_frame, +/obj/structure/machine_frame, /turf/simulated/floor/mineral/titanium, /area/ruin/space/deepstorage) "CD" = ( diff --git a/_maps/map_files/RandomRuins/SpaceRuins/mechtransport.dmm b/_maps/map_files/RandomRuins/SpaceRuins/mechtransport.dmm index fd86d3dc15d..2c74b43e9fb 100644 --- a/_maps/map_files/RandomRuins/SpaceRuins/mechtransport.dmm +++ b/_maps/map_files/RandomRuins/SpaceRuins/mechtransport.dmm @@ -674,7 +674,7 @@ /turf/simulated/floor/plating/airless, /area/ruin/space/mech_transport) "UF" = ( -/obj/machinery/constructable_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plating/airless, /area/ruin/space/mech_transport) "UK" = ( diff --git a/_maps/map_files/RandomRuins/SpaceRuins/syndicatedruglab.dmm b/_maps/map_files/RandomRuins/SpaceRuins/syndicatedruglab.dmm index ee7e03df506..b3614e01e67 100644 --- a/_maps/map_files/RandomRuins/SpaceRuins/syndicatedruglab.dmm +++ b/_maps/map_files/RandomRuins/SpaceRuins/syndicatedruglab.dmm @@ -226,7 +226,7 @@ /turf/simulated/mineral/random/high_chance, /area/ruin/space/syndicate_druglab/asteroid) "yV" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/pod/dark, /area/ruin/space/syndicate_druglab) "AE" = ( @@ -312,7 +312,7 @@ /turf/simulated/floor/pod/dark, /area/ruin/space/syndicate_druglab) "Im" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stock_parts/manipulator/nano, /turf/simulated/floor/pod/dark, /area/ruin/space/syndicate_druglab) diff --git a/_maps/map_files/RandomRuins/SpaceRuins/telecomns_returns.dmm b/_maps/map_files/RandomRuins/SpaceRuins/telecomns_returns.dmm index cbcef47c034..94f6209c037 100644 --- a/_maps/map_files/RandomRuins/SpaceRuins/telecomns_returns.dmm +++ b/_maps/map_files/RandomRuins/SpaceRuins/telecomns_returns.dmm @@ -278,7 +278,7 @@ /turf/space, /area/space/nearstation/no_teleport) "fc" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/bluegrid{ icon_state = "dark"; name = "Mainframe Floor"; diff --git a/_maps/map_files/stations/boxstation.dmm b/_maps/map_files/stations/boxstation.dmm index 30be8d03d68..c4934e1b9c1 100644 --- a/_maps/map_files/stations/boxstation.dmm +++ b/_maps/map_files/stations/boxstation.dmm @@ -41119,7 +41119,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/asmaint) "cIu" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plating, /area/station/maintenance/asmaint) "cIC" = ( @@ -42568,7 +42568,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/aft) "cNZ" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/dirt, /turf/simulated/floor/plasteel, /area/station/maintenance/assembly_line) @@ -54332,7 +54332,7 @@ }, /area/station/security/brig) "eWA" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/dirt, /turf/simulated/floor/plating, /area/station/maintenance/aft) @@ -69705,7 +69705,7 @@ }, /area/station/science/xenobiology) "msm" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/dirt, /obj/machinery/light/small, /turf/simulated/floor/plating, @@ -80148,7 +80148,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/apmaint2) "rnd" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plating, /area/station/maintenance/aft) "rne" = ( @@ -93070,7 +93070,7 @@ }, /area/station/supply/qm) "xRG" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plasteel{ dir = 6; icon_state = "purple" diff --git a/_maps/map_files/stations/cerestation.dmm b/_maps/map_files/stations/cerestation.dmm index 0544f3340c2..42aec929276 100644 --- a/_maps/map_files/stations/cerestation.dmm +++ b/_maps/map_files/stations/cerestation.dmm @@ -40813,7 +40813,7 @@ /turf/simulated/floor/plating/asteroid/ancient, /area/station/maintenance/port2) "gtz" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plasteel{ icon_state = "dark" }, @@ -41968,7 +41968,7 @@ }, /area/station/medical/surgery/secondary) "gLg" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plating{ icon_state = "asteroidplating" }, @@ -64119,7 +64119,7 @@ }, /area/station/turret_protected/ai_upload) "mNd" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plating, /area/station/maintenance/starboard) "mNi" = ( @@ -64701,7 +64701,7 @@ /obj/effect/turf_decal/stripes/line{ dir = 6 }, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plasteel{ icon_state = "dark" }, @@ -71108,7 +71108,7 @@ /turf/simulated/floor/wood, /area/station/service/clown) "oRS" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plating{ icon_state = "asteroidplating" }, @@ -86444,7 +86444,7 @@ }, /area/station/hallway/secondary/entry/west) "tbU" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/machinery/light/small{ dir = 1 }, @@ -104494,7 +104494,7 @@ /area/station/security/prison/cell_block/A) "xWe" = ( /obj/effect/decal/cleanable/dirt, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plating, /area/station/maintenance/apmaint) "xWf" = ( diff --git a/_maps/map_files/stations/deltastation.dmm b/_maps/map_files/stations/deltastation.dmm index 9763b0fd8fc..3cc26d5f92f 100644 --- a/_maps/map_files/stations/deltastation.dmm +++ b/_maps/map_files/stations/deltastation.dmm @@ -53231,7 +53231,7 @@ }, /area/station/maintenance/starboard) "cZj" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/cobweb2, /obj/effect/decal/cleanable/dirt, /obj/effect/turf_decal/stripes/line{ @@ -53311,7 +53311,7 @@ /turf/simulated/wall, /area/station/science/research) "cZw" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/turf_decal/stripes/line{ dir = 5 }, @@ -55154,7 +55154,7 @@ /turf/simulated/floor/plasteel, /area/station/science/research) "dfS" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stack/cable_coil/random, /obj/effect/turf_decal/stripes/line{ dir = 9 @@ -55521,7 +55521,7 @@ /turf/simulated/floor/plasteel, /area/station/maintenance/port) "dhB" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stack/cable_coil/random, /obj/effect/turf_decal/stripes/line{ dir = 6 @@ -56886,7 +56886,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/port2) "dmU" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stack/cable_coil/random, /turf/simulated/floor/plating, /area/station/maintenance/port2) @@ -57975,7 +57975,7 @@ /turf/simulated/floor/plasteel, /area/station/maintenance/starboard) "dsn" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/circuitboard/cyborgrecharger, /turf/simulated/floor/plating, /area/station/maintenance/port2) @@ -58555,7 +58555,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/port2) "duV" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/machinery/light/small, /obj/machinery/alarm/directional/south, /turf/simulated/floor/plating, diff --git a/_maps/map_files/stations/emeraldstation.dmm b/_maps/map_files/stations/emeraldstation.dmm index 33ff7413f60..06651b3812b 100644 --- a/_maps/map_files/stations/emeraldstation.dmm +++ b/_maps/map_files/stations/emeraldstation.dmm @@ -2664,7 +2664,7 @@ }, /area/station/science/xenobiology) "aAM" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/reagent_containers/glass/beaker/large, /obj/item/reagent_containers/glass/beaker, /turf/simulated/floor/plasteel{ @@ -9740,7 +9740,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/fsmaint) "bNO" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/plating, /area/station/maintenance/apmaint2) "bNS" = ( @@ -13832,7 +13832,7 @@ /turf/simulated/wall/r_wall, /area/station/engineering/engine/supermatter) "cCo" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /turf/simulated/floor/wood, /area/station/maintenance/aft2) "cCu" = ( @@ -36646,7 +36646,7 @@ /turf/simulated/floor/plasteel, /area/station/engineering/atmos) "gOI" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/dirt, /turf/simulated/floor/plasteel{ icon_state = "whitebluefull" @@ -37290,7 +37290,7 @@ }, /area/station/maintenance/asmaint) "gVK" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/machinery/conveyor{ dir = 4; id = "Skynet_heavy" @@ -37300,7 +37300,7 @@ /turf/simulated/floor/plasteel, /area/station/maintenance/assembly_line) "gVP" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/dirt, /obj/structure/cable, /turf/simulated/floor/plating, @@ -40510,7 +40510,7 @@ }, /area/station/security/range) "hyE" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/reagent_containers/glass/bucket, /turf/simulated/floor/plating, /area/station/maintenance/abandoned_garden) @@ -48127,7 +48127,7 @@ }, /area/station/hallway/primary/central/west) "iUn" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/dirt, /obj/structure/sign/poster/official/random{ pixel_y = 32 @@ -98957,7 +98957,7 @@ }, /area/station/security/prison) "snE" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/cobweb, /turf/simulated/floor/plating, /area/station/maintenance/security/fore) @@ -102895,7 +102895,7 @@ /area/station/medical/medbay) "sZN" = ( /obj/effect/decal/cleanable/dirt, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stack/cable_coil, /turf/simulated/floor/plating, /area/station/maintenance/starboard) @@ -105143,7 +105143,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/aft) "ttc" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/decal/cleanable/dirt, /turf/simulated/floor/plating, /area/station/maintenance/aft) @@ -115110,7 +115110,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/fpmaint) "vnf" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/reagent_containers/glass/beaker/large, /obj/item/reagent_containers/glass/beaker, /turf/simulated/floor/plasteel{ @@ -116109,7 +116109,7 @@ /turf/simulated/floor/plating, /area/station/maintenance/apmaint) "vwN" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/effect/turf_decal/stripes/line, /turf/simulated/floor/plasteel{ icon_state = "dark" @@ -118524,7 +118524,7 @@ }, /area/station/security/checkpoint/secondary) "vSy" = ( -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stack/cable_coil, /obj/structure/cable, /turf/simulated/floor/plasteel, diff --git a/_maps/map_files/stations/metastation.dmm b/_maps/map_files/stations/metastation.dmm index 7442882ae0f..f73452206aa 100644 --- a/_maps/map_files/stations/metastation.dmm +++ b/_maps/map_files/stations/metastation.dmm @@ -33257,7 +33257,7 @@ /area/station/science/rnd) "cqC" = ( /obj/effect/spawner/random/cobweb/left/rare, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stack/cable_coil/five, /turf/simulated/floor/plating, /area/station/maintenance/starboard2) @@ -51637,7 +51637,7 @@ "gHV" = ( /obj/machinery/atmospherics/pipe/simple/heat_exchanging, /obj/effect/spawner/random/cobweb/left/frequent, -/obj/machinery/constructable_frame/machine_frame, +/obj/structure/machine_frame, /obj/item/stack/cable_coil/five, /turf/simulated/floor/bluegrid, /area/station/maintenance/starboard) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/machine_frame.dm similarity index 90% rename from code/game/machinery/constructable_frame.dm rename to code/game/machinery/machine_frame.dm index 937406689b6..665f6f92429 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/machine_frame.dm @@ -1,26 +1,34 @@ -/// Made into a seperate type to make future revisions easier. -/obj/machinery/constructable_frame +#define MACHINE_FRAME_EMPTY 1 +#define MACHINE_FRAME_WIRED 2 +#define MACHINE_FRAME_CIRCUITBOARD 3 + +/obj/structure/machine_frame name = "machine frame" + desc = "The standard frame for most station machines. Its appearance and function is controlled by the inserted board." icon = 'icons/obj/stock_parts.dmi' icon_state = "box_0" density = TRUE anchored = TRUE - power_state = NO_POWER_USE + + pressure_resistance = 15 max_integrity = 250 + layer = BELOW_OBJ_LAYER + armor = list(MELEE = 25, BULLET = 10, LASER = 10, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 50, ACID = 70) + atom_say_verb = "beeps" + flags_ricochet = RICOCHET_HARD + receive_ricochet_chance_mod = 0.3 + var/obj/item/circuitboard/circuit = null var/list/components = null var/list/req_components = null - var/list/req_component_names = null // user-friendly names of components - var/state = 1 + var/state = MACHINE_FRAME_EMPTY + var/frame_type = "machine" + var/extra_desc - // For pods - var/list/connected_parts = list() - var/pattern_idx=0 - -/obj/machinery/constructable_frame/deconstruct(disassembled = TRUE) +/obj/structure/machine_frame/deconstruct(disassembled = TRUE) if(!(flags & NODECONSTRUCT)) new /obj/item/stack/sheet/metal(loc, 5) - if(state >= 2) + if(state >= MACHINE_FRAME_WIRED) var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil(loc) A.amount = 5 if(circuit) @@ -28,63 +36,73 @@ circuit = null return ..() -/obj/machinery/constructable_frame/obj_break(damage_flag) +/obj/structure/machine_frame/obj_break(damage_flag) deconstruct() -// unfortunately, we have to instance the objects really quickly to get the names -// fortunately, this is only called once when the board is added and the items are immediately GC'd -// and none of the parts do much in their constructors -/obj/machinery/constructable_frame/proc/update_namelist() - if(!req_components) - return - - req_component_names = new() - for(var/tname in req_components) - var/path = tname - var/obj/O = new path() - req_component_names[tname] = O.name - -/obj/machinery/constructable_frame/proc/get_req_components_amt() +/obj/structure/machine_frame/proc/get_req_components_amt() var/amt = 0 for(var/path in req_components) amt += req_components[path] return amt -// update description of required components remaining -/obj/machinery/constructable_frame/proc/update_req_desc() - if(!req_components || !req_component_names) - desc = "Does not require any more components." +/obj/structure/machine_frame/examine(mob/user) + . = ..() + if(extra_desc) + . += "[extra_desc]" + +/obj/structure/machine_frame/update_name(updates) + . = ..() + if(circuit) + name = "[initial(name)] ([circuit.board_name])" + return + name = initial(name) + +/obj/structure/machine_frame/update_desc(updates) + . = ..() + if(!circuit) + extra_desc = null + return + if(!req_components) + extra_desc = "Does not require any more components." return - var/hasContent = 0 - desc = "Requires" - for(var/i = 1 to length(req_components)) - var/tname = req_components[i] - var/amt = req_components[tname] - if(amt == 0) + var/list/needed_components = list() + for(var/obj/component as anything in req_components) + var/amt = req_components[component] + if(amt <= 0) continue - var/use_and = i == length(req_components) - desc += "[(hasContent ? (use_and ? ", and" : ",") : "")] [amt] [amt == 1 ? req_component_names[tname] : "[req_component_names[tname]]\s"]" - hasContent = 1 + needed_components += "[amt] [component.name]\s" - if(!hasContent) - desc = "Does not require any more components." - else - desc += "." + if(!length(needed_components)) + extra_desc = "Does not require any more components." + return + extra_desc = "Requires [english_list(needed_components)]." -/obj/machinery/constructable_frame/machine_frame/attackby(obj/item/P, mob/user, params) +/obj/structure/machine_frame/update_icon_state() + . = ..() switch(state) - if(1) + if(MACHINE_FRAME_EMPTY) + icon_state = "box_0" + if(MACHINE_FRAME_WIRED) + icon_state = "box_1" + if(MACHINE_FRAME_CIRCUITBOARD) + icon_state = "box_2" + else + icon_state = "box_0" + +/obj/structure/machine_frame/attackby(obj/item/P, mob/user, params) + switch(state) + if(MACHINE_FRAME_EMPTY) if(istype(P, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/C = P if(C.get_amount() >= 5) playsound(src.loc, C.usesound, 50, 1) to_chat(user, "You start to add cables to the frame.") if(do_after(user, 20 * C.toolspeed, target = src)) - if(state == 1 && C.get_amount() >= 5 && C.use(5)) + if(state == MACHINE_FRAME_EMPTY && C.get_amount() >= 5 && C.use(5)) to_chat(user, "You add cables to the frame.") - state = 2 - icon_state = "box_1" + state = MACHINE_FRAME_WIRED + update_icon(UPDATE_ICON_STATE) else to_chat(user, "At some point during construction you lost some cable. Make sure you have five lengths before trying again.") return @@ -97,10 +115,12 @@ to_chat(user, "You dismantle the frame.") deconstruct(TRUE) return - if(2) + if(MACHINE_FRAME_WIRED) + // see wirecutter_act() + if(istype(P, /obj/item/circuitboard)) var/obj/item/circuitboard/B = P - if(B.board_type == "machine") + if(B.board_type == frame_type) if(!B.build_path) to_chat(user, "This is not a functional machine board!") return @@ -108,43 +128,17 @@ to_chat(user, "You add the circuit board to the frame.") circuit = P user.drop_item() - P.loc = src - name += " ([B.board_name])" - icon_state = "box_2" - state = 3 + P.forceMove(src) + state = MACHINE_FRAME_CIRCUITBOARD components = list() req_components = circuit.req_components?.Copy() - update_namelist() - update_req_desc() + update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE) else to_chat(user, "This frame does not accept circuit boards of this type!") return - if(istype(P, /obj/item/wirecutters)) - playsound(src.loc, P.usesound, 50, 1) - to_chat(user, "You remove the cables.") - state = 1 - icon_state = "box_0" - var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil(src.loc,5) - A.amount = 5 - return - if(3) - if(P.tool_behaviour == TOOL_CROWBAR) - playsound(src.loc, P.usesound, 50, 1) - state = 2 - circuit.loc = src.loc - circuit = null - if(length(components) == 0) - to_chat(user, "You remove the circuit board.") - else - to_chat(user, "You remove the circuit board and other components.") - for(var/obj/item/I in components) - I.loc = src.loc - name = initial(name) - desc = initial(desc) - req_components = null - components = null - icon_state = "box_1" - return + + if(MACHINE_FRAME_CIRCUITBOARD) + // see crowbar_act() if(istype(P, /obj/item/storage/part_replacer) && length(P.contents) && get_req_components_amt()) var/obj/item/storage/part_replacer/replacer = P @@ -171,7 +165,7 @@ to_chat(user, "[part.name] applied.") replacer.play_rped_sound() - update_req_desc() + update_appearance(UPDATE_DESC) return if(isitem(P)) @@ -189,13 +183,13 @@ S.use(camt) components += NS req_components[I] -= camt - update_req_desc() + update_appearance(UPDATE_DESC) break user.drop_item() P.forceMove(src) components += P req_components[I]-- - update_req_desc() + update_appearance(UPDATE_DESC) return 1 if(!success) to_chat(user, "You cannot add that to the machine!") @@ -204,10 +198,45 @@ if(user.a_intent == INTENT_HARM) return ..() -/obj/machinery/constructable_frame/machine_frame/screwdriver_act(mob/living/user, obj/item/I) - if(state != 3) +/obj/structure/machine_frame/wirecutter_act(mob/living/user, obj/item/I) + if(state != MACHINE_FRAME_WIRED) return + . = TRUE + if(!I.use_tool(src, user, 0, volume = I.tool_volume)) + return + to_chat(user, "You remove the cables.") + state = MACHINE_FRAME_EMPTY + new /obj/item/stack/cable_coil(loc, 5) + update_appearance(UPDATE_ICON_STATE) + +/obj/structure/machine_frame/crowbar_act(mob/living/user, obj/item/I) + if(state != MACHINE_FRAME_CIRCUITBOARD) + return + + . = TRUE + if(!I.use_tool(src, user, 0, volume = I.tool_volume)) + return + state = MACHINE_FRAME_WIRED + circuit.forceMove(loc) + circuit = null + if(length(components) == 0) + to_chat(user, "You remove the circuit board.") + else + to_chat(user, "You remove the circuit board and other components.") + for(var/obj/item/comp in components) + comp.forceMove(loc) + + req_components = null + components = null + update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE) + + +/obj/structure/machine_frame/screwdriver_act(mob/living/user, obj/item/I) + if(state != MACHINE_FRAME_CIRCUITBOARD) + return + . = TRUE + var/component_check = 1 for(var/R in req_components) if(req_components[R] > 0) @@ -222,12 +251,15 @@ qdel(O) new_machine.component_parts = list() for(var/obj/O in src) - O.loc = null + O.forceMove(null) new_machine.component_parts += O - circuit.loc = null + circuit.forceMove(null) new_machine.RefreshParts() qdel(src) - return TRUE + +#undef MACHINE_FRAME_EMPTY +#undef MACHINE_FRAME_WIRED +#undef MACHINE_FRAME_CIRCUITBOARD //Machine Frame Circuit Boards /*Common Parts: Parts List: Ignitor, Timer, Infra-red laser, Infra-red sensor, t_scanner, Capacitor, Valve, sensor unit, diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index da1534bdbb5..b325cf00d0f 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -293,7 +293,7 @@ qdel(src) /obj/machinery/proc/spawn_frame(disassembled) - var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(loc) + var/obj/structure/machine_frame/M = new /obj/structure/machine_frame(loc) . = M M.anchored = anchored if(!disassembled) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 6d001ae87f5..b29eca92e65 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -76,7 +76,7 @@ GLOBAL_LIST_INIT(metal_recipes, list( null, new /datum/stack_recipe("computer frame", /obj/structure/computerframe, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_floor = TRUE), new /datum/stack_recipe("wall girders", /obj/structure/girder, 2, time = 5 SECONDS, one_per_turf = TRUE, on_floor = TRUE), - new /datum/stack_recipe("machine frame", /obj/machinery/constructable_frame/machine_frame, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_floor = TRUE), + new /datum/stack_recipe("machine frame", /obj/structure/machine_frame, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_floor = TRUE), new /datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 2.5 SECONDS, one_per_turf = TRUE, on_floor = TRUE), new /datum/stack_recipe("firelock frame", /obj/structure/firelock_frame, 3, time = 5 SECONDS, one_per_turf = TRUE, on_floor = TRUE), new /datum/stack_recipe("meatspike frame", /obj/structure/kitchenspike_frame, 5, time = 5 SECONDS, one_per_turf = TRUE, on_floor = TRUE), diff --git a/code/modules/power/engines/tesla/energy_ball.dm b/code/modules/power/engines/tesla/energy_ball.dm index 7e526501faf..6bf6a8f3efd 100644 --- a/code/modules/power/engines/tesla/energy_ball.dm +++ b/code/modules/power/engines/tesla/energy_ball.dm @@ -344,7 +344,7 @@ /obj/structure/grille, /obj/structure/cable, /obj/machinery/the_singularitygen/tesla, - /obj/machinery/constructable_frame/machine_frame)) + /obj/structure/machine_frame)) //Ok so we are making an assumption here. We assume that view() still calculates from the center out. //This means that if we find an object we can assume it is the closest one of its type. This is somewhat of a speed increase. diff --git a/paradise.dme b/paradise.dme index 89276328f6e..a6d72a7300a 100644 --- a/paradise.dme +++ b/paradise.dme @@ -834,7 +834,6 @@ #include "code\game\machinery\cell_charger.dm" #include "code\game\machinery\clonepod.dm" #include "code\game\machinery\clonescanner.dm" -#include "code\game\machinery\constructable_frame.dm" #include "code\game\machinery\cryopod.dm" #include "code\game\machinery\dance_machine.dm" #include "code\game\machinery\defib_mount.dm" @@ -852,6 +851,7 @@ #include "code\game\machinery\hologram.dm" #include "code\game\machinery\iv_drip.dm" #include "code\game\machinery\lightswitch.dm" +#include "code\game\machinery\machine_frame.dm" #include "code\game\machinery\machinery.dm" #include "code\game\machinery\magnetic_module.dm" #include "code\game\machinery\mass_driver.dm" diff --git a/tools/UpdatePaths/Scripts/27388_machine_frames.txt b/tools/UpdatePaths/Scripts/27388_machine_frames.txt new file mode 100644 index 00000000000..da7b58489c6 --- /dev/null +++ b/tools/UpdatePaths/Scripts/27388_machine_frames.txt @@ -0,0 +1 @@ +/obj/machinery/constructable_frame/@SUBTYPES : /obj/structure/machine_frame{@OLD}