//************************************************************************** //** //** ## ## ## ## ## #### #### ### ### //** ## ## ## ## ## ## ## ## ## ## #### #### //** ## ## ## ## ## ## ## ## ## ## ## ## ## ## //** ## ## ######## ## ## ## ## ## ## ## ### ## //** ### ## ## ### ## ## ## ## ## ## //** # ## ## # #### #### ## ## //** //** $Id: FireFlicker.vc 1583 2006-06-27 19:05:42Z dj_jl $ //** //** Copyright (C) 1999-2006 Jānis Legzdiņš //** //** This program is free software; you can redistribute it and/or //** modify it under the terms of the GNU General Public License //** as published by the Free Software Foundation; either version 2 //** of the License, or (at your option) any later version. //** //** This program is distributed in the hope that it will be useful, //** but WITHOUT ANY WARRANTY; without even the implied warranty of //** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //** GNU General Public License for more details. //** //************************************************************************** //** //** FIRELIGHT FLICKER //** //************************************************************************** class FireFlicker : Lighting; float Time; int MaxLight; int MinLight; //========================================================================== // // Init // //========================================================================== void Init(sector_t* InSector) { Sector = InSector; Sector->LightingData = self; Time = 4.0 / 35.0; MaxLight = Sector->params.lightlevel; MinLight = Level.FindMinSurroundingLight(Sector, Sector->params.lightlevel) + 16; } //========================================================================== // // Tick // //========================================================================== void Tick(float deltaTime) { int Amount; Time -= deltaTime; if (Time > 0.0) { return; } Amount = (P_Random() & 3) * 16; if (Sector->params.lightlevel - Amount < MinLight) Sector->params.lightlevel = MinLight; else Sector->params.lightlevel = MaxLight - Amount; Time = 4.0 / 35.0; } defaultproperties { }