Skip to content

Commit

Permalink
Bookcases can now be deconstructed by slashing or wrenching (#6213)
Browse files Browse the repository at this point in the history
# About the pull request
title

# Explain why it's good for the game
no more stupid undestroyable crap blocking your movement

# Testing Photographs and Procedure


https://github.com/cmss13-devs/cmss13/assets/140007537/e5c8f24a-8a4f-4977-a1a4-22954beee519

# Changelog
:cl:
qol: Bookcases can now be wrenched or slashed to be deconstructed
/:cl:

---------

Co-authored-by: Drathek <[email protected]>
  • Loading branch information
iloveloopers and Drulikar committed May 3, 2024
1 parent 6efc072 commit ab6c09d
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions code/game/objects/structures/bookcase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
density = TRUE
opacity = TRUE

/obj/structure/bookcase/deconstruct(disassembled)
new /obj/item/stack/sheet/metal(loc)
return ..()

/obj/structure/bookcase/attack_alien(mob/living/carbon/xenomorph/xeno)
if(xeno.a_intent == INTENT_HARM)
if(unslashable)
return
xeno.animation_attack_on(src)
playsound(loc, 'sound/effects/metalhit.ogg', 25, 1)
xeno.visible_message(SPAN_DANGER("[xeno] slices [src] apart!"),
SPAN_DANGER("We slice [src] apart!"), null, 5, CHAT_TYPE_XENO_COMBAT)
deconstruct(FALSE)
return XENO_ATTACK_ACTION
else
attack_hand(xeno)
return XENO_NONCOMBAT_ACTION

/obj/structure/bookcase/Initialize()
. = ..()
for(var/obj/item/I in loc)
Expand All @@ -20,20 +38,26 @@
O.forceMove(src)
update_icon()
else if(HAS_TRAIT(O, TRAIT_TOOL_PEN))
var/newname = stripped_input(usr, "What would you like to title this bookshelf?")
var/newname = stripped_input(user, "What would you like to title this bookshelf?")
if(!newname)
return
else
name = ("bookcase ([strip_html(newname)])")
playsound(src, "paper_writing", 15, TRUE)
else if(HAS_TRAIT(O, TRAIT_TOOL_WRENCH))
playsound(loc, 'sound/items/Ratchet.ogg', 25, 1)
if(do_after(user, 1 SECONDS, INTERRUPT_MOVED, BUSY_ICON_FRIENDLY, src))
user.visible_message("[user] deconstructs [src].", \
"You deconstruct [src].", "You hear a noise.")
deconstruct(FALSE)
else
..()

/obj/structure/bookcase/attack_hand(mob/user as mob)
if(contents.len)
var/obj/item/book/choice = input("Which book would you like to remove from the shelf?") as null|obj in contents
if(choice)
if(usr.is_mob_incapacitated() || !in_range(loc, usr))
if(user.is_mob_incapacitated() || !in_range(loc, user))
return
if(ishuman(user))
if(!user.get_active_hand())
Expand Down Expand Up @@ -67,7 +91,7 @@


/obj/structure/bookcase/manuals/medical
name = "Medical Manuals bookcase"
name = "medical manuals bookcase"

/obj/structure/bookcase/manuals/medical/Initialize()
. = ..()
Expand All @@ -78,7 +102,7 @@


/obj/structure/bookcase/manuals/engineering
name = "Engineering Manuals bookcase"
name = "engineering manuals bookcase"

/obj/structure/bookcase/manuals/engineering/Initialize()
. = ..()
Expand All @@ -90,7 +114,7 @@
update_icon()

/obj/structure/bookcase/manuals/research_and_development
name = "R&D Manuals bookcase"
name = "\improper R&D manuals bookcase"

/obj/structure/bookcase/manuals/research_and_development/Initialize()
. = ..()
Expand Down

0 comments on commit ab6c09d

Please sign in to comment.