Ejemplo n.º 1
0
        // Function from file: disposal-unit.dm
        public virtual void newHolderDestination(Obj_Structure_Disposalholder H = null)
        {
            Obj_Item_SmallDelivery O = null;


            foreach (dynamic _a in Lang13.Enumerate(this, typeof(Obj_Item_SmallDelivery)))
            {
                O = _a;

                H.tomail = 1;
                return;
            }
            return;
        }
Ejemplo n.º 2
0
        // Function from file: sortingmachinery.dm
        public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null)
        {
            dynamic O = null;
            Obj_Item_SmallDelivery P = null;
            int     i  = 0;
            dynamic O2 = null;
            Obj_Structure_BigDelivery P2 = null;
            dynamic O3 = null;
            Obj_Structure_BigDelivery P3 = null;


            if (!(proximity_flag == true))
            {
                return(false);
            }

            if (!(target is Obj))
            {
                return(false);
            }

            if (target is Obj_Item_SmallDelivery || target is Obj_Structure_BigDelivery || target is Obj_Item_Weapon_Evidencebag || target is Obj_Structure_Closet_BodyBag)
            {
                return(false);
            }

            if (Lang13.Bool(target.anchored))
            {
                return(false);
            }

            if (Lang13.Bool(user.Contains(target)))
            {
                return(false);
            }

            if (target is Obj_Item && !(target is Obj_Item_Weapon_Storage && !(target is Obj_Item_Weapon_Storage_Box)))
            {
                O = target;

                if (this.use(1) != 0)
                {
                    P = new Obj_Item_SmallDelivery(GlobalFuncs.get_turf(O.loc));

                    if (!(O.loc is Tile))
                    {
                        if (Lang13.Bool(user.client))
                        {
                            user.client.screen -= O;
                        }
                    }
                    P.wrapped = O;
                    O.loc     = P;
                    i         = Num13.Floor(Convert.ToDouble(O.w_class));

                    if (new ByTable(new object [] { 1, 2, 3, 4, 5 }).Contains(i))
                    {
                        P.icon_state = "deliverycrate" + i;
                        P.w_class    = i;
                    }
                    P.add_fingerprint(Task13.User);
                    ((Ent_Static)O).add_fingerprint(Task13.User);
                    this.add_fingerprint(Task13.User);
                }
                else
                {
                    return(false);
                }
            }
            else if (target is Obj_Structure_Closet_Crate)
            {
                O2 = target;

                if (Lang13.Bool(O2.opened))
                {
                    return(false);
                }

                if (this.use(3) != 0)
                {
                    P2            = new Obj_Structure_BigDelivery(GlobalFuncs.get_turf(O2.loc));
                    P2.icon_state = "deliverycrate";
                    P2.wrapped    = O2;
                    O2.loc        = P2;
                }
                else
                {
                    user.WriteMsg("<span class='warning'>You need more paper!</span>");
                    return(false);
                }
            }
            else if (target is Obj_Structure_Closet)
            {
                O3 = target;

                if (Lang13.Bool(O3.opened))
                {
                    return(false);
                }

                if (this.use(3) != 0)
                {
                    P3         = new Obj_Structure_BigDelivery(GlobalFuncs.get_turf(O3.loc));
                    P3.wrapped = O3;
                    O3.welded  = 1;
                    O3.loc     = P3;
                }
                else
                {
                    user.WriteMsg("<span class='warning'>You need more paper!</span>");
                    return(false);
                }
            }
            else
            {
                user.WriteMsg("<span class='warning'>The object you are trying to wrap is unsuitable for the sorting machinery!</span>");
                return(false);
            }
            ((Ent_Static)user).visible_message("" + user + " wraps " + target + ".");
            user.attack_log += "[" + GlobalFuncs.time_stamp() + "] <font color='blue'>Has used " + this.name + " on " + target + "</font>";

            if ((this.amount ?? 0) <= 0 && !(this.loc != null))
            {
                new Obj_Item_Weapon_CTube(GlobalFuncs.get_turf(user));
            }
            return(false);
        }