Beispiel #1
0
        // Function from file: robot.dm
        public override void on_pulse(string wire = null)
        {
            Obj     R      = null;
            dynamic new_ai = null;

            R = this.holder;

            switch ((string)(wire))
            {
            case "ai":

                if (!Lang13.Bool(((dynamic)R).emagged))
                {
                    new_ai = GlobalFuncs.select_active_ai(R);

                    if (Lang13.Bool(new_ai) && new_ai != ((dynamic)R).connected_ai)
                    {
                        ((dynamic)R).connected_ai = new_ai;
                        ((dynamic)R).notify_ai(GlobalVars.TRUE);
                    }
                }
                break;

            case "camera":

                if (!(((dynamic)R).camera == null) && !Lang13.Bool(((dynamic)R).scrambledcodes))
                {
                    ((Obj_Machinery_Camera)((dynamic)R).camera).toggle_cam(Task13.User, false);
                    R.visible_message("" + R + "'s camera lense focuses loudly.", "Your camera lense focuses loudly.");
                }
                break;

            case "lawsync":

                if (Lang13.Bool(((dynamic)R).lawupdate))
                {
                    R.visible_message("" + R + " gently chimes.", "LawSync protocol engaged.");
                    ((dynamic)R).lawsync();
                    ((dynamic)R).show_laws();
                }
                break;

            case "lockdown":
                ((dynamic)R).SetLockdown(!Lang13.Bool(((dynamic)R).lockcharge));
                break;
            }
            return;
        }
        // Function from file: particle_accelerator.dm
        public override void on_pulse(string wire = null)
        {
            Obj C = null;

            C = this.holder;

            switch ((string)(wire))
            {
            case "power":
                ((dynamic)C).toggle_power();
                break;

            case "strength":
                ((dynamic)C).add_strength();
                break;

            case "interface":
                ((dynamic)C).interface_control = !Lang13.Bool(((dynamic)C).interface_control);
                break;

            case "limit":
                C.visible_message(new Txt().icon(C).str("<b>").item(C).str("</b> makes a large whirring noise.").ToString());
                break;
            }
            return;
        }
Beispiel #3
0
        // Function from file: robot.dm
        public override void on_cut(dynamic wire = null, int?mend = null)
        {
            Obj R = null;

            R = this.holder;

            dynamic _a = wire;             // Was a switch-case, sorry for the mess.

            if (_a == "ai")
            {
                if (!Lang13.Bool(mend))
                {
                    ((dynamic)R).connected_ai = null;
                }
            }
            else if (_a == "lawsync")
            {
                if (Lang13.Bool(mend))
                {
                    if (!Lang13.Bool(((dynamic)R).emagged))
                    {
                        ((dynamic)R).lawupdate = GlobalVars.TRUE;
                    }
                }
                else
                {
                    ((dynamic)R).lawupdate = GlobalVars.FALSE;
                }
            }
            else if (_a == "camera")
            {
                if (!(((dynamic)R).camera == null) && !Lang13.Bool(((dynamic)R).scrambledcodes))
                {
                    ((dynamic)R).camera.status = mend;
                    ((Obj_Machinery_Camera)((dynamic)R).camera).toggle_cam(Task13.User, false);
                    R.visible_message("" + R + "'s camera lense focuses loudly.", "Your camera lense focuses loudly.");
                }
            }
            else if (_a == "lockdown")
            {
                ((dynamic)R).SetLockdown(!Lang13.Bool(mend));
            }
            return;
        }