Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stops structures from being built on dense objects #6837

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/game/objects/items/frames/table_rack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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!"))
VileBeggar marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/items/stacks/stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 || 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)))
to_chat(usr, SPAN_WARNING("The [R.title] must be built on snow!"))
return
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/structures/airlock_assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 10 additions & 4 deletions code/game/objects/structures/girders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -334,15 +338,16 @@
else
dmg = floor(P.damage * 0.5)
if(dmg)
health -= dmg
take_damage(dmg)
bullet_ping(P)
if(health <= 0)
update_state()
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()

Expand All @@ -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
Expand Down
Loading