示例#1
0
        // Function from file: disposal-construction.dm
        public bool can_place(  )
        {
            Obj_Structure_Disposalconstruct DC = null;


            if (this.is_pipe())
            {
                return(true);
            }

            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.get_turf(this), typeof(Obj_Structure_Disposalconstruct)))
            {
                DC = _a;


                if (DC == this)
                {
                    continue;
                }

                if (!DC.is_pipe())
                {
                    return(false);
                }
            }
            return(true);
        }
示例#2
0
        // Function from file: disposal-structures.dm
        public Obj_Structure_Disposaloutlet(dynamic loc = null, Obj_Structure_Disposalconstruct make_from = null) : base((object)(loc))
        {
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            if (make_from != null)
            {
                this.dir      = make_from.dir;
                make_from.loc = this;
                this.stored   = make_from;
            }
            else
            {
                this.stored = new Obj_Structure_Disposalconstruct(this, 7, this.dir);
            }
            Task13.Schedule(1, (Task13.Closure)(() => {
                this.target = GlobalFuncs.get_ranged_target_turf(this, this.dir, 10);
                this.trunk  = Lang13.FindIn(typeof(Obj_Structure_Disposalpipe_Trunk), this.loc);

                if (Lang13.Bool(this.trunk))
                {
                    this.trunk.linked = this;
                }
                return;
            }));
            return;
        }
示例#3
0
        // Function from file: disposal-unit.dm
        public Obj_Machinery_Disposal_DeliveryChute(dynamic loc = null, Obj_Structure_Disposalconstruct make_from = null) : base((object)(loc), make_from)
        {
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            ((dynamic)this.stored).ptype = 8;
            Task13.Schedule(5, (Task13.Closure)(() => {
                this.trunk = Lang13.FindIn(typeof(Obj_Structure_Disposalpipe_Trunk), loc);

                if (Lang13.Bool(this.trunk))
                {
                    this.trunk.linked = this;
                }
                return;
            }));
            return;
        }
示例#4
0
        // Function from file: disposal-unit.dm
        public Obj_Machinery_Disposal(dynamic loc = null, Obj_Structure_Disposalconstruct make_from = null) : base((object)(loc))
        {
            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;

            if (make_from != null)
            {
                this.dir      = make_from.dir;
                make_from.loc = loc;
                this.stored   = make_from;
            }
            else
            {
                this.stored = new Obj_Structure_Disposalconstruct(loc, 6, this.dir);
            }
            this.trunk_check();
            this.air_contents = new GasMixture();
            this.update();
            return;
        }
示例#5
0
        // Function from file: pipe_dispenser.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            double?p_type = null;
            Obj_Structure_Disposalconstruct C = null;


            if (Lang13.Bool(base.Topic(href, href_list, (object)(hsrc))))
            {
                return(1);
            }
            Task13.User.set_machine(this);
            this.add_fingerprint(Task13.User);

            if (Lang13.Bool(href_list["dmake"]))
            {
                if (!this.wait)
                {
                    p_type = String13.ParseNumber(href_list["dmake"]);
                    C      = new Obj_Structure_Disposalconstruct(this.loc, p_type);

                    if (!C.can_place())
                    {
                        Task13.User.WriteMsg("<span class='warning'>There's not enough room to build that here!</span>");
                        GlobalFuncs.qdel(C);
                        return(null);
                    }
                    C.add_fingerprint(Task13.User);
                    C.update();
                    this.wait = true;
                    Task13.Schedule(15, (Task13.Closure)(() => {
                        this.wait = false;
                        return;
                    }));
                }
            }
            return(null);
        }
 public Obj_Machinery_Disposal_Bin(dynamic loc = null, Obj_Structure_Disposalconstruct make_from = null) : base((object)(loc), make_from)
 {
 }
示例#7
0
        // Function from file: RPD.dm
        public override bool afterattack(dynamic target = null, dynamic user = null, bool?proximity_flag = null, string click_parameters = null)
        {
            dynamic       queued_p_type    = null;
            double?       queued_p_dir     = null;
            double?       queued_p_flipped = null;
            dynamic       P  = null;
            Obj_Item_Pipe P2 = null;
            Obj_Structure_Disposalconstruct C = null;


            if (!(Map13.GetDistance(target, user) <= 1) || this.loc != user)
            {
                return(false);
            }

            if (!((Mob)user).IsAdvancedToolUser())
            {
                user.WriteMsg("<span class='warning'>You don't have the dexterity to do this!</span>");
                return(false);
            }

            if (target is Zone_Shuttle || target is Tile_Space_Transit)
            {
                return(false);
            }
            queued_p_type    = this.p_type;
            queued_p_dir     = this.p_dir;
            queued_p_flipped = this.p_flipped;

            switch ((int)(this.p_class))
            {
            case -2:

                if (!(target is Obj_Machinery_Atmospherics_Pipe))
                {
                    user.WriteMsg(new Txt("<span class='warning'>").The(this).item().str("'s error light flickers!  Perhaps you need to only use it on pipes and pipe meters?</span>").ToString());
                    return(false);
                }
                P = target;
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/machines/click.ogg", 50, 1);
                P.color        = this.paint_colors[this.paint_color];
                P.pipe_color   = this.paint_colors[this.paint_color];
                P.stored.color = this.paint_colors[this.paint_color];
                ((Ent_Static)user).visible_message(new Txt("<span class='notice'>").item(user).str(" paints ").the(P).item().str(" ").item(this.paint_color).str(".</span>").ToString(), new Txt("<span class='notice'>You paint ").the(P).item().str(" ").item(this.paint_color).str(".</span>").ToString());
                ((Obj_Machinery_Atmospherics_Pipe)P).update_node_icon();
                return(true);

                break;

            case -1:

                if (target is Obj_Item_Pipe || target is Obj_Item_PipeMeter || target is Obj_Structure_Disposalconstruct)
                {
                    user.WriteMsg("<span class='notice'>You start destroying pipe...</span>");
                    GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/machines/click.ogg", 50, 1);

                    if (GlobalFuncs.do_after(user, 2, null, target))
                    {
                        this.activate();
                        GlobalFuncs.qdel(target);
                        return(true);
                    }
                    return(false);
                }
                user.WriteMsg("<span class='warning'>The " + this + "'s error light flickers!  Perhaps you need to only use it on pipes and pipe meters?</span>");
                return(false);

                break;

            case 0:

                if (!(target is Tile))
                {
                    user.WriteMsg("<span class='warning'>The " + this + "'s error light flickers!</span>");
                    return(false);
                }
                user.WriteMsg("<span class='notice'>You start building pipes...</span>");
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/machines/click.ogg", 50, 1);

                if (GlobalFuncs.do_after(user, 2, null, target))
                {
                    this.activate();
                    P2         = new Obj_Item_Pipe(target, queued_p_type, queued_p_dir);
                    P2.flipped = queued_p_flipped;
                    P2.update();
                    P2.add_fingerprint(Task13.User);
                    return(true);
                }
                return(false);

                break;

            case 1:

                if (!(target is Tile))
                {
                    user.WriteMsg("<span class='warning'>The " + this + "'s error light flickers!</span>");
                    return(false);
                }
                user.WriteMsg("<span class='notice'>You start building meter...</span>");
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/machines/click.ogg", 50, 1);

                if (GlobalFuncs.do_after(user, 2, null, target))
                {
                    this.activate();
                    new Obj_Item_PipeMeter(target);
                    return(true);
                }
                return(false);

                break;

            case 2:

                if (!(target is Tile) || GlobalFuncs.is_anchored_dense_turf(target))
                {
                    user.WriteMsg("<span class='warning'>The " + this + "'s error light flickers!</span>");
                    return(false);
                }
                user.WriteMsg("<span class='notice'>You start building pipes...</span>");
                GlobalFuncs.playsound(GlobalFuncs.get_turf(this), "sound/machines/click.ogg", 50, 1);

                if (GlobalFuncs.do_after(user, 20, null, target))
                {
                    C = new Obj_Structure_Disposalconstruct(target, queued_p_type, queued_p_dir);

                    if (!C.can_place())
                    {
                        user.WriteMsg("<span class='warning'>There's not enough room to build that here!</span>");
                        GlobalFuncs.qdel(C);
                        return(false);
                    }
                    this.activate();
                    C.add_fingerprint(Task13.User);
                    C.update();
                    return(true);
                }
                return(false);

                break;

            default:
                base.afterattack((object)(target), (object)(user), proximity_flag, click_parameters);
                return(false);

                break;
            }
            return(false);
        }