Skip to content

Commit

Permalink
Wood Palette Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AmoryBlaine authored and AmoryBlaine committed Mar 28, 2024
1 parent 03aa232 commit ec45cf1
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions code/game/objects/structures/bookcase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,72 @@
else
icon_state = "book-5"

obj/structure/bookcasewood

Check warning on line 69 in code/game/objects/structures/bookcase.dm

View workflow job for this annotation

GitHub Actions / Run Linters

relatively pathed type defined here
name = "bookcase"
icon = 'icons/obj/structures/structures.dmi'
icon_state = "bookwood-0"
anchored = TRUE
density = TRUE
opacity = TRUE
unslashable = TRUE

/obj/structure/bookcasewood/Initialize()
. = ..()
for(var/obj/item/I in loc)
if(istype(I, /obj/item/book))
I.forceMove(src)
update_icon()

/obj/structure/bookcasewood/attackby(obj/O as obj, mob/user as mob)
if(istype(O, /obj/item/book))
user.drop_held_item()
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?")
if(!newname)
return
else
name = ("bookcase ([strip_html(newname)])")
playsound(src, "paper_writing", 15, TRUE)
else
..()

/obj/structure/bookcasewood/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))
return
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hands(choice)
else
choice.forceMove(get_turf(src))
update_icon()

/obj/structure/bookcasewood/ex_act(severity)
switch(severity)
if(0 to EXPLOSION_THRESHOLD_LOW)
if (prob(50))
for(var/obj/item/book/b in contents)
b.forceMove((get_turf(src)))
deconstruct(FALSE)
return
if(EXPLOSION_THRESHOLD_LOW to EXPLOSION_THRESHOLD_MEDIUM)
contents_explosion(severity)
deconstruct(FALSE)
return
if(EXPLOSION_THRESHOLD_MEDIUM to INFINITY)
contents_explosion(severity)
deconstruct(FALSE)
return

/obj/structure/bookcasewood/update_icon()
if(contents.len < 5)
icon_state = "bookwood-[contents.len]"
else
icon_state = "bookwood-5"

/obj/structure/bookcase/manuals/medical
name = "Medical Manuals bookcase"
Expand Down
Binary file modified icons/obj/items/items.dmi
Binary file not shown.
Binary file modified icons/obj/structures/doors/mineral_doors.dmi
Binary file not shown.
Binary file modified icons/obj/structures/props/misc.dmi
Binary file not shown.
Binary file modified icons/obj/structures/structures.dmi
Binary file not shown.
Binary file modified icons/obj/structures/tables.dmi
Binary file not shown.

0 comments on commit ec45cf1

Please sign in to comment.