Removes All Weapons

This commit is contained in:
Fox McCloud
2018-04-15 16:25:56 -04:00
parent 8b576c4d42
commit 5c4aa9b3fd
1100 changed files with 17642 additions and 17666 deletions
+12 -12
View File
@@ -47,14 +47,14 @@
dat += "</ol>"
if(src.arcanecheckout)
new /obj/item/weapon/tome(src.loc)
new /obj/item/tome(src.loc)
to_chat(user, "<span class='warning'>Your sanity barely endures the seconds spent in the vault's browsing window. The only thing to remind you of this when you stop browsing is a dusty old tome sitting on the desk. You don't really remember printing it.</span>")
user.visible_message("[user] stares at the blank screen for a few moments, his expression frozen in fear. When he finally awakens from it, he looks a lot older.", 2)
src.arcanecheckout = 0
if(1)
// Inventory
dat += "<h3>Inventory</h3>"
for(var/obj/item/weapon/book/b in inventory)
for(var/obj/item/book/b in inventory)
dat += "[b.name] <A href='?src=[UID()];delbook=\ref[b]'>(Delete)</A><BR>"
dat += "<A href='?src=[UID()];switchscreen=0'>(Return to main menu)</A><BR>"
if(2)
@@ -165,16 +165,16 @@
dat += "<table>"
var/list/forbidden = list(
/obj/item/weapon/book/manual
/obj/item/book/manual
)
if(!emagged)
forbidden |= /obj/item/weapon/book/manual/nuclear
forbidden |= /obj/item/book/manual/nuclear
var/manualcount = 1
var/obj/item/weapon/book/manual/M = null
var/obj/item/book/manual/M = null
for(var/manual_type in (typesof(/obj/item/weapon/book/manual) - forbidden))
for(var/manual_type in (typesof(/obj/item/book/manual) - forbidden))
M = new manual_type()
dat += "<tr><td><A href='?src=[UID()];manual=[manualcount]'>[M.title]</A></td></tr>"
manualcount++
@@ -198,9 +198,9 @@
emagged = 1
to_chat(user, "<span class='notice'>You override the library computer's printing restrictions.</span>")
/obj/machinery/computer/library/checkout/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/barcodescanner))
var/obj/item/weapon/barcodescanner/scanner = W
/obj/machinery/computer/library/checkout/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/barcodescanner))
var/obj/item/barcodescanner/scanner = W
scanner.computer = src
to_chat(user, "[scanner]'s associated machine has been set to [src].")
audible_message("[src] lets out a low, short blip.", 2)
@@ -316,7 +316,7 @@
if("6")
if(!bibledelay)
var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible(src.loc)
var/obj/item/storage/bible/B = new /obj/item/storage/bible(src.loc)
if(ticker && ( ticker.Bible_icon_state && ticker.Bible_item_state) )
B.icon_state = ticker.Bible_icon_state
B.item_state = ticker.Bible_item_state
@@ -359,7 +359,7 @@
var/datum/borrowbook/b = locate(href_list["checkin"])
checkouts.Remove(b)
if(href_list["delbook"])
var/obj/item/weapon/book/b = locate(href_list["delbook"])
var/obj/item/book/b = locate(href_list["delbook"])
inventory.Remove(b)
if(href_list["uploadauthor"])
var/newauthor = copytext(sanitize(input("Enter the author's name: ") as text|null),1,MAX_MESSAGE_LEN)
@@ -451,7 +451,7 @@
/obj/machinery/computer/library/checkout/proc/make_external_book(var/datum/cachedbook/newbook)
if(!newbook || !newbook.id)
return
var/obj/item/weapon/book/B = new newbook.path(loc)
var/obj/item/book/B = new newbook.path(loc)
if(!newbook.programmatic)
B.name = "Book: [newbook.title]"
+25 -25
View File
@@ -22,7 +22,7 @@
burntime = 30
var/health = 50
var/tmp/busy = 0
var/list/allowed_books = list(/obj/item/weapon/book, /obj/item/weapon/spellbook, /obj/item/weapon/storage/bible, /obj/item/weapon/tome) //Things allowed in the bookcase
var/list/allowed_books = list(/obj/item/book, /obj/item/spellbook, /obj/item/storage/bible, /obj/item/tome) //Things allowed in the bookcase
/obj/structure/bookcase/initialize()
..()
@@ -40,15 +40,15 @@
O.forceMove(src)
update_icon()
return 1
else if(istype(O, /obj/item/weapon/storage/bag/books))
var/obj/item/weapon/storage/bag/books/B = O
else if(istype(O, /obj/item/storage/bag/books))
var/obj/item/storage/bag/books/B = O
for(var/obj/item/T in B.contents)
if(istype(T, /obj/item/weapon/book) || istype(T, /obj/item/weapon/spellbook) || istype(T, /obj/item/weapon/tome) || istype(T, /obj/item/weapon/storage/bible))
if(istype(T, /obj/item/book) || istype(T, /obj/item/spellbook) || istype(T, /obj/item/tome) || istype(T, /obj/item/storage/bible))
B.remove_from_storage(T, src)
to_chat(user, "<span class='notice'>You empty [O] into [src].</span>")
update_icon()
return 1
else if(istype(O, /obj/item/weapon/wrench))
else if(istype(O, /obj/item/wrench))
user.visible_message("<span class='warning'>[user] starts disassembling \the [src].</span>", \
"<span class='notice'>You start disassembling \the [src].</span>")
playsound(get_turf(src), O.usesound, 50, 1)
@@ -64,7 +64,7 @@
else
busy = 0
return 1
else if(istype(O, /obj/item/weapon/pen))
else if(istype(O, /obj/item/pen))
var/newname = stripped_input(user, "What would you like to title this [name]?")
if(newname)
name = ("bookcase ([sanitize(newname)])")
@@ -83,7 +83,7 @@
/obj/structure/bookcase/attack_hand(var/mob/user as mob)
if(contents.len)
var/obj/item/weapon/book/choice = input("Which book would you like to remove from [src]?") as null|anything in contents
var/obj/item/book/choice = input("Which book would you like to remove from [src]?") as null|anything in contents
if(choice)
if(user.incapacitated() || user.lying || !Adjacent(user))
return
@@ -132,7 +132,7 @@
New()
..()
new /obj/item/weapon/book/manual/medical_cloning(src)
new /obj/item/book/manual/medical_cloning(src)
update_icon()
@@ -141,12 +141,12 @@
New()
..()
new /obj/item/weapon/book/manual/engineering_construction(src)
new /obj/item/weapon/book/manual/engineering_particle_accelerator(src)
new /obj/item/weapon/book/manual/engineering_hacking(src)
new /obj/item/weapon/book/manual/engineering_guide(src)
new /obj/item/weapon/book/manual/engineering_singularity_safety(src)
new /obj/item/weapon/book/manual/robotics_cyborgs(src)
new /obj/item/book/manual/engineering_construction(src)
new /obj/item/book/manual/engineering_particle_accelerator(src)
new /obj/item/book/manual/engineering_hacking(src)
new /obj/item/book/manual/engineering_guide(src)
new /obj/item/book/manual/engineering_singularity_safety(src)
new /obj/item/book/manual/robotics_cyborgs(src)
update_icon()
/obj/structure/bookcase/manuals/research_and_development
@@ -154,14 +154,14 @@
New()
..()
new /obj/item/weapon/book/manual/research_and_development(src)
new /obj/item/book/manual/research_and_development(src)
update_icon()
/*
* Book
*/
/obj/item/weapon/book
/obj/item/book
name = "book"
icon = 'icons/obj/library.dmi'
icon_state ="book"
@@ -180,7 +180,7 @@
var/forbidden = 0 // Prevent ordering of this book. (0=no, 1=yes, 2=emag only)
var/obj/item/store // What's in the book?
/obj/item/weapon/book/attack_self(var/mob/user as mob)
/obj/item/book/attack_self(var/mob/user as mob)
if(carved)
if(store)
to_chat(user, "<span class='notice'>[store] falls out of [title]!</span>")
@@ -198,7 +198,7 @@
else
to_chat(user, "This book is completely blank!")
/obj/item/weapon/book/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
/obj/item/book/attackby(obj/item/W as obj, mob/user as mob, params)
if(carved)
if(!store)
if(W.w_class < WEIGHT_CLASS_NORMAL)
@@ -213,7 +213,7 @@
else
to_chat(user, "<span class='notice'>There's already something in [title]!</span>")
return 1
if(istype(W, /obj/item/weapon/pen))
if(istype(W, /obj/item/pen))
if(unique)
to_chat(user, "These pages don't seem to take the ink well. Looks like you can't modify it.")
return 1
@@ -242,8 +242,8 @@
else
src.author = newauthor
return 1
else if(istype(W, /obj/item/weapon/barcodescanner))
var/obj/item/weapon/barcodescanner/scanner = W
else if(istype(W, /obj/item/barcodescanner))
var/obj/item/barcodescanner/scanner = W
if(!scanner.computer)
to_chat(user, "[W]'s screen flashes: 'No associated computer found!'")
else
@@ -265,14 +265,14 @@
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. No active check-out record found for current title.'")
if(3)
scanner.book = src
for(var/obj/item/weapon/book in scanner.computer.inventory)
for(var/obj/item/book in scanner.computer.inventory)
if(book == src)
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Title already present in inventory, aborting to avoid duplicate entry.'")
return 1
scanner.computer.inventory.Add(src)
to_chat(user, "[W]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'")
return 1
else if(istype(W, /obj/item/weapon/kitchen/knife) || iswirecutter(W))
else if(istype(W, /obj/item/kitchen/knife) || iswirecutter(W))
if(carved)
return 1
to_chat(user, "<span class='notice'>You begin to carve out [title].</span>")
@@ -287,7 +287,7 @@
/*
* Barcode Scanner
*/
/obj/item/weapon/barcodescanner
/obj/item/barcodescanner
name = "barcode scanner"
icon = 'icons/obj/library.dmi'
icon_state ="scanner"
@@ -295,7 +295,7 @@
throw_range = 5
w_class = WEIGHT_CLASS_TINY
var/obj/machinery/computer/library/checkout/computer // Associated computer - Modes 1 to 3 use this
var/obj/item/weapon/book/book // Currently scanned book
var/obj/item/book/book // Currently scanned book
var/mode = 0 // 0 - Scan only, 1 - Scan and Set Buffer, 2 - Scan and Attempt to Check In, 3 - Scan and Attempt to Add to Inventory
attack_self(mob/user as mob)
+9 -9
View File
@@ -29,7 +29,7 @@ var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "A
var/content
var/programmatic=0 // Is the book programmatically added to the catalog?
var/forbidden=0
var/path = /obj/item/weapon/book // Type path of the book to generate
var/path = /obj/item/book // Type path of the book to generate
var/flagged = 0
/datum/cachedbook/proc/LoadFromRow(var/list/row)
@@ -67,8 +67,8 @@ var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "A
/datum/library_catalog/proc/initialize()
var/newid=1
for(var/typepath in subtypesof(/obj/item/weapon/book/manual))
var/obj/item/weapon/book/B = new typepath(null)
for(var/typepath in subtypesof(/obj/item/book/manual))
var/obj/item/book/B = new typepath(null)
var/datum/cachedbook/CB = new()
CB.forbidden = B.forbidden
CB.title = B.name
@@ -148,10 +148,10 @@ var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "A
icon_state = "bigscanner"
anchored = 1
density = 1
var/obj/item/weapon/book/cache // Last scanned book
var/obj/item/book/cache // Last scanned book
/obj/machinery/libraryscanner/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/book))
if(istype(I, /obj/item/book))
user.drop_item()
I.forceMove(src)
return 1
@@ -183,13 +183,13 @@ var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "A
return
if(href_list["scan"])
for(var/obj/item/weapon/book/B in contents)
for(var/obj/item/book/B in contents)
cache = B
break
if(href_list["clear"])
cache = null
if(href_list["eject"])
for(var/obj/item/weapon/book/B in contents)
for(var/obj/item/book/B in contents)
B.loc = src.loc
src.add_fingerprint(usr)
src.updateUsrDialog()
@@ -207,14 +207,14 @@ var/global/list/library_section_names = list("Any", "Fiction", "Non-Fiction", "A
density = 1
/obj/machinery/bookbinder/attackby(obj/item/I, mob/user)
var/obj/item/weapon/paper/P = I
var/obj/item/paper/P = I
if(istype(P))
user.drop_item()
user.visible_message("[user] loads some paper into [src].", "You load some paper into [src].")
src.visible_message("[src] begins to hum as it warms up its printing drums.")
sleep(rand(200,400))
src.visible_message("[src] whirs as it prints and binds a new book.")
var/obj/item/weapon/book/b = new(loc)
var/obj/item/book/b = new(loc)
b.dat = P.info
b.name = "Print Job #[rand(100, 999)]"
b.icon_state = "book[rand(1,16)]"