Ejemplo n.º 1
0
        // Function from file: xmas.dm
        public override bool attack(dynamic M = null, dynamic user = null, bool?def_zone = null)
        {
            Obj_Item_Weapon_Paper           Joke       = null;
            Obj_Item_Weapon_Toy_XmasCracker other_half = null;


            if (!this.cracked && M is Mob_Living_Carbon_Human && Lang13.Bool(M.stat) == false && !Lang13.Bool(((Mob)M).get_active_hand()))
            {
                ((Ent_Static)M).visible_message(new Txt().item(user).str(" and ").item(M).str(" pop ").a(this).item().str("! *pop*").ToString(), new Txt("<span class='notice'>You pull ").a(this).item().str(" with ").item(M).str("! *pop*</span>").ToString(), "<span class='italics'>You hear a pop.</span>");
                Joke      = new Obj_Item_Weapon_Paper(user.loc);
                Joke.name = "" + Rand13.Pick(new object [] { "awful", "terrible", "unfunny" }) + " joke";
                Joke.info = Rand13.Pick(new object [] { "What did one snowman say to the other?\n\n<i>'Is it me or can you smell carrots?'</i>", "Why couldn't the snowman get laid?\n\n<i>He was frigid!</i>", "Where are santa's helpers educated?\n\n<i>Nowhere, they're ELF-taught.</i>", "What happened to the man who stole advent calanders?\n\n<i>He got 25 days.</i>", "What does Santa get when he gets stuck in a chimney?\n\n<i>Claus-trophobia.</i>", "Where do you find chili beans?\n\n<i>The north pole.</i>", "What do you get from eating tree decorations?\n\n<i>Tinsilitis!</i>", "What do snowmen wear on their heads?\n\n<i>Ice caps!</i>", "Why is Christmas just like life on ss13?\n\n<i>You do all the work and the fat guy gets all the credit.</i>", "Why doesn’t Santa have any children?\n\n<i>Because he only comes down the chimney.</i>" });
                new Obj_Item_Clothing_Head_Festive(M.loc);
                user.update_icons();
                this.cracked          = true;
                this.icon_state       = "cracker1";
                other_half            = new Obj_Item_Weapon_Toy_XmasCracker(M);
                other_half.cracked    = true;
                other_half.icon_state = "cracker2";
                ((Mob)M).put_in_active_hand(other_half);
                GlobalFuncs.playsound(user, "sound/effects/snap.ogg", 50, 1);
                return(true);
            }
            return(base.attack((object)(M), (object)(user), def_zone));
        }
Ejemplo n.º 2
0
        // Function from file: scanner.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            Obj_Item_Weapon_Paper P = null;
            Ent_Static            M = null;


            if (this.log.len != 0 && !this.scanning)
            {
                this.scanning = true;
                user.WriteMsg("<span class='notice'>Printing report, please wait...</span>");
                Task13.Schedule(100, (Task13.Closure)(() => {
                    P            = new Obj_Item_Weapon_Paper(GlobalFuncs.get_turf(this));
                    P.name       = "paper- 'Scanner Report'";
                    P.info       = "<center><font size='6'><B>Scanner Report</B></font></center><HR><BR>";
                    P.info      += GlobalFuncs.jointext(this.log, "<BR>");
                    P.info      += "<HR><B>Notes:</B><BR>";
                    P.info_links = P.info;

                    if (this.loc is Mob)
                    {
                        M = this.loc;
                        ((dynamic)M).put_in_hands(P);
                        ((dynamic)M).WriteMsg("<span class='notice'>Report printed. Log cleared.<span>");
                    }
                    this.log      = new ByTable();
                    this.scanning = false;
                    return;
                }));
            }
            else
            {
                user.WriteMsg("<span class='notice'>The scanner has no logs or is in use.</span>");
            }
            return(null);
        }
        // Function from file: random_books.dm
        public override void initialize(  )
        {
            Obj_Item_Weapon_Paper P = null;
            string  c              = null;
            DBQuery query          = null;
            Obj_Item_Weapon_Book B = null;


            if (!(this.book_count != 0) || !Lang13.Bool(Lang13.IsNumber(this.book_count)))
            {
                this.update_icon();
                return;
            }

            if (!GlobalFuncs.establish_db_connection())
            {
                if (Rand13.PercentChance(5))
                {
                    P      = new Obj_Item_Weapon_Paper(GlobalFuncs.get_turf(this.loc));
                    P.info = "There once was a book from Nantucket<br>But the database failed us, so f*$! it.<br>I tried to be good to you<br>Now this is an I.O.U<br>If you're feeling entitled, well, stuff it!<br><br><font color='gray'>~</font>";
                }
                this.update_icon();
                return;
            }

            if (Lang13.Bool(this.category) && Rand13.PercentChance(25))
            {
                this.category = null;
            }
            this.book_count += Convert.ToDouble(Rand13.Pick(new object [] { -1, -1, 0, 1, 1 }));

            if (this.book_count <= 0)
            {
                this.update_icon();
                return;
            }
            c     = (Lang13.Bool(this.category) ? " AND category='" + GlobalFuncs.sanitizeSQL(this.category) + "'" : "");
            query = GlobalVars.dbcon.NewQuery("SELECT * FROM " + GlobalFuncs.format_table_name("library") + " WHERE isnull(deleted)" + c + " GROUP BY title ORDER BY rand() LIMIT " + this.book_count + ";");

            if (query.Execute())
            {
                while (query.NextRow())
                {
                    B            = new Obj_Item_Weapon_Book(this);
                    B.author     = query.item[2];
                    B.title      = query.item[3];
                    B.dat        = query.item[4];
                    B.name       = "Book: " + B.title;
                    B.icon_state = "book" + Rand13.Int(1, 8);
                }
            }
            else
            {
                GlobalFuncs.log_game("SQL ERROR populating library bookshelf.  Category: [" + this.category + "], Count: " + this.book_count + ", Error: [" + query.ErrorMsg() + "]\n");
            }
            this.update_icon();
            return;
        }
Ejemplo n.º 4
0
        public void print_transcript(  )
        {
            Obj_Item_Weapon_Paper P = null;
            string t1 = null;
            int?   i  = null;


            if (!this.can_use(Task13.User))
            {
                return;
            }

            if (!Lang13.Bool(this.mytape))
            {
                return;
            }

            if (!this.canprint)
            {
                Task13.User.WriteMsg("<span class='notice'>The recorder can't print that fast!</span>");
                return;
            }

            if (this.recording || this.playing)
            {
                return;
            }
            Task13.User.WriteMsg("<span class='notice'>Transcript printed.</span>");
            P  = new Obj_Item_Weapon_Paper(GlobalFuncs.get_turf(this));
            t1 = "<B>Transcript:</B><BR><BR>";
            i  = null;
            i  = 1;

            while (this.mytape.storedinfo.len >= (i ?? 0))
            {
                t1 += "" + this.mytape.storedinfo[i] + "<BR>";
                i++;
            }
            P.info = t1;
            P.name = "paper- 'Transcript'";
            Task13.User.put_in_hands(P);
            this.canprint = false;
            Task13.Sleep(300);
            this.canprint = true;
            return;
        }
Ejemplo n.º 5
0
        // Function from file: noticeboard.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            string dat = null;
            Obj_Item_Weapon_Paper P = null;

            dat = "<B>Noticeboard</B><BR>";

            foreach (dynamic _a in Lang13.Enumerate(this, typeof(Obj_Item_Weapon_Paper)))
            {
                P = _a;

                dat += new Txt("<A href='?src=").Ref(this).str(";read=").Ref(P).str("'>").item(P.name).str("</A> <A href='?src=").Ref(this).str(";write=").Ref(P).str("'>Write</A> <A href='?src=").Ref(this).str(";remove=").Ref(P).str("'>Remove</A><BR>").ToString();
            }
            Interface13.Browse(a, "<HEAD><TITLE>Notices</TITLE></HEAD>" + dat, "window=noticeboard");
            GlobalFuncs.onclose(a, "noticeboard");
            return(null);
        }
Ejemplo n.º 6
0
        // Function from file: order.dm
        public Obj_Item_Weapon_Paper generateRequisition(dynamic T = null)
        {
            Obj_Item_Weapon_Paper P = null;

            P       = new Obj_Item_Weapon_Paper(T);
            P.name  = "requisition form - #" + this.id + " (" + this.pack.name + ")";
            P.info += "<h2>" + GlobalFuncs.station_name() + " Supply Requisition</h2>";
            P.info += "<hr/>";
            P.info += "Order #" + this.id + "<br/>";
            P.info += "Item: " + this.pack.name + "<br/>";
            P.info += "Access Restrictions: " + GlobalFuncs.get_access_desc(this.pack.access) + "<br/>";
            P.info += "Requested by: " + this.orderer + "<br/>";
            P.info += "Rank: " + this.orderer_rank + "<br/>";
            P.info += "Comment: " + this.reason + "<br/>";
            P.update_icon();
            return(P);
        }
Ejemplo n.º 7
0
        // Function from file: paperbin.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            Obj_Item_Weapon_Paper P = null;


            if (Lang13.Bool(a.lying))
            {
                return(null);
            }
            ((Mob)a).changeNext_move(8);

            if (this.amount >= 1)
            {
                this.amount--;
                this.update_icon();

                if (this.papers.len > 0)
                {
                    P = this.papers[this.papers.len];
                    this.papers.Remove(P);
                }
                else
                {
                    P = new Obj_Item_Weapon_Paper();

                    if (Lang13.Bool(GlobalVars.SSevent.holidays) && Lang13.Bool(GlobalVars.SSevent.holidays["April Fool's Day"]))
                    {
                        if (Rand13.PercentChance(30))
                        {
                            P.info   = "<font face=\"" + "Comic Sans MS" + "\" color=\"red\"><b>HONK HONK HONK HONK HONK HONK HONK<br>HOOOOOOOOOOOOOOOOOOOOOONK<br>APRIL FOOLS</b></font>";
                            P.rigged = true;
                            P.updateinfolinks();
                        }
                    }
                }
                P.loc = a.loc;
                ((Mob)a).put_in_hands(P);
                a.WriteMsg(new Txt("<span class='notice'>You take ").item(P).str(" out of ").the(this).item().str(".</span>").ToString());
            }
            else
            {
                a.WriteMsg("<span class='warning'>" + this + " is empty!</span>");
            }
            this.add_fingerprint(a);
            return(null);
        }
Ejemplo n.º 8
0
        // Function from file: tgstation.dme
        public void manifest(  )
        {
            string dat = null;
            Mob_Living_Carbon_Human M = null;
            Obj_Item_Weapon_Paper   P = null;

            dat = "<B>Crew Manifest</B>:<BR>";

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_Carbon_Human)))
            {
                M = _a;

                dat += "    <B>" + M.name + "</B> -  " + M.get_assignment() + "<BR>";
            }
            P      = new Obj_Item_Weapon_Paper(this.loc);
            P.info = dat;
            P.name = "paper- 'Crew Manifest'";
            GlobalFuncs.qdel(this);
            return;
        }
        // Function from file: filingcabinet.dm
        public void populate(  )
        {
            Data_Record           G = null;
            Data_Record           M = null;
            Obj_Item_Weapon_Paper P = null;
            int counter             = 0;


            if (this.virgin)
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.data_core.general, typeof(Data_Record)))
                {
                    G = _a;

                    M = GlobalFuncs.find_record("name", G.fields["name"], GlobalVars.data_core.medical);

                    if (!(M != null))
                    {
                        continue;
                    }
                    P       = new Obj_Item_Weapon_Paper(this);
                    P.info  = "<CENTER><B>Medical Record</B></CENTER><BR>";
                    P.info += "Name: " + G.fields["name"] + " ID: " + G.fields["id"] + "<BR>\nSex: " + G.fields["sex"] + "<BR>\nAge: " + G.fields["age"] + "<BR>\nFingerprint: " + G.fields["fingerprint"] + "<BR>\nPhysical Status: " + G.fields["p_stat"] + "<BR>\nMental Status: " + G.fields["m_stat"] + "<BR>";
                    P.info += "<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: " + M.fields["blood_type"] + "<BR>\nDNA: " + M.fields["b_dna"] + "<BR>\n<BR>\nMinor Disabilities: " + M.fields["mi_dis"] + "<BR>\nDetails: " + M.fields["mi_dis_d"] + "<BR>\n<BR>\nMajor Disabilities: " + M.fields["ma_dis"] + "<BR>\nDetails: " + M.fields["ma_dis_d"] + "<BR>\n<BR>\nAllergies: " + M.fields["alg"] + "<BR>\nDetails: " + M.fields["alg_d"] + "<BR>\n<BR>\nCurrent Diseases: " + M.fields["cdi"] + " (per disease info placed in log/comment section)<BR>\nDetails: " + M.fields["cdi_d"] + "<BR>\n<BR>\nImportant Notes:<BR>\n	"+ M.fields["notes"] + "<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>";
                    counter = 1;

                    while (Lang13.Bool(M.fields["com_" + counter]))
                    {
                        P.info += "" + M.fields["com_" + counter] + "<BR>";
                        counter++;
                    }
                    P.info     += "</TT>";
                    P.name      = "paper - '" + G.fields["name"] + "'";
                    this.virgin = false;
                }
            }
            return;
        }
Ejemplo n.º 10
0
        // Function from file: filingcabinet.dm
        public void populate(  )
        {
            Data_Record           G = null;
            Data_Record           S = null;
            Obj_Item_Weapon_Paper P = null;
            int counter             = 0;


            if (this.virgin)
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.data_core.general, typeof(Data_Record)))
                {
                    G = _a;

                    S = GlobalFuncs.find_record("name", G.fields["name"], GlobalVars.data_core.security);

                    if (!(S != null))
                    {
                        continue;
                    }
                    P       = new Obj_Item_Weapon_Paper(this);
                    P.info  = "<CENTER><B>Security Record</B></CENTER><BR>";
                    P.info += "Name: " + G.fields["name"] + " ID: " + G.fields["id"] + "<BR>\nSex: " + G.fields["sex"] + "<BR>\nAge: " + G.fields["age"] + "<BR>\nFingerprint: " + G.fields["fingerprint"] + "<BR>\nPhysical Status: " + G.fields["p_stat"] + "<BR>\nMental Status: " + G.fields["m_stat"] + "<BR>";
                    P.info += "<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: " + S.fields["criminal"] + "<BR>\n<BR>\nMinor Crimes: " + S.fields["mi_crim"] + "<BR>\nDetails: " + S.fields["mi_crim_d"] + "<BR>\n<BR>\nMajor Crimes: " + S.fields["ma_crim"] + "<BR>\nDetails: " + S.fields["ma_crim_d"] + "<BR>\n<BR>\nImportant Notes:<BR>\n	"+ S.fields["notes"] + "<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>";
                    counter = 1;

                    while (Lang13.Bool(S.fields["com_" + counter]))
                    {
                        P.info += "" + S.fields["com_" + counter] + "<BR>";
                        counter++;
                    }
                    P.info     += "</TT>";
                    P.name      = "paper - '" + G.fields["name"] + "'";
                    this.virgin = false;
                }
            }
            return;
        }
Ejemplo n.º 11
0
        // Function from file: runes.dm
        public override void invoke(dynamic user = null)
        {
            dynamic T = null;
            ByTable papers_on_rune         = null;
            Obj_Item_Weapon_Paper P        = null;
            dynamic         paper_to_imbue = null;
            ByTable         nearby_runes   = null;
            Obj_Effect_Rune R               = null;
            dynamic         picked_rune     = null;
            ByTable         split_rune_type = null;
            dynamic         imbue_type      = null;
            Type            talisman_type   = null;
            dynamic         TA              = null;
            dynamic         TR              = null;
            dynamic         TT              = null;

            T = GlobalFuncs.get_turf(this);
            papers_on_rune = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(T, typeof(Obj_Item_Weapon_Paper)))
            {
                P = _a;


                if (!Lang13.Bool(P.info))
                {
                    papers_on_rune.Add(P);
                }
            }

            if (!(papers_on_rune.len != 0))
            {
                user.WriteMsg("<span class='cultitalic'>There must be a blank paper on top of " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - no blank papers on rune");
                return;
            }
            paper_to_imbue = Rand13.PickFromTable(papers_on_rune);
            nearby_runes   = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInRangeExcludeThis(this, 1), typeof(Obj_Effect_Rune)))
            {
                R = _b;

                nearby_runes.Add(R);
            }

            if (!(nearby_runes.len != 0))
            {
                user.WriteMsg("<span class='cultitalic'>There are no runes near " + this + "!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - no nearby runes");
                return;
            }
            picked_rune     = Rand13.PickFromTable(nearby_runes);
            split_rune_type = GlobalFuncs.splittext("" + picked_rune.type, "/");
            imbue_type      = split_rune_type[split_rune_type.len];
            talisman_type   = Lang13.FindClass("/obj/item/weapon/paper/talisman/" + imbue_type);

            if (talisman_type is Type)
            {
                ((Ent_Dynamic)user).say("H'drak v'loso, mir'kanas verbot!");
                TA = Lang13.Call(talisman_type, GlobalFuncs.get_turf(this));

                if (picked_rune is Obj_Effect_Rune_Teleport)
                {
                    TR         = picked_rune;
                    TT         = TA;
                    TT.keyword = TR.keyword;
                }
            }
            else
            {
                user.WriteMsg("<span class='cultitalic'>The chosen rune was not a valid target!</span>");
                this.fail_invoke();
                GlobalFuncs.log_game("Talisman Imbue rune failed - chosen rune invalid");
                return;
            }
            this.visible_message("<span class='warning'>" + picked_rune + " crumbles to dust, and bloody images form themselves on " + paper_to_imbue + ".</span>");
            GlobalFuncs.qdel(paper_to_imbue);
            GlobalFuncs.qdel(picked_rune);
            return;
        }
        // Function from file: syndicate.dm
        public Obj_Structure_Closet_Syndicate_Resources(dynamic loc = null) : base((object)(loc))
        {
            int common_min          = 0;
            int common_max          = 0;
            int rare_min            = 0;
            int rare_max            = 0;
            int pickednum           = 0;
            Obj_Item_Weapon_Paper P = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            common_min = 30;
            common_max = 50;
            rare_min   = 5;
            rare_max   = 20;
            pickednum  = Rand13.Int(1, 50);

            if (pickednum == 1)
            {
                P      = new Obj_Item_Weapon_Paper(this);
                P.name = "ÿIOU";
                P.info = "Sorry man, we needed the money so we sold your stash. It's ok, we'll double our money for sure this time!";
            }

            if (pickednum >= 2)
            {
                new Obj_Item_Stack_Sheet_Metal(this, Rand13.Int(common_min, common_max));
            }

            if (pickednum >= 5)
            {
                new Obj_Item_Stack_Sheet_Glass(this, Rand13.Int(common_min, common_max));
            }

            if (pickednum >= 10)
            {
                new Obj_Item_Stack_Sheet_Plasteel(this, Rand13.Int(common_min, common_max));
            }

            if (pickednum >= 15)
            {
                new Obj_Item_Stack_Sheet_Mineral_Plasma(this, Rand13.Int(rare_min, rare_max));
            }

            if (pickednum >= 20)
            {
                new Obj_Item_Stack_Sheet_Mineral_Silver(this, Rand13.Int(rare_min, rare_max));
            }

            if (pickednum >= 30)
            {
                new Obj_Item_Stack_Sheet_Mineral_Gold(this, Rand13.Int(rare_min, rare_max));
            }

            if (pickednum >= 40)
            {
                new Obj_Item_Stack_Sheet_Mineral_Uranium(this, Rand13.Int(rare_min, rare_max));
            }

            if (pickednum >= 45)
            {
                new Obj_Item_Stack_Sheet_Mineral_Diamond(this, Rand13.Int(rare_min, rare_max));
            }

            if (pickednum == 50)
            {
                new Obj_Item_Weapon_Tank_Jetpack_Carbondioxide(this);
            }
            return;
        }
Ejemplo n.º 13
0
        // Function from file: photocopier.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            int?i = null;
            Obj_Item_Weapon_Paper c = null;
            dynamic copied          = null;
            int?    i2 = null;
            Obj_Item_Weapon_Photo p = null;
            Icon I                   = null;
            Icon img                 = null;
            int? i3                  = null;
            Icon temp_img            = null;
            Obj_Item_Weapon_Photo p2 = null;
            Icon    small_img        = null;
            Icon    ic               = null;
            ByTable nametemp         = null;
            dynamic find             = null;
            Picture selection        = null;
            Mob     tempAI           = null;
            Picture t                = null;
            Obj_Item_Weapon_Photo p3 = null;
            Picture q                = null;
            dynamic I2               = null;
            dynamic img2             = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }

            if (Lang13.Bool(href_list["copy"]))
            {
                if (Lang13.Bool(this.copy))
                {
                    i = null;
                    i = 0;

                    while ((i ?? 0) < (this.copies ?? 0))
                    {
                        if (this.toner > 0 && !this.busy && Lang13.Bool(this.copy))
                        {
                            c = new Obj_Item_Weapon_Paper(this.loc);

                            if (Lang13.Length(this.copy.info) > 0)
                            {
                                if (this.toner > 10)
                                {
                                    c.info = "<font color = #101010>";
                                }
                                else
                                {
                                    c.info = "<font color = #808080>";
                                }
                                copied   = this.copy.info;
                                copied   = GlobalFuncs.replacetext(copied, "<font face=\"" + "Verdana" + "\" color=", "<font face=\"" + "Verdana" + "\" nocolor=");
                                copied   = GlobalFuncs.replacetext(copied, "<font face=\"" + "Comic Sans MS" + "\" color=", "<font face=\"" + "Comic Sans MS" + "\" nocolor=");
                                c.info  += copied;
                                c.info  += "</font>";
                                c.name   = this.copy.name;
                                c.fields = Lang13.DoubleNullable(this.copy.fields);
                                c.updateinfolinks();
                                this.toner--;
                            }
                            this.busy = true;
                            Task13.Sleep(15);
                            this.busy = false;
                        }
                        else
                        {
                            break;
                        }
                        i++;
                    }
                    this.updateUsrDialog();
                }
                else if (Lang13.Bool(this.photocopy))
                {
                    i2 = null;
                    i2 = 0;

                    while ((i2 ?? 0) < (this.copies ?? 0))
                    {
                        if (this.toner >= 5 && !this.busy && Lang13.Bool(this.photocopy))
                        {
                            p   = new Obj_Item_Weapon_Photo(this.loc);
                            I   = new Icon(this.photocopy.icon, this.photocopy.icon_state);
                            img = new Icon(this.photocopy.img);

                            if (this.greytoggle == "Greyscale")
                            {
                                if (this.toner > 10)
                                {
                                    I.MapColors("#4d4d4d", "#969696", "#1c1c1c", "#000000");
                                    img.MapColors("#4d4d4d", "#969696", "#1c1c1c", "#000000");
                                }
                                else
                                {
                                    I.MapColors("#4d4d4d", "#969696", "#1c1c1c", "#646464");
                                    img.MapColors("#4d4d4d", "#969696", "#1c1c1c", "#646464");
                                }
                                this.toner -= 5;
                            }
                            else if (this.greytoggle == "Color")
                            {
                                if (this.toner >= 10)
                                {
                                    this.toner -= 10;
                                }
                                else
                                {
                                    i2++;
                                    continue;
                                }
                            }
                            p.icon       = I;
                            p.img        = img;
                            p.name       = this.photocopy.name;
                            p.desc       = this.photocopy.desc;
                            p.scribble   = this.photocopy.scribble;
                            p.pixel_x    = Rand13.Int(-10, 10);
                            p.pixel_y    = Rand13.Int(-10, 10);
                            p.blueprints = Lang13.Bool(this.photocopy.blueprints);
                            this.busy    = true;
                            Task13.Sleep(15);
                            this.busy = false;
                        }
                        else
                        {
                            break;
                        }
                        i2++;
                    }
                }
                else if (this.ass != null)
                {
                    i3 = null;
                    i3 = 0;

                    while ((i3 ?? 0) < (this.copies ?? 0))
                    {
                        temp_img = null;

                        if (this.ass is Mob_Living_Carbon_Human && (Lang13.Bool(((Mob)this.ass).get_item_by_slot(14)) || Lang13.Bool(((Mob)this.ass).get_item_by_slot(13))))
                        {
                            Task13.User.WriteMsg("<span class='notice'>You feel kind of silly, copying " + (this.ass == Task13.User ? ((dynamic)("your")) : ((dynamic)(this.ass))) + (this.ass == Task13.User ? "" : "'s") + " ass with " + (this.ass == Task13.User ? "your" : "their") + " clothes on.</span>");
                            break;
                        }
                        else if (this.toner >= 5 && !this.busy && this.check_ass())
                        {
                            if (this.ass is Mob_Living_Carbon_Alien_Humanoid || this.ass is Mob_Living_SimpleAnimal_Hostile_Alien)
                            {
                                temp_img = new Icon("icons/ass/assalien.png");
                            }
                            else if (this.ass is Mob_Living_Carbon_Human)
                            {
                                if (this.ass.gender == GlobalVars.MALE)
                                {
                                    temp_img = new Icon("icons/ass/assmale.png");
                                }
                                else if (this.ass.gender == GlobalVars.FEMALE)
                                {
                                    temp_img = new Icon("icons/ass/assfemale.png");
                                }
                                else
                                {
                                    temp_img = new Icon("icons/ass/assmale.png");
                                }
                            }
                            else if (this.ass is Mob_Living_SimpleAnimal_Drone || this.ass is Mob_Living_SimpleAnimal_Drone)
                            {
                                temp_img = new Icon("icons/ass/assdrone.png");
                            }
                            else
                            {
                                break;
                            }
                            p2         = new Obj_Item_Weapon_Photo(this.loc);
                            p2.desc    = "You see " + this.ass + "'s ass on the photo.";
                            p2.pixel_x = Rand13.Int(-10, 10);
                            p2.pixel_y = Rand13.Int(-10, 10);
                            p2.img     = temp_img;
                            small_img  = new Icon(temp_img);
                            ic         = new Icon("icons/obj/items.dmi", "photo");
                            small_img.Scale(8, 8);
                            ic.Blend(small_img, 3, 10, 13);
                            p2.icon     = ic;
                            this.toner -= 5;
                            this.busy   = true;
                            Task13.Sleep(15);
                            this.busy = false;
                        }
                        else
                        {
                            break;
                        }
                        i3++;
                    }
                }
                this.updateUsrDialog();
            }
            else if (Lang13.Bool(href_list["remove"]))
            {
                if (Lang13.Bool(this.copy))
                {
                    if (!(Task13.User is Mob_Living_Silicon_Ai))
                    {
                        this.copy.loc = Task13.User.loc;
                        Task13.User.put_in_hands(this.copy);
                    }
                    else
                    {
                        this.copy.loc = this.loc;
                    }
                    Task13.User.WriteMsg("<span class='notice'>You take " + this.copy + " out of " + this + ".</span>");
                    this.copy = null;
                    this.updateUsrDialog();
                }
                else if (Lang13.Bool(this.photocopy))
                {
                    if (!(Task13.User is Mob_Living_Silicon_Ai))
                    {
                        this.photocopy.loc = Task13.User.loc;
                        Task13.User.put_in_hands(this.photocopy);
                    }
                    else
                    {
                        this.photocopy.loc = this.loc;
                    }
                    Task13.User.WriteMsg("<span class='notice'>You take " + this.photocopy + " out of " + this + ".</span>");
                    this.photocopy = null;
                    this.updateUsrDialog();
                }
                else if (this.check_ass())
                {
                    ((dynamic)this.ass).WriteMsg("<span class='notice'>You feel a slight pressure on your ass.</span>");
                }
            }
            else if (Lang13.Bool(href_list["min"]))
            {
                if ((this.copies ?? 0) > 1)
                {
                    this.copies--;
                    this.updateUsrDialog();
                }
            }
            else if (Lang13.Bool(href_list["add"]))
            {
                if ((this.copies ?? 0) < (this.maxcopies ?? 0))
                {
                    this.copies++;
                    this.updateUsrDialog();
                }
            }
            else if (Lang13.Bool(href_list["aipic"]))
            {
                if (!(Task13.User is Mob_Living_Silicon_Ai))
                {
                    return(null);
                }

                if (this.toner >= 5 && !this.busy)
                {
                    nametemp  = new ByTable();
                    find      = null;
                    selection = null;
                    tempAI    = Task13.User;

                    if (((dynamic)tempAI).aicamera.aipictures.len == 0)
                    {
                        Task13.User.WriteMsg("<span class='boldannounce'>No images saved</span>");
                        return(null);
                    }

                    foreach (dynamic _a in Lang13.Enumerate(((dynamic)tempAI).aicamera.aipictures, typeof(Picture)))
                    {
                        t = _a;

                        nametemp.Add(t.fields["name"]);
                    }
                    find = Interface13.Input("Select image (numbered in order taken)", null, null, null, nametemp, InputType.Any);
                    p3   = new Obj_Item_Weapon_Photo(this.loc);

                    foreach (dynamic _b in Lang13.Enumerate(((dynamic)tempAI).aicamera.aipictures, typeof(Picture)))
                    {
                        q = _b;


                        if (q.fields["name"] == find)
                        {
                            selection = q;
                            break;
                        }
                    }
                    I2            = selection.fields["icon"];
                    img2          = selection.fields["img"];
                    p3.icon       = I2;
                    p3.img        = img2;
                    p3.desc       = selection.fields["desc"];
                    p3.blueprints = Lang13.Bool(selection.fields["blueprints"]);
                    p3.pixel_x    = Rand13.Int(-10, 10);
                    p3.pixel_y    = Rand13.Int(-10, 10);
                    this.toner   -= 5;
                    this.busy     = true;
                    Task13.Sleep(15);
                    this.busy = false;
                }
                this.updateUsrDialog();
            }
            else if (Lang13.Bool(href_list["colortoggle"]))
            {
                if (this.greytoggle == "Greyscale")
                {
                    this.greytoggle = "Color";
                }
                else
                {
                    this.greytoggle = "Greyscale";
                }
                this.updateUsrDialog();
            }
            return(null);
        }
Ejemplo n.º 14
0
        // Function from file: card.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic I                = null;
            dynamic I2               = null;
            double? access_type      = null;
            double? access_allowed   = null;
            dynamic t1               = null;
            dynamic newJob           = null;
            dynamic jobdatum         = null;
            dynamic jobtype          = null;
            dynamic J                = null;
            dynamic t2               = null;
            string  newName          = null;
            dynamic edit_job_target  = null;
            Job     j                = null;
            dynamic edit_job_target2 = null;
            Job     j2               = null;
            Obj_Item_Weapon_Paper P  = null;
            string      t12          = null;
            Data_Record t            = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(null);
            }
            Task13.User.set_machine(this);

            dynamic _c = href_list["choice"];             // Was a switch-case, sorry for the mess.

            if (_c == "modify")
            {
                if (Lang13.Bool(this.modify))
                {
                    GlobalVars.data_core.manifest_modify(this.modify.registered_name, this.modify.assignment);
                    this.modify.update_label();
                    this.modify.loc = this.loc;
                    this.modify.__CallVerb("Pick up");
                    this.modify            = null;
                    this.region_access     = null;
                    this.head_subordinates = null;
                }
                else
                {
                    I = Task13.User.get_active_hand();

                    if (I is Obj_Item_Weapon_Card_Id)
                    {
                        if (!Task13.User.drop_item())
                        {
                            return(null);
                        }
                        I.loc       = this;
                        this.modify = I;
                    }
                }
                this.authenticated = 0;
            }
            else if (_c == "scan")
            {
                if (Lang13.Bool(this.scan))
                {
                    this.scan.loc = this.loc;
                    this.scan.__CallVerb("Pick up");
                    this.scan = null;
                }
                else
                {
                    I2 = Task13.User.get_active_hand();

                    if (I2 is Obj_Item_Weapon_Card_Id)
                    {
                        if (!Task13.User.drop_item())
                        {
                            return(null);
                        }
                        I2.loc    = this;
                        this.scan = I2;
                    }
                }
                this.authenticated = 0;
            }
            else if (_c == "auth")
            {
                if (!(this.authenticated != 0) && (Lang13.Bool(this.scan) || Task13.User is Mob_Living_Silicon) && (Lang13.Bool(this.modify) || Lang13.Bool(this.mode)))
                {
                    if (this.check_access(this.scan))
                    {
                        this.region_access     = new ByTable();
                        this.head_subordinates = new ByTable();

                        if (Lang13.Bool(this.scan.access.Contains(GlobalVars.access_change_ids)))
                        {
                            if (this.target_dept != 0)
                            {
                                this.head_subordinates = GlobalFuncs.get_all_jobs();
                                this.region_access.Or(this.target_dept);
                                this.authenticated = 1;
                            }
                            else
                            {
                                this.authenticated = 2;
                            }
                        }
                        else
                        {
                            if (Lang13.Bool(this.scan.access.Contains(GlobalVars.access_hop)) && (this.target_dept == 1 || !(this.target_dept != 0)))
                            {
                                this.region_access.Or(1);
                                this.region_access.Or(6);
                                this.get_subordinates("Head of Personnel");
                            }

                            if (Lang13.Bool(this.scan.access.Contains(GlobalVars.access_hos)) && (this.target_dept == 2 || !(this.target_dept != 0)))
                            {
                                this.region_access.Or(2);
                                this.get_subordinates("Head of Security");
                            }

                            if (Lang13.Bool(this.scan.access.Contains(GlobalVars.access_cmo)) && (this.target_dept == 3 || !(this.target_dept != 0)))
                            {
                                this.region_access.Or(3);
                                this.get_subordinates("Chief Medical Officer");
                            }

                            if (Lang13.Bool(this.scan.access.Contains(GlobalVars.access_rd)) && (this.target_dept == 4 || !(this.target_dept != 0)))
                            {
                                this.region_access.Or(4);
                                this.get_subordinates("Research Director");
                            }

                            if (Lang13.Bool(this.scan.access.Contains(GlobalVars.access_ce)) && (this.target_dept == 5 || !(this.target_dept != 0)))
                            {
                                this.region_access.Or(5);
                                this.get_subordinates("Chief Engineer");
                            }

                            if (this.region_access != null)
                            {
                                this.authenticated = 1;
                            }
                        }
                    }
                }
                else if (!(this.authenticated != 0) && Task13.User is Mob_Living_Silicon && !Lang13.Bool(this.modify))
                {
                    Task13.User.WriteMsg("<span class='warning'>You can't modify an ID without an ID inserted to modify! Once one is in the modify slot on the computer, you can log in.</span>");
                }
            }
            else if (_c == "logout")
            {
                this.region_access     = null;
                this.head_subordinates = null;
                this.authenticated     = 0;
            }
            else if (_c == "access")
            {
                if (Lang13.Bool(href_list["allowed"]))
                {
                    if (this.authenticated != 0)
                    {
                        access_type    = String13.ParseNumber(href_list["access_target"]);
                        access_allowed = String13.ParseNumber(href_list["allowed"]);

                        if ((this is Obj_Machinery_Computer_Card_Centcom ? GlobalFuncs.get_all_centcom_access() : GlobalFuncs.get_all_accesses()).Contains(access_type))
                        {
                            this.modify.access -= access_type;

                            if (access_allowed == 1)
                            {
                                this.modify.access += access_type;
                            }
                        }
                    }
                }
            }
            else if (_c == "assign")
            {
                if (this.authenticated == 2)
                {
                    t1 = href_list["assign_target"];

                    if (t1 == "Custom")
                    {
                        newJob = GlobalFuncs.reject_bad_text(Interface13.Input("Enter a custom job assignment.", "Assignment", (Lang13.Bool(this.modify) ? this.modify.assignment : ((dynamic)("Unassigned"))), null, null, InputType.Any), 26);

                        if (Lang13.Bool(newJob))
                        {
                            t1 = newJob;
                        }
                    }
                    else if (t1 == "Unassigned")
                    {
                        this.modify.access -= GlobalFuncs.get_all_accesses();
                    }
                    else
                    {
                        jobdatum = null;

                        foreach (dynamic _a in Lang13.Enumerate(Lang13.GetTypes(typeof(Job))))
                        {
                            jobtype = _a;

                            J = Lang13.Call(jobtype);

                            if (String13.CKey(J.title) == String13.CKey(t1))
                            {
                                jobdatum = J;
                                break;
                            }
                        }

                        if (!Lang13.Bool(jobdatum))
                        {
                            Task13.User.WriteMsg("<span class='error'>No log exists for this job.</span>");
                            return(null);
                        }
                        this.modify.access = (this is Obj_Machinery_Computer_Card_Centcom ? GlobalFuncs.get_centcom_access(t1) : ((Job)jobdatum).get_access());
                    }

                    if (Lang13.Bool(this.modify))
                    {
                        this.modify.assignment = t1;
                    }
                }
            }
            else if (_c == "demote")
            {
                if (Lang13.Bool(((dynamic)(this.head_subordinates != null || this.modify.assignment == "Assistant")).Contains(this.modify.assignment)))
                {
                    this.modify.assignment = "Unassigned";
                }
                else
                {
                    Task13.User.WriteMsg("<span class='error'>You are not authorized to demote this position.</span>");
                }
            }
            else if (_c == "reg")
            {
                if (this.authenticated != 0)
                {
                    t2 = this.modify;

                    if (this.authenticated != 0 && this.modify == t2 && (Map13.GetDistance(this, Task13.User) <= 1 || Task13.User is Mob_Living_Silicon) && this.loc is Tile)
                    {
                        newName = GlobalFuncs.reject_bad_name(href_list["reg"]);

                        if (Lang13.Bool(newName))
                        {
                            this.modify.registered_name = newName;
                        }
                        else
                        {
                            Task13.User.WriteMsg("<span class='error'>Invalid name entered.</span>");
                            return(null);
                        }
                    }
                }
            }
            else if (_c == "mode")
            {
                this.mode = String13.ParseNumber(href_list["mode_target"]);
            }
            else if (_c == "return")
            {
                this.mode = 3;
            }
            else if (_c == "make_job_available")
            {
                if (Lang13.Bool(this.scan) && Lang13.Bool(this.scan.access.Contains(GlobalVars.access_change_ids)) && !(this.target_dept != 0))
                {
                    edit_job_target = href_list["job"];
                    j = GlobalVars.SSjob.GetJob(edit_job_target);

                    if (!(j != null))
                    {
                        return(0);
                    }

                    if (this.can_open_job(j) != 1)
                    {
                        return(0);
                    }

                    if (Convert.ToDouble(this.opened_positions[edit_job_target]) >= 0)
                    {
                        GlobalVars.time_last_changed_position = Game13.time / 10;
                    }
                    j.total_positions++;
                    this.opened_positions[edit_job_target]++;
                }
            }
            else if (_c == "make_job_unavailable")
            {
                if (Lang13.Bool(this.scan) && Lang13.Bool(this.scan.access.Contains(GlobalVars.access_change_ids)) && !(this.target_dept != 0))
                {
                    edit_job_target2 = href_list["job"];
                    j2 = GlobalVars.SSjob.GetJob(edit_job_target2);

                    if (!(j2 != null))
                    {
                        return(0);
                    }

                    if (this.can_close_job(j2) != 1)
                    {
                        return(0);
                    }

                    if (Convert.ToDouble(this.opened_positions[edit_job_target2]) <= 0)
                    {
                        GlobalVars.time_last_changed_position = Game13.time / 10;
                    }
                    j2.total_positions--;
                    this.opened_positions[edit_job_target2]--;
                }
            }
            else if (_c == "print")
            {
                if (!(this.printing == true))
                {
                    this.printing = true;
                    Task13.Sleep(50);
                    P   = new Obj_Item_Weapon_Paper(this.loc);
                    t12 = "<B>Crew Manifest:</B><BR>";

                    foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.sortRecord(GlobalVars.data_core.general), typeof(Data_Record)))
                    {
                        t = _b;

                        t12 += t.fields["name"] + " - " + t.fields["rank"] + "<br>";
                    }
                    P.info        = t12;
                    P.name        = "paper- 'Crew Manifest'";
                    this.printing = null;
                }
            }

            if (Lang13.Bool(this.modify))
            {
                this.modify.update_label();
            }
            this.updateUsrDialog();
            return(null);
        }