Exemplo n.º 1
0
        // Function from file: implantchair.dm
        public bool put_mob(Ent_Dynamic M = null)
        {
            if (!(M is Mob_Living_Carbon))
            {
                Task13.User.WriteMsg("<span class='warning'>The " + this.name + " cannot hold this!</span>");
                return(false);
            }

            if (Lang13.Bool(this.occupant))
            {
                Task13.User.WriteMsg("<span class='warning'>The " + this.name + " is already occupied!</span>");
                return(false);
            }
            M.__CallVerb("Stop Pulling");
            M.loc = this;
            ((dynamic)M).reset_perspective(this);
            this.occupant = M;
            this.add_fingerprint(Task13.User);
            this.icon_state = "implantchair_on";
            return(true);
        }
Exemplo n.º 2
0
        // Function from file: closets.dm
        public virtual int insert(Ent_Dynamic AM = null)
        {
            Ent_Dynamic L           = null;
            int         mobs_stored = 0;
            Mob_Living  M           = null;


            if (this.contents.len >= this.storage_capacity)
            {
                return(-1);
            }
            L = AM;

            if (L is Mob_Living)
            {
                if (Lang13.Bool(((dynamic)L).buckled) || Lang13.Bool(L.buckled_mob))
                {
                    return(0);
                }

                if (Convert.ToDouble(((dynamic)L).mob_size) > 0)
                {
                    if (this.horizontal && !Lang13.Bool(((dynamic)L).lying))
                    {
                        return(0);
                    }

                    if (Convert.ToDouble(((dynamic)L).mob_size) > this.max_mob_size)
                    {
                        return(0);
                    }
                    mobs_stored = 0;

                    foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Mob_Living)))
                    {
                        M = _a;


                        if (++mobs_stored >= this.mob_storage_capacity)
                        {
                            return(0);
                        }
                    }
                }
                L.__CallVerb("Stop Pulling");
            }
            else if (AM is Obj_Structure_Closet)
            {
                return(0);
            }
            else if (AM is Obj)
            {
                if (!this.allow_objects && !(AM is Obj_Item) && !(AM is Obj_Effect_Dummy_Chameleon))
                {
                    return(0);
                }

                if (!this.allow_dense && AM.density)
                {
                    return(0);
                }

                if (Lang13.Bool(AM.anchored) || Lang13.Bool(AM.buckled_mob) || Lang13.Bool(AM.flags & 2))
                {
                    return(0);
                }
            }
            AM.forceMove(this);

            if (AM.pulledby != null)
            {
                AM.pulledby.__CallVerb("Stop Pulling");
            }
            return(1);
        }