Merge pull request #10279 from Kearel/LibraryModifications

Library modifications
This commit is contained in:
Chinsky
2015-08-13 17:47:16 +03:00
6 changed files with 52 additions and 5 deletions

View File

@@ -36,6 +36,20 @@
return
else
name = ("bookcase ([newname])")
else if(istype(O,/obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
user << (anchored ? "<span class='notice'>You unfasten \the [src] from the floor.</span>" : "<span class='notice'>You secure \the [src] to the floor.</span>")
anchored = !anchored
else if(istype(O,/obj/item/weapon/screwdriver))
playsound(loc, 'sound/items/Screwdriver.ogg', 75, 1)
user << "<span class='notice'>You begin dismantling \the [src].</span>"
if(do_after(user,25))
user << "<span class='notice'>You dismantle \the [src].</span>"
new /obj/item/stack/material/wood(get_turf(src), amount = 3)
for(var/obj/item/weapon/book/b in contents)
b.loc = (get_turf(src))
qdel(src)
else
..()
@@ -81,6 +95,7 @@
icon_state = "book-5"
/obj/structure/bookcase/manuals/medical
name = "Medical Manuals bookcase"

View File

@@ -122,6 +122,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
density = 1
var/arcanecheckout = 0
var/screenstate = 0 // 0 - Main Menu, 1 - Inventory, 2 - Checked Out, 3 - Check Out a Book
var/sortby = "author"
var/buffer_book
var/buffer_mob
var/upload_category = "Fiction"
@@ -195,9 +196,8 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
else
dat += {"<A href='?src=\ref[src];orderbyid=1'>(Order book by SS<sup>13</sup>BN)</A><BR><BR>
<table>
<tr><td>AUTHOR</td><td>TITLE</td><td>CATEGORY</td><td></td></tr>"}
var/DBQuery/query = dbcon_old.NewQuery("SELECT id, author, title, category FROM library")
<tr><td><A href='?src=\ref[src];sort=author>AUTHOR</A></td><td><A href='?src=\ref[src];sort=title>TITLE</A></td><td><A href='?src=\ref[src];sort=category>CATEGORY</A></td><td></td></tr>"}
var/DBQuery/query = dbcon_old.NewQuery("SELECT id, author, title, category FROM library ORDER BY [sortby]")
query.Execute()
while(query.NextRow())
@@ -236,7 +236,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
//dat += "<A HREF='?src=\ref[user];mach_close=library'>Close</A><br><br>"
user << browse(dat, "window=library")
onclose(user, "library")
/obj/machinery/librarycomp/emag_act(var/remaining_charges, var/mob/user)
if (src.density && !src.emagged)
src.emagged = 1
@@ -389,6 +389,8 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f
if(isnum(orderid))
var/nhref = "src=\ref[src];targetid=[orderid]"
spawn() src.Topic(nhref, params2list(nhref), src)
if(href_list["sort"] in list("author", "title", "category"))
sortby = href_list["sort"]
src.add_fingerprint(usr)
src.updateUsrDialog()
return

View File

@@ -104,6 +104,7 @@
recipes += new/datum/stack_recipe("wooden chair", /obj/structure/bed/chair/wood, 3, time = 10, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("crossbow frame", /obj/item/weapon/crossbowframe, 5, time = 25, one_per_turf = 0, on_floor = 0)
recipes += new/datum/stack_recipe("coffin", /obj/structure/closet/coffin, 5, time = 15, one_per_turf = 1, on_floor = 1)
recipes += new/datum/stack_recipe("book shelf", /obj/structure/bookcase, 5, time = 15, one_per_turf = 1, on_floor = 1)
/material/cardboard/generate_recipes()
..()

View File

@@ -107,6 +107,15 @@
return
/obj/item/weapon/paper/attack_self(mob/living/user as mob)
if(user.a_intent == I_HURT)
if(icon_state == "scrap")
user.show_message("<span class='warning'>\The [src] is already crumpled.</span>")
return
//crumple dat paper
info = stars(info,85)
user.visible_message("\The [user] crumples \the [src] into a ball!")
icon_state = "scrap"
return
user.examinate(src)
if(rigged && (Holiday == "April Fool's Day"))
if(spam_flag == 0)
@@ -442,6 +451,10 @@
B.update_icon()
else if(istype(P, /obj/item/weapon/pen))
if(icon_state == "scrap")
usr << "<span class='warning'>\The [src] is too crumpled to write on.</span>"
return
var/obj/item/weapon/pen/robopen/RP = P
if ( istype(RP) && RP.mode == 2 )
RP.RenamePaper(user,src)

View File

@@ -17,7 +17,17 @@
if((user == usr && (!( usr.restrained() ) && (!( usr.stat ) && (usr.contents.Find(src) || in_range(src, usr))))))
if(!istype(usr, /mob/living/carbon/slime) && !istype(usr, /mob/living/simple_animal))
if( !usr.get_active_hand() ) //if active hand is empty
attack_hand(usr, 1, 1)
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
user << "<span class='notice'>You try to move your [temp.name], but cannot!</span>"
return
user << "<span class='notice'>You pick up the [src].</span>"
user.put_in_hands(src)
return

View File

@@ -0,0 +1,6 @@
author: TheWelp
delete-after: True
changes:
- rscadd: "Bookcases are now movable/buildable/destroyable."
- rscadd: "Paper can now be crumpled by using in-hand while on hurt intent."
- rscadd: "Library Computer External Archive is now sortable."