Exemplo n.º 1
0
        //==================================================================
        //
        //	P_SpawnLightFlash
        //
        //	After the map has been loaded, scan each sector for specials that spawn thinkers
        //
        //==================================================================
        public static void P_SpawnLightFlash(r_local.sector_t sector)
        {
            p_spec.lightflash_t flash;

            sector.special = 0;                         // nothing special about it during gameplay

            flash = new p_spec.lightflash_t();
            p_tick.P_AddThinker(flash.thinker);
            flash.thinker.function = new T_LightFlash(flash);
            flash.sector           = sector;
            flash.maxlight         = sector.lightlevel;

            flash.minlight = p_spec.P_FindMinSurroundingLight(sector, sector.lightlevel);
            flash.maxtime  = 64;
            flash.mintime  = 7;
            flash.count    = (m_misc.P_Random() & flash.maxtime) + 1;
        }
Exemplo n.º 2
0
            public override void function(object obj)
            {
                p_spec.lightflash_t flash = obj as p_spec.lightflash_t;
                if (--flash.count != 0)
                {
                    return;
                }

                if (flash.sector.lightlevel == flash.maxlight)
                {
                    flash.sector.lightlevel = (short)flash.minlight;
                    flash.count             = (m_misc.P_Random() & flash.mintime) + 1;
                }
                else
                {
                    flash.sector.lightlevel = (short)flash.maxlight;
                    flash.count             = (m_misc.P_Random() & flash.maxtime) + 1;
                }
            }