Пример #1
0
        // Function from file: gun.dm
        public override double emp_act(int severity = 0)
        {
            Obj O = null;


            foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj)))
            {
                O = _a;

                O.emp_act(severity);
            }
            return(0);
        }
Пример #2
0
        // Function from file: storage.dm
        public override double emp_act(int severity = 0)
        {
            Obj O = null;


            if (!(this.loc is Mob_Living))
            {
                foreach (dynamic _a in Lang13.Enumerate(this.contents, typeof(Obj)))
                {
                    O = _a;

                    O.emp_act(severity);
                }
            }
            base.emp_act(severity);
            return(0);
        }
Пример #3
0
        // Function from file: robot_modules.dm
        public override double emp_act(int severity = 0)
        {
            Obj O = null;


            if (this.modules != null)
            {
                foreach (dynamic _a in Lang13.Enumerate(this.modules, typeof(Obj)))
                {
                    O = _a;

                    O.emp_act(severity);
                }
            }

            if (this.emag != null)
            {
                this.emag.emp_act(severity);
            }
            base.emp_act(severity);
            return(0);
        }
Пример #4
0
        // Function from file: closets.dm
        public override double emp_act(int severity = 0)
        {
            Obj O = null;


            foreach (dynamic _a in Lang13.Enumerate(this, typeof(Obj)))
            {
                O = _a;

                O.emp_act(severity);
            }

            if (this.secure && !this.broken)
            {
                if (Rand13.PercentChance(((int)(50 / severity))))
                {
                    this.locked = !this.locked;
                    this.update_icon();
                }

                if (Rand13.PercentChance(((int)(20 / severity))) && !this.opened)
                {
                    if (!this.locked)
                    {
                        this.open();
                    }
                    else
                    {
                        this.req_access  = new ByTable();
                        this.req_access += Rand13.PickFromTable(GlobalFuncs.get_all_accesses());
                    }
                }
            }
            base.emp_act(severity);
            return(0);
        }
        // Function from file: revenant_abilities.dm
        public override bool cast(dynamic targets = null, dynamic thearea = null, dynamic user = null)
        {
            thearea = thearea ?? Task13.User;

            dynamic T = null;
            Mob_Living_SimpleAnimal_Bot bot   = null;
            Mob_Living_Carbon_Human     human = null;
            Obj thing = null;
            Mob_Living_Silicon_Robot S = null;


            if (this.attempt_cast(thearea))
            {
                foreach (dynamic _e in Lang13.Enumerate(targets))
                {
                    T = _e;

                    Task13.Schedule(0, (Task13.Closure)(() => {
                        foreach (dynamic _a in Lang13.Enumerate(T.contents, typeof(Mob_Living_SimpleAnimal_Bot)))
                        {
                            bot = _a;


                            if (!(bot.emagged != 0))
                            {
                                GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), bot.loc);
                                bot.locked = false;
                                bot.open   = true;
                                bot.emag_act();
                            }
                        }

                        foreach (dynamic _b in Lang13.Enumerate(T.contents, typeof(Mob_Living_Carbon_Human)))
                        {
                            human = _b;


                            if (human == thearea)
                            {
                                continue;
                            }
                            human.WriteMsg("<span class='revenwarning'>You feel " + Rand13.Pick(new object [] { "your sense of direction flicker out", "a stabbing pain in your head", "your mind fill with static" }) + ".</span>");
                            GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), human.loc);
                            human.emp_act(1);
                        }

                        foreach (dynamic _c in Lang13.Enumerate(T.contents, typeof(Obj)))
                        {
                            thing = _c;


                            if (thing is Obj_Machinery_Dominator || thing is Obj_Machinery_Power_Apc || thing is Obj_Machinery_Power_Smes)
                            {
                                continue;
                            }

                            if (Rand13.PercentChance(20))
                            {
                                if (Rand13.PercentChance(50))
                                {
                                    GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), thing.loc);
                                }
                                thing.emag_act(null);
                            }
                            else if (!(thing is Obj_Machinery_Clonepod))
                            {
                                thing.emp_act(1);
                            }
                        }

                        foreach (dynamic _d in Lang13.Enumerate(T.contents, typeof(Mob_Living_Silicon_Robot)))
                        {
                            S = _d;

                            GlobalFuncs.playsound(S, "sound/machines/warning-buzzer.ogg", 50, 1);
                            GlobalFuncs.PoolOrNew(typeof(Obj_Effect_Overlay_Temp_Revenant), S.loc);
                            S.spark_system.start();
                            S.emp_act(1);
                        }
                        return;
                    }));
                }
            }
            return(false);
        }