Пример #1
0
        // Function from file: tables_racks.dm
        public virtual bool tablepush(dynamic I = null, dynamic user = null)
        {
            dynamic             G  = null;
            Obj_Structure_Table OT = null;


            if (Map13.GetDistance(this, user) < 2)
            {
                G = I;

                if (G.affecting.buckled != null)
                {
                    user.WriteMsg("<span class='warning'>" + G.affecting + " is buckled to " + G.affecting.buckled + "!</span>");
                    return(false);
                }

                if (Convert.ToDouble(G.state) < 2)
                {
                    user.WriteMsg("<span class='warning'>You need a better grip to do that!</span>");
                    return(false);
                }

                if (!((Obj_Item_Weapon_Grab)G).confirm())
                {
                    return(false);
                }
                G.affecting.loc = this.loc;

                if (this is Obj_Structure_Table_Optable)
                {
                    OT = this;
                    G.affecting.resting = 1;
                    ((Mob)G.affecting).update_canmove();
                    this.visible_message("<span class='notice'>" + G.assailant + " has laid " + G.affecting + " on " + this + ".</span>");
                    ((dynamic)OT).patient = G.affecting;
                    ((dynamic)OT).check_patient();
                    GlobalFuncs.qdel(I);
                    return(true);
                }
                ((Mob)G.affecting).Weaken(2);
                ((Ent_Static)G.affecting).visible_message("<span class='danger'>" + G.assailant + " pushes " + G.affecting + " onto " + this + ".</span>", "<span class='userdanger'>" + G.assailant + " pushes " + G.affecting + " onto " + this + ".</span>");
                GlobalFuncs.add_logs(G.assailant, G.affecting, "pushed");
                GlobalFuncs.qdel(I);
                return(true);
            }
            GlobalFuncs.qdel(I);
            return(false);
        }
Пример #2
0
        // Function from file: tables_racks.dm
        public Obj_Structure_Table(dynamic loc = null) : base((object)(loc))
        {
            Obj_Structure_Table T = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Obj_Structure_Table)))
            {
                T = _a;


                if (T != this)
                {
                    GlobalFuncs.qdel(T);
                }
            }
            return;
        }
Пример #3
0
        // Function from file: tables_racks.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            Obj_Structure_Table RT           = null;
            Obj_Structure_Table RT2          = null;
            dynamic             T            = null;
            ByTable             oldContents  = null;
            Obj_Item            C            = null;
            ByTable             click_params = null;


            if (A is Obj_Item_Weapon_Grab)
            {
                this.tablepush(A, user);
                return(null);
            }

            if (!Lang13.Bool(this.flags & 128))
            {
                if (A is Obj_Item_Weapon_Screwdriver)
                {
                    if (this is Obj_Structure_Table_Reinforced)
                    {
                        RT = this;

                        if (Lang13.Bool(((dynamic)RT).status) == true)
                        {
                            this.table_destroy(2, user);
                            return(null);
                        }
                    }
                    else
                    {
                        this.table_destroy(2, user);
                        return(null);
                    }
                }

                if (A is Obj_Item_Weapon_Wrench)
                {
                    if (this is Obj_Structure_Table_Reinforced)
                    {
                        RT2 = this;

                        if (Lang13.Bool(((dynamic)RT2).status) == true)
                        {
                            this.table_destroy(3, user);
                            return(null);
                        }
                    }
                    else
                    {
                        this.table_destroy(3, user);
                        return(null);
                    }
                }
            }

            if (A is Obj_Item_Weapon_Storage_Bag_Tray)
            {
                T = A;

                if (T.contents.len > 0)
                {
                    oldContents = T.contents.Copy();
                    T.__CallVerb("Empty Contents");

                    foreach (dynamic _a in Lang13.Enumerate(oldContents, typeof(Obj_Item)))
                    {
                        C = _a;

                        C.loc = this.loc;
                    }
                    ((Ent_Static)user).visible_message("" + user + " empties " + A + " on " + this + ".");
                    return(null);
                }
            }

            if (user is Mob_Living_Silicon_Robot)
            {
                return(null);
            }

            if (!Lang13.Bool(A.flags & 128))
            {
                if (Lang13.Bool(user.drop_item()))
                {
                    A.Move(this.loc);
                    click_params = String13.ParseUrlParams(_params);

                    if (!(click_params != null) || !Lang13.Bool(click_params["icon-x"]) || !Lang13.Bool(click_params["icon-y"]))
                    {
                        return(null);
                    }
                    A.pixel_x = Num13.MaxInt(((int)(-(Game13.icon_size / 2))), Num13.MinInt(((int)((String13.ParseNumber(click_params["icon-x"]) ?? 0) - 16)), ((int)(Game13.icon_size / 2))));
                    A.pixel_y = Num13.MaxInt(((int)(-(Game13.icon_size / 2))), Num13.MinInt(((int)((String13.ParseNumber(click_params["icon-y"]) ?? 0) - 16)), ((int)(Game13.icon_size / 2))));
                }
            }
            return(null);
        }