//************************************************************************** //** //** ## ## ## ## ## #### #### ### ### //** ## ## ## ## ## ## ## ## ## ## #### #### //** ## ## ## ## ## ## ## ## ## ## ## ## ## ## //** ## ## ######## ## ## ## ## ## ## ## ### ## //** ### ## ## ### ## ## ## ## ## ## //** # ## ## # #### #### ## ## //** //** $Id: PowerInvisibility.vc 2606 2007-08-09 19:31:44Z 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. //** //************************************************************************** class PowerInvisibility : Powerup; //========================================================================== // // InitEffect // //========================================================================== void InitEffect() { Owner.Alpha = 0.2; } //========================================================================== // // DoEffect // //========================================================================== void DoEffect() { ::DoEffect(); // Re-init effect every tic since other PowerInvisibility powers may // interfere with this one. InitEffect(); } //========================================================================== // // EndEffect // //========================================================================== void EndEffect() { if (!Owner) { return; } Owner.Alpha = 1.0; // If there are other invisibility powers, reinit their effect. Inventory Item; for (Item = EntityEx(Owner).Inventory; Item; Item = Item.Inventory) { if (PowerInvisibility(Item)) { PowerInvisibility(Item).InitEffect(); } } } defaultproperties { EffectTime = 60.0; }