// Function from file: transit_tube_pod.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            Obj_Structure_TransitTube_Station T = null;
            Obj_Structure_CTransitTubePod     R = null;


            if (A is Obj_Item_Weapon_Crowbar)
            {
                if (!this.moving)
                {
                    foreach (dynamic _a in Lang13.Enumerate(this.loc, typeof(Obj_Structure_TransitTube_Station)))
                    {
                        T = _a;

                        return(null);
                    }

                    if (this.contents.len != 0)
                    {
                        ((Ent_Static)user).visible_message(new Txt().item(user).str(" empties ").the(this).item().str(".").ToString(), new Txt("<span class='notice'>You empty ").the(this).item().str(".</span>").ToString());
                        this.empty();
                        return(null);
                    }
                    else
                    {
                        user.WriteMsg(new Txt("<span class='notice'>You free ").the(this).item().str(".</span>").ToString());
                        R = new Obj_Structure_CTransitTubePod(this.loc);
                        this.transfer_fingerprints_to(R);
                        R.add_fingerprint(user);
                        GlobalFuncs.qdel(this);
                    }
                }
            }
            return(null);
        }
        // Function from file: station.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic G  = null;
            Mob     GM = null;
            Obj_Structure_TransitTubePod  pod  = null;
            Obj_Structure_TransitTubePod  pod2 = null;
            Obj_Structure_CTransitTubePod R    = null;


            if (A is Obj_Item_Weapon_Grab && this.icon_state == "open")
            {
                G = A;

                if (G.affecting is Mob && Convert.ToDouble(G.state) >= 2)
                {
                    GM = G.affecting;

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

                        pod.visible_message("<span class='warning'>" + user + " starts putting " + GM + " into the " + pod + "!</span>");

                        if (GlobalFuncs.do_after(user, 15, null, this) && GM != null && Lang13.Bool(G) && G.affecting == GM)
                        {
                            GM.Weaken(5);
                            this.Bumped(GM);
                            GlobalFuncs.qdel(G);
                        }
                        break;
                    }
                }
            }

            if (A is Obj_Item_Weapon_Crowbar)
            {
                foreach (dynamic _b in Lang13.Enumerate(this.loc, typeof(Obj_Structure_TransitTubePod)))
                {
                    pod2 = _b;


                    if (pod2.contents != null)
                    {
                        user.WriteMsg("<span class='warning'>Empty the pod first!</span>");
                        return(null);
                    }
                    ((Ent_Static)user).visible_message("" + user + " removes the " + pod2 + ".", "<span class='notice'>You remove the " + pod2 + ".</span>");
                    R = new Obj_Structure_CTransitTubePod(this.loc);
                    pod2.transfer_fingerprints_to(R);
                    R.add_fingerprint(user);
                    GlobalFuncs.qdel(pod2);
                }
            }
            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            return(null);
        }
Пример #3
0
        // Function from file: pipe_dispenser.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            double?tube_type = null;
            Obj_Structure_CTransitTube                 C  = null;
            Obj_Structure_CTransitTube_Station         C2 = null;
            Obj_Structure_CTransitTube_Station_Reverse C3 = null;
            Obj_Structure_CTransitTube_Station_Block   C4 = null;
            Obj_Structure_CTransitTubePod              C5 = null;


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

            if (!this.wait)
            {
                if (Lang13.Bool(href_list["tube"]))
                {
                    tube_type = String13.ParseNumber(href_list["tube"]);

                    if ((tube_type ?? 0) <= 4)
                    {
                        C = new Obj_Structure_CTransitTube(this.loc);

                        switch ((int?)(tube_type))
                        {
                        case 0:
                            C.icon_state = "E-W";
                            break;

                        case 1:
                            C.icon_state = "E-W-Pass";
                            break;

                        case 2:
                            C.icon_state = "S-NE";
                            break;

                        case 3:
                            C.icon_state = "NE-SW";
                            break;

                        case 4:
                            C.icon_state = "W-NE-SE";
                            break;
                        }
                        C.add_fingerprint(Task13.User);
                    }
                    else
                    {
                        switch ((int?)(tube_type))
                        {
                        case 5:
                            C2 = new Obj_Structure_CTransitTube_Station(this.loc);
                            C2.add_fingerprint(Task13.User);
                            break;

                        case 6:
                            C3 = new Obj_Structure_CTransitTube_Station_Reverse(this.loc);
                            C3.add_fingerprint(Task13.User);
                            break;

                        case 7:
                            C4 = new Obj_Structure_CTransitTube_Station_Block(this.loc);
                            C4.add_fingerprint(Task13.User);
                            break;

                        case 8:
                            C5 = new Obj_Structure_CTransitTubePod(this.loc);
                            C5.add_fingerprint(Task13.User);
                            break;
                        }
                    }
                    this.wait = true;
                    Task13.Schedule(15, (Task13.Closure)(() => {
                        this.wait = false;
                        return;
                    }));
                }
            }
            return(null);
        }