00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 }