src/weapon/riot_bomb.cpp

Go to the documentation of this file.
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  * riot bomb : fire a rocket that doesn't make any damage but makes a big
00020  * hole with angle and force
00021  *****************************************************************************/
00022 
00023 #include "riot_bomb.h"
00024 #include "explosion.h"
00025 #include "../game/config.h"
00026 #include "../game/time.h"
00027 #include "../graphic/video.h"
00028 #include "../interface/game_msg.h"
00029 #include "../map/camera.h"
00030 #include "../object/objects_list.h"
00031 #include "../team/teams_list.h"
00032 #include "../tool/math_tools.h"
00033 #include "../tool/i18n.h"
00034 
00035 RiotBombRocket::RiotBombRocket(ExplosiveWeaponConfig& cfg,
00036                                    WeaponLauncher * p_launcher) :
00037   WeaponProjectile ("riot_rocket", cfg, p_launcher)
00038 {
00039   explode_colliding_character = true;
00040 }
00041 
00042 void RiotBombRocket::Refresh()
00043 {
00044   WeaponProjectile::Refresh();
00045   image->SetRotation_rad(GetSpeedAngle());
00046 }
00047 
00048 void RiotBombRocket::SignalOutOfMap()
00049 {
00050   GameMessages::GetInstance()->Add (_("The rocket has left the battlefield..."));
00051   WeaponProjectile::SignalOutOfMap();
00052 }
00053 
00054 void RiotBombRocket::DoExplosion()
00055 {
00056   Point2i pos = GetCenter();
00057   ApplyExplosion (pos, cfg, "weapon/riot_bomb_exp", false, ParticleEngine::LittleESmoke);
00058 }
00059 //-----------------------------------------------------------------------------
00060 
00061 RiotBomb::RiotBomb() :
00062   WeaponLauncher(WEAPON_RIOT_BOMB, "riot_bomb", new ExplosiveWeaponConfig())
00063 {
00064   m_name = _("Riot Bomb");
00065   ReloadLauncher();
00066 }
00067 
00068 WeaponProjectile * RiotBomb::GetProjectileInstance()
00069 {
00070   return dynamic_cast<WeaponProjectile *>
00071       (new RiotBombRocket(cfg(),dynamic_cast<WeaponLauncher *>(this)));
00072 }

Generated on Mon Jan 1 13:11:00 2007 for Wormux by  doxygen 1.4.7