Constructable Directional Firelocks (#89061)

## About The Pull Request
Gone are the days of these turning into big fulltile firelocks.

![image](https://github.com/user-attachments/assets/85e49c57-0691-41f0-b0ba-e7ce72eea554)


Pretty simple PR conceptually, makes a border_only firelock frame,
constructable with 2 iron (as opposed to the full 3)

![image](https://github.com/user-attachments/assets/1ea866ff-8a6d-4ecb-8bb0-23f0907d0897)

They function just like any other border object, rotatable and so on.
Direction is properly shared between frame and completed firelock.
Firelocks can't ever share a tile (so you can't make a 90 degree angle)
but even if we wanted to remove that limitation it will have to stay
until somebody smarter comes along.

![image](https://github.com/user-attachments/assets/6e410b27-af75-41a7-9e80-1a9a04a7130f)

![image](https://github.com/user-attachments/assets/da4aa515-60a2-42fc-90fd-4ebdc63118d2)

Construction steps are identical to any other firelock, except these can
**not** be reinforced with plasteel.
Deconstruction is the same.

![image](https://github.com/user-attachments/assets/e4539bda-551c-405e-87c7-73d0a0ca4e32)

![image](https://github.com/user-attachments/assets/cafd069e-f52f-424f-9cb7-13d59e06eab7)


Also I discovered that the firelock icons just didn't work correctly
during construction so those are fixed now too

![image](https://github.com/user-attachments/assets/a2d4bec9-a2d8-4137-a3f1-3035fc0388bc)
## Why It's Good For The Game
Crew should be capable of repairing damages caused during a round, and
items like this that had no means of replacement leave a sour taste to
an aspiring engineer.
Plus turning into full tile ones the second they're damaged is really
jarring.
## Changelog
🆑
add: Added Directional Firelock Frames, making the tile-edge firelocks
properly repairable/deconstructable.
fix: fixed firelock construction not properly updating icons
/🆑

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
This commit is contained in:
OrionTheFox
2025-01-26 19:03:04 +00:00
committed by GitHub
co-authored by SyncIt21
parent b2d96e5178
commit 5cd8786154
3 changed files with 58 additions and 6 deletions
+57 -6
View File
@@ -1,5 +1,5 @@
#define CONSTRUCTION_PANEL_OPEN 1 //Maintenance panel is open, still functioning
#define CONSTRUCTION_NO_CIRCUIT 2 //Circuit board removed, can safely weld apart
#define CONSTRUCTION_NO_CIRCUIT 1 //Empty frame, can safely weld apart or install circuit
#define CONSTRUCTION_PANEL_OPEN 2 //Circuit panel exposed for removal or securing
#define DEFAULT_STEP_TIME 20 /// default time for each step
#define REACTIVATION_DELAY (3 SECONDS) // Delay on reactivation, used to prevent dumb crowbar things. Just trust me
@@ -709,6 +709,7 @@
else
unbuilt_lock.constructionStep = CONSTRUCTION_NO_CIRCUIT
unbuilt_lock.update_integrity(unbuilt_lock.max_integrity * 0.5)
unbuilt_lock.setDir(dir)
unbuilt_lock.update_appearance()
else
new /obj/item/electronics/firelock (targetloc)
@@ -728,6 +729,7 @@
can_crush = FALSE
flags_1 = ON_BORDER_1
can_atmos_pass = ATMOS_PASS_PROC
assemblytype = /obj/structure/firelock_frame/border_only
/obj/machinery/door/firedoor/border_only/closed
icon_state = "door_closed"
@@ -810,13 +812,15 @@
density = TRUE
var/constructionStep = CONSTRUCTION_NO_CIRCUIT
var/reinforced = 0
/// Is this a border_only firelock? Used in several checks during construction
var/directional = FALSE
/obj/structure/firelock_frame/examine(mob/user)
. = ..()
switch(constructionStep)
if(CONSTRUCTION_PANEL_OPEN)
. += span_notice("It is <i>unbolted</i> from the floor. The circuit could be removed with a <b>crowbar</b>.")
if(!reinforced)
if(!reinforced && !directional)
. += span_notice("It could be reinforced with plasteel.")
if(CONSTRUCTION_NO_CIRCUIT)
. += span_notice("There are no <i>firelock electronics</i> in the frame. The frame could be <b>welded</b> apart .")
@@ -859,11 +863,18 @@
playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, TRUE)
if(reinforced)
new /obj/machinery/door/firedoor/heavy(get_turf(src))
else if(directional)
var/obj/machinery/door/firedoor/border_only/new_firedoor = new /obj/machinery/door/firedoor/border_only(get_turf(src))
new_firedoor.setDir(dir)
new_firedoor.adjust_lights_starting_offset()
else
new /obj/machinery/door/firedoor(get_turf(src))
qdel(src)
return
if(istype(attacking_object, /obj/item/stack/sheet/plasteel))
if(directional)
to_chat(user, span_warning("[src] can not be reinforced."))
return
var/obj/item/stack/sheet/plasteel/plasteel_sheet = attacking_object
if(reinforced)
to_chat(user, span_warning("[src] is already reinforced."))
@@ -897,6 +908,7 @@
span_notice("You insert and secure [attacking_object]."))
playsound(get_turf(src), 'sound/items/deconstruct.ogg', 50, TRUE)
constructionStep = CONSTRUCTION_PANEL_OPEN
update_appearance()
return
if(attacking_object.tool_behaviour == TOOL_WELDER)
if(!attacking_object.tool_start_check(user, amount=1))
@@ -909,10 +921,10 @@
return
user.visible_message(span_notice("[user] cuts apart [src]!"), \
span_notice("You cut [src] into metal."))
var/turf/tagetloc = get_turf(src)
new /obj/item/stack/sheet/iron(tagetloc, 3)
var/turf/targetloc = get_turf(src)
new /obj/item/stack/sheet/iron(targetloc, directional ? 2 : 3)
if(reinforced)
new /obj/item/stack/sheet/plasteel(tagetloc, 2)
new /obj/item/stack/sheet/plasteel(targetloc, 2)
qdel(src)
return
if(istype(attacking_object, /obj/item/electroadaptive_pseudocircuit))
@@ -949,6 +961,45 @@
name = "heavy firelock frame"
reinforced = TRUE
/obj/structure/firelock_frame/border_only
icon = 'icons/obj/doors/edge_Doorfire.dmi'
flags_1 = ON_BORDER_1
obj_flags = CAN_BE_HIT | IGNORE_DENSITY
directional = TRUE
/obj/structure/firelock_frame/border_only/Initialize(mapload)
. = ..()
AddComponent(/datum/component/simple_rotation, ROTATION_NEEDS_ROOM)
var/static/list/loc_connections = list(
COMSIG_ATOM_EXIT = PROC_REF(on_exit),
)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/structure/firelock_frame/border_only/proc/on_exit(datum/source, atom/movable/leaving, direction)
SIGNAL_HANDLER
if(leaving == src)
return // Let's not block ourselves.
if(!(direction & dir))
return
if (!density)
return
if (leaving.movement_type & (PHASING))
return
if (leaving.move_force >= MOVE_FORCE_EXTREMELY_STRONG)
return
leaving.Bump(src)
return COMPONENT_ATOM_BLOCK_EXIT
/obj/structure/firelock_frame/border_only/CanPass(atom/movable/mover, border_dir)
return border_dir & dir ? ..() : TRUE
#undef CONSTRUCTION_PANEL_OPEN
#undef CONSTRUCTION_NO_CIRCUIT
#undef REACTIVATION_DELAY
@@ -113,6 +113,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
)), \
null, \
new/datum/stack_recipe("firelock frame", /obj/structure/firelock_frame, 3, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_DOORS), \
new/datum/stack_recipe("directional firelock frame", /obj/structure/firelock_frame/border_only, 2, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND | CRAFT_CHECK_DIRECTION, category = CAT_DOORS), \
new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 2.5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_STRUCTURE), \
new/datum/stack_recipe("meatspike frame", /obj/structure/kitchenspike_frame, 5, time = 2.5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_STRUCTURE), \
new/datum/stack_recipe("reflector frame", /obj/structure/reflector, 5, time = 2.5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_STRUCTURE), \
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 22 KiB