00001 /* 00002 00003 ************************************************************************* 00004 00005 ArmageTron -- Just another Tron Lightcycle Game in 3D. 00006 Copyright (C) 2000 Manuel Moos (manuel@moosnet.de) 00007 00008 ************************************************************************** 00009 00010 This program is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU General Public License 00012 as published by the Free Software Foundation; either version 2 00013 of the License, or (at your option) any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00023 00024 *************************************************************************** 00025 00026 */ 00027 00028 #ifndef ArmageTron_explosion_H 00029 #define ArmageTron_explosion_H 00030 00031 #include "eGameObject.h" 00032 00033 class gCycle; 00034 struct gRealColor; 00035 00036 class gExplosion: virtual public eReferencableGameObject 00037 { // Boom! 00038 public: 00039 gExplosion(eGrid *grid, const eCoord &pos,REAL time, gRealColor& color, gCycle * owner ); 00040 virtual ~gExplosion(); 00041 00042 virtual bool Timestep(REAL currentTime); 00043 00044 virtual void InteractWith(eGameObject *target,REAL time,int recursion=1); 00045 00046 virtual void PassEdge(const eWall *w,REAL time,REAL a,int recursion=1); 00047 00048 virtual void Kill(); 00049 #ifndef DEDICATED 00050 virtual void Render(const eCamera *cam); 00051 virtual void Render2D(tCoord scale) const; 00052 00053 //virtual void SoundMix(Uint8 *dest,unsigned int len, 00054 // int viewer,REAL rvol,REAL lvol); 00055 #endif 00056 00057 bool AccountForHole(); // will return true exactly once per explosion; to be used to make the holing score only count once. 00058 00059 static void OnNewWall( eWall* w ); // blow holes into a new wall 00060 00061 //#ifdef USEPARTICLES 00062 int particle_handle_circle; 00063 int particle_handle_cylinder; 00064 //#endif 00065 00066 // returns the owner 00067 gCycle * GetOwner() const 00068 { 00069 return owner_; 00070 } 00071 00072 protected: 00073 virtual void OnRemoveFromGame(); // called last when the object is removed from the game 00074 00075 private: 00076 REAL createTime; 00077 00078 // gRealColor color_; 00079 REAL explosion_r; 00080 REAL explosion_g; 00081 REAL explosion_b; 00082 00083 int expansion; 00084 00085 static int expansionSteps; 00086 static REAL expansionTime; 00087 00088 bool holeAccountedFor_; 00089 00090 int listID; 00091 00092 tJUST_CONTROLLED_PTR< gCycle > owner_; // the owner/victim of the explosion 00093 }; 00094 #endif