Esempio n. 1
0
        public static void P_SpawnGlowingLight(r_local.sector_t sector)
        {
            p_spec.glow_t g;

            g = new p_spec.glow_t();
            p_tick.P_AddThinker(g.thinker);
            g.sector           = sector;
            g.minlight         = p_spec.P_FindMinSurroundingLight(sector, sector.lightlevel);
            g.maxlight         = sector.lightlevel;
            g.thinker.function = new T_Glow(g);
            g.direction        = -1;

            sector.special = 0;
        }
Esempio n. 2
0
            public override void function(object obj)
            {
                p_spec.glow_t g = obj as p_spec.glow_t;
                switch (g.direction)
                {
                case -1:                                        // DOWN
                    g.sector.lightlevel -= p_spec.GLOWSPEED;
                    if (g.sector.lightlevel <= g.minlight)
                    {
                        g.sector.lightlevel += p_spec.GLOWSPEED;
                        g.direction          = 1;
                    }
                    break;

                case 1:                                         // UP
                    g.sector.lightlevel += p_spec.GLOWSPEED;
                    if (g.sector.lightlevel >= g.maxlight)
                    {
                        g.sector.lightlevel -= p_spec.GLOWSPEED;
                        g.direction          = -1;
                    }
                    break;
                }
            }