Beispiel #1
0
        // Function from file: shuttles.dm
        public void initial_move(  )
        {
            Obj_DockingPort_Mobile     M = null;
            Obj_DockingPort_Stationary S = null;


            foreach (dynamic _b in Lang13.Enumerate(this.mobile, typeof(Obj_DockingPort_Mobile)))
            {
                M = _b;


                if (!Lang13.Bool(M.roundstart_move))
                {
                    continue;
                }

                foreach (dynamic _a in Lang13.Enumerate(this.stationary, typeof(Obj_DockingPort_Stationary)))
                {
                    S = _a;


                    if (S.z != 1 && String13.FindIgnoreCase(S.id, M.id, 1, 0) != 0)
                    {
                        S.width   = M.width;
                        S.height  = M.height;
                        S.dwidth  = M.dwidth;
                        S.dheight = M.dheight;
                    }
                }
                this.moveShuttle(M.id, "" + M.roundstart_move, 0);
            }
            return;
        }
        // Function from file: shuttle.dm
        public void enterTransit(  )
        {
            dynamic S0 = null;
            Obj_DockingPort_Stationary S1 = null;

            this.previous = null;
            S0            = this.get_docked();
            S1            = this.findTransitDock();

            if (S1 != null)
            {
                if (this.dock(S1) != 0)
                {
                    GlobalFuncs.warning("" + ("shuttle \"" + this.id + "\" could not enter transit space. Docked at " + (Lang13.Bool(S0) ? S0.id : "null") + ". Transit dock " + (S1 != null ? S1.id : "null") + ".") + " in " + "code/modules/shuttle/shuttle.dm" + " at line " + 272 + " src: " + this + " usr: "******".");
                }
                else
                {
                    this.previous = S0;
                }
            }
            else
            {
                GlobalFuncs.warning("" + ("shuttle \"" + this.id + "\" could not enter transit space. S0=" + (Lang13.Bool(S0) ? S0.id : "null") + " S1=" + (S1 != null ? S1.id : "null")) + " in " + "code/modules/shuttle/shuttle.dm" + " at line " + 276 + " src: " + this + " usr: "******".");
            }
            return;
        }
        // Function from file: shuttle.dm
        public virtual void check(  )
        {
            double timeLeft = 0;

            timeLeft = this.timeLeft(1);

            if (timeLeft <= 0)
            {
                switch ((int)(this.mode))
                {
                case 2:

                    if (this.dock(this.destination) != 0)
                    {
                        this.setTimer(20);
                        return;
                    }
                    break;

                case 1:

                    if (this.dock(this.previous) != 0)
                    {
                        this.setTimer(20);
                        return;
                    }
                    break;
                }
                this.mode        = 0;
                this.timer       = 0;
                this.destination = null;
            }
            return;
        }
Beispiel #4
0
 // Function from file: supply.dm
 public override int request(Obj_DockingPort_Stationary S = null, double?coefficient = null, dynamic signalOrigin = null, string reason = null, bool?redAlert = null)
 {
     if (this.mode != 0)
     {
         return(2);
     }
     return(base.request(S, coefficient, (object)(signalOrigin), reason, redAlert));
 }
Beispiel #5
0
        // Function from file: computer.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            ByTable options          = null;
            Obj_DockingPort_Mobile M = null;
            string dat = null;
            bool   destination_found     = false;
            Obj_DockingPort_Stationary S = null;
            Browser popup = null;


            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            this.add_fingerprint(Task13.User);
            options = String13.ParseUrlParams(this.possible_destinations);
            M       = GlobalVars.SSshuttle.getShuttle(this.shuttleId);
            dat     = "Status: " + (M != null ? M.getStatusText() : "*Missing*") + "<br><br>";

            if (M != null)
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.SSshuttle.stationary, typeof(Obj_DockingPort_Stationary)))
                {
                    S = _a;


                    if (!(options.Find(S.id) != 0))
                    {
                        continue;
                    }

                    if (M.canDock(S) != 0)
                    {
                        continue;
                    }
                    destination_found = true;
                    dat += new Txt("<A href='?src=").Ref(this).str(";move=").item(S.id).str("'>Send to ").item(S.name).str("</A><br>").ToString();
                }

                if (!destination_found)
                {
                    dat += "<B>Shuttle Locked</B><br>";

                    if (this.admin_controlled)
                    {
                        dat += "Authorized personnel only<br>";
                        dat += new Txt("<A href='?src=").Ref(this).str(";request=1]'>Request Authorization</A><br>").ToString();
                    }
                }
            }
            dat  += new Txt("<a href='?src=").Ref(a).str(";mach_close=computer'>Close</a>").ToString();
            popup = new Browser(a, "computer", (M != null ? M.name : "shuttle"), 300, 200);
            popup.set_content("<center>" + dat + "</center>");
            popup.set_title_image(Task13.User.browse_rsc_icon(this.icon, this.icon_state));
            popup.open();
            return(null);
        }
Beispiel #6
0
 // Function from file: emergency.dm
 public override int request(Obj_DockingPort_Stationary S = null, double?coefficient = null, dynamic signalOrigin = null, string reason = null, bool?redAlert = null)
 {
     if ((GlobalVars.security_level == 2 || GlobalVars.security_level == 3) && this.launch_status == 0)
     {
         this.launch_status = 2;
         return(base.request(S, coefficient, (object)(signalOrigin), reason, redAlert));
     }
     return(0);
 }
        // Function from file: shuttle.dm
        public virtual int request(Obj_DockingPort_Stationary S = null, double?coefficient = null, dynamic signalOrigin = null, string reason = null, bool?redAlert = null)
        {
            int _default = 0;


            if (this.canDock(S) != 0)
            {
                _default = 1;
                throw new Exception("request(): shuttle cannot dock");
                return(1);
            }

            switch ((int)(this.mode))
            {
            case 2:

                if (S == this.destination)
                {
                    if (Game13.time <= this.timer)
                    {
                        this.timer = Game13.time;
                    }
                }
                else
                {
                    this.destination = S;
                    this.timer       = Game13.time;
                }
                break;

            case 1:

                if (S == this.destination)
                {
                    this.timer = Game13.time - this.timeLeft(1);
                }
                else
                {
                    this.destination = S;
                    this.timer       = Game13.time;
                }
                this.mode = 2;
                break;

            default:
                this.destination = S;
                this.mode        = 2;
                this.timer       = Game13.time;
                this.enterTransit();
                break;
            }
            return(_default);
        }
        // Function from file: shuttle.dm
        public Obj_DockingPort_Stationary findTransitDock(  )
        {
            Obj_DockingPort_Stationary T = null;

            T = GlobalVars.SSshuttle.getDock("" + this.id + "_transit");

            if (T != null && !(this.canDock(T) != 0))
            {
                return(T);
            }
            return(null);
        }
Beispiel #9
0
        // Function from file: shuttles.dm
        public Obj_DockingPort_Stationary getDock(string id = null)
        {
            Obj_DockingPort_Stationary S = null;


            foreach (dynamic _a in Lang13.Enumerate(this.stationary, typeof(Obj_DockingPort_Stationary)))
            {
                S = _a;


                if (S.id == id)
                {
                    return(S);
                }
            }
            GlobalFuncs.warning("" + ("couldn't find dock with id: " + id) + " in " + "code/controllers/subsystem/shuttles.dm" + " at line " + 84 + " src: " + this + " usr: "******".");
            return(null);
        }
Beispiel #10
0
        // Function from file: assault_pod.dm
        public override dynamic attack_self(dynamic user = null, dynamic flag = null, bool?emp = null)
        {
            dynamic target_area = null;
            dynamic picked_area = null;
            dynamic T           = null;
            Obj_DockingPort_Stationary     landing_zone = null;
            Obj_Machinery_Computer_Shuttle S            = null;

            target_area = Interface13.Input("Area to land", "Select a Landing Zone", target_area, null, GlobalVars.teleportlocs, InputType.Any);
            picked_area = GlobalVars.teleportlocs[target_area];

            if (!(this != null) || Lang13.Bool(GlobalFuncs.qdeleted(this)))
            {
                return(null);
            }
            T = GlobalFuncs.safepick(GlobalFuncs.get_area_turfs(picked_area));

            if (!Lang13.Bool(T))
            {
                return(null);
            }
            landing_zone         = new Obj_DockingPort_Stationary(T);
            landing_zone.id      = new Txt("assault_pod(").Ref(this).str(")").ToString();
            landing_zone.name    = "Landing Zone";
            landing_zone.dwidth  = this.dwidth;
            landing_zone.dheight = this.dheight;
            landing_zone.width   = this.width;
            landing_zone.height  = this.height;
            landing_zone.dir     = this.lz_dir ?1:0;

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_Shuttle)))
            {
                S = _a;


                if (S.shuttleId == this.shuttle_id)
                {
                    S.possible_destinations = "" + landing_zone.id;
                }
            }
            user.WriteMsg("Landing zone set.");
            GlobalFuncs.qdel(this);
            return(null);
        }
Beispiel #11
0
        // Function from file: emergency.dm
        public override int request(Obj_DockingPort_Stationary S = null, double?coefficient = null, dynamic signalOrigin = null, string reason = null, bool?redAlert = null)
        {
            coefficient = coefficient ?? 1;

            GlobalVars.SSshuttle.emergencyCallTime = Lang13.Initial(GlobalVars.SSshuttle, "emergencyCallTime") * coefficient;

            switch ((int)(this.mode))
            {
            case 1:
                this.mode  = 2;
                this.timer = Game13.time - this.timeLeft(1);
                break;

            case 0:
                this.mode  = 2;
                this.timer = Game13.time;
                break;

            case 2:

                if (Game13.time < this.timer)
                {
                    this.timer = Game13.time;
                }
                break;

            default:
                return(0);

                break;
            }

            if (Rand13.PercentChance(70))
            {
                GlobalVars.SSshuttle.emergencyLastCallLoc = signalOrigin;
            }
            else
            {
                GlobalVars.SSshuttle.emergencyLastCallLoc = null;
            }
            GlobalFuncs.priority_announce("The emergency shuttle has been called. " + (redAlert == true ? "Red Alert state confirmed: Dispatching priority shuttle. " : "") + "It will arrive in " + this.timeLeft(600) + " minutes." + reason + (Lang13.Bool(GlobalVars.SSshuttle.emergencyLastCallLoc) ? "\n\nCall signal traced. Results can be viewed on any communications console." : ""), null, "sound/AI/shuttlecalled.ogg", "Priority");
            return(0);
        }
Beispiel #12
0
        // Function from file: laborstacker.dm
        public override dynamic Topic(string href = null, ByTable href_list = null, dynamic hsrc = null)
        {
            dynamic I = null;
            Obj_DockingPort_Stationary S = null;

            Task13.User.set_machine(this);
            this.add_fingerprint(Task13.User);

            if (Lang13.Bool(href_list["choice"]))
            {
                if (this.inserted_id is Obj_Item_Weapon_Card_Id_Prisoner)
                {
                    if (href_list["choice"] == "eject")
                    {
                        this.inserted_id.loc = this.loc;
                        this.inserted_id.__CallVerb("Pick up");
                        this.inserted_id = null;
                    }

                    if (href_list["choice"] == "claim")
                    {
                        this.inserted_id.points += this.machine.points;
                        this.machine.points      = 0;
                        ((dynamic)this).WriteMsg("Points transferred.");
                    }
                }
                else if (href_list["choice"] == "insert")
                {
                    I = Task13.User.get_active_hand();

                    if (I is Obj_Item_Weapon_Card_Id_Prisoner)
                    {
                        if (!Task13.User.drop_item())
                        {
                            return(null);
                        }
                        I.loc            = this;
                        this.inserted_id = I;
                    }
                    else
                    {
                        Task13.User.WriteMsg("<span class='warning'>Invalid ID.</span>");
                    }
                }

                if (this.check_auth())
                {
                    if (href_list["choice"] == "station")
                    {
                        if (!GlobalFuncs.alone_in_area(GlobalFuncs.get_area(this), Task13.User))
                        {
                            Task13.User.WriteMsg("<span class='warning'>Prisoners are only allowed to be released while alone.</span>");
                        }
                        else
                        {
                            switch ((int)(GlobalVars.SSshuttle.moveShuttle("laborcamp", "laborcamp_home")))
                            {
                            case 1:
                                Task13.User.WriteMsg("<span class='notice'>Shuttle not found</span>");
                                break;

                            case 2:
                                Task13.User.WriteMsg("<span class='notice'>Shuttle already at station</span>");
                                break;

                            case 3:
                                Task13.User.WriteMsg("<span class='notice'>No permission to dock could be granted.</span>");
                                break;

                            default:
                                this.Radio.set_frequency(GlobalVars.SEC_FREQ);
                                this.Radio.talk_into(this, "" + this.inserted_id.registered_name + " has returned to the station. Minerals and Prisoner ID card ready for retrieval.", GlobalVars.SEC_FREQ);
                                Task13.User.WriteMsg("<span class='notice'>Shuttle received message and will be sent shortly.</span>");
                                break;
                            }
                        }
                    }

                    if (href_list["choice"] == "release")
                    {
                        if (GlobalFuncs.alone_in_area(GlobalFuncs.get_area(this.loc), Task13.User))
                        {
                            S = GlobalVars.SSshuttle.getDock("laborcamp_home");

                            if (S != null && Lang13.Bool(S.get_docked()))
                            {
                                if (this.release_door != null && this.release_door.density)
                                {
                                    this.release_door.open();
                                }
                            }
                            else
                            {
                                Task13.User.WriteMsg("<span class='warning'>Prisoners can only be released while docked with the station.</span>");
                            }
                        }
                        else
                        {
                            Task13.User.WriteMsg("<span class='warning'>Prisoners are only allowed to be released while alone.</span>");
                        }
                    }
                }
                this.updateUsrDialog();
            }
            return(null);
        }