Exemplo n.º 1
0
        // Function from file: icons.dm
        public void ColorTone(string tone = null)
        {
            ByTable TONE  = null;
            double  gray  = 0;
            Icon    upper = null;

            this.GrayScale();
            TONE  = GlobalFuncs.ReadRGB(tone);
            gray  = Num13.Round(Convert.ToDouble(TONE[1] * 0.3 + TONE[2] * 0.81 + TONE[3] * 0.01), 1);
            upper = (255 - gray != 0 ? new Icon(this) : null);

            if (gray != 0)
            {
                this.MapColors(255 / gray, 0, 0, 0, 255 / gray, 0, 0, 0, 255 / gray, false, 0, 0);
                this.Blend(tone, 2);
            }
            else
            {
                this.SetIntensity(0);
            }

            if (255 - gray != 0)
            {
                upper.Blend(String13.ColorCode(((int)(gray)), ((int)(gray)), ((int)(gray))), 1);
                upper.MapColors((255 - Convert.ToDouble(TONE[1])) / (255 - gray), 0, 0, 0, 0, (255 - Convert.ToDouble(TONE[2])) / (255 - gray), 0, 0, 0, false, (255 - Convert.ToDouble(TONE[3])) / (255 - gray), 0, 0, 0, 0, 0, 0, 0, 0, 1);
                this.Blend(upper, 0);
            }
            return;
        }
Exemplo n.º 2
0
        // Function from file: chrono_eraser.dm
        public Obj_Effect_ChronoField(dynamic loc = null, Ent_Static target = null, dynamic G = null) : base((object)(loc))
        {
            Icon mob_snapshot   = null;
            Icon cached_icon    = null;
            int? i              = null;
            Icon removing_frame = null;
            Icon mob_icon       = null;


            if (target != null && target is Mob_Living && Lang13.Bool(G))
            {
                target.loc    = this;
                this.captured = target;
                mob_snapshot  = GlobalFuncs.getFlatIcon(target);
                cached_icon   = new Icon();
                i             = null;
                i             = 1;

                while ((i ?? 0) <= 22)
                {
                    removing_frame = new Icon("icons/obj/chronos.dmi", "erasing", GlobalVars.SOUTH, i);
                    mob_icon       = new Icon(mob_snapshot);
                    mob_icon.Blend(removing_frame, 2);
                    cached_icon.Insert(mob_icon, "frame" + i);
                    i++;
                }
                this.mob_underlay = new Image(cached_icon, "frame1");
                this.update_icon();
                this.desc = Lang13.Initial(this, "desc") + ("<br><span class='info'>It appears to contain " + target.name + ".</span>");
            }
            GlobalVars.SSobj.processing.Or(this);
            return;
        }
Exemplo n.º 3
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;
        }
Exemplo n.º 4
0
        // Function from file: species_types.dm
        public void build_disguise(dynamic H = null)
        {
            dynamic _base      = null;
            Icon    base_flesh = null;
            Icon    damage     = null;

            _base = "";

            if (Lang13.Bool(this.fake_species))
            {
                _base = this.fake_species.update_base_icon_state(H);

                if (Lang13.Bool(GlobalVars.synth_flesh_disguises[_base]))
                {
                    this.damaged_synth_flesh = GlobalVars.synth_flesh_disguises[_base];
                }
                else
                {
                    base_flesh = new Icon(H.icon, "" + _base + "_s");
                    damage     = new Icon(H.icon, "synthflesh_damage");
                    base_flesh.Blend(damage, 2);
                    this.damaged_synth_flesh = new Image(base_flesh, null, null, -27);
                    GlobalVars.synth_flesh_disguises[_base] = this.damaged_synth_flesh;
                }
            }
            else
            {
                this.damaged_synth_flesh = null;
            }
            return;
        }
Exemplo n.º 5
0
        // Function from file: icons.dm
        public void AddAlphaMask(Icon mask = null)
        {
            Icon M = null;

            M = new Icon(mask);
            M.Blend("#ffffff", 1);
            this.Blend(M, 0);
            return;
        }
Exemplo n.º 6
0
        // Function from file: icons.dm
        public void MinColors(dynamic icon = null)
        {
            Icon I = null;

            I = new Icon(this);
            I.Opaque();
            I.Blend(icon, 1);
            this.Blend(I, 1);
            return;
        }
        // Function from file: experiment.dm
        public Icon dissection_icon(dynamic H = null)
        {
            Icon    photo    = null;
            string  g        = null;
            Icon    eyes_s   = null;
            dynamic S        = null;
            Icon    hair_s   = null;
            Icon    facial_s = null;
            Icon    splat    = null;

            photo = null;
            g     = (H.gender == GlobalVars.FEMALE ? "f" : "m");

            if (!GlobalVars.config.mutant_races || H.dna.species.use_skintones)
            {
                photo = new Icon("icons/mob/human.dmi", "" + H.skin_tone + "_" + g + "_s");
            }
            else
            {
                photo = new Icon("icons/mob/human.dmi", "" + H.dna.species.id + "_" + g + "_s");
                photo.Blend("#" + H.dna.features["mcolor"], 2);
            }

            if (H.dna.species.specflags.Contains(8))
            {
                eyes_s = new Icon("icons/mob/human_face.dmi", "" + H.dna.species.eyes + "_s");
                eyes_s.Blend("#" + H.eye_color, 2);
            }
            S = GlobalVars.hair_styles_list[H.hair_style];

            if (Lang13.Bool(S) && H.dna.species.specflags.Contains(2))
            {
                hair_s = new Icon(S.icon, "" + S.icon_state + "_s");
                hair_s.Blend("#" + H.hair_color, 2);
                eyes_s.Blend(hair_s, 3);
            }
            S = GlobalVars.facial_hair_styles_list[H.facial_hair_style];

            if (Lang13.Bool(S) && H.dna.species.specflags.Contains(4))
            {
                facial_s = new Icon(S.icon, "" + S.icon_state + "_s");
                facial_s.Blend("#" + H.facial_hair_color, 2);
                eyes_s.Blend(facial_s, 3);
            }

            if (eyes_s != null)
            {
                photo.Blend(eyes_s, 3);
            }
            splat = new Icon("icons/mob/dam_human.dmi", "chest30");
            photo.Blend(splat, 3);
            return(photo);
        }
Exemplo n.º 8
0
        // Function from file: icons.dm
        public void MaxColors(dynamic icon = null)
        {
            Icon I = null;
            Icon J = null;


            if (icon is Icon)
            {
                I = new Icon(icon);
            }
            else
            {
                I = new Icon(this);
                I.Blend("#000000", 3);
                I.SwapColor("#000000", null);
                I.Blend(icon, 3);
            }
            J = new Icon(this);
            J.Opaque();
            I.Blend(J, 1);
            this.Blend(I, 5);
            return;
        }
        // Function from file: bottle.dm
        public void smash(dynamic target = null, dynamic user = null, bool?ranged = null)
        {
            ranged = ranged ?? false;

            dynamic new_location           = null;
            Obj_Item_Weapon_BrokenBottle B = null;
            Icon I = null;

            new_location = GlobalFuncs.get_turf(this.loc);
            B            = new Obj_Item_Weapon_BrokenBottle(new_location);

            if (ranged == true)
            {
                B.loc = new_location;
            }
            else
            {
                user.drop_item();
                ((Mob)user).put_in_active_hand(B);
            }
            B.icon_state = this.icon_state;
            I            = new Icon("icons/obj/drinks.dmi", this.icon_state);
            I.Blend(B.broken_outline, 3, Rand13.Int(5), 1);
            I.SwapColor("#ff00dcff", "#00000000");
            B.icon = I;

            if (this.isGlass)
            {
                if (Rand13.PercentChance(33))
                {
                    new Obj_Item_Weapon_Shard(new_location);
                }
                GlobalFuncs.playsound(this, "shatter", 70, 1);
            }
            else
            {
                B.name       = "broken carton";
                B.force      = 0;
                B.throwforce = 0;
                B.desc       = "A carton with the bottom half burst open. Might give you a papercut.";
            }
            this.transfer_fingerprints_to(B);
            GlobalFuncs.qdel(this);
            return;
        }
        // Function from file: chronosuit.dm
        public Dynamic_Overlay create_phase_underlay(Ent_Static user = null)
        {
            Icon            user_icon = null;
            Dynamic_Overlay phase     = null;

            user_icon = GlobalFuncs.getFlatIcon(user);
            user_icon.Blend("#ffffff");
            phase          = new Dynamic_Overlay(user.loc);
            phase.icon     = user_icon;
            phase.density  = true;
            phase.anchored = 1;
            phase.master   = user;
            ((dynamic)phase).animate_movement = 0;
            phase.alpha         = 0;
            phase.mouse_opacity = 0;
            phase.name          = user.name;
            phase.transform     = user.transform;
            phase.pixel_x       = user.pixel_x;
            phase.pixel_y       = user.pixel_y;
            return(phase);
        }
Exemplo n.º 11
0
        // Function from file: photography.dm
        public void aipicture(dynamic user = null, Icon temp = null, string mobs = null, bool isAi = false)
        {
            Icon   small_img        = null;
            Icon   ic               = null;
            Icon   icon             = null;
            Icon   img              = null;
            string desc             = null;
            int    pixel_x          = 0;
            int    pixel_y          = 0;
            bool   injectblueprints = false;

            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);
            icon             = ic;
            img              = temp;
            desc             = mobs;
            pixel_x          = Rand13.Int(-10, 10);
            pixel_y          = Rand13.Int(-10, 10);
            injectblueprints = true;

            if (this.blueprints)
            {
                injectblueprints = true;
                this.blueprints  = false;
            }

            if (isAi)
            {
                this.injectaialbum(icon, img, desc, pixel_x, pixel_y, injectblueprints);
            }
            else
            {
                this.injectmasteralbum(icon, img, desc, pixel_x, pixel_y, injectblueprints);
            }
            return;
        }
Exemplo n.º 12
0
        // Function from file: minimap.dm
        public void generate(dynamic z = null, int?x1 = null, int?y1 = null, int?x2 = null, int?y2 = null)
        {
            z  = z ?? 1;
            x1 = x1 ?? 1;
            y1 = y1 ?? 1;
            x2 = x2 ?? Game13.map_size_x;
            y2 = y2 ?? Game13.map_size_y;

            Icon    minimap   = null;
            ByTable obj_icons = null;
            int     counter   = 0;
            dynamic T         = null;
            dynamic tile      = null;
            Icon    tile_icon = null;
            dynamic obj       = null;
            dynamic I         = null;
            dynamic obj_icon  = null;
            Icon    flatten   = null;
            Icon    final     = null;

            minimap = new Icon("icons/minimap.dmi");
            minimap.Scale(GlobalVars.MINIMAP_SIZE, GlobalVars.MINIMAP_SIZE);
            obj_icons = new ByTable();
            counter   = 128;

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInBlock(Map13.GetTile(x1 ?? 0, y1 ?? 0, Convert.ToInt32(z)), Map13.GetTile(x2 ?? 0, y2 ?? 0, Convert.ToInt32(z)))))
            {
                T = _b;

                tile      = T;
                tile_icon = null;
                obj       = null;

                if (tile is Tile_Space)
                {
                    obj = Lang13.FindIn(typeof(Obj_Structure_Lattice_Catwalk), tile);

                    if (Lang13.Bool(obj))
                    {
                        tile_icon = new Icon("icons/obj/smooth_structures/catwalk.dmi", "catwalk", GlobalVars.SOUTH);
                    }
                    obj = Lang13.FindIn(typeof(Obj_Structure_Lattice), tile);

                    if (Lang13.Bool(obj))
                    {
                        tile_icon = new Icon("icons/obj/smooth_structures/lattice.dmi", "lattice", GlobalVars.SOUTH);
                    }
                    obj = Lang13.FindIn(typeof(Obj_Structure_Grille), tile);

                    if (Lang13.Bool(obj))
                    {
                        tile_icon = new Icon("icons/obj/structures.dmi", "grille", GlobalVars.SOUTH);
                    }
                    obj = Lang13.FindIn(typeof(Obj_Structure_TransitTube), tile);

                    if (Lang13.Bool(obj))
                    {
                        tile_icon = new Icon("icons/obj/atmospherics/pipes/transit_tube.dmi", obj.icon_state, Lang13.DoubleNullable(obj.dir));
                    }
                }
                else
                {
                    tile_icon = new Icon(tile.icon, tile.icon_state, Lang13.DoubleNullable(tile.dir));
                    obj_icons.Cut();
                    obj = Lang13.FindIn(typeof(Obj_Structure), tile);

                    if (Lang13.Bool(obj))
                    {
                        obj_icons.Add(GlobalFuncs.getFlatIcon(obj));
                    }
                    obj = Lang13.FindIn(typeof(Obj_Machinery), tile);

                    if (Lang13.Bool(obj))
                    {
                        obj_icons.Add(new Icon(obj.icon, obj.icon_state, Lang13.DoubleNullable(obj.dir), 1, false));
                    }
                    obj = Lang13.FindIn(typeof(Obj_Structure_Window), tile);

                    if (Lang13.Bool(obj))
                    {
                        obj_icons.Add(new Icon("icons/obj/smooth_structures/window.dmi", "window", GlobalVars.SOUTH));
                    }

                    foreach (dynamic _a in Lang13.Enumerate(obj_icons))
                    {
                        I = _a;

                        obj_icon = I;
                        tile_icon.Blend(obj_icon, 3);
                    }
                }

                if (tile_icon != null)
                {
                    tile_icon.Scale(GlobalVars.TILE_SIZE, GlobalVars.TILE_SIZE);
                    minimap.Blend(tile_icon, 3, Lang13.DoubleNullable((tile.x - 1) * 8), Lang13.DoubleNullable((tile.y - 1) * 8));
                    Lang13.Delete(tile_icon);
                    tile_icon = null;
                }
                counter--;

                if (counter <= 0)
                {
                    counter = 128;
                    flatten = new Icon();
                    flatten.Insert(minimap, "", GlobalVars.SOUTH, 1, false);
                    Lang13.Delete(minimap);
                    minimap = null;
                    minimap = flatten;
                    Task13.Sleep(-1);
                }
            }
            final = new Icon();
            final.Insert(minimap, "", GlobalVars.SOUTH, 1, false);
            File13.Copy(final, this.map_path(z));
            return;
        }
Exemplo 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);
        }
Exemplo n.º 14
0
        // Function from file: photography.dm
        public Icon camera_get_icon(ByTable turfs = null, dynamic center = null)
        {
            ByTable     atoms  = null;
            dynamic     T      = null;
            Ent_Dynamic A      = null;
            Ent_Dynamic O      = null;
            ByTable     sorted = null;
            int?        j      = null;
            double      i      = 0;
            dynamic     c      = null;
            dynamic     c2     = null;
            Icon        res    = null;
            Ent_Static  A2     = null;
            Icon        img    = null;
            double?     offX   = null;
            double?     offY   = null;
            dynamic     T2     = null;

            atoms = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(turfs))
            {
                T = _b;

                atoms.Add(T);

                foreach (dynamic _a in Lang13.Enumerate(T, typeof(Ent_Dynamic)))
                {
                    A = _a;


                    if (A.invisibility != 0)
                    {
                        if (this.see_ghosts)
                        {
                            if (A is Mob_Dead_Observer)
                            {
                                O = A;

                                if (Lang13.Bool(O.orbiting))
                                {
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            continue;
                        }
                    }
                    atoms.Add(A);
                }
            }
            sorted = new ByTable();
            j      = null;

            foreach (dynamic _c in Lang13.IterateRange(1, atoms.len))
            {
                i = _c;

                c = atoms[i];
                j = sorted.len;

                while ((j ?? 0) > 0)
                {
                    c2 = sorted[j];

                    if (Convert.ToDouble(c2.layer) <= Convert.ToDouble(c.layer))
                    {
                        break;
                    }
                    j--;
                }
                sorted.Insert((j ?? 0) + 1, c);
            }
            res = new Icon("icons/effects/96x96.dmi", "");

            foreach (dynamic _d in Lang13.Enumerate(sorted, typeof(Ent_Static)))
            {
                A2 = _d;

                img = GlobalFuncs.getFlatIcon(A2);

                if (A2 is Mob_Living && Lang13.Bool(((dynamic)A2).lying))
                {
                    img.Turn(((dynamic)A2).lying);
                }
                offX = (A2.x - Convert.ToDouble(center.x)) * 32 + A2.pixel_x + 33;
                offY = (A2.y - Convert.ToDouble(center.y)) * 32 + A2.pixel_y + 33;

                if (A2 is Ent_Dynamic)
                {
                    offX += Convert.ToDouble(((dynamic)A2).step_x);
                    offY += Convert.ToDouble(((dynamic)A2).step_y);
                }
                res.Blend(img, GlobalFuncs.blendMode2iconMode(Lang13.BoolNullable(A2.blend_mode)), offX, offY);

                if (A2 is Obj_Item_Areaeditor_Blueprints)
                {
                    this.blueprints = true;
                }
            }

            foreach (dynamic _e in Lang13.Enumerate(turfs))
            {
                T2 = _e;

                res.Blend(GlobalFuncs.getFlatIcon(T2.loc), GlobalFuncs.blendMode2iconMode(Lang13.BoolNullable(T2.blend_mode)), Lang13.DoubleNullable((T2.x - center.x) * 32 + 33), Lang13.DoubleNullable((T2.y - center.y) * 32 + 33));
            }
            return(res);
        }
Exemplo n.º 15
0
        // Function from file: photography.dm
        public void captureimage(dynamic target = null, dynamic user = null, bool?flag = null)
        {
            string  mobs  = null;
            bool    isAi  = false;
            ByTable seen  = null;
            ByTable turfs = null;
            dynamic T     = null;
            Icon    temp  = null;

            mobs = "";
            isAi = user is Mob_Living_Silicon_Ai;

            if (!isAi)
            {
                if (Lang13.Bool(user.client))
                {
                    seen = GlobalFuncs.get_hear(Game13.view, user.client.eye);
                }
                else
                {
                    seen = GlobalFuncs.get_hear(Game13.view, user);
                }
            }
            else
            {
                seen = GlobalFuncs.get_hear(Game13.view, target);
            }
            turfs = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(Map13.FetchInRange(target, 1)))
            {
                T = _a;


                if (seen.Contains(T))
                {
                    if (isAi && !GlobalVars.cameranet.checkTurfVis(T))
                    {
                        continue;
                    }
                    else
                    {
                        turfs.Add(T);
                        mobs += this.camera_get_mobs(T);
                    }
                }
            }
            temp = new Icon("icons/effects/96x96.dmi", "");
            temp.Blend("#000", 3);
            temp.Blend(this.camera_get_icon(turfs, target), 3);

            if (!(user is Mob_Living_Silicon))
            {
                this.printpicture(user, temp, mobs, flag);
            }
            else
            {
                this.aipicture(user, temp, mobs, isAi);
            }
            return;
        }