Пример #1
0
        // Function from file: camera_bug.dm
        public override dynamic Destroy(  )
        {
            dynamic cam_tag             = null;
            Obj_Machinery_Camera camera = null;

            this.get_cameras();

            foreach (dynamic _a in Lang13.Enumerate(this.bugged_cameras))
            {
                cam_tag = _a;

                camera = this.bugged_cameras[cam_tag];

                if (camera.bug == this)
                {
                    camera.bug = null;
                }
            }
            this.bugged_cameras = new ByTable();

            if (Lang13.Bool(this.tracking))
            {
                this.tracking = null;
            }
            return(base.Destroy());
        }
Пример #2
0
        // Function from file: camera.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            ByTable camera_list      = null;
            dynamic Num              = null;
            Obj_Machinery_Camera CAM = null;


            if (this.stat != 0)
            {
                return(null);
            }

            if (!(this.network != null))
            {
                throw new Exception("No camera network");
                ((Mob)a).unset_machine();
                return(null);
            }

            if (!(this.network is ByTable))
            {
                throw new Exception("Camera network is not a list");
                ((Mob)a).unset_machine();
                return(null);
            }

            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                ((Mob)a).unset_machine();
                return(null);
            }
            camera_list = this.get_available_cameras();

            if (!this.watchers.Contains(a))
            {
                foreach (dynamic _a in Lang13.Enumerate(camera_list))
                {
                    Num = _a;

                    CAM = camera_list[Num];

                    if (CAM is Obj_Machinery_Camera)
                    {
                        if (CAM.can_use())
                        {
                            this.watchers[a] = CAM;
                            break;
                        }
                    }
                }

                if (!this.watchers.Contains(a))
                {
                    ((Mob)a).unset_machine();
                    return(null);
                }
            }
            this.use_camera_console(a);
            return(null);
        }
Пример #3
0
        // Function from file: camera.dm
        public void Togglelight(bool?on = null)
        {
            on = on ?? false;

            Mob_Living_Silicon_Ai A   = null;
            Obj_Machinery_Camera  cam = null;


            foreach (dynamic _b in Lang13.Enumerate(GlobalVars.ai_list, typeof(Mob_Living_Silicon_Ai)))
            {
                A = _b;


                foreach (dynamic _a in Lang13.Enumerate(A.lit_cameras, typeof(Obj_Machinery_Camera)))
                {
                    cam = _a;


                    if (cam == this)
                    {
                        return;
                    }
                }
            }

            if (on == true)
            {
                this.SetLuminosity(5);
            }
            else
            {
                this.SetLuminosity(0);
            }
            return;
        }
Пример #4
0
        // Function from file: camera_bug.dm
        public ByTable get_cameras(  )
        {
            Obj_Machinery_Camera camera = null;


            if (Game13.time > (this.last_net_update ?1:0) + 100)
            {
                this.bugged_cameras = new ByTable();

                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.cameranet.cameras, typeof(Obj_Machinery_Camera)))
                {
                    camera = _a;


                    if (camera.stat != 0 || !camera.can_use())
                    {
                        continue;
                    }

                    if (Lang13.Length(new ByTable(new object [] { "SS13", "MINE" }) & camera.network) != 0)
                    {
                        this.bugged_cameras[camera.c_tag] = camera;
                    }
                }
            }
            GlobalFuncs.sortList(this.bugged_cameras);
            return(this.bugged_cameras);
        }
Пример #5
0
        // Function from file: areas.dm
        public void burglaralert(Obj trigger = null)
        {
            ByTable cameras = null;
            dynamic RA      = null;
            Obj_Machinery_Door_Airlock DOOR    = null;
            Obj_Machinery_Camera       C       = null;
            Mob_Living_Silicon         SILICON = null;


            if (this.always_unpowered)
            {
                return;
            }
            cameras = new ByTable();

            foreach (dynamic _c in Lang13.Enumerate(this.related))
            {
                RA = _c;

                ((Zone)RA).set_fire_alarm_effect();

                foreach (dynamic _a in Lang13.Enumerate(RA, typeof(Obj_Machinery_Door_Airlock)))
                {
                    DOOR = _a;

                    Task13.Schedule(0, (Task13.Closure)(() => {
                        DOOR.close();

                        if (DOOR.density)
                        {
                            DOOR.locked = true;
                            DOOR.update_icon();
                        }
                        return;
                    }));
                }

                foreach (dynamic _b in Lang13.Enumerate(RA, typeof(Obj_Machinery_Camera)))
                {
                    C = _b;

                    cameras.Add(C);
                }
            }

            foreach (dynamic _d in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon)))
            {
                SILICON = _d;


                if (SILICON.triggerAlarm("Burglar", this, cameras, trigger))
                {
                    Task13.Schedule(600, (Task13.Closure)(() => {
                        SILICON.cancelAlarm("Burglar", this, trigger);
                        return;
                    }));
                }
            }
            return;
        }
Пример #6
0
 // Function from file: cameranet.dm
 public void updatePortableCamera(Obj_Machinery_Camera c = null)
 {
     if (c.can_use())
     {
         this.majorChunkChange(c, 1);
     }
     return;
 }
Пример #7
0
 // Function from file: cameranet.dm
 public void removeCamera(Obj_Machinery_Camera c = null)
 {
     if (c.can_use())
     {
         this.majorChunkChange(c, 0);
     }
     return;
 }
Пример #8
0
        // Function from file: camera.dm
        public ByTable get_available_cameras(  )
        {
            ByTable L = null;
            Obj_Machinery_Camera C = null;
            ByTable D = null;
            Obj_Machinery_Camera C2 = null;
            ByTable tempnetwork     = null;

            L = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.cameranet.cameras, typeof(Obj_Machinery_Camera)))
            {
                C = _a;


                if ((this.z > 7 || C.z > 7) && C.z != this.z)
                {
                    continue;
                }
                L.Add(C);
            }
            GlobalFuncs.camera_sort(L);
            D           = new ByTable();
            D["Cancel"] = "Cancel";

            foreach (dynamic _b in Lang13.Enumerate(L, typeof(Obj_Machinery_Camera)))
            {
                C2 = _b;


                if (!(C2.network != null))
                {
                    Task13.Schedule(0, (Task13.Closure)(() => {
                        throw new Exception("Camera in a cameranet has no camera network");
                        return;
                    }));
                    continue;
                }

                if (!(C2.network is ByTable))
                {
                    Task13.Schedule(0, (Task13.Closure)(() => {
                        throw new Exception("Camera in a cameranet has a non-list camera network");
                        return;
                    }));
                    continue;
                }
                tempnetwork = C2.network & this.network;

                if (tempnetwork.len != 0)
                {
                    D["" + C2.c_tag + (C2.status ? null : " (Deactivated)")] = C2;
                }
            }
            return(D);
        }
Пример #9
0
        // Function from file: camera_advanced.dm
        public override void Activate(int?forced_state = null)
        {
            dynamic C                   = null;
            Obj     remote_eye          = null;
            dynamic origin              = null;
            ByTable L                   = null;
            Obj_Machinery_Camera cam    = null;
            ByTable T                   = null;
            Obj_Machinery_Camera netcam = null;
            ByTable tempnetwork         = null;
            dynamic camera              = null;
            dynamic final               = null;


            if (!Lang13.Bool(this.target) || !(this.target is Mob_Living_Carbon))
            {
                return;
            }
            C          = this.target;
            remote_eye = C.remote_control;
            origin     = ((dynamic)remote_eye).origin;
            L          = new ByTable();

            foreach (dynamic _a in Lang13.Enumerate(GlobalVars.cameranet.cameras, typeof(Obj_Machinery_Camera)))
            {
                cam = _a;

                L.Add(cam);
            }
            GlobalFuncs.camera_sort(L);
            T = new ByTable();

            foreach (dynamic _b in Lang13.Enumerate(L, typeof(Obj_Machinery_Camera)))
            {
                netcam = _b;

                tempnetwork = netcam.network & origin.networks;

                if (tempnetwork.len != 0)
                {
                    T["" + netcam.c_tag + (netcam.can_use() ? null : " (Deactivated)")] = netcam;
                }
            }
            camera = Interface13.Input("Choose which camera you want to view", "Cameras", null, null, T, InputType.Null | InputType.Any);
            final  = T[camera];

            if (Lang13.Bool(final))
            {
                ((Mob_Camera_AiEye)remote_eye).setLoc(GlobalFuncs.get_turf(final));
            }
            return;
        }
Пример #10
0
        // Function from file: camera.dm
        public override dynamic check_eye(Mob user = null)
        {
            Obj_Machinery_Camera C = null;
            ByTable viewing        = null;


            if ((this.stat & 3) != 0 || user.incapacitated() || user.eye_blind != 0)
            {
                user.unset_machine();
                return(null);
            }

            if (!this.watchers.Contains(user))
            {
                user.unset_machine();
                return(null);
            }

            if (!Lang13.Bool(this.watchers[user]))
            {
                user.unset_machine();
                return(null);
            }
            C = this.watchers[user];

            if (!C.can_use())
            {
                user.unset_machine();
                return(null);
            }

            if (!(user is Mob_Living_Silicon))
            {
                if (!this.Adjacent(user))
                {
                    user.unset_machine();
                    return(null);
                }
            }
            else if (user is Mob_Living_Silicon_Robot)
            {
                viewing = Map13.FetchViewers(null, this);

                if (!(viewing.Find(user) != 0))
                {
                    user.unset_machine();
                }
            }
            return(null);
        }
Пример #11
0
        // Function from file: ai_monitored.dm
        public Zone_AiMonitored(dynamic loc = null) : base((object)(loc))
        {
            Obj_Machinery_Camera M = null;

            // Warning: Super call was HERE! If anything above HERE is needed by the super call, it might break!;
            Task13.Schedule(20, (Task13.Closure)(() => {
                foreach (dynamic _a in Lang13.Enumerate(this, typeof(Obj_Machinery_Camera)))
                {
                    M = _a;


                    if (M.isMotion() != 0)
                    {
                        this.motioncamera = M;
                        M.area_motion     = this;
                        return;
                    }
                }
                return;
            }));
            return;
        }
Пример #12
0
        // Function from file: areas.dm
        public bool atmosalert(int danger_level = 0, Obj source = null)
        {
            ByTable cameras                        = null;
            dynamic RA                             = null;
            Obj_Machinery_Camera C                 = null;
            Mob_Living_Silicon   aiPlayer          = null;
            Obj_Machinery_Computer_StationAlert a  = null;
            Mob_Living_SimpleAnimal_Drone       D  = null;
            Mob_Living_Silicon aiPlayer2           = null;
            Obj_Machinery_Computer_StationAlert a2 = null;
            Mob_Living_SimpleAnimal_Drone       D2 = null;


            if (danger_level != this.atmosalm)
            {
                if (danger_level == 2)
                {
                    cameras = new ByTable();

                    foreach (dynamic _b in Lang13.Enumerate(this.related))
                    {
                        RA = _b;


                        foreach (dynamic _a in Lang13.Enumerate(RA, typeof(Obj_Machinery_Camera)))
                        {
                            C = _a;

                            cameras.Add(C);
                        }
                    }

                    foreach (dynamic _c in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon)))
                    {
                        aiPlayer = _c;

                        aiPlayer.triggerAlarm("Atmosphere", this, cameras, source);
                    }

                    foreach (dynamic _d in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_StationAlert)))
                    {
                        a = _d;

                        a.triggerAlarm("Atmosphere", this, cameras, source);
                    }

                    foreach (dynamic _e in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Drone)))
                    {
                        D = _e;

                        D.triggerAlarm("Atmosphere", this, cameras, source);
                    }
                }
                else if (this.atmosalm == 2)
                {
                    foreach (dynamic _f in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon)))
                    {
                        aiPlayer2 = _f;

                        aiPlayer2.cancelAlarm("Atmosphere", this, source);
                    }

                    foreach (dynamic _g in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_StationAlert)))
                    {
                        a2 = _g;

                        a2.cancelAlarm("Atmosphere", this, source);
                    }

                    foreach (dynamic _h in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Drone)))
                    {
                        D2 = _h;

                        D2.cancelAlarm("Atmosphere", this, source);
                    }
                }
                this.atmosalm = danger_level;
                return(true);
            }
            return(false);
        }
Пример #13
0
        // Function from file: camera_bug.dm
        public override int?process(dynamic seconds = null)
        {
            dynamic M              = null;
            ByTable tracking_cams  = null;
            ByTable b_cams         = null;
            dynamic entry          = null;
            ByTable target_region  = null;
            Obj_Machinery_Camera C = null;


            if (this.track_mode == 0 || Game13.time < this.last_tracked + this.refresh_interval)
            {
                return(null);
            }
            this.last_tracked = Game13.time;

            if (this.track_mode == 2)
            {
                if (!Lang13.Bool(this.tracking))
                {
                    this.updateSelfDialog();
                    return(null);
                }

                if (this.tracking.name != this.tracked_name)
                {
                    M = this.tracking;

                    if (M is Mob)
                    {
                        if (!(this.tracked_name == "Unknown" && String13.FindIgnoreCase(this.tracking.name, "Unknown", 1, 0) != 0))
                        {
                            if (!(this.tracked_name == M.real_name && String13.FindIgnoreCase(this.tracking.name, M.real_name, 1, 0) != 0))
                            {
                                this.updateSelfDialog();
                                return(null);
                            }
                        }
                    }
                    else
                    {
                        this.updateSelfDialog();
                        return(null);
                    }
                }
                tracking_cams = new ByTable();
                b_cams        = this.get_cameras();

                foreach (dynamic _a in Lang13.Enumerate(b_cams))
                {
                    entry = _a;

                    tracking_cams.Add(b_cams[entry]);
                }
                target_region = Map13.FetchInView(null, this.tracking);

                foreach (dynamic _b in Lang13.Enumerate(target_region & tracking_cams, typeof(Obj_Machinery_Camera)))
                {
                    C = _b;


                    if (!GlobalFuncs.can_see(C, this.tracking))
                    {
                        continue;
                    }

                    if (C.can_use())
                    {
                        this.last_found = C.c_tag;
                        this.last_seen  = Game13.time;
                        break;
                    }
                }
            }
            this.updateSelfDialog();
            return(null);
        }
Пример #14
0
        // Function from file: camera_assembly.dm
        public override dynamic attackby(dynamic A = null, dynamic user = null, string _params = null, bool?silent = null, bool?replace_spent = null)
        {
            dynamic C               = null;
            string  input           = null;
            ByTable tempnetwork     = null;
            Obj_Machinery_Camera C2 = null;
            dynamic A2              = null;
            dynamic U               = null;


            switch ((int)(this.state))
            {
            case 1:

                if (A is Obj_Item_Weapon_Weldingtool)
                {
                    if (this.weld(A, user))
                    {
                        user.WriteMsg("<span class='notice'>You weld the assembly securely into place.</span>");
                        this.anchored = 1;
                        this.state    = 2;
                    }
                    return(null);
                }
                else if (A is Obj_Item_Weapon_Wrench)
                {
                    GlobalFuncs.playsound(this.loc, "sound/items/ratchet.ogg", 50, 1);
                    user.WriteMsg("<span class='notice'>You unattach the assembly from its place.</span>");
                    new Obj_Item_Wallframe_Camera(GlobalFuncs.get_turf(this));
                    GlobalFuncs.qdel(this);
                    return(null);
                }
                break;

            case 2:

                if (A is Obj_Item_Stack_CableCoil)
                {
                    C = A;

                    if (Lang13.Bool(C.use(2)))
                    {
                        user.WriteMsg("<span class='notice'>You add wires to the assembly.</span>");
                        this.state = 3;
                    }
                    else
                    {
                        user.WriteMsg("<span class='warning'>You need two lengths of cable to wire a camera!</span>");
                        return(null);
                    }
                    return(null);
                }
                else if (A is Obj_Item_Weapon_Weldingtool)
                {
                    if (this.weld(A, user))
                    {
                        user.WriteMsg("<span class='notice'>You unweld the assembly from its place.</span>");
                        this.state    = 1;
                        this.anchored = 1;
                    }
                    return(null);
                }
                break;

            case 3:

                if (A is Obj_Item_Weapon_Screwdriver)
                {
                    GlobalFuncs.playsound(this.loc, "sound/items/Screwdriver.ogg", 50, 1);
                    input = GlobalFuncs.stripped_input(Task13.User, "Which networks would you like to connect this camera to? Seperate networks with a comma. No Spaces!\nFor example: SS13,Security,Secret ", "Set Network", "SS13");

                    if (!Lang13.Bool(input))
                    {
                        Task13.User.WriteMsg("<span class='warning'>No input found, please hang up and try your call again!</span>");
                        return(null);
                    }
                    tempnetwork = GlobalFuncs.splittext(input, ",");

                    if (tempnetwork.len < 1)
                    {
                        Task13.User.WriteMsg("<span class='warning'>No network found, please hang up and try your call again!</span>");
                        return(null);
                    }
                    this.state  = 4;
                    C2          = new Obj_Machinery_Camera(this.loc);
                    this.loc    = C2;
                    C2.assembly = this;
                    C2.dir      = this.dir;
                    C2.network  = tempnetwork;
                    A2          = GlobalFuncs.get_area_master(this);
                    C2.c_tag    = "" + A2.name + " (" + Rand13.Int(1, 999) + ")";
                }
                else if (A is Obj_Item_Weapon_Wirecutters)
                {
                    new Obj_Item_Stack_CableCoil(GlobalFuncs.get_turf(this), 2);
                    GlobalFuncs.playsound(this.loc, "sound/items/Wirecutter.ogg", 50, 1);
                    user.WriteMsg("<span class='notice'>You cut the wires from the circuits.</span>");
                    this.state = 2;
                    return(null);
                }
                break;
            }

            if (GlobalFuncs.is_type_in_list(A, this.possible_upgrades) && !GlobalFuncs.is_type_in_list(A, this.upgrades))
            {
                if (!((Mob)user).unEquip(A))
                {
                    return(null);
                }
                user.WriteMsg(new Txt("<span class='notice'>You attach ").the(A).item().str(" into the assembly inner circuits.</span>").ToString());
                this.upgrades.Add(A);
                A.loc = this;
                return(null);
            }
            else if (A is Obj_Item_Weapon_Crowbar && this.upgrades.len != 0)
            {
                U = Lang13.FindIn(typeof(Obj), this.upgrades);

                if (Lang13.Bool(U))
                {
                    user.WriteMsg("<span class='notice'>You unattach an upgrade from the assembly.</span>");
                    GlobalFuncs.playsound(this.loc, "sound/items/Crowbar.ogg", 50, 1);
                    U.loc = GlobalFuncs.get_turf(this);
                    this.upgrades.Remove(U);
                }
                return(null);
            }
            base.attackby((object)(A), (object)(user), _params, silent, replace_spent);
            return(null);
        }
Пример #15
0
        // Function from file: chunk.dm
        public Camerachunk(dynamic loc = null, int?x = null, int?y = null, int z = 0)
        {
            Obj_Machinery_Camera c = null;
            dynamic t      = null;
            dynamic camera = null;
            dynamic c2     = null;
            dynamic t2     = null;
            dynamic turf   = null;
            dynamic t3     = null;

            x     &= 65520;
            y     &= 65520;
            this.x = x;
            this.y = y;
            this.z = z;

            foreach (dynamic _a in Lang13.Enumerate(GlobalFuncs.ultra_range(GlobalVars.CHUNK_SIZE, Map13.GetTile((x ?? 0) + 8, (y ?? 0) + 8, z)), typeof(Obj_Machinery_Camera)))
            {
                c = _a;


                if (c.can_use())
                {
                    this.cameras.Add(c);
                }
            }

            foreach (dynamic _b in Lang13.Enumerate(Map13.FetchInBlock(Map13.GetTile(x ?? 0, y ?? 0, z), Map13.GetTile(Num13.MinInt((x ?? 0) + 16 - 1, Game13.map_size_x), Num13.MinInt((y ?? 0) + 16 - 1, Game13.map_size_y), z))))
            {
                t = _b;

                this.turfs[t] = t;
            }

            foreach (dynamic _d in Lang13.Enumerate(this.cameras))
            {
                camera = _d;

                c2 = camera;

                if (!Lang13.Bool(c2))
                {
                    continue;
                }

                if (!((Obj_Machinery_Camera)c2).can_use())
                {
                    continue;
                }

                foreach (dynamic _c in Lang13.Enumerate(((Obj_Machinery_Camera)c2).can_see()))
                {
                    t2 = _c;

                    this.visibleTurfs[t2] = t2;
                }
            }
            this.visibleTurfs.And(this.turfs);
            this.obscuredTurfs = this.turfs - this.visibleTurfs;

            foreach (dynamic _e in Lang13.Enumerate(this.obscuredTurfs))
            {
                turf = _e;

                t3 = turf;

                if (!Lang13.Bool(t3.obscured))
                {
                    t3.obscured = new Image("icons/effects/cameravis.dmi", t3, "black", 16);
                }
                this.obscured.Add(t3.obscured);
            }
            return;
        }
        // Function from file: camera_advanced.dm
        public override dynamic attack_hand(dynamic a = null, bool?b = null, bool?c = null)
        {
            dynamic L = null;
            dynamic camera_location = null;
            Obj_Machinery_Camera C  = null;


            if (Lang13.Bool(this.current_user))
            {
                a.WriteMsg("The console is already in use!");
                return(null);
            }

            if (!(a is Mob_Living_Carbon))
            {
                return(null);
            }

            if (Lang13.Bool(base.attack_hand((object)(a), b, c)))
            {
                return(null);
            }
            L = a;

            if (!(this.eyeobj != null))
            {
                this.CreateEye();
            }

            if (!this.eyeobj.initialized)
            {
                foreach (dynamic _a in Lang13.Enumerate(GlobalVars.cameranet.cameras, typeof(Obj_Machinery_Camera)))
                {
                    C = _a;


                    if (!C.can_use())
                    {
                        continue;
                    }

                    if ((C.network & this.networks) != null)
                    {
                        camera_location = GlobalFuncs.get_turf(C);
                        break;
                    }
                }

                if (Lang13.Bool(camera_location))
                {
                    this.eyeobj.initialized = true;
                    this.give_eye_control(L);
                    this.eyeobj.setLoc(camera_location);
                }
                else
                {
                    ((Mob)a).unset_machine();
                }
            }
            else
            {
                this.give_eye_control(L);
                this.eyeobj.setLoc(this.eyeobj.loc);
            }
            return(null);
        }
Пример #17
0
        // Function from file: areas.dm
        public virtual void poweralert(bool state = false, Obj_Machinery_Power_Apc source = null)
        {
            ByTable cameras                       = null;
            Obj_Machinery_Camera C                = null;
            Mob_Living_Silicon   aiPlayer         = null;
            Obj_Machinery_Computer_StationAlert a = null;
            Mob_Living_SimpleAnimal_Drone       D = null;


            if (state != this.poweralm)
            {
                this.poweralm = state;

                if (source is Obj)
                {
                    cameras = new ByTable();

                    foreach (dynamic _a in Lang13.Enumerate(this, typeof(Obj_Machinery_Camera)))
                    {
                        C = _a;

                        cameras.Add(C);
                    }

                    foreach (dynamic _b in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon)))
                    {
                        aiPlayer = _b;


                        if (state)
                        {
                            aiPlayer.cancelAlarm("Power", this, source);
                        }
                        else
                        {
                            aiPlayer.triggerAlarm("Power", this, cameras, source);
                        }
                    }

                    foreach (dynamic _c in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_StationAlert)))
                    {
                        a = _c;


                        if (state)
                        {
                            a.cancelAlarm("Power", this, source);
                        }
                        else
                        {
                            a.triggerAlarm("Power", this, cameras, source);
                        }
                    }

                    foreach (dynamic _d in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Drone)))
                    {
                        D = _d;


                        if (state)
                        {
                            D.cancelAlarm("Power", this, source);
                        }
                        else
                        {
                            D.triggerAlarm("Power", this, cameras, source);
                        }
                    }
                }
            }
            return;
        }
Пример #18
0
        // Function from file: camera.dm
        public bool use_camera_console(dynamic user = null)
        {
            ByTable camera_list    = null;
            dynamic t              = null;
            Obj_Machinery_Camera C = null;
            bool    camera_fail    = false;
            ByTable viewing        = null;
            dynamic A              = null;

            camera_list = this.get_available_cameras();
            t           = Interface13.Input(user, "Which camera should you change to?", null, null, camera_list, InputType.Null | InputType.Any);

            if (user.machine != this)
            {
                return(false);
            }

            if (!Lang13.Bool(t))
            {
                ((Mob)user).unset_machine();
                return(false);
            }
            C = camera_list[t];

            if (t == "Cancel")
            {
                ((Mob)user).unset_machine();
                return(false);
            }

            if (C != null)
            {
                camera_fail = false;

                if (!C.can_use() || user.machine != this || user.eye_blind != 0 || ((Mob)user).incapacitated())
                {
                    camera_fail = true;
                }
                else if (user is Mob_Living_Silicon_Robot)
                {
                    viewing = Map13.FetchViewers(null, this);

                    if (!(viewing.Find(user) != 0))
                    {
                        camera_fail = true;
                    }
                }
                else if (!(user is Mob_Living_Silicon))
                {
                    if (!this.Adjacent(user))
                    {
                        camera_fail = true;
                    }
                }

                if (camera_fail)
                {
                    ((Mob)user).unset_machine();
                    return(false);
                }

                if (user is Mob_Living_Silicon_Ai)
                {
                    A = user;
                    ((Mob_Camera_AiEye)A.eyeobj).setLoc(GlobalFuncs.get_turf(C));
                    A.client.eye = A.eyeobj;
                }
                else
                {
                    ((Mob)user).reset_perspective(C);
                }
                this.watchers[user] = C;
                this.f_use_power(50);
                Task13.Schedule(5, (Task13.Closure)(() => {
                    this.use_camera_console(user);
                    return;
                }));
            }
            else
            {
                ((Mob)user).unset_machine();
            }
            return(false);
        }
Пример #19
0
        // Function from file: camera_bug.dm
        public string menu(ByTable cameras = null)
        {
            string  html            = null;
            dynamic entry           = null;
            Obj_Machinery_Camera C  = null;
            string functions        = null;
            int    time_diff        = 0;
            Obj_Machinery_Camera C2 = null;
            dynamic outstring       = null;
            int     m = 0;
            dynamic s = null;


            if (!(cameras != null) || !(cameras.len != 0))
            {
                return("No bugged cameras found.");
            }

            switch ((int?)(this.track_mode))
            {
            case 0:
                html = new Txt("<h3>Select a camera:</h3> <a href='?src=").Ref(this).str(";view'>[Cancel camera view]</a><hr><table>").ToString();

                foreach (dynamic _a in Lang13.Enumerate(cameras))
                {
                    entry = _a;

                    C         = cameras[entry];
                    functions = "";

                    if (C.bug == this)
                    {
                        functions = new Txt(" - <a href='?src=").Ref(this).str(";monitor=").Ref(C).str("'>[Monitor]</a> <a href='?src=").Ref(this).str(";emp=").Ref(C).str("'>[Disable]</a>").ToString();
                    }
                    else
                    {
                        functions = new Txt(" - <a href='?src=").Ref(this).str(";monitor=").Ref(C).str("'>[Monitor]</a>").ToString();
                    }
                    html += new Txt("<tr><td><a href='?src=").Ref(this).str(";view=").Ref(C).str("'>").item(entry).str("</a></td><td>").item(functions).str("</td></tr>").ToString();
                }
                break;

            case 1:

                if (Lang13.Bool(this.current))
                {
                    html  = new Txt("Analyzing Camera '").item(this.current.c_tag).str("' <a href='?").Ref(this).str(";mode=0'>[Select Camera]</a><br>").ToString();
                    html += this.camera_report();
                }
                else
                {
                    this.track_mode = 0;
                    return(this.menu(cameras));
                }
                break;

            case 2:

                if (Lang13.Bool(this.tracking))
                {
                    html = new Txt("Tracking '").item(this.tracked_name).str("'  <a href='?").Ref(this).str(";mode=0'>[Cancel Tracking]</a>  <a href='?src=").Ref(this).str(";view'>[Cancel camera view]</a><br>").ToString();

                    if (Lang13.Bool(this.last_found))
                    {
                        time_diff = Num13.Floor((Game13.time - this.last_seen) / 150);
                        C2        = this.bugged_cameras[this.last_found];
                        outstring = null;

                        if (C2 != null)
                        {
                            outstring = new Txt("<a href='?").Ref(this).str(";view=").Ref(C2).str("'>").item(this.last_found).str("</a>").ToString();
                        }
                        else
                        {
                            outstring = this.last_found;
                        }

                        if (!(time_diff != 0))
                        {
                            html += "Last seen near " + outstring + " (now)<br>";
                        }
                        else
                        {
                            m = Num13.Floor(time_diff / 4);
                            s = (time_diff - m * 4) * 15;

                            if (!Lang13.Bool(s))
                            {
                                s = "00";
                            }
                            html += new Txt("Last seen near ").item(outstring).str(" (").item(m).str(":").item(s).str(" minute").s().str(" ago)<br>").ToString();
                        }

                        if (C2 != null && C2.bug == this)
                        {
                            html += new Txt("<a href='?src=").Ref(this).str(";emp=").Ref(C2).str("'>[Disable]</a>").ToString();
                        }
                    }
                    else
                    {
                        html += "Not yet seen.";
                    }
                }
                else
                {
                    this.track_mode = 0;
                    return(this.menu(cameras));
                }
                break;
            }
            return(html);
        }
Пример #20
0
        // Function from file: areas.dm
        public void firealert(Obj_Machinery source = null)
        {
            ByTable cameras = null;
            dynamic RA      = null;
            Obj_Machinery_Door_Firedoor         D  = null;
            Obj_Machinery_Firealarm             F  = null;
            Obj_Machinery_Camera                C  = null;
            Obj_Machinery_Computer_StationAlert a  = null;
            Mob_Living_Silicon            aiPlayer = null;
            Mob_Living_SimpleAnimal_Drone D2       = null;


            if (this.always_unpowered)
            {
                return;
            }
            cameras = new ByTable();

            foreach (dynamic _d in Lang13.Enumerate(this.related))
            {
                RA = _d;


                if (!RA.fire)
                {
                    ((Zone)RA).set_fire_alarm_effect();

                    foreach (dynamic _a in Lang13.Enumerate(RA, typeof(Obj_Machinery_Door_Firedoor)))
                    {
                        D = _a;


                        if (!D.blocked)
                        {
                            if (D.operating)
                            {
                                D.nextstate = GlobalVars.CLOSED;
                            }
                            else if (!D.density)
                            {
                                Task13.Schedule(0, (Task13.Closure)(() => {
                                    D.close();
                                    return;
                                }));
                            }
                        }
                    }

                    foreach (dynamic _b in Lang13.Enumerate(RA, typeof(Obj_Machinery_Firealarm)))
                    {
                        F = _b;

                        F.update_icon();
                    }
                }

                foreach (dynamic _c in Lang13.Enumerate(RA, typeof(Obj_Machinery_Camera)))
                {
                    C = _c;

                    cameras.Add(C);
                }
            }

            foreach (dynamic _e in Lang13.Enumerate(GlobalVars.machines, typeof(Obj_Machinery_Computer_StationAlert)))
            {
                a = _e;

                a.triggerAlarm("Fire", this, cameras, source);
            }

            foreach (dynamic _f in Lang13.Enumerate(GlobalVars.player_list, typeof(Mob_Living_Silicon)))
            {
                aiPlayer = _f;

                aiPlayer.triggerAlarm("Fire", this, cameras, source);
            }

            foreach (dynamic _g in Lang13.Enumerate(GlobalVars.mob_list, typeof(Mob_Living_SimpleAnimal_Drone)))
            {
                D2 = _g;

                D2.triggerAlarm("Fire", this, cameras, source);
            }
            return;
        }