//************************************************************************** //** //** ## ## ## ## ## #### #### ### ### //** ## ## ## ## ## ## ## ## ## ## #### #### //** ## ## ## ## ## ## ## ## ## ## ## ## ## ## //** ## ## ######## ## ## ## ## ## ## ## ### ## //** ### ## ## ### ## ## ## ## ## ## //** # ## ## # #### #### ## ## //** //** $Id: PowerFlight.vc 2703 2007-09-03 16:21:21Z 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 PowerFlight : Powerup; //========================================================================== // // Tick // //========================================================================== void Tick(float DeltaTime) { // Flight expires only in multiplayer and non-hub games. if (!Level.Game.netgame && Level.bClusterHub) { EffectTime += DeltaTime; } ::Tick(DeltaTime); } //========================================================================== // // InitEffect // //========================================================================== void InitEffect() { Owner.bFly = true; Owner.bNoGravity = true; if (Owner.Origin.z <= Owner.FloorZ) { // thrust the player in the air a bit PlayerEx(Owner.Player).FlyHeight = 10.0; } if (Owner.Velocity.z <= -35.0 * 35.0) { // stop falling scream Owner.StopSound(CHAN_VOICE); } } //========================================================================== // // EndEffect // //========================================================================== void EndEffect() { if (!Owner) { return; } if (Owner.Origin.z != Owner.FloorZ) { //FIXME player->centreing = true; } Owner.bFly = false; Owner.bNoGravity = false; } defaultproperties { EffectTime = 60.0; bHubPower = true; }