//************************************************************************** //** //** ## ## ## ## ## #### #### ### ### //** ## ## ## ## ## ## ## ## ## ## #### #### //** ## ## ## ## ## ## ## ## ## ## ## ## ## ## //** ## ## ######## ## ## ## ## ## ## ## ### ## //** ### ## ## ### ## ## ## ## ## ## //** # ## ## # #### #### ## ## //** //** $Id: PowerStrength.vc 2601 2007-08-08 22:10:20Z 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 PowerStrength : Powerup; //========================================================================== // // HandlePickup // //========================================================================== bool HandlePickup(Inventory Item) { // Setting effect time to 0 will cause powerup pickup handler to reset // effect time so we get the red flash again. if (Item.Class == Class) { EffectTime = 0.0; } return ::HandlePickup(Item); } //========================================================================== // // Tick // //========================================================================== void Tick(float DeltaTime) { // Strength counts up to diminish fade. EffectTime += 2.0 * DeltaTime; ::Tick(DeltaTime); } //========================================================================== // // GetBlend // //========================================================================== int GetBlend() { // slowly fade the berzerk out int Amount = 12 - ftoi(EffectTime / 2.0); if (Amount > 0) { Amount = (Amount + 7) >> 3; int a = (Amount + 1) * 28; return (BlendColour & 0x00ffffff) | (a << 24); } return 0; } defaultproperties { EffectTime = 1.0 / 35.0; BlendColour = RGBA(255, 0, 0, 128); bHubPower = true; }