// Function from file: lib_machines.dm public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null) { dynamic scanner = null; if (A is Obj_Item_Weapon_Barcodescanner) { scanner = A; scanner.computer = this; user.WriteMsg("" + scanner + "'s associated machine has been set to " + this + "."); this.audible_message("" + this + " lets out a low, short blip."); } else { base.attackby((object)(A), (object)(user), _params, silent, replace_spent); } return(null); }
// Function from file: lib_machines.dm public override dynamic interact(dynamic user = null, bool?flag1 = null) { string dat = null; Obj_Item_Weapon_Book b = null; Borrowbook b2 = null; double timetaken = 0; dynamic timedue = null; Obj_Machinery_Libraryscanner S = null; Browser popup = null; ((Mob)user).set_machine(this); dat = ""; switch ((int)(this.screenstate)) { case 0: dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=1'>1. View General Inventory</A><BR>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=2'>2. View Checked Out Inventory</A><BR>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=3'>3. Check out a Book</A><BR>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=4'>4. Connect to External Archive</A><BR>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=5'>5. Upload New Title to Archive</A><BR>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=6'>6. Print a Bible</A><BR>").ToString(); if (Lang13.Bool(this.emagged)) { dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=7'>7. Access the Forbidden Lore Vault</A><BR>").ToString(); } if (this.arcanecheckout) { new Obj_Item_Weapon_Tome(this.loc); user.WriteMsg("<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>"); ((Ent_Static)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); this.arcanecheckout = false; } break; case 1: dat += "<H3>Inventory</H3><BR>"; foreach (dynamic _a in Lang13.Enumerate(this.inventory, typeof(Obj_Item_Weapon_Book))) { b = _a; dat += new Txt().item(b.name).str(" <A href='?src=").Ref(this).str(";delbook=").Ref(b).str("'>(Delete)</A><BR>").ToString(); } dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=0'>(Return to main menu)</A><BR>").ToString(); break; case 2: dat += "<h3>Checked Out Books</h3><BR>"; foreach (dynamic _b in Lang13.Enumerate(this.checkouts, typeof(Borrowbook))) { b2 = _b; timetaken = Game13.time - b2.getdate; timetaken /= 600; timetaken = Num13.Floor(timetaken); timedue = b2.duedate - Game13.time; timedue /= 600; if (Convert.ToDouble(timedue) <= 0) { timedue = "<font color=red><b>(OVERDUE)</b> " + timedue + "</font>"; } else { timedue = Num13.Floor(Convert.ToDouble(timedue)); } dat += "\"" + b2.bookname + "\", Checked out to: " + b2.mobname + "<BR>--- Taken: " + timetaken + " minutes ago, Due: in " + timedue + " minutes<BR>"; dat += new Txt("<A href='?src=").Ref(this).str(";checkin=").Ref(b2).str("'>(Check In)</A><BR><BR>").ToString(); } dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=0'>(Return to main menu)</A><BR>").ToString(); break; case 3: dat += "<h3>Check Out a Book</h3><BR>"; dat += "Book: " + this.buffer_book + " "; dat += new Txt("<A href='?src=").Ref(this).str(";editbook=1'>[Edit]</A><BR>").ToString(); dat += "Recipient: " + this.buffer_mob + " "; dat += new Txt("<A href='?src=").Ref(this).str(";editmob=1'>[Edit]</A><BR>").ToString(); dat += "Checkout Date : " + Game13.time / 600 + "<BR>"; dat += "Due Date: " + (Game13.time + this.checkoutperiod) / 600 + "<BR>"; dat += new Txt("(Checkout Period: ").item(this.checkoutperiod).str(" minutes) (<A href='?src=").Ref(this).str(";increasetime=1'>+</A>/<A href='?src=").Ref(this).str(";decreasetime=1'>-</A>)").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";checkout=1'>(Commit Entry)</A><BR>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=0'>(Return to main menu)</A><BR>").ToString(); break; case 4: dat += "<h3>External Archive</h3>"; this.build_library_menu(); if (!(GlobalVars.cachedbooks != null)) { dat += "<font color=red><b>ERROR</b>: Unable to contact External Archive. Please contact your system administrator for assistance.</font>"; } else { dat += new Txt("<A href='?src=").Ref(this).str(";orderbyid=1'>(Order book by SS<sup>13</sup>BN)</A><BR><BR>").ToString(); dat += "<table>"; dat += "<tr><td>AUTHOR</td><td>TITLE</td><td>CATEGORY</td><td></td></tr>"; dat += this.libcomp_menu[Num13.MaxInt(1, Num13.MinInt(((int)(this.page ?? 0)), this.libcomp_menu.len))]; dat += new Txt("<tr><td><A href='?src=").Ref(this).str(";page=").item(Num13.MaxInt(1, ((int)((this.page ?? 0) - 1)))).str("'><<<<</A></td> <td></td> <td></td> <td><span style='text-align:right'><A href='?src=").Ref(this).str(";page=").item(Num13.MinInt(this.libcomp_menu.len, ((int)((this.page ?? 0) + 1)))).str("'>>>>></A></span></td></tr>").ToString(); dat += "</table>"; } dat += new Txt("<BR><A href='?src=").Ref(this).str(";switchscreen=0'>(Return to main menu)</A><BR>").ToString(); break; case 5: dat += "<H3>Upload a New Title</H3>"; if (!(this.scanner != null)) { foreach (dynamic _c in Lang13.Enumerate(Map13.FetchInRange(null, 9), typeof(Obj_Machinery_Libraryscanner))) { S = _c; this.scanner = S; break; } } if (!(this.scanner != null)) { dat += "<FONT color=red>No scanner found within wireless network range.</FONT><BR>"; } else if (!(this.scanner.cache != null)) { dat += "<FONT color=red>No data found in scanner memory.</FONT><BR>"; } else { dat += "<TT>Data marked for upload...</TT><BR>"; dat += "<TT>Title: </TT>" + this.scanner.cache.name + "<BR>"; if (!Lang13.Bool(this.scanner.cache.author)) { this.scanner.cache.author = "Anonymous"; } dat += new Txt("<TT>Author: </TT><A href='?src=").Ref(this).str(";setauthor=1'>").item(this.scanner.cache.author).str("</A><BR>").ToString(); dat += new Txt("<TT>Category: </TT><A href='?src=").Ref(this).str(";setcategory=1'>").item(this.upload_category).str("</A><BR>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";upload=1'>[Upload]</A><BR>").ToString(); } dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=0'>(Return to main menu)</A><BR>").ToString(); break; case 7: dat += "<h3>Accessing Forbidden Lore Vault v 1.3</h3>"; dat += "Are you absolutely sure you want to proceed? EldritchTomes Inc. takes no responsibilities for loss of sanity resulting from this action.<p>"; dat += new Txt("<A href='?src=").Ref(this).str(";arccheckout=1'>Yes.</A><BR>").ToString(); dat += new Txt("<A href='?src=").Ref(this).str(";switchscreen=0'>No.</A><BR>").ToString(); break; } popup = new Browser(user, "library", this.name, 600, 400); popup.set_content(dat); popup.set_title_image(((Mob)user).browse_rsc_icon(this.icon, this.icon_state)); popup.open(); return(null); }