00001 /****************************************************************************** 00002 * Wormux is a convivial mass murder game. 00003 * Copyright (C) 2001-2004 Lawrence Azzoug. 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00018 ****************************************************************************** 00019 * Cluster Bomb : launch a grenade will exploding, it produce new little cluster 00020 * exploding bomb 00021 *****************************************************************************/ 00022 00023 #ifndef CLUSTER_BOMB_H 00024 #define CLUSTER_BOMB_H 00025 00026 #include <list> 00027 #include "launcher.h" 00028 #include "../graphic/surface.h" 00029 #include "../gui/progress_bar.h" 00030 #include "../include/base.h" 00031 #include "../object/physical_obj.h" 00032 00033 class ClusterBombConfig; 00034 00035 class Cluster : public WeaponProjectile 00036 { 00037 public: 00038 Cluster(ClusterBombConfig& cfg, 00039 WeaponLauncher * p_launcher); 00040 void Refresh(); 00041 void Shoot(int n_x, int n_y); 00042 protected: 00043 void SignalOutOfMap(); 00044 void DoExplosion(); 00045 }; 00046 00047 class ClusterBomb : public WeaponProjectile 00048 { 00049 public: 00050 ClusterBomb(ClusterBombConfig& cfg, 00051 WeaponLauncher * p_launcher); 00052 void Refresh(); 00053 protected: 00054 void DoExplosion(); 00055 void SignalOutOfMap(); 00056 }; 00057 00058 class ClusterBombConfig : public ExplosiveWeaponConfig 00059 { 00060 public: 00061 uint nb_fragments; 00062 public: 00063 ClusterBombConfig(); 00064 virtual void LoadXml(xmlpp::Element *elem); 00065 }; 00066 00067 class ClusterLauncher : public WeaponLauncher 00068 { 00069 public: 00070 ClusterLauncher(); 00071 protected: 00072 WeaponProjectile * GetProjectileInstance(); 00073 private: 00074 ClusterBombConfig& cfg() ; 00075 }; 00076 00077 #endif