Esempio n. 1
0
        // Function from file: computer.dm
        public void nerf(double?active = null)
        {
            Obj_Item I = null;
            Obj_Effect_HolodeckEffect HE = null;


            foreach (dynamic _a in Lang13.Enumerate(this.spawned, typeof(Obj_Item)))
            {
                I = _a;

                I.damtype = (Lang13.Bool(active) ? ((dynamic)("stamina")) : Lang13.Initial(I, "damtype"));
            }

            foreach (dynamic _b in Lang13.Enumerate(this.effects, typeof(Obj_Effect_HolodeckEffect)))
            {
                HE = _b;

                HE.safety(active);
            }
            return;
        }
Esempio n. 2
0
        // Function from file: computer_funcs.dm
        public void load_program(dynamic A = null, bool?force = null, bool?delay = null)
        {
            force = force ?? false;
            delay = delay ?? false;

            Obj_Effect_HolodeckEffect HE    = null;
            dynamic                   item  = null;
            Obj_Machinery             M     = null;
            Obj_Structure             S     = null;
            ByTable                   added = null;
            Obj_Effect_HolodeckEffect HE2   = null;
            dynamic                   x     = null;
            Obj_Machinery             M2    = null;
            Obj_Structure             S2    = null;


            if (this.stat != 0)
            {
                A     = this.offline_program;
                force = true;
                delay = false;
            }

            if (this.program == A)
            {
                return;
            }

            if (Game13.time < this.last_change + (this.damaged ? 500 : 0) + 25 && !(force == true))
            {
                if (delay == true)
                {
                    Task13.Sleep(25);
                }
                else
                {
                    if (Game13.time < this.last_change + 15)
                    {
                        return;
                    }

                    if (Map13.GetDistance(Task13.User, this) <= 3)
                    {
                        Task13.User.WriteMsg("<span class='warning'>ERROR. Recalibrating projection apparatus.</span>");
                        return;
                    }
                }
            }
            this.last_change = Game13.time;
            this.active      = A != this.offline_program;
            this.use_power   = (this.active == true ?1:0) + 1;

            foreach (dynamic _a in Lang13.Enumerate(this.effects, typeof(Obj_Effect_HolodeckEffect)))
            {
                HE = _a;

                HE.deactivate(this);
            }

            foreach (dynamic _b in Lang13.Enumerate(this.spawned))
            {
                item = _b;

                this.derez(item, null, force);
            }
            this.program = A;
            this.spawned = ((Zone)A).copy_contents_to(this.linked, true, !Lang13.Bool(this.emagged));

            foreach (dynamic _c in Lang13.Enumerate(this.spawned, typeof(Obj_Machinery)))
            {
                M = _c;

                M.flags |= 128;
            }

            foreach (dynamic _d in Lang13.Enumerate(this.spawned, typeof(Obj_Structure)))
            {
                S = _d;

                S.flags |= 128;
            }
            this.effects = new ByTable();
            Task13.Schedule(30, (Task13.Closure)(() => {
                added = new ByTable();

                foreach (dynamic _e in Lang13.Enumerate(this.spawned, typeof(Obj_Effect_HolodeckEffect)))
                {
                    HE2 = _e;

                    this.effects.Add(HE2);
                    this.spawned -= HE2;
                    x             = HE2.activate(this);

                    if (x is Ent_Static || x is ByTable)
                    {
                        this.spawned += x;
                        added.Add(x);
                    }
                }

                foreach (dynamic _f in Lang13.Enumerate(added, typeof(Obj_Machinery)))
                {
                    M2 = _f;

                    M2.flags |= 128;
                }

                foreach (dynamic _g in Lang13.Enumerate(added, typeof(Obj_Structure)))
                {
                    S2 = _g;

                    S2.flags |= 128;
                }
                return;
            }));
            return;
        }
Esempio n. 3
0
        // Function from file: computer.dm
        public override int?process(dynamic seconds = null)
        {
            Tile_Simulated           T = null;
            EffectSystem_SparkSpread s = null;
            dynamic M  = null;
            dynamic T2 = null;
            EffectSystem_SparkSpread s2 = null;
            dynamic item = null;
            Obj_Effect_HolodeckEffect HE = null;


            if (this.damaged)
            {
                if (Rand13.PercentChance(10))
                {
                    foreach (dynamic _a in Lang13.Enumerate(this.linked, typeof(Tile_Simulated)))
                    {
                        T = _a;


                        if (Rand13.PercentChance(5))
                        {
                            s = new EffectSystem_SparkSpread();
                            s.set_up(2, 1, T);
                            s.start();
                            return(null);
                        }
                    }
                }
            }

            if (!Lang13.Bool(base.process((object)(seconds))) || !(this.active == true))
            {
                return(null);
            }

            if (!this.floorcheck())
            {
                this.emergency_shutdown();
                this.damaged = true;

                foreach (dynamic _b in Lang13.Enumerate(GlobalFuncs.ultra_range(10, this)))
                {
                    M = _b;

                    M.show_message("The holodeck overloads!");
                }

                foreach (dynamic _c in Lang13.Enumerate(this.linked))
                {
                    T2 = _c;


                    if (Rand13.PercentChance(30))
                    {
                        s2 = new EffectSystem_SparkSpread();
                        s2.set_up(2, 1, T2);
                        s2.start();
                    }
                    ((Ent_Static)T2).ex_act(3);
                    ((Tile)T2).hotspot_expose(1000, 500, true);
                }
            }

            if (!Lang13.Bool(this.emagged))
            {
                foreach (dynamic _d in Lang13.Enumerate(this.spawned))
                {
                    item = _d;


                    if (!Lang13.Bool(this.linked.Contains(GlobalFuncs.get_turf(item))))
                    {
                        this.derez(item, false);
                    }
                }
            }

            foreach (dynamic _e in Lang13.Enumerate(this.effects, typeof(Obj_Effect_HolodeckEffect)))
            {
                HE = _e;

                HE.tick();
            }
            this.active_power_usage = this.spawned.len * 3 + this.effects.len * 5 + 50;
            return(null);
        }