// Function from file: experiment.dm
        public void experimentUI(dynamic user = null)
        {
            dynamic dat             = null;
            Obj_Item_Weapon_Photo P = null;
            Browser popup           = null;

            dat += "<h3> Experiment </h3>";

            if (Lang13.Bool(this.occupant))
            {
                P = new Obj_Item_Weapon_Photo();
                P.photocreate(null, new Icon(this.dissection_icon(this.occupant), null, GlobalVars.SOUTH));
                Interface13.CacheBrowseResource(user, P.img, "dissection_img");
                dat += "<table><tr><td>";
                dat += "<img src=dissection_img height=80 width=80>";
                dat += "</td><td>";
                dat += new Txt("<a href='?src=").Ref(this).str(";experiment=1'>Probe</a><br>").ToString();
                dat += new Txt("<a href='?src=").Ref(this).str(";experiment=2'>Dissect</a><br>").ToString();
                dat += new Txt("<a href='?src=").Ref(this).str(";experiment=3'>Analyze</a><br>").ToString();
                dat += "</td></tr></table>";
            }
            else
            {
                dat += "<span class='linkOff'>Experiment </span>";
            }

            if (!Lang13.Bool(this.occupant))
            {
                dat += "<h3>Machine Unoccupied</h3>";
            }
            else
            {
                dat += "<h3>Subject Status : </h3>";
                dat += "" + this.occupant.name + " => ";

                dynamic _a = this.occupant.stat;                 // Was a switch-case, sorry for the mess.
                if (_a == 0)
                {
                    dat += "<span class='good'>Conscious</span>";
                }
                else if (_a == 1)
                {
                    dat += "<span class='average'>Unconscious</span>";
                }
                else
                {
                    dat += "<span class='bad'>Deceased</span>";
                }
            }
            dat  += "<br>";
            dat  += "" + this.flash;
            dat  += "<br>";
            dat  += new Txt("<a href='?src=").Ref(this).str(";refresh=1'>Scan</a>").ToString();
            dat  += new Txt("<a href='?src=").Ref(this).str(";").item((Lang13.Bool(this.state_open) ? "close=1'>Close</a>" : "open=1'>Open</a>")).ToString();
            popup = new Browser(user, "experiment", "Probing Console", 300, 300);
            popup.set_title_image(((Mob)user).browse_rsc_icon(this.icon, this.icon_state));
            popup.set_content(dat);
            popup.open();
            return;
        }
示例#2
0
        // Function from file: photography.dm
        public void printpicture(dynamic user = null, Icon temp = null, string mobs = null, bool?flag = null)
        {
            Obj_Item_Weapon_Photo P = null;
            Icon small_img          = null;
            Icon ic = null;

            P = new Obj_Item_Weapon_Photo(GlobalFuncs.get_turf(this));

            if (this.Adjacent(user))
            {
                ((Mob)user).put_in_hands(P);
            }
            small_img = new Icon(temp);
            ic        = new Icon("icons/obj/items.dmi", "photo");
            small_img.Scale(8, 8);
            ic.Blend(small_img, 3, 10, 13);
            P.icon    = ic;
            P.img     = temp;
            P.desc    = mobs;
            P.pixel_x = Rand13.Int(-10, 10);
            P.pixel_y = Rand13.Int(-10, 10);

            if (this.blueprints)
            {
                P.blueprints    = true;
                this.blueprints = false;
            }
            return;
        }
        // Function from file: photography.dm
        public void viewpichelper(Obj_Item_Device_Camera_Siliconcam targetloc = null)
        {
            Obj_Item_Weapon_Photo P = null;
            Picture selection       = null;

            P         = new Obj_Item_Weapon_Photo();
            selection = this.selectpicture(targetloc);

            if (selection != null)
            {
                P.photocreate(selection.fields["icon"], selection.fields["img"], selection.fields["desc"]);
                P.pixel_x = Convert.ToInt32(selection.fields["pixel_x"]);
                P.pixel_y = Convert.ToInt32(selection.fields["pixel_y"]);
                P.show(Task13.User);
                Task13.User.WriteMsg(P.desc);
            }
            GlobalFuncs.qdel(P);
            return;
        }
示例#4
0
        // Function from file: photography.dm
        public void borgprint(  )
        {
            ByTable    nametemp  = null;
            dynamic    find      = null;
            Picture    selection = null;
            Ent_Static C         = null;
            Obj_Item_Device_Camera_Siliconcam targetcam = null;
            Picture t = null;
            Picture q = null;
            Obj_Item_Weapon_Photo p = null;

            nametemp  = new ByTable();
            C         = this.loc;
            targetcam = null;

            if (Convert.ToDouble(((dynamic)C).toner) < 20)
            {
                Task13.User.WriteMsg("Insufficent toner to print image.");
                return;
            }

            if (Lang13.Bool(((dynamic)C).connected_ai))
            {
                targetcam = ((dynamic)C).connected_ai.aicamera;
            }
            else
            {
                targetcam = ((dynamic)C).aicamera;
            }

            if (targetcam.aipictures.len == 0)
            {
                Task13.User.WriteMsg("<span class='userdanger'>No images saved</span>");
                return;
            }

            foreach (dynamic _a in Lang13.Enumerate(targetcam.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);

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


                if (q.fields["name"] == find)
                {
                    selection = q;
                    break;
                }
            }
            p = new Obj_Item_Weapon_Photo(C.loc);
            p.photocreate(selection.fields["icon"], selection.fields["img"], selection.fields["desc"], selection.fields["blueprints"]);
            p.pixel_x           = Rand13.Int(-10, 10);
            p.pixel_y           = Rand13.Int(-10, 10);
            ((dynamic)C).toner -= 20;
            this.visible_message("" + C.name + " spits out a photograph from a narrow slot on it's chassis.");
            Task13.User.WriteMsg("<span class='notice'>You print a photograph.</span>");
            return;
        }
示例#5
0
        // Function from file: datacore.dm
        public void manifest_inject(dynamic H = null)
        {
            dynamic assignment = null;
            string  id         = null;
            Icon    image      = null;
            Obj_Item_Weapon_Photo photo_front = null;
            Obj_Item_Weapon_Photo photo_side  = null;
            Data_Record           G           = null;
            Data_Record           M           = null;
            Data_Record           S           = null;
            Data_Record           L           = null;


            if (Lang13.Bool(H.mind) && H.mind.assigned_role != H.mind.special_role)
            {
                if (Lang13.Bool(H.mind.assigned_role))
                {
                    assignment = H.mind.assigned_role;
                }
                else if (Lang13.Bool(H.job))
                {
                    assignment = H.job;
                }
                else
                {
                    assignment = "Unassigned";
                }
                id          = GlobalFuncs.num2hex(GlobalVars.record_id_num++, 6);
                image       = this.get_id_photo(H);
                photo_front = new Obj_Item_Weapon_Photo();
                photo_side  = new Obj_Item_Weapon_Photo();
                photo_front.photocreate(null, new Icon(image, null, GlobalVars.SOUTH));
                photo_side.photocreate(null, new Icon(image, null, GlobalVars.WEST));
                G = new Data_Record();
                G.fields["id"]   = id;
                G.fields["name"] = H.real_name;
                G.fields["rank"] = assignment;
                G.fields["age"]  = H.age;

                if (GlobalVars.config.mutant_races)
                {
                    G.fields["species"] = H.dna.species.name;
                }
                G.fields["fingerprint"] = Num13.Md5(H.dna.uni_identity);
                G.fields["p_stat"]      = "Active";
                G.fields["m_stat"]      = "Stable";
                G.fields["sex"]         = H.gender;
                G.fields["photo_front"] = photo_front;
                G.fields["photo_side"]  = photo_side;
                this.general.Add(G);
                M = new Data_Record();
                M.fields["id"]         = id;
                M.fields["name"]       = H.real_name;
                M.fields["blood_type"] = H.dna.blood_type;
                M.fields["b_dna"]      = H.dna.unique_enzymes;
                M.fields["mi_dis"]     = "None";
                M.fields["mi_dis_d"]   = "No minor disabilities have been declared.";
                M.fields["ma_dis"]     = "None";
                M.fields["ma_dis_d"]   = "No major disabilities have been diagnosed.";
                M.fields["alg"]        = "None";
                M.fields["alg_d"]      = "No allergies have been detected in this patient.";
                M.fields["cdi"]        = "None";
                M.fields["cdi_d"]      = "No diseases have been diagnosed at the moment.";
                M.fields["notes"]      = "No notes.";
                this.medical.Add(M);
                S = new Data_Record();
                S.fields["id"]       = id;
                S.fields["name"]     = H.real_name;
                S.fields["criminal"] = "None";
                S.fields["mi_crim"]  = new ByTable();
                S.fields["ma_crim"]  = new ByTable();
                S.fields["notes"]    = "No notes.";
                this.security.Add(S);
                L = new Data_Record();
                L.fields["id"]         = Num13.Md5("" + H.real_name + H.mind.assigned_role);
                L.fields["name"]       = H.real_name;
                L.fields["rank"]       = H.mind.assigned_role;
                L.fields["age"]        = H.age;
                L.fields["sex"]        = H.gender;
                L.fields["blood_type"] = H.dna.blood_type;
                L.fields["b_dna"]      = H.dna.unique_enzymes;
                L.fields["enzymes"]    = H.dna.struc_enzymes;
                L.fields["identity"]   = H.dna.uni_identity;
                L.fields["species"]    = H.dna.species.type;
                L.fields["features"]   = H.dna.features;
                L.fields["image"]      = image;
                this.locked.Add(L);
            }
            return;
        }
示例#6
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);
        }