Exemple #1
0
        // Function from file: order.dm
        public dynamic generate(dynamic T = null)
        {
            dynamic C = null;
            Obj_Item_Weapon_Paper_Manifest M = null;
            int lost = 0;

            C = this.pack.generate(T);
            M = this.generateManifest(C);

            if ((M.errors & 4) != 0)
            {
                if (C is Obj_Structure_Closet_Crate_Secure || C is Obj_Structure_Closet_Crate_Large)
                {
                    M.errors &= 65531;
                }
                else
                {
                    lost = Num13.MaxInt(Num13.Floor(C.contents.len / 10), 1);

                    while (--lost >= 0)
                    {
                        GlobalFuncs.qdel(Rand13.PickFromTable(C.contents));
                    }
                }
            }
            return(C);
        }
Exemple #2
0
        // Function from file: crates.dm
        public void tear_manifest(dynamic user = null)
        {
            user.WriteMsg("<span class='notice'>You tear the manifest off of the crate.</span>");
            GlobalFuncs.playsound(this, "sound/items/poster_ripped.ogg", 75, 1);
            this.manifest.loc = this.loc;

            if (user is Mob_Living_Carbon_Human)
            {
                ((Mob)user).put_in_hands(this.manifest);
            }
            this.manifest = null;
            this.update_icon();
            return;
        }
Exemple #3
0
        // Function from file: order.dm
        public Obj_Item_Weapon_Paper_Manifest generateManifest(dynamic C = null)
        {
            Obj_Item_Weapon_Paper_Manifest P = null;
            dynamic     station_name         = null;
            Ent_Dynamic AM = null;

            P            = new Obj_Item_Weapon_Paper_Manifest(C, this.id, this.pack.cost);
            station_name = ((P.errors & 1) != 0 ? ((dynamic)(GlobalFuncs.new_station_name())) : GlobalFuncs.station_name());
            P.name       = "shipping manifest - #" + this.id + " (" + this.pack.name + ")";
            P.info      += "<h2>" + GlobalFuncs.command_name() + " Shipping Manifest</h2>";
            P.info      += "<hr/>";
            P.info      += "Order #" + this.id + "<br/>";
            P.info      += "Destination: " + station_name + "<br/>";
            P.info      += "Item: " + this.pack.name + "<br/>";
            P.info      += "Contents: <br/>";
            P.info      += "<ul>";

            foreach (dynamic _a in Lang13.Enumerate(C.contents - P, typeof(Ent_Dynamic)))
            {
                AM = _a;


                if ((P.errors & 2) != 0)
                {
                    if (Rand13.PercentChance(50))
                    {
                        P.info += "<li>" + AM.name + "</li>";
                    }
                    else
                    {
                        continue;
                    }
                }
                P.info += "<li>" + AM.name + "</li>";
            }
            P.info += "</ul>";
            P.info += "<h4>Stamp below to confirm receipt of goods:</h4>";
            P.update_icon();
            P.loc      = C;
            C.manifest = P;
            C.update_icon();
            return(P);
        }