From fb3ceb9cfc9e28b07d405090bc29ed0cf33b6713 Mon Sep 17 00:00:00 2001 From: Vile Beggar Date: Wed, 31 Jul 2024 19:41:15 +0200 Subject: [PATCH 1/3] stops structures from being built on dense objects --- code/game/objects/items/frames/table_rack.dm | 5 ++++- code/game/objects/items/stacks/stack.dm | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/frames/table_rack.dm b/code/game/objects/items/frames/table_rack.dm index eda9b9c5749b..b8bc51d9ad08 100644 --- a/code/game/objects/items/frames/table_rack.dm +++ b/code/game/objects/items/frames/table_rack.dm @@ -59,7 +59,10 @@ if(istype(get_area(loc), /area/shuttle)) //HANGAR/SHUTTLE BUILDING to_chat(user, SPAN_WARNING("No. This area is needed for the dropship.")) return - + for(var/obj/object in OT) + if(object.density) + to_chat(user, SPAN_WARNING("[object] is blocking you from constructing the table!")) + return if(!do_after(user, 3 SECONDS, INTERRUPT_ALL, BUSY_ICON_BUILD)) to_chat(user, SPAN_WARNING("Hold still while you're constructing a table!")) return diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 5f72e4a75567..9827e62a938d 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -197,6 +197,12 @@ Also change the icon to reflect the amount of sheets, if possible.*/ to_chat(usr, SPAN_WARNING("The [R.title] cannot be constructed on a tunnel!")) return + if(R.one_per_turf != ONE_TYPE_PER_BORDER) //all barricade-esque structures utilize this define and have their own check for object density. checking twice is unneeded. + for(var/obj/object in usr.loc) + if(object.density) + to_chat(usr, SPAN_WARNING("[object] is blocking you from constructing \the [R.title].")) + return + if((R.flags & RESULT_REQUIRES_SNOW) && !(istype(usr.loc, /turf/open/snow) || istype(usr.loc, /turf/open/auto_turf/snow))) to_chat(usr, SPAN_WARNING("The [R.title] must be built on snow!")) return From 5d81b5cf02fd0def3d95d7c4bb56349d01836a60 Mon Sep 17 00:00:00 2001 From: Vile Beggar Date: Thu, 1 Aug 2024 10:39:44 +0200 Subject: [PATCH 2/3] stop airlock construction on top of dense objects, fixes girders not being destroyed --- code/game/objects/items/stacks/stack.dm | 4 ++-- code/game/objects/structures/airlock_assembly.dm | 5 +++++ code/game/objects/structures/girders.dm | 14 ++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 9827e62a938d..3856aebd7971 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -199,8 +199,8 @@ Also change the icon to reflect the amount of sheets, if possible.*/ if(R.one_per_turf != ONE_TYPE_PER_BORDER) //all barricade-esque structures utilize this define and have their own check for object density. checking twice is unneeded. for(var/obj/object in usr.loc) - if(object.density) - to_chat(usr, SPAN_WARNING("[object] is blocking you from constructing \the [R.title].")) + if(object.density || istype(object, /obj/structure/machinery/door)) + to_chat(usr, SPAN_WARNING("[object] is blocking you from constructing \the [R.title]!")) return if((R.flags & RESULT_REQUIRES_SNOW) && !(istype(usr.loc, /turf/open/snow) || istype(usr.loc, /turf/open/auto_turf/snow))) diff --git a/code/game/objects/structures/airlock_assembly.dm b/code/game/objects/structures/airlock_assembly.dm index d9e55e868016..01fca4a68783 100644 --- a/code/game/objects/structures/airlock_assembly.dm +++ b/code/game/objects/structures/airlock_assembly.dm @@ -111,6 +111,11 @@ qdel(src) return + for(var/obj/object in loc) + if(object.density && object != src) + to_chat(user, SPAN_WARNING("[object] is blocking you from interacting with [src]!")) + return + switch(state) if(STATE_STANDARD) if(HAS_TRAIT(attacking_item, TRAIT_TOOL_WRENCH)) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 01e0e1b717cc..325af12c814b 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -110,6 +110,10 @@ if(!HAS_TRAIT(W, TRAIT_TOOL_BLOWTORCH)) to_chat(user, SPAN_WARNING("You need a stronger blowtorch!")) return + for(var/obj/object in loc) + if(object.density) + to_chat(user, SPAN_WARNING("[object] is blocking you from welding [src] together!")) + return if(do_after(user,30, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD)) if(QDELETED(src)) return @@ -334,7 +338,6 @@ else dmg = floor(P.damage * 0.5) if(dmg) - health -= dmg take_damage(dmg) bullet_ping(P) if(health <= 0) @@ -342,7 +345,9 @@ return TRUE /obj/structure/girder/proc/take_damage(damage) - health = max(health - damage, 0) + health -= damage + if(health <= -100) + qdel(src) if(health <= 0) update_state() @@ -356,10 +361,11 @@ update_state() /obj/structure/girder/proc/update_state() - if (health <= 0) + if(health <= 0 && density) icon_state = "[icon_state]_damaged" density = FALSE - else + + else if(health > 0 && !density) var/underscore_position = findtext(icon_state,"_") var/new_state = copytext(icon_state, 1, underscore_position) icon_state = new_state From dda4d3dd2ece4b666476110cc233f6db368cb83b Mon Sep 17 00:00:00 2001 From: Vile Beggar Date: Thu, 1 Aug 2024 13:48:29 +0200 Subject: [PATCH 3/3] Update code/game/objects/items/frames/table_rack.dm Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/game/objects/items/frames/table_rack.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/frames/table_rack.dm b/code/game/objects/items/frames/table_rack.dm index b8bc51d9ad08..95ab43869774 100644 --- a/code/game/objects/items/frames/table_rack.dm +++ b/code/game/objects/items/frames/table_rack.dm @@ -61,7 +61,7 @@ return for(var/obj/object in OT) if(object.density) - to_chat(user, SPAN_WARNING("[object] is blocking you from constructing the table!")) + to_chat(user, SPAN_WARNING("[object] is blocking you from constructing [src]!")) return if(!do_after(user, 3 SECONDS, INTERRUPT_ALL, BUSY_ICON_BUILD)) to_chat(user, SPAN_WARNING("Hold still while you're constructing a table!"))